[BusyBox-cvs] svn commit: trunk/busybox: networking
landley at busybox.net
landley at busybox.net
Thu Jul 28 19:36:34 UTC 2005
Author: landley
Date: 2005-07-28 13:36:33 -0600 (Thu, 28 Jul 2005)
New Revision: 10944
Log:
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.
Modified:
trunk/busybox/Makefile
trunk/busybox/networking/ifconfig.c
Changeset:
Modified: trunk/busybox/Makefile
===================================================================
--- trunk/busybox/Makefile 2005-07-28 18:28:48 UTC (rev 10943)
+++ trunk/busybox/Makefile 2005-07-28 19:36:33 UTC (rev 10944)
@@ -214,7 +214,9 @@
include/bb_config.h: include/config.h
echo "#ifndef AUTOCONF_INCLUDED" > $@
- sed -e 's/#undef \(.*\)/static const int \1 = 0;/' < $< >> $@
+ sed -e 's/#undef CONFIG_\(.*\)/#define ENABLE_\1 0/' \
+ -e 's/#define CONFIG_\(.*\)/#define CONFIG_\1\n#define ENABLE_\1/' \
+ < $< >> $@
echo "#endif" >> $@
finished2:
Modified: trunk/busybox/networking/ifconfig.c
===================================================================
--- trunk/busybox/networking/ifconfig.c 2005-07-28 18:28:48 UTC (rev 10943)
+++ trunk/busybox/networking/ifconfig.c 2005-07-28 19:36:33 UTC (rev 10944)
@@ -559,7 +559,7 @@
continue;
} /* end of while-loop */
- if (CONFIG_FEATURE_CLEAN_UP) close(sockfd);
+ if (ENABLE_FEATURE_CLEAN_UP) close(sockfd);
return goterr;
}
More information about the busybox-cvs
mailing list