03-change-config-option-prefix.patch 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. ---
  2. confdata.c | 57 +++++++++++++++++++++++++++++----------------------------
  3. lkc.h | 2 +-
  4. menu.c | 2 +-
  5. 3 files changed, 31 insertions(+), 30 deletions(-)
  6. Index: config/confdata.c
  7. ===================================================================
  8. --- config.orig/confdata.c
  9. +++ config/confdata.c
  10. @@ -12,6 +12,7 @@
  11. #include <string.h>
  12. #include <time.h>
  13. #include <unistd.h>
  14. +#include <libgen.h>
  15. #define LKC_DIRECT_LINK
  16. #include "lkc.h"
  17. @@ -25,7 +26,7 @@
  18. static const char *conf_filename;
  19. static int conf_lineno, conf_warnings, conf_unsaved;
  20. -const char conf_defname[] = "arch/$ARCH/defconfig";
  21. +const char conf_defname[] = ".defconfig";
  22. static void conf_warning(const char *fmt, ...)
  23. {
  24. @@ -63,7 +64,7 @@
  25. const char *conf_get_configname(void)
  26. {
  27. - char *name = getenv("KCONFIG_CONFIG");
  28. + char *name = getenv("BUILDROOT_CONFIG");
  29. return name ? name : ".config";
  30. }
  31. @@ -249,20 +250,20 @@
  32. if (line[0] == '#') {
  33. if (memcmp(line + 2, CONFIG_, strlen(CONFIG_)))
  34. continue;
  35. - p = strchr(line + 2 + strlen(CONFIG_), ' ');
  36. + p = strchr(line + 2, ' ');
  37. if (!p)
  38. continue;
  39. *p++ = 0;
  40. if (strncmp(p, "is not set", 10))
  41. continue;
  42. if (def == S_DEF_USER) {
  43. - sym = sym_find(line + 2 + strlen(CONFIG_));
  44. + sym = sym_find(line + 2);
  45. if (!sym) {
  46. sym_add_change_count(1);
  47. goto setsym;
  48. }
  49. } else {
  50. - sym = sym_lookup(line + 2 + strlen(CONFIG_), 0);
  51. + sym = sym_lookup(line + 2, 0);
  52. if (sym->type == S_UNKNOWN)
  53. sym->type = S_BOOLEAN;
  54. }
  55. @@ -278,8 +279,8 @@
  56. default:
  57. ;
  58. }
  59. - } else if (memcmp(line, CONFIG_, strlen(CONFIG_)) == 0) {
  60. - p = strchr(line + strlen(CONFIG_), '=');
  61. + } else if (isupper(line[0])) {
  62. + p = strchr(line, '=');
  63. if (!p)
  64. continue;
  65. *p++ = 0;
  66. @@ -290,13 +291,13 @@
  67. *p2 = 0;
  68. }
  69. if (def == S_DEF_USER) {
  70. - sym = sym_find(line + strlen(CONFIG_));
  71. + sym = sym_find(line);
  72. if (!sym) {
  73. sym_add_change_count(1);
  74. goto setsym;
  75. }
  76. } else {
  77. - sym = sym_lookup(line + strlen(CONFIG_), 0);
  78. + sym = sym_lookup(line, 0);
  79. if (sym->type == S_UNKNOWN)
  80. sym->type = S_OTHER;
  81. }
  82. @@ -423,9 +424,9 @@
  83. {
  84. int l;
  85. if (headerfile)
  86. - fprintf(out, "#define %s%s \"", CONFIG_, name);
  87. + fprintf(out, "#define %s \"", name);
  88. else
  89. - fprintf(out, "%s%s=\"", CONFIG_, name);
  90. + fprintf(out, "%s=\"", name);
  91. while (1) {
  92. l = strcspn(str, "\"\\");
  93. @@ -450,14 +451,14 @@
  94. switch (sym_get_tristate_value(sym)) {
  95. case no:
  96. if (write_no)
  97. - fprintf(out, "# %s%s is not set\n",
  98. - CONFIG_, sym->name);
  99. + fprintf(out, "# %s is not set\n",
  100. + sym->name);
  101. break;
  102. case mod:
  103. - fprintf(out, "%s%s=m\n", CONFIG_, sym->name);
  104. + fprintf(out, "%s=m\n", sym->name);
  105. break;
  106. case yes:
  107. - fprintf(out, "%s%s=y\n", CONFIG_, sym->name);
  108. + fprintf(out, "%s=y\n", sym->name);
  109. break;
  110. }
  111. break;
  112. @@ -467,7 +468,7 @@
  113. case S_HEX:
  114. case S_INT:
  115. str = sym_get_string_value(sym);
  116. - fprintf(out, "%s%s=%s\n", CONFIG_, sym->name, str);
  117. + fprintf(out, "%s=%s\n", sym->name, str);
  118. break;
  119. case S_OTHER:
  120. case S_UNKNOWN:
  121. @@ -844,17 +845,17 @@
  122. case no:
  123. break;
  124. case mod:
  125. - fprintf(tristate, "%s%s=M\n",
  126. - CONFIG_, sym->name);
  127. - fprintf(out_h, "#define %s%s_MODULE 1\n",
  128. - CONFIG_, sym->name);
  129. + fprintf(tristate, "%s=M\n",
  130. + sym->name);
  131. + fprintf(out_h, "#define %s_MODULE 1\n",
  132. + sym->name);
  133. break;
  134. case yes:
  135. if (sym->type == S_TRISTATE)
  136. - fprintf(tristate,"%s%s=Y\n",
  137. - CONFIG_, sym->name);
  138. - fprintf(out_h, "#define %s%s 1\n",
  139. - CONFIG_, sym->name);
  140. + fprintf(tristate,"%s=Y\n",
  141. + sym->name);
  142. + fprintf(out_h, "#define %s 1\n",
  143. + sym->name);
  144. break;
  145. }
  146. break;
  147. @@ -864,14 +865,14 @@
  148. case S_HEX:
  149. str = sym_get_string_value(sym);
  150. if (str[0] != '0' || (str[1] != 'x' && str[1] != 'X')) {
  151. - fprintf(out_h, "#define %s%s 0x%s\n",
  152. - CONFIG_, sym->name, str);
  153. + fprintf(out_h, "#define %s 0x%s\n",
  154. + sym->name, str);
  155. break;
  156. }
  157. case S_INT:
  158. str = sym_get_string_value(sym);
  159. - fprintf(out_h, "#define %s%s %s\n",
  160. - CONFIG_, sym->name, str);
  161. + fprintf(out_h, "#define %s %s\n",
  162. + sym->name, str);
  163. break;
  164. default:
  165. break;
  166. Index: config/lkc.h
  167. ===================================================================
  168. --- config.orig/lkc.h
  169. +++ config/lkc.h
  170. @@ -42,7 +42,7 @@
  171. #define N_(text) (text)
  172. #ifndef CONFIG_
  173. -#define CONFIG_ "CONFIG_"
  174. +#define CONFIG_ "BR2_"
  175. #endif
  176. #define TF_COMMAND 0x0001
  177. Index: config/menu.c
  178. ===================================================================
  179. --- config.orig/menu.c
  180. +++ config/menu.c
  181. @@ -597,7 +597,7 @@
  182. if (menu_has_help(menu)) {
  183. if (sym->name) {
  184. - str_printf(help, "%s%s:\n\n", CONFIG_, sym->name);
  185. + str_printf(help, "%s:\n\n", sym->name);
  186. str_append(help, _(menu_get_help(menu)));
  187. str_append(help, "\n");
  188. }