diff options
author | landley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2005-07-28 19:36:33 +0000 |
---|---|---|
committer | landley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2005-07-28 19:36:33 +0000 |
commit | dbcb8958266ccf757d5c29db0cade9c702f944de (patch) | |
tree | c5c63db86b458a88cede6d64ead21248ff89b4c7 | |
parent | 8f273dc06a0af5b67600fbd09b0a035d778abd36 (diff) | |
download | busybox-w32-dbcb8958266ccf757d5c29db0cade9c702f944de.tar.gz busybox-w32-dbcb8958266ccf757d5c29db0cade9c702f944de.tar.bz2 busybox-w32-dbcb8958266ccf757d5c29db0cade9c702f944de.zip |
Erik pointed out that in the last try at the #ifdef cleanup
infrastructure, the compiler isn't smart enough to replace const static
int with the constant, and allocates space for each set of them,
bloating the executable something fierce. Oops.
So now, we #define ENABLE_XXX to 0 or 1 for each CONFIG_XXX (which
is still there so the 1000+ #ifdef/#ifndef tests don't have to be
replaced wholesale). Changed the test instance in networking/ifconfig.c
to use this.
git-svn-id: svn://busybox.net/trunk/busybox@10944 69ca8d6d-28ef-0310-b511-8ec308f3f277
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | networking/ifconfig.c | 2 |
2 files changed, 4 insertions, 2 deletions
@@ -214,7 +214,9 @@ include/config.h: .config | |||
214 | 214 | ||
215 | include/bb_config.h: include/config.h | 215 | include/bb_config.h: include/config.h |
216 | echo "#ifndef AUTOCONF_INCLUDED" > $@ | 216 | echo "#ifndef AUTOCONF_INCLUDED" > $@ |
217 | sed -e 's/#undef \(.*\)/static const int \1 = 0;/' < $< >> $@ | 217 | sed -e 's/#undef CONFIG_\(.*\)/#define ENABLE_\1 0/' \ |
218 | -e 's/#define CONFIG_\(.*\)/#define CONFIG_\1\n#define ENABLE_\1/' \ | ||
219 | < $< >> $@ | ||
218 | echo "#endif" >> $@ | 220 | echo "#endif" >> $@ |
219 | 221 | ||
220 | finished2: | 222 | finished2: |
diff --git a/networking/ifconfig.c b/networking/ifconfig.c index 1b43a0825..f79fd83be 100644 --- a/networking/ifconfig.c +++ b/networking/ifconfig.c | |||
@@ -559,7 +559,7 @@ int ifconfig_main(int argc, char **argv) | |||
559 | continue; | 559 | continue; |
560 | } /* end of while-loop */ | 560 | } /* end of while-loop */ |
561 | 561 | ||
562 | if (CONFIG_FEATURE_CLEAN_UP) close(sockfd); | 562 | if (ENABLE_FEATURE_CLEAN_UP) close(sockfd); |
563 | return goterr; | 563 | return goterr; |
564 | } | 564 | } |
565 | 565 | ||