source: menu/BusyBox-1.1.3-menu.patch@ 7fa9369

ablfs-more legacy trunk
Last change on this file since 7fa9369 was a705708, checked in by Manuel Canales Esparcia <manuel@…>, 18 years ago

Merged menuconfig code from experimental.
Added clfs2 symlink (required by menuconfig)

  • Property mode set to 100644
File size: 14.1 KB
Line 
1diff -Npr menu-bb/conf.c menu/conf.c
2*** menu-bb/conf.c 2006-03-22 16:16:18.000000000 -0500
3--- menu/conf.c 2006-07-26 17:26:45.000000000 -0400
4*************** int main(int ac, char **av)
5*** 535,554 ****
6 conf_parse(name);
7 //zconfdump(stdout);
8 switch (input_mode) {
9- case set_default:
10- if (!defconfig_file)
11- defconfig_file = conf_get_default_confname();
12- if (conf_read(defconfig_file)) {
13- printf("***\n"
14- "*** Can't find default configuration \"%s\"!\n"
15- "***\n", defconfig_file);
16- exit(1);
17- }
18- break;
19 case ask_silent:
20 if (stat(".config", &tmpstat)) {
21 printf("***\n"
22! "*** You have not yet configured BusyBox!\n"
23 "***\n"
24 "*** Please run some configurator (e.g. \"make oldconfig\" or\n"
25 "*** \"make menuconfig\" or \"make config\").\n"
26--- 535,544 ----
27 conf_parse(name);
28 //zconfdump(stdout);
29 switch (input_mode) {
30 case ask_silent:
31 if (stat(".config", &tmpstat)) {
32 printf("***\n"
33! "*** You have not yet configured JHALFS!\n"
34 "***\n"
35 "*** Please run some configurator (e.g. \"make oldconfig\" or\n"
36 "*** \"make menuconfig\" or \"make config\").\n"
37*************** int main(int ac, char **av)
38*** 576,582 ****
39 check_conf(&rootmenu);
40 } while (conf_cnt);
41 if (conf_write(NULL)) {
42! fprintf(stderr, "\n*** Error during writing of the BusyBox configuration.\n\n");
43 return 1;
44 }
45 return 0;
46--- 566,572 ----
47 check_conf(&rootmenu);
48 } while (conf_cnt);
49 if (conf_write(NULL)) {
50! fprintf(stderr, "\n*** Error during writing of the JHALFS configuration.\n\n");
51 return 1;
52 }
53 return 0;
54diff -Npr menu-bb/confdata.c menu/confdata.c
55*** menu-bb/confdata.c 2006-03-22 16:16:18.000000000 -0500
56--- menu/confdata.c 2006-07-26 17:26:45.000000000 -0400
57***************
58*** 13,24 ****
59 #define LKC_DIRECT_LINK
60 #include "lkc.h"
61
62! const char conf_def_filename[] = ".config";
63
64 const char conf_defname[] = "defconfig";
65
66 const char *conf_confnames[] = {
67! ".config",
68 conf_defname,
69 NULL,
70 };
71--- 13,24 ----
72 #define LKC_DIRECT_LINK
73 #include "lkc.h"
74
75! const char conf_def_filename[] = "configuration";
76
77 const char conf_defname[] = "defconfig";
78
79 const char *conf_confnames[] = {
80! "configuration",
81 conf_defname,
82 NULL,
83 };
84*************** static char *conf_expand_value(const cha
85*** 49,70 ****
86 return res_value;
87 }
88
89- char *conf_get_default_confname(void)
90- {
91- struct stat buf;
92- static char fullname[PATH_MAX+1];
93- char *env, *name;
94-
95- name = conf_expand_value(conf_defname);
96- env = getenv(SRCTREE);
97- if (env) {
98- sprintf(fullname, "%s/%s", env, name);
99- if (!stat(fullname, &buf))
100- return fullname;
101- }
102- return name;
103- }
104-
105 int conf_read(const char *name)
106 {
107 FILE *in = NULL;
108--- 49,54 ----
109*************** struct menu *next_menu(struct menu *menu
110*** 271,277 ****
111
112 int conf_write(const char *name)
113 {
114! FILE *out, *out_h;
115 struct symbol *sym;
116 struct menu *menu;
117 const char *basename;
118--- 255,261 ----
119
120 int conf_write(const char *name)
121 {
122! FILE *out;
123 struct symbol *sym;
124 struct menu *menu;
125 const char *basename;
126*************** int conf_write(const char *name)
127*** 279,288 ****
128 int type, l;
129 const char *str;
130
131- /* busybox`s code */
132- const char *opt_name;
133- int use_flg;
134-
135 dirname[0] = 0;
136 if (name && name[0]) {
137 struct stat st;
138--- 263,268 ----
139*************** int conf_write(const char *name)
140*** 309,342 ****
141 out = fopen(newname, "w");
142 if (!out)
143 return 1;
144- out_h = NULL;
145- if (!name) {
146- out_h = fopen(".tmpconfig.h", "w");
147- if (!out_h)
148- return 1;
149- }
150 fprintf(out, "#\n"
151! "# Automatically generated make config: don't edit\n"
152 "#\n");
153
154- /* busybox`s code */
155- if (out_h) {
156- fprintf(out_h, "#ifndef BB_CONFIG_H\n#define BB_CONFIG_H\n");
157- fprintf(out_h, "/*\n"
158- " * Automatically generated header file: don't edit\n"
159- " */\n\n"
160- "/* Version Number */\n"
161- "#define BB_VER \"%s\"\n"
162- "#define BB_BT \"%s\"\n",
163- getenv("VERSION"),
164- getenv("BUILDTIME"));
165- if (getenv("EXTRA_VERSION"))
166- fprintf(out_h, "#define BB_EXTRA_VERSION \"%s\"\n",
167- getenv("EXTRA_VERSION"));
168- fprintf(out_h, "\n");
169- }
170- /* end busybox`s code */
171-
172 if (!sym_change_count)
173 sym_clear_all_valid();
174
175--- 289,299 ----
176 out = fopen(newname, "w");
177 if (!out)
178 return 1;
179 fprintf(out, "#\n"
180! "# Automatically generated configuration: don't edit\n"
181! "# use make menuconfig or make config to make changes\n"
182 "#\n");
183
184 if (!sym_change_count)
185 sym_clear_all_valid();
186
187*************** int conf_write(const char *name)
188*** 357,367 ****
189 "#\n"
190 "# %s\n"
191 "#\n", str);
192- if (out_h)
193- fprintf(out_h, "\n"
194- "/*\n"
195- " * %s\n"
196- " */\n", str);
197 } else if (!(sym->flags & SYMBOL_CHOICE)) {
198 sym_calc_value(sym);
199 if (!(sym->flags & SYMBOL_FORCEWRITE))
200--- 314,319 ----
201*************** int conf_write(const char *name)
202*** 375,388 ****
203 type = S_BOOLEAN;
204 }
205
206- /* busybox`s code */
207- opt_name = strchr(sym->name, '_');
208- if(opt_name == NULL)
209- opt_name = sym->name;
210- else
211- opt_name++;
212- use_flg = 1;
213- /* end busybox`s code */
214
215 switch (type) {
216 case S_BOOLEAN:
217--- 327,332 ----
218*************** int conf_write(const char *name)
219*** 390,410 ****
220 switch (sym_get_tristate_value(sym)) {
221 case no:
222 fprintf(out, "# %s is not set\n", sym->name);
223- if (out_h)
224- fprintf(out_h, "#undef %s\n", sym->name);
225- use_flg = 0; /* busybox`s code */
226 break;
227 case mod:
228- #if 0 /* busybox`s code */
229 fprintf(out, "%s=m\n", sym->name);
230- if (out_h)
231- fprintf(out_h, "#define %s_MODULE 1\n", sym->name);
232- #endif /* busybox`s code */
233 break;
234 case yes:
235 fprintf(out, "%s=y\n", sym->name);
236- if (out_h)
237- fprintf(out_h, "#define %s 1\n", sym->name);
238 break;
239 }
240 break;
241--- 334,345 ----
242*************** int conf_write(const char *name)
243*** 412,473 ****
244 // fix me
245 str = sym_get_string_value(sym);
246 fprintf(out, "%s=\"", sym->name);
247- if (out_h)
248- fprintf(out_h, "#define %s \"", sym->name);
249 do {
250 l = strcspn(str, "\"\\");
251 if (l) {
252 fwrite(str, l, 1, out);
253- if (out_h)
254- fwrite(str, l, 1, out_h);
255 }
256 str += l;
257 while (*str == '\\' || *str == '"') {
258 fprintf(out, "\\%c", *str);
259- if (out_h)
260- fprintf(out_h, "\\%c", *str);
261 str++;
262 }
263 } while (*str);
264 fputs("\"\n", out);
265- if (out_h)
266- fputs("\"\n", out_h);
267 break;
268 case S_HEX:
269 str = sym_get_string_value(sym);
270 if (str[0] != '0' || (str[1] != 'x' && str[1] != 'X')) {
271 fprintf(out, "%s=%s\n", sym->name, *str ? str : "0");
272- if (out_h)
273- fprintf(out_h, "#define %s 0x%s\n", sym->name, str);
274 break;
275 }
276 case S_INT:
277 str = sym_get_string_value(sym);
278 fprintf(out, "%s=%s\n", sym->name, *str ? str : "0");
279- if (out_h)
280- fprintf(out_h, "#define %s %s\n", sym->name, str);
281 break;
282 }
283- /* busybox`s code */
284- if (out_h) {
285- fprintf(out_h, "#define ENABLE_%s %d\n", opt_name, use_flg);
286- fprintf(out_h, "#define USE_%s(...)%s\n", opt_name,
287- (use_flg ? " __VA_ARGS__" : ""));
288- fprintf(out_h, "#define SKIP_%s(...)%s\n\n", opt_name,
289- (use_flg ? "" : " __VA_ARGS__"));
290- }
291- /* end busybox`s code */
292 }
293 next:
294 menu = next_menu(menu);
295 }
296 fclose(out);
297- if (out_h) {
298- fprintf(out_h, "#endif /* BB_CONFIG_H */\n"); /* busybox`s code */
299- fclose(out_h);
300- rename(".tmpconfig.h", "include/bb_config.h"); /* busybox`s config name */
301- file_write_dep(NULL);
302- }
303 if (!name || basename != conf_def_filename) {
304 if (!name)
305 name = conf_def_filename;
306--- 347,381 ----
307diff -Npr menu-bb/Makefile menu/Makefile
308*** menu-bb/Makefile 2006-03-22 16:16:18.000000000 -0500
309--- menu/Makefile 2006-07-26 18:06:25.000000000 -0400
310***************
311*** 1,11 ****
312 # Makefile for BusyBox
313 #
314 # Copyright (C) 2002 Erik Andersen <andersen@codepoet.org>
315
316- top_srcdir=../..
317- top_builddir=../..
318- srcdir=$(top_srcdir)/scripts/config
319- include $(top_srcdir)/Rules.mak
320
321 all: ncurses conf mconf
322
323--- 1,30 ----
324 # Makefile for BusyBox
325 #
326 # Copyright (C) 2002 Erik Andersen <andersen@codepoet.org>
327+ # Modified by George Boudreau georgeb@LinuxFromScratch.org
328+
329+ top_srcdir=.
330+ top_builddir=.
331+ srcdir=$(top_srcdir)
332+
333+ # Select the compiler needed to build binaries for your development system
334+ HOSTCC = gcc
335+ HOSTCFLAGS= -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
336+
337+ # Ensure consistent sort order, 'gcc -print-search-dirs' behavior, etc.
338+ LC_ALL:= C
339+
340+ SED ?= sed
341+ SECHO := @-false
342+ DISP := pur
343+ Q := @
344+
345+ show_objs = $(subst $(top_builddir)/,,$(subst ../,,$@))
346+ pur_disp_compile.h = echo " "HOSTCC $(show_objs)
347+ disp_compile.h = $($(DISP)_disp_compile.h)
348+ cmd_compile.h = $(HOSTCC) $(HOSTCFLAGS) -c -o $@ $<
349+ compile.h = @$(disp_compile.h) ; $(cmd_compile.h)
350
351
352 all: ncurses conf mconf
353
354diff -Npr menu-bb/mconf.c menu/mconf.c
355*** menu-bb/mconf.c 2006-03-22 16:16:18.000000000 -0500
356--- menu/mconf.c 2006-07-26 17:26:45.000000000 -0400
357*************** static char menu_backtitle[128];
358*** 32,38 ****
359 static const char mconf_readme[] =
360 "Overview\n"
361 "--------\n"
362! "Some features may be built directly into BusyBox. Some features\n"
363 "may be completely removed altogether. There are also certain\n"
364 "parameters which are not really features, but must be\n"
365 "entered in as decimal or hexadecimal numbers or possibly text.\n"
366--- 32,38 ----
367 static const char mconf_readme[] =
368 "Overview\n"
369 "--------\n"
370! "Some features may be built directly into JHALFS. Some features\n"
371 "may be completely removed altogether. There are also certain\n"
372 "parameters which are not really features, but must be\n"
373 "entered in as decimal or hexadecimal numbers or possibly text.\n"
374*************** load_config_text[] =
375*** 194,204 ****
376 "last retrieved. Leave blank to abort.",
377 load_config_help[] =
378 "\n"
379! "For various reasons, one may wish to keep several different BusyBox\n"
380 "configurations available on a single machine.\n"
381 "\n"
382 "If you have saved a previous configuration in a file other than the\n"
383! "BusyBox's default, entering the name of the file here will allow you\n"
384 "to modify that configuration.\n"
385 "\n"
386 "If you are uncertain, then you have probably never used alternate\n"
387--- 194,204 ----
388 "last retrieved. Leave blank to abort.",
389 load_config_help[] =
390 "\n"
391! "For various reasons, one may wish to keep several different JHALFS\n"
392 "configurations available on a single machine.\n"
393 "\n"
394 "If you have saved a previous configuration in a file other than the\n"
395! "JHALFS's default, entering the name of the file here will allow you\n"
396 "to modify that configuration.\n"
397 "\n"
398 "If you are uncertain, then you have probably never used alternate\n"
399*************** save_config_text[] =
400*** 208,214 ****
401 "as an alternate. Leave blank to abort.",
402 save_config_help[] =
403 "\n"
404! "For various reasons, one may wish to keep different BusyBox\n"
405 "configurations available on a single machine.\n"
406 "\n"
407 "Entering a file name here will allow you to later retrieve, modify\n"
408--- 208,214 ----
409 "as an alternate. Leave blank to abort.",
410 save_config_help[] =
411 "\n"
412! "For various reasons, one may wish to keep different JHALFS\n"
413 "configurations available on a single machine.\n"
414 "\n"
415 "Entering a file name here will allow you to later retrieve, modify\n"
416*************** int main(int ac, char **av)
417*** 940,946 ****
418
419 sym = sym_lookup("VERSION", 0);
420 sym_calc_value(sym);
421! snprintf(menu_backtitle, 128, "BusyBox v%s Configuration",
422 sym_get_string_value(sym));
423
424 mode = getenv("MENUCONFIG_MODE");
425--- 940,946 ----
426
427 sym = sym_lookup("VERSION", 0);
428 sym_calc_value(sym);
429! snprintf(menu_backtitle, 128, "JHALFS v%s Configuration",
430 sym_get_string_value(sym));
431
432 mode = getenv("MENUCONFIG_MODE");
433*************** int main(int ac, char **av)
434*** 961,976 ****
435 init_dialog();
436 do {
437 stat = dialog_yesno(NULL,
438! "Do you wish to save your new BusyBox configuration?", 5, 60);
439 } while (stat < 0);
440 end_dialog();
441
442 if (stat == 0) {
443 conf_write(NULL);
444 printf("\n"
445! "*** End of BusyBox configuration.\n");
446 } else
447! printf("\n\nYour BusyBox configuration changes were NOT saved.\n\n");
448
449 return 0;
450 }
451--- 961,976 ----
452 init_dialog();
453 do {
454 stat = dialog_yesno(NULL,
455! "Do you wish to save your new JHALFS configuration?", 5, 60);
456 } while (stat < 0);
457 end_dialog();
458
459 if (stat == 0) {
460 conf_write(NULL);
461 printf("\n"
462! "*** End of JHALFS configuration.\n");
463 } else
464! printf("\n\nYour JHALFS configuration changes were NOT saved.\n\n");
465
466 return 0;
467 }
468diff -Npr menu-bb/zconf.tab.c_shipped menu/zconf.tab.c_shipped
469*** menu-bb/zconf.tab.c_shipped 2006-03-22 16:16:18.000000000 -0500
470--- menu/zconf.tab.c_shipped 2006-07-26 17:26:45.000000000 -0400
471*************** void conf_parse(const char *name)
472*** 1925,1931 ****
473 sym_init();
474 menu_init();
475 modules_sym = sym_lookup("MODULES", 0);
476! rootmenu.prompt = menu_add_prop(P_MENU, "BusyBox Configuration", NULL, NULL);
477
478 //zconfdebug = 1;
479 zconfparse();
480--- 1925,1931 ----
481 sym_init();
482 menu_init();
483 modules_sym = sym_lookup("MODULES", 0);
484! rootmenu.prompt = menu_add_prop(P_MENU, "JHALFS Configuration", NULL, NULL);
485
486 //zconfdebug = 1;
487 zconfparse();
488diff -Npr menu-bb/zconf.y menu/zconf.y
489*** menu-bb/zconf.y 2006-03-22 16:16:18.000000000 -0500
490--- menu/zconf.y 2006-07-26 17:26:45.000000000 -0400
491*************** void conf_parse(const char *name)
492*** 487,493 ****
493 sym_init();
494 menu_init();
495 modules_sym = sym_lookup("MODULES", 0);
496! rootmenu.prompt = menu_add_prop(P_MENU, "BusyBox Configuration", NULL, NULL);
497
498 //zconfdebug = 1;
499 zconfparse();
500--- 487,493 ----
501 sym_init();
502 menu_init();
503 modules_sym = sym_lookup("MODULES", 0);
504! rootmenu.prompt = menu_add_prop(P_MENU, "JHALFS Configuration", NULL, NULL);
505
506 //zconfdebug = 1;
507 zconfparse();
Note: See TracBrowser for help on using the repository browser.