From 0a04b3ef850cd3d6f06b3c8d0036993adc9ba7b2 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Fri, 3 Nov 2006 00:05:52 -0500 Subject: Implement which. Add hello world to menuconfig. Wrap the various applet main functions in main.c with USE() macros so --gc-sections can strip them. --- main.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index de349ec6..00d76312 100644 --- a/main.c +++ b/main.c @@ -14,12 +14,13 @@ struct toy_list toy_list[] = { // This one is out of order on purpose. {"toybox", toybox_main, 0}, // The rest of these are alphabetical, for binary search. - {"cd", cd_main, TOYFLAG_NOFORK}, - {"df", df_main, TOYFLAG_USR|TOYFLAG_SBIN}, - {"exit", exit_main, TOYFLAG_NOFORK}, - {"hello", hello_main, TOYFLAG_NOFORK|TOYFLAG_USR}, - {"sh", toysh_main, TOYFLAG_BIN}, - {"toysh", toysh_main, TOYFLAG_BIN} + USE_TOYSH({"cd", cd_main, TOYFLAG_NOFORK},) + USE_DF({"df", df_main, TOYFLAG_USR|TOYFLAG_SBIN},) + USE_TOYSH({"exit", exit_main, TOYFLAG_NOFORK},) + USE_HELLO({"hello", hello_main, TOYFLAG_NOFORK|TOYFLAG_USR},) + USE_TOYSH({"sh", toysh_main, TOYFLAG_BIN},) + USE_TOYSH({"toysh", toysh_main, TOYFLAG_BIN},) + USE_WHICH({"which", which_main, TOYFLAG_USR|TOYFLAG_BIN},) }; #define TOY_LIST_LEN (sizeof(toy_list)/sizeof(struct toy_list)) -- cgit v1.2.3