aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Config.in4
-rw-r--r--Makefile4
-rw-r--r--kconfig/Makefile6
-rw-r--r--lib/args.c3
-rw-r--r--toys/catv.c2
-rw-r--r--toys/df.c2
-rw-r--r--toys/pwd.c2
-rw-r--r--toys/toysh.c2
-rw-r--r--toys/which.c2
9 files changed, 16 insertions, 11 deletions
diff --git a/Config.in b/Config.in
index 51b3cdaf..4218bcb2 100644
--- a/Config.in
+++ b/Config.in
@@ -2,7 +2,7 @@ mainmenu "ToyBox Configuration"
menu "Global settings"
-config TOYS_FREE
+config TOYBOX_FREE
bool "Free memory unnecessarily"
default n
help
@@ -12,7 +12,7 @@ config TOYS_FREE
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 --git a/Makefile b/Makefile
index c366b13c..471c089e 100644
--- a/Makefile
+++ b/Makefile
@@ -12,6 +12,10 @@ all: toybox
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 --git a/kconfig/Makefile b/kconfig/Makefile
index 46a8f6e4..f66432e5 100644
--- a/kconfig/Makefile
+++ b/kconfig/Makefile
@@ -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 @@ allyesconfig: $(obj)/conf
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 --git a/lib/args.c b/lib/args.c
index 9290293c..2c17951b 100644
--- a/lib/args.c
+++ b/lib/args.c
@@ -169,7 +169,8 @@ void get_optflags(void)
// 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 --git a/toys/catv.c b/toys/catv.c
index 9097c065..ee23061d 100644
--- a/toys/catv.c
+++ b/toys/catv.c
@@ -53,7 +53,7 @@ int catv_main(void)
putchar(c);
}
}
- if (CFG_TOYS_FREE && fd) close(fd);
+ if (CFG_TOYBOX_FREE && fd) close(fd);
} while (*++argv);
return retval;
diff --git a/toys/df.c b/toys/df.c
index 3e8a9725..52a6c1df 100644
--- a/toys/df.c
+++ b/toys/df.c
@@ -113,7 +113,7 @@ int df_main(void)
}
}
- if (CFG_TOYS_FREE) llist_free(mtlist, NULL);
+ if (CFG_TOYBOX_FREE) llist_free(mtlist, NULL);
return 0;
}
diff --git a/toys/pwd.c b/toys/pwd.c
index 59d7223d..a6fdd441 100644
--- a/toys/pwd.c
+++ b/toys/pwd.c
@@ -10,7 +10,7 @@ int pwd_main(void)
char *pwd = xgetcwd();
xprintf("%s\n", pwd);
- if (CFG_TOYS_FREE) free(pwd);
+ if (CFG_TOYBOX_FREE) free(pwd);
return 0;
}
diff --git a/toys/toysh.c b/toys/toysh.c
index 074907ef..c383b89a 100644
--- a/toys/toysh.c
+++ b/toys/toysh.c
@@ -212,7 +212,7 @@ int toysh_main(void)
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 --git a/toys/which.c b/toys/which.c
index 16e19d00..df7566c0 100644
--- a/toys/which.c
+++ b/toys/which.c
@@ -61,7 +61,7 @@ int which_main(void)
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;
}