# HG changeset patch # User Rob Landley # Date 1170272221 18000 # Node ID 7c77c6ec17ee07ec0152e2767cfa6171a44820d6 # Parent 4f5cdc6552dac6fb2453964e6e0dd03876382511 Add "make defconfig". Modify global options to start with CONFIG_TOYBOX_. diff -r 4f5cdc6552da -r 7c77c6ec17ee Config.in --- a/Config.in Wed Jan 31 14:18:05 2007 -0500 +++ b/Config.in Wed Jan 31 14:37:01 2007 -0500 @@ -2,7 +2,7 @@ menu "Global settings" -config TOYS_FREE +config TOYBOX_FREE bool "Free memory unnecessarily" default n help @@ -12,7 +12,7 @@ without a real OS (ala newlib+libgloss), enable this to make toybox clean up after itself. -config DEBUG +config TOYBOX_DEBUG bool "Debugging tests" default n help diff -r 4f5cdc6552da -r 7c77c6ec17ee Makefile --- a/Makefile Wed Jan 31 14:18:05 2007 -0500 +++ b/Makefile Wed Jan 31 14:37:01 2007 -0500 @@ -12,6 +12,10 @@ include kconfig/Makefile +# defconfig is the "maximum sane config"; allyesconfig minus debugging and such. +defconfig: allyesconfig + @sed -i -r -e "s/^(CONFIG_(TOYBOX_DEBUG|TOYBOX_FREE))=.*/# \1 is not set/" .config + .config: Config.in toys/Config.in # The long and roundabout sed is to make old versions of sed happy. New ones diff -r 4f5cdc6552da -r 7c77c6ec17ee kconfig/Makefile --- a/kconfig/Makefile Wed Jan 31 14:18:05 2007 -0500 +++ b/kconfig/Makefile Wed Jan 31 14:37:01 2007 -0500 @@ -5,7 +5,7 @@ KCONFIG_TOP = Config.in obj = ./kconfig PHONY += clean help oldconfig menuconfig config silentoldconfig \ - randconfig allyesconfig allnoconfig allmodconfig defconfig + randconfig allyesconfig allnoconfig allmodconfig #defconfig menuconfig: $(obj)/mconf $< $(KCONFIG_TOP) @@ -28,8 +28,8 @@ allnoconfig: $(obj)/conf $< -n $(KCONFIG_TOP) -defconfig: $(obj)/conf - $< -d $(KCONFIG_TOP) +#defconfig: $(obj)/conf +# $< -d $(KCONFIG_TOP) # Help text used by make help help:: diff -r 4f5cdc6552da -r 7c77c6ec17ee lib/args.c --- a/lib/args.c Wed Jan 31 14:18:05 2007 -0500 +++ b/lib/args.c Wed Jan 31 14:37:01 2007 -0500 @@ -169,7 +169,8 @@ // Find the end of the longopt for (end = ++options; *end && *end != ')'; end++); - if (CFG_DEBUG && !*end) error_exit("Unterminated optstring"); + if (CFG_TOYBOX_DEBUG && !*end) + error_exit("Unterminated optstring"); // Allocate and init a new struct longopts lo = xmalloc(sizeof(struct longopts)); diff -r 4f5cdc6552da -r 7c77c6ec17ee toys/catv.c --- a/toys/catv.c Wed Jan 31 14:18:05 2007 -0500 +++ b/toys/catv.c Wed Jan 31 14:37:01 2007 -0500 @@ -53,7 +53,7 @@ putchar(c); } } - if (CFG_TOYS_FREE && fd) close(fd); + if (CFG_TOYBOX_FREE && fd) close(fd); } while (*++argv); return retval; diff -r 4f5cdc6552da -r 7c77c6ec17ee toys/df.c --- a/toys/df.c Wed Jan 31 14:18:05 2007 -0500 +++ b/toys/df.c Wed Jan 31 14:37:01 2007 -0500 @@ -113,7 +113,7 @@ } } - if (CFG_TOYS_FREE) llist_free(mtlist, NULL); + if (CFG_TOYBOX_FREE) llist_free(mtlist, NULL); return 0; } diff -r 4f5cdc6552da -r 7c77c6ec17ee toys/pwd.c --- a/toys/pwd.c Wed Jan 31 14:18:05 2007 -0500 +++ b/toys/pwd.c Wed Jan 31 14:37:01 2007 -0500 @@ -10,7 +10,7 @@ char *pwd = xgetcwd(); xprintf("%s\n", pwd); - if (CFG_TOYS_FREE) free(pwd); + if (CFG_TOYBOX_FREE) free(pwd); return 0; } diff -r 4f5cdc6552da -r 7c77c6ec17ee toys/toysh.c --- a/toys/toysh.c Wed Jan 31 14:18:05 2007 -0500 +++ b/toys/toysh.c Wed Jan 31 14:37:01 2007 -0500 @@ -212,7 +212,7 @@ if (1 > getline(&command, &cmdlen, f ? : stdin)) break; handle(command); } - if (CFG_TOYS_FREE) free(command); + if (CFG_TOYBOX_FREE) free(command); } return 1; diff -r 4f5cdc6552da -r 7c77c6ec17ee toys/which.c --- a/toys/which.c Wed Jan 31 14:18:05 2007 -0500 +++ b/toys/which.c Wed Jan 31 14:37:01 2007 -0500 @@ -61,7 +61,7 @@ int i; for (i=0; toys.optargs[i]; i++) rc |= which_in_path(toys.optargs[i]); } - // if (CFG_TOYS_FREE) free(argv); + // if (CFG_TOYBOX_FREE) free(argv); return rc; }