changeset 90:7c77c6ec17ee

Add "make defconfig". Modify global options to start with CONFIG_TOYBOX_.
author Rob Landley <rob@landley.net>
date Wed, 31 Jan 2007 14:37:01 -0500
parents 4f5cdc6552da
children b596b9b3b2af
files Config.in Makefile kconfig/Makefile lib/args.c toys/catv.c toys/df.c toys/pwd.c toys/toysh.c toys/which.c
diffstat 9 files changed, 16 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- 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
--- 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
--- 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::
--- 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));
--- 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;
--- 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;
 }
--- 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;
 }
--- 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;
--- 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;
 }