kconfig-to-uclibc.patch 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462
  1. --- kconfig/conf.c
  2. +++ uClibc/conf.c
  3. @@ -557,10 +557,10 @@
  4. case ask_silent:
  5. if (stat(".config", &tmpstat)) {
  6. printf(_("***\n"
  7. - "*** You have not yet configured your kernel!\n"
  8. + "*** You have not yet configured uClibc!\n"
  9. "***\n"
  10. "*** Please run some configurator (e.g. \"make oldconfig\" or\n"
  11. - "*** \"make menuconfig\" or \"make xconfig\").\n"
  12. + "*** \"make menuconfig\" or \"make config\").\n"
  13. "***\n"));
  14. exit(1);
  15. }
  16. @@ -603,7 +603,7 @@
  17. } else if (conf_get_changed()) {
  18. name = getenv("KCONFIG_NOSILENTUPDATE");
  19. if (name && *name) {
  20. - fprintf(stderr, _("\n*** Kernel configuration requires explicit update.\n\n"));
  21. + fprintf(stderr, _("\n*** uClibc configuration requires explicit update.\n\n"));
  22. return 1;
  23. }
  24. } else
  25. @@ -614,12 +614,12 @@
  26. check_conf(&rootmenu);
  27. } while (conf_cnt);
  28. if (conf_write(NULL)) {
  29. - fprintf(stderr, _("\n*** Error during writing of the kernel configuration.\n\n"));
  30. + fprintf(stderr, _("\n*** Error during writing of the uClibc configuration.\n\n"));
  31. return 1;
  32. }
  33. skip_check:
  34. - if (input_mode == ask_silent && conf_write_autoconf()) {
  35. - fprintf(stderr, _("\n*** Error during writing of the kernel configuration.\n\n"));
  36. + if (/*input_mode == ask_silent &&*/ conf_write_autoconf()) {
  37. + fprintf(stderr, _("\n*** Error during writing of the uClibc configuration.\n\n"));
  38. return 1;
  39. }
  40. --- kconfig/confdata.c
  41. +++ uClibc/confdata.c
  42. @@ -21,7 +21,7 @@
  43. static const char *conf_filename;
  44. static int conf_lineno, conf_warnings, conf_unsaved;
  45. -const char conf_defname[] = "arch/$ARCH/defconfig";
  46. +const char conf_defname[] = "extra/Configs/defconfigs/$ARCH";
  47. static void conf_warning(const char *fmt, ...)
  48. {
  49. @@ -150,22 +150,22 @@
  50. sym = NULL;
  51. switch (line[0]) {
  52. case '#':
  53. - if (memcmp(line + 2, "CONFIG_", 7))
  54. + if (line[1]!=' ')
  55. continue;
  56. - p = strchr(line + 9, ' ');
  57. + p = strchr(line + 2, ' ');
  58. if (!p)
  59. continue;
  60. *p++ = 0;
  61. if (strncmp(p, "is not set", 10))
  62. continue;
  63. if (def == S_DEF_USER) {
  64. - sym = sym_find(line + 9);
  65. + sym = sym_find(line + 2);
  66. if (!sym) {
  67. - conf_warning("trying to assign nonexistent symbol %s", line + 9);
  68. + conf_warning("trying to assign nonexistent symbol %s", line + 2);
  69. break;
  70. }
  71. } else {
  72. - sym = sym_lookup(line + 9, 0);
  73. + sym = sym_lookup(line + 2, 0);
  74. if (sym->type == S_UNKNOWN)
  75. sym->type = S_BOOLEAN;
  76. }
  77. @@ -183,12 +183,8 @@
  78. ;
  79. }
  80. break;
  81. - case 'C':
  82. - if (memcmp(line, "CONFIG_", 7)) {
  83. - conf_warning("unexpected data");
  84. - continue;
  85. - }
  86. - p = strchr(line + 7, '=');
  87. + case 'A' ... 'Z':
  88. + p = strchr(line, '=');
  89. if (!p)
  90. continue;
  91. *p++ = 0;
  92. @@ -199,13 +195,13 @@
  93. *p2 = 0;
  94. }
  95. if (def == S_DEF_USER) {
  96. - sym = sym_find(line + 7);
  97. + sym = sym_find(line);
  98. if (!sym) {
  99. - conf_warning("trying to assign nonexistent symbol %s", line + 7);
  100. + conf_warning("trying to assign nonexistent symbol %s", line);
  101. break;
  102. }
  103. } else {
  104. - sym = sym_lookup(line + 7, 0);
  105. + sym = sym_lookup(line, 0);
  106. if (sym->type == S_UNKNOWN)
  107. sym->type = S_OTHER;
  108. }
  109. @@ -416,7 +412,7 @@
  110. if (!out)
  111. return 1;
  112. - sym = sym_lookup("KERNELVERSION", 0);
  113. + sym = sym_lookup("VERSION", 0);
  114. sym_calc_value(sym);
  115. time(&now);
  116. env = getenv("KCONFIG_NOTIMESTAMP");
  117. @@ -425,10 +421,8 @@
  118. fprintf(out, _("#\n"
  119. "# Automatically generated make config: don't edit\n"
  120. - "# Linux kernel version: %s\n"
  121. "%s%s"
  122. "#\n"),
  123. - sym_get_string_value(sym),
  124. use_timestamp ? "# " : "",
  125. use_timestamp ? ctime(&now) : "");
  126. @@ -462,19 +456,19 @@
  127. case S_TRISTATE:
  128. switch (sym_get_tristate_value(sym)) {
  129. case no:
  130. - fprintf(out, "# CONFIG_%s is not set\n", sym->name);
  131. + fprintf(out, "# %s is not set\n", sym->name);
  132. break;
  133. case mod:
  134. - fprintf(out, "CONFIG_%s=m\n", sym->name);
  135. + fprintf(out, "%s=m\n", sym->name);
  136. break;
  137. case yes:
  138. - fprintf(out, "CONFIG_%s=y\n", sym->name);
  139. + fprintf(out, "%s=y\n", sym->name);
  140. break;
  141. }
  142. break;
  143. case S_STRING:
  144. str = sym_get_string_value(sym);
  145. - fprintf(out, "CONFIG_%s=\"", sym->name);
  146. + fprintf(out, "%s=\"", sym->name);
  147. while (1) {
  148. l = strcspn(str, "\"\\");
  149. if (l) {
  150. @@ -490,12 +484,12 @@
  151. case S_HEX:
  152. str = sym_get_string_value(sym);
  153. if (str[0] != '0' || (str[1] != 'x' && str[1] != 'X')) {
  154. - fprintf(out, "CONFIG_%s=%s\n", sym->name, str);
  155. + fprintf(out, "%s=%s\n", sym->name, str);
  156. break;
  157. }
  158. case S_INT:
  159. str = sym_get_string_value(sym);
  160. - fprintf(out, "CONFIG_%s=%s\n", sym->name, str);
  161. + fprintf(out, "%s=%s\n", sym->name, str);
  162. break;
  163. }
  164. }
  165. @@ -655,6 +649,8 @@
  166. time_t now;
  167. int i, l;
  168. + return 0;
  169. +
  170. sym_clear_all_valid();
  171. file_write_dep("include/config/auto.conf.cmd");
  172. @@ -672,22 +668,19 @@
  173. return 1;
  174. }
  175. - sym = sym_lookup("KERNELVERSION", 0);
  176. + sym = sym_lookup("VERSION", 0);
  177. sym_calc_value(sym);
  178. time(&now);
  179. fprintf(out, "#\n"
  180. "# Automatically generated make config: don't edit\n"
  181. - "# Linux kernel version: %s\n"
  182. "# %s"
  183. "#\n",
  184. - sym_get_string_value(sym), ctime(&now));
  185. + ctime(&now));
  186. fprintf(out_h, "/*\n"
  187. " * Automatically generated C config: don't edit\n"
  188. - " * Linux kernel version: %s\n"
  189. " * %s"
  190. - " */\n"
  191. - "#define AUTOCONF_INCLUDED\n",
  192. - sym_get_string_value(sym), ctime(&now));
  193. + " */\n",
  194. + ctime(&now));
  195. for_all_symbols(i, sym) {
  196. sym_calc_value(sym);
  197. @@ -700,19 +693,19 @@
  198. case no:
  199. break;
  200. case mod:
  201. - fprintf(out, "CONFIG_%s=m\n", sym->name);
  202. - fprintf(out_h, "#define CONFIG_%s_MODULE 1\n", sym->name);
  203. + fprintf(out, "%s=m\n", sym->name);
  204. + fprintf(out_h, "#define %s_MODULE 1\n", sym->name);
  205. break;
  206. case yes:
  207. - fprintf(out, "CONFIG_%s=y\n", sym->name);
  208. - fprintf(out_h, "#define CONFIG_%s 1\n", sym->name);
  209. + fprintf(out, "%s=y\n", sym->name);
  210. + fprintf(out_h, "#define %s 1\n", sym->name);
  211. break;
  212. }
  213. break;
  214. case S_STRING:
  215. str = sym_get_string_value(sym);
  216. - fprintf(out, "CONFIG_%s=\"", sym->name);
  217. - fprintf(out_h, "#define CONFIG_%s \"", sym->name);
  218. + fprintf(out, "%s=\"", sym->name);
  219. + fprintf(out_h, "#define %s \"", sym->name);
  220. while (1) {
  221. l = strcspn(str, "\"\\");
  222. if (l) {
  223. @@ -732,14 +725,14 @@
  224. case S_HEX:
  225. str = sym_get_string_value(sym);
  226. if (str[0] != '0' || (str[1] != 'x' && str[1] != 'X')) {
  227. - fprintf(out, "CONFIG_%s=%s\n", sym->name, str);
  228. - fprintf(out_h, "#define CONFIG_%s 0x%s\n", sym->name, str);
  229. + fprintf(out, "%s=%s\n", sym->name, str);
  230. + fprintf(out_h, "#define %s 0x%s\n", sym->name, str);
  231. break;
  232. }
  233. case S_INT:
  234. str = sym_get_string_value(sym);
  235. - fprintf(out, "CONFIG_%s=%s\n", sym->name, str);
  236. - fprintf(out_h, "#define CONFIG_%s %s\n", sym->name, str);
  237. + fprintf(out, "%s=%s\n", sym->name, str);
  238. + fprintf(out_h, "#define %s %s\n", sym->name, str);
  239. break;
  240. default:
  241. break;
  242. --- kconfig/gconf.c
  243. +++ uClibc/gconf.c
  244. @@ -271,8 +271,8 @@
  245. /*"style", PANGO_STYLE_OBLIQUE, */
  246. NULL);
  247. - sprintf(title, _("Linux Kernel v%s Configuration"),
  248. - getenv("KERNELVERSION"));
  249. + sprintf(title, _("uClibc v%s Configuration"),
  250. + getenv("VERSION"));
  251. gtk_window_set_title(GTK_WINDOW(main_wnd), title);
  252. gtk_widget_show(main_wnd);
  253. --- kconfig/mconf.c
  254. +++ uClibc/mconf.c
  255. @@ -30,20 +30,18 @@
  256. static const char mconf_readme[] = N_(
  257. "Overview\n"
  258. "--------\n"
  259. -"Some kernel features may be built directly into the kernel.\n"
  260. -"Some may be made into loadable runtime modules. Some features\n"
  261. +"Some features may be built directly into uClibc. Some features\n"
  262. "may be completely removed altogether. There are also certain\n"
  263. -"kernel parameters which are not really features, but must be\n"
  264. +"parameters which are not really features, but must be\n"
  265. "entered in as decimal or hexadecimal numbers or possibly text.\n"
  266. "\n"
  267. -"Menu items beginning with [*], <M> or [ ] represent features\n"
  268. -"configured to be built in, modularized or removed respectively.\n"
  269. -"Pointed brackets <> represent module capable features.\n"
  270. +"Menu items beginning with [*] or [ ] represent features\n"
  271. +"configured to be built in or removed respectively.\n"
  272. "\n"
  273. "To change any of these features, highlight it with the cursor\n"
  274. -"keys and press <Y> to build it in, <M> to make it a module or\n"
  275. -"<N> to removed it. You may also press the <Space Bar> to cycle\n"
  276. -"through the available options (ie. Y->N->M->Y).\n"
  277. +"keys and press <Y> to build it in or <N> to removed it.\n"
  278. +"You may also press the <Space Bar> to cycle\n"
  279. +"through the available options (ie. Y->N->Y).\n"
  280. "\n"
  281. "Some additional keyboard hints:\n"
  282. "\n"
  283. @@ -116,7 +114,7 @@
  284. "-----------------------------\n"
  285. "Menuconfig supports the use of alternate configuration files for\n"
  286. "those who, for various reasons, find it necessary to switch\n"
  287. -"between different kernel configurations.\n"
  288. +"between different configurations.\n"
  289. "\n"
  290. "At the end of the main menu you will find two options. One is\n"
  291. "for saving the current configuration to a file of your choosing.\n"
  292. @@ -149,7 +147,7 @@
  293. "\n"
  294. "Optional personality available\n"
  295. "------------------------------\n"
  296. -"If you prefer to have all of the kernel options listed in a single\n"
  297. +"If you prefer to have all of the options listed in a single\n"
  298. "menu, rather than the default multimenu hierarchy, run the menuconfig\n"
  299. "with MENUCONFIG_MODE environment variable set to single_menu. Example:\n"
  300. "\n"
  301. @@ -179,9 +177,9 @@
  302. "Arrow keys navigate the menu. "
  303. "<Enter> selects submenus --->. "
  304. "Highlighted letters are hotkeys. "
  305. - "Pressing <Y> includes, <N> excludes, <M> modularizes features. "
  306. + "Pressing <Y> selectes a feature, while <N> will exclude a feature. "
  307. "Press <Esc><Esc> to exit, <?> for Help, </> for Search. "
  308. - "Legend: [*] built-in [ ] excluded <M> module < > module capable"),
  309. + "Legend: [*] feature is selected [ ] feature is excluded"),
  310. radiolist_instructions[] = N_(
  311. "Use the arrow keys to navigate this window or "
  312. "press the hotkey of the item you wish to select "
  313. @@ -201,18 +199,18 @@
  314. "This feature depends on another which has been configured as a module.\n"
  315. "As a result, this feature will be built as a module."),
  316. nohelp_text[] = N_(
  317. - "There is no help available for this kernel option.\n"),
  318. + "There is no help available for this option.\n"),
  319. load_config_text[] = N_(
  320. "Enter the name of the configuration file you wish to load. "
  321. "Accept the name shown to restore the configuration you "
  322. "last retrieved. Leave blank to abort."),
  323. load_config_help[] = N_(
  324. "\n"
  325. - "For various reasons, one may wish to keep several different kernel\n"
  326. + "For various reasons, one may wish to keep several different uClibc\n"
  327. "configurations available on a single machine.\n"
  328. "\n"
  329. "If you have saved a previous configuration in a file other than the\n"
  330. - "kernel's default, entering the name of the file here will allow you\n"
  331. + "uClibc's default, entering the name of the file here will allow you\n"
  332. "to modify that configuration.\n"
  333. "\n"
  334. "If you are uncertain, then you have probably never used alternate\n"
  335. @@ -222,7 +220,7 @@
  336. "as an alternate. Leave blank to abort."),
  337. save_config_help[] = N_(
  338. "\n"
  339. - "For various reasons, one may wish to keep different kernel\n"
  340. + "For various reasons, one may wish to keep different uClibc\n"
  341. "configurations available on a single machine.\n"
  342. "\n"
  343. "Entering a file name here will allow you to later retrieve, modify\n"
  344. @@ -871,9 +869,9 @@
  345. conf_parse(av[1]);
  346. conf_read(NULL);
  347. - sym = sym_lookup("KERNELVERSION", 0);
  348. + sym = sym_lookup("VERSION", 0);
  349. sym_calc_value(sym);
  350. - sprintf(menu_backtitle, _("Linux Kernel v%s Configuration"),
  351. + sprintf(menu_backtitle, _("uClibc v%s Configuration"),
  352. sym_get_string_value(sym));
  353. mode = getenv("MENUCONFIG_MODE");
  354. @@ -893,7 +891,7 @@
  355. if (conf_get_changed())
  356. res = dialog_yesno(NULL,
  357. _("Do you wish to save your "
  358. - "new kernel configuration?\n"
  359. + "new uClibc configuration?\n"
  360. "<ESC><ESC> to continue."),
  361. 6, 60);
  362. else
  363. @@ -905,22 +903,22 @@
  364. case 0:
  365. if (conf_write(NULL)) {
  366. fprintf(stderr, _("\n\n"
  367. - "Error during writing of the kernel configuration.\n"
  368. - "Your kernel configuration changes were NOT saved."
  369. + "Error during writing of the uClibc configuration.\n"
  370. + "Your uClibc configuration changes were NOT saved."
  371. "\n\n"));
  372. return 1;
  373. }
  374. case -1:
  375. printf(_("\n\n"
  376. - "*** End of Linux kernel configuration.\n"
  377. - "*** Execute 'make' to build the kernel or try 'make help'."
  378. + "*** End of uClibc configuration.\n"
  379. + "*** Execute 'make' to build uClibc or try 'make help'."
  380. "\n\n"));
  381. break;
  382. default:
  383. fprintf(stderr, _("\n\n"
  384. - "Your kernel configuration changes were NOT saved."
  385. + "Your uClibc configuration changes were NOT saved."
  386. "\n\n"));
  387. }
  388. - return 0;
  389. + return conf_write_autoconf();
  390. }
  391. --- kconfig/symbol.c
  392. +++ uClibc/symbol.c
  393. @@ -61,10 +61,10 @@
  394. if (p)
  395. sym_add_default(sym, p);
  396. - sym = sym_lookup("KERNELVERSION", 0);
  397. + sym = sym_lookup("VERSION", 0);
  398. sym->type = S_STRING;
  399. sym->flags |= SYMBOL_AUTO;
  400. - p = getenv("KERNELVERSION");
  401. + p = getenv("VERSION");
  402. if (p)
  403. sym_add_default(sym, p);
  404. --- kconfig/zconf.tab.c
  405. +++ uClibc/zconf.tab.c
  406. @@ -2115,7 +2115,7 @@
  407. modules_sym = sym_lookup(NULL, 0);
  408. modules_sym->type = S_BOOLEAN;
  409. modules_sym->flags |= SYMBOL_AUTO;
  410. - rootmenu.prompt = menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL);
  411. + rootmenu.prompt = menu_add_prompt(P_MENU, "uClibc Configuration", NULL);
  412. #if YYDEBUG
  413. if (getenv("ZCONF_DEBUG"))
  414. @@ -2135,7 +2135,7 @@
  415. sym_check_deps(sym);
  416. }
  417. - sym_change_count = 1;
  418. + sym_set_change_count(1);
  419. }
  420. const char *zconf_tokenname(int token)
  421. --- kconfig/zconf.tab.c_shipped
  422. +++ uClibc/zconf.tab.c_shipped
  423. @@ -2115,7 +2115,7 @@
  424. modules_sym = sym_lookup(NULL, 0);
  425. modules_sym->type = S_BOOLEAN;
  426. modules_sym->flags |= SYMBOL_AUTO;
  427. - rootmenu.prompt = menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL);
  428. + rootmenu.prompt = menu_add_prompt(P_MENU, "uClibc Configuration", NULL);
  429. #if YYDEBUG
  430. if (getenv("ZCONF_DEBUG"))
  431. --- kconfig/zconf.y
  432. +++ uClibc/zconf.y
  433. @@ -484,7 +484,7 @@
  434. modules_sym = sym_lookup(NULL, 0);
  435. modules_sym->type = S_BOOLEAN;
  436. modules_sym->flags |= SYMBOL_AUTO;
  437. - rootmenu.prompt = menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL);
  438. + rootmenu.prompt = menu_add_prompt(P_MENU, "uClibc Configuration", NULL);
  439. #if YYDEBUG
  440. if (getenv("ZCONF_DEBUG"))