svn commit: trunk/busybox: networking/udhcp scripts

vda at busybox.net vda at busybox.net
Sun Oct 7 17:06:02 UTC 2007


Author: vda
Date: 2007-10-07 10:06:01 -0700 (Sun, 07 Oct 2007)
New Revision: 20191

Log:
reviving libbusybox, adding CONFIG_INDIVIDUAL part 3



Modified:
   trunk/busybox/Config.in
   trunk/busybox/Makefile.flags
   trunk/busybox/networking/udhcp/dhcpc.c
   trunk/busybox/networking/udhcp/dhcpd.c
   trunk/busybox/scripts/trylink


Changeset:
Modified: trunk/busybox/Config.in
===================================================================
--- trunk/busybox/Config.in	2007-10-07 17:05:42 UTC (rev 20190)
+++ trunk/busybox/Config.in	2007-10-07 17:06:01 UTC (rev 20191)
@@ -292,31 +292,30 @@
 	  binary serves no purpose (and increases the size).  You should
 	  almost certainly say "no" to this right now.
 
-config FEATURE_FULL_LIBBUSYBOX
-	bool "Feature-complete libbusybox"
-	default n if !FEATURE_SHARED_BUSYBOX
-	depends on BUILD_LIBBUSYBOX
-	help
-	  Build a libbusybox with the complete feature-set, disregarding
-	  the actually selected config.
+### config FEATURE_FULL_LIBBUSYBOX
+###	bool "Feature-complete libbusybox"
+###	default n if !FEATURE_SHARED_BUSYBOX
+###	depends on BUILD_LIBBUSYBOX
+###	help
+###	  Build a libbusybox with the complete feature-set, disregarding
+###	  the actually selected config.
+###
+###	  Normally, libbusybox will only contain the features which are
+###	  used by busybox itself. If you plan to write a separate
+###	  standalone application which uses libbusybox say 'Y'.
+###
+###	  Note: libbusybox is GPL, not LGPL, and exports no stable API that
+###	  might act as a copyright barrier.  We can and will modify the
+###	  exported function set between releases (even minor version number
+###	  changes), and happily break out-of-tree features.
+###
+###	  Say 'N' if in doubt.
 
-	  Normally, libbusybox will only contain the features which are
-	  used by busybox itself. If you plan to write a separate
-	  standalone application which uses libbusybox say 'Y'.
-
-	  Note: libbusybox is GPL, not LGPL, and exports no stable API that
-	  might act as a copyright barrier.  We can and will modify the
-	  exported function set between releases (even minor version number
-	  changes), and happily break out-of-tree features.
-
-	  Say 'N' if in doubt.
-
 config FEATURE_SHARED_BUSYBOX
-	bool "Use shared libbusybox for busybox"
+	bool "Produce additional busybox binary linked against libbusybox"
 	default y if BUILD_LIBBUSYBOX
 	depends on !STATIC && BUILD_LIBBUSYBOX
 	help
-	  Use libbusybox.so also for busybox itself.
 	  You need to have a working dynamic linker to use this variant.
 
 config LFS
@@ -331,25 +330,25 @@
 	  cp, mount, tar, and many others.  If you want to access files larger
 	  than 2 Gigabytes, enable this option.  Otherwise, leave it set to 'N'.
 
-config BUILD_AT_ONCE
-	bool "Compile all sources at once"
-	default n
-	help
-	  Normally each source-file is compiled with one invocation of
-	  the compiler.
-	  If you set this option, all sources are compiled at once.
-	  This gives the compiler more opportunities to optimize which can
-	  result in smaller and/or faster binaries.
+### config BUILD_AT_ONCE
+###	bool "Compile all sources at once"
+###	default n
+###	help
+###	  Normally each source-file is compiled with one invocation of
+###	  the compiler.
+###	  If you set this option, all sources are compiled at once.
+###	  This gives the compiler more opportunities to optimize which can
+###	  result in smaller and/or faster binaries.
+###
+###	  Setting this option will consume alot of memory, e.g. if you
+###	  enable all applets with all features, gcc uses more than 300MB
+###	  RAM during compilation of busybox.
+###
+###	  This option is most likely only beneficial for newer compilers
+###	  such as gcc-4.1 and above.
+###
+###	  Say 'N' unless you know what you are doing.
 
-	  Setting this option will consume alot of memory, e.g. if you
-	  enable all applets with all features, gcc uses more than 300MB
-	  RAM during compilation of busybox.
-
-	  This option is most likely only beneficial for newer compilers
-	  such as gcc-4.1 and above.
-
-	  Say 'N' unless you know what you are doing.
-
 endmenu
 
 menu 'Debugging Options'

Modified: trunk/busybox/Makefile.flags
===================================================================
--- trunk/busybox/Makefile.flags	2007-10-07 17:05:42 UTC (rev 20190)
+++ trunk/busybox/Makefile.flags	2007-10-07 17:06:01 UTC (rev 20191)
@@ -3,6 +3,7 @@
 # ==========================================================================
 
 BB_VER = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
+export BB_VER
 SKIP_STRIP = n
 
 # -std=gnu99 needed for [U]LLONG_MAX on some systems
@@ -59,7 +60,7 @@
 LDFLAGS += -static
 endif
 
-LDLIBS = m crypt
+LDLIBS += m crypt
 
 ifeq ($(CONFIG_PAM),y)
 LDLIBS += pam pam_misc

Modified: trunk/busybox/networking/udhcp/dhcpc.c
===================================================================
--- trunk/busybox/networking/udhcp/dhcpc.c	2007-10-07 17:05:42 UTC (rev 20190)
+++ trunk/busybox/networking/udhcp/dhcpc.c	2007-10-07 17:06:01 UTC (rev 20191)
@@ -260,7 +260,7 @@
 	if (opt & OPT_t)
 		client_config.retries = xatoi_u(str_t);
 	if (opt & OPT_v) {
-		printf("version %s\n", BB_VER);
+		puts("version "BB_VER);
 		return 0;
 	}
 
@@ -283,7 +283,7 @@
 	/* if (!..) bb_perror_msg("cannot create pidfile %s", pidfile); */
 
 	/* Goes to stdout and possibly syslog */
-	bb_info_msg("%s (v%s) started", applet_name, BB_VER);
+	bb_info_msg("%s (v"BB_VER") started", applet_name);
 
 	/* if not set, and not suppressed, setup the default client ID */
 	if (!client_config.clientid && !(opt & OPT_C)) {

Modified: trunk/busybox/networking/udhcp/dhcpd.c
===================================================================
--- trunk/busybox/networking/udhcp/dhcpd.c	2007-10-07 17:05:42 UTC (rev 20190)
+++ trunk/busybox/networking/udhcp/dhcpd.c	2007-10-07 17:06:01 UTC (rev 20191)
@@ -62,7 +62,7 @@
 	write_pidfile(server_config.pidfile);
 	/* if (!..) bb_perror_msg("cannot create pidfile %s", pidfile); */
 
-	bb_info_msg("%s (v%s) started", applet_name, BB_VER);
+	bb_info_msg("%s (v"BB_VER") started", applet_name);
 
 	option = find_option(server_config.options, DHCP_LEASE_TIME);
 	server_config.lease = LEASE_TIME;

Modified: trunk/busybox/scripts/trylink
===================================================================
--- trunk/busybox/scripts/trylink	2007-10-07 17:05:42 UTC (rev 20190)
+++ trunk/busybox/scripts/trylink	2007-10-07 17:06:01 UTC (rev 20191)
@@ -101,35 +101,50 @@
 	    >/dev/null
 fi
 
-mkdir 0lib 2>/dev/null
-test -d 0lib || exit 1
-ln -s libbusybox.so.1.8.0 0lib/libbusybox.so 2>/dev/null
+. .config
 
-EXE="0lib/libbusybox.so.1.8.0"
-try $CC $LDFLAGS \
+sharedlib_dir="0_lib"
+
+if test "$CONFIG_BUILD_LIBBUSYBOX" = y; then
+    mkdir "$sharedlib_dir" 2>/dev/null
+    test -d "$sharedlib_dir" || {
+	echo "Cannot make directory $sharedlib_dir"
+	exit 1
+    }
+    ln -s "libbusybox.so.$BB_VER" "$sharedlib_dir"/libbusybox.so 2>/dev/null
+
+    EXE="$sharedlib_dir/libbusybox.so.${BB_VER}_unstripped"
+    try $CC $LDFLAGS \
 	-o $EXE -Wl,-Map -Wl,$EXE.map \
 	-shared -fPIC -Wl,--enable-new-dtags \
 	-Wl,--start-group -Wl,--whole-archive $A_FILES -Wl,--no-whole-archive -Wl,--end-group \
 	$l_list -Wl,--verbose \
-	-Wl,-soname="libbusybox.so.1.8.0" \
+	-Wl,-soname="libbusybox.so.$BB_VER" \
 	-Wl,-z,combreloc \
 	>/dev/null \
-|| {
-    echo "Linking $EXE failed"
-    exit 1
-}
-strip -s --remove-section=.note --remove-section=.comment $EXE
+    || {
+	echo "Linking $EXE failed"
+	cat $EXE.out
+	exit 1
+    }
+    strip -s --remove-section=.note --remove-section=.comment $EXE -o "$sharedlib_dir/libbusybox.so.$BB_VER"
+    echo "libbusybox: $sharedlib_dir/libbusybox.so.$BB_VER"
+fi
 
-EXE="0lib/busybox"
-try $CC $LDFLAGS \
+if test "$CONFIG_FEATURE_SHARED_BUSYBOX" = y; then
+    EXE="$sharedlib_dir/busybox_unstripped"
+    try $CC $LDFLAGS \
 	-o $EXE -Wl,-Map -Wl,$EXE.map \
 	-Wl,--warn-common -Wl,--sort-common -Wl,--gc-sections \
 	-Wl,--start-group $O_FILES -Wl,--end-group \
 	$l_list -Wl,--verbose \
-	-L"0lib" -lbusybox \
+	-L"$sharedlib_dir" -lbusybox \
 	>/dev/null \
-|| {
-    echo "Linking $EXE failed"
-    exit 1
-}
-strip -s --remove-section=.note --remove-section=.comment $EXE
+    || {
+	echo "Linking $EXE failed"
+	cat $EXE.out
+	exit 1
+    }
+    strip -s --remove-section=.note --remove-section=.comment $EXE -o "$sharedlib_dir/busybox"
+    echo "busybox linked against libbusybox: $sharedlib_dir/busybox"
+fi




More information about the busybox-cvs mailing list