aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-10-07 17:06:01 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-10-07 17:06:01 +0000
commitdef88985966a9351911844d42e06b735977bcb72 (patch)
tree99059022fef92213ec7f7adf7b80822f307bf38e
parent76a6b236a9e2654e8c296c61cf71e0cf8bf4a64c (diff)
downloadbusybox-w32-def88985966a9351911844d42e06b735977bcb72.tar.gz
busybox-w32-def88985966a9351911844d42e06b735977bcb72.tar.bz2
busybox-w32-def88985966a9351911844d42e06b735977bcb72.zip
reviving libbusybox, adding CONFIG_INDIVIDUAL part 3
-rw-r--r--Config.in75
-rw-r--r--Makefile.flags3
-rw-r--r--networking/udhcp/dhcpc.c4
-rw-r--r--networking/udhcp/dhcpd.c2
-rwxr-xr-xscripts/trylink53
5 files changed, 76 insertions, 61 deletions
diff --git a/Config.in b/Config.in
index 450c4a6d4..64281f03e 100644
--- a/Config.in
+++ b/Config.in
@@ -292,31 +292,30 @@ config BUILD_LIBBUSYBOX
292 binary serves no purpose (and increases the size). You should 292 binary serves no purpose (and increases the size). You should
293 almost certainly say "no" to this right now. 293 almost certainly say "no" to this right now.
294 294
295config FEATURE_FULL_LIBBUSYBOX 295### config FEATURE_FULL_LIBBUSYBOX
296 bool "Feature-complete libbusybox" 296### bool "Feature-complete libbusybox"
297 default n if !FEATURE_SHARED_BUSYBOX 297### default n if !FEATURE_SHARED_BUSYBOX
298 depends on BUILD_LIBBUSYBOX 298### depends on BUILD_LIBBUSYBOX
299 help 299### help
300 Build a libbusybox with the complete feature-set, disregarding 300### Build a libbusybox with the complete feature-set, disregarding
301 the actually selected config. 301### the actually selected config.
302 302###
303 Normally, libbusybox will only contain the features which are 303### Normally, libbusybox will only contain the features which are
304 used by busybox itself. If you plan to write a separate 304### used by busybox itself. If you plan to write a separate
305 standalone application which uses libbusybox say 'Y'. 305### standalone application which uses libbusybox say 'Y'.
306 306###
307 Note: libbusybox is GPL, not LGPL, and exports no stable API that 307### Note: libbusybox is GPL, not LGPL, and exports no stable API that
308 might act as a copyright barrier. We can and will modify the 308### might act as a copyright barrier. We can and will modify the
309 exported function set between releases (even minor version number 309### exported function set between releases (even minor version number
310 changes), and happily break out-of-tree features. 310### changes), and happily break out-of-tree features.
311 311###
312 Say 'N' if in doubt. 312### Say 'N' if in doubt.
313 313
314config FEATURE_SHARED_BUSYBOX 314config FEATURE_SHARED_BUSYBOX
315 bool "Use shared libbusybox for busybox" 315 bool "Produce additional busybox binary linked against libbusybox"
316 default y if BUILD_LIBBUSYBOX 316 default y if BUILD_LIBBUSYBOX
317 depends on !STATIC && BUILD_LIBBUSYBOX 317 depends on !STATIC && BUILD_LIBBUSYBOX
318 help 318 help
319 Use libbusybox.so also for busybox itself.
320 You need to have a working dynamic linker to use this variant. 319 You need to have a working dynamic linker to use this variant.
321 320
322config LFS 321config LFS
@@ -331,24 +330,24 @@ config LFS
331 cp, mount, tar, and many others. If you want to access files larger 330 cp, mount, tar, and many others. If you want to access files larger
332 than 2 Gigabytes, enable this option. Otherwise, leave it set to 'N'. 331 than 2 Gigabytes, enable this option. Otherwise, leave it set to 'N'.
333 332
334config BUILD_AT_ONCE 333### config BUILD_AT_ONCE
335 bool "Compile all sources at once" 334### bool "Compile all sources at once"
336 default n 335### default n
337 help 336### help
338 Normally each source-file is compiled with one invocation of 337### Normally each source-file is compiled with one invocation of
339 the compiler. 338### the compiler.
340 If you set this option, all sources are compiled at once. 339### If you set this option, all sources are compiled at once.
341 This gives the compiler more opportunities to optimize which can 340### This gives the compiler more opportunities to optimize which can
342 result in smaller and/or faster binaries. 341### result in smaller and/or faster binaries.
343 342###
344 Setting this option will consume alot of memory, e.g. if you 343### Setting this option will consume alot of memory, e.g. if you
345 enable all applets with all features, gcc uses more than 300MB 344### enable all applets with all features, gcc uses more than 300MB
346 RAM during compilation of busybox. 345### RAM during compilation of busybox.
347 346###
348 This option is most likely only beneficial for newer compilers 347### This option is most likely only beneficial for newer compilers
349 such as gcc-4.1 and above. 348### such as gcc-4.1 and above.
350 349###
351 Say 'N' unless you know what you are doing. 350### Say 'N' unless you know what you are doing.
352 351
353endmenu 352endmenu
354 353
diff --git a/Makefile.flags b/Makefile.flags
index 764ce16e8..529491557 100644
--- a/Makefile.flags
+++ b/Makefile.flags
@@ -3,6 +3,7 @@
3# ========================================================================== 3# ==========================================================================
4 4
5BB_VER = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) 5BB_VER = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
6export BB_VER
6SKIP_STRIP = n 7SKIP_STRIP = n
7 8
8# -std=gnu99 needed for [U]LLONG_MAX on some systems 9# -std=gnu99 needed for [U]LLONG_MAX on some systems
@@ -59,7 +60,7 @@ ifeq ($(CONFIG_STATIC),y)
59LDFLAGS += -static 60LDFLAGS += -static
60endif 61endif
61 62
62LDLIBS = m crypt 63LDLIBS += m crypt
63 64
64ifeq ($(CONFIG_PAM),y) 65ifeq ($(CONFIG_PAM),y)
65LDLIBS += pam pam_misc 66LDLIBS += pam pam_misc
diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c
index ca478b3c5..21b496c0b 100644
--- a/networking/udhcp/dhcpc.c
+++ b/networking/udhcp/dhcpc.c
@@ -260,7 +260,7 @@ int udhcpc_main(int argc, char **argv)
260 if (opt & OPT_t) 260 if (opt & OPT_t)
261 client_config.retries = xatoi_u(str_t); 261 client_config.retries = xatoi_u(str_t);
262 if (opt & OPT_v) { 262 if (opt & OPT_v) {
263 printf("version %s\n", BB_VER); 263 puts("version "BB_VER);
264 return 0; 264 return 0;
265 } 265 }
266 266
@@ -283,7 +283,7 @@ int udhcpc_main(int argc, char **argv)
283 /* if (!..) bb_perror_msg("cannot create pidfile %s", pidfile); */ 283 /* if (!..) bb_perror_msg("cannot create pidfile %s", pidfile); */
284 284
285 /* Goes to stdout and possibly syslog */ 285 /* Goes to stdout and possibly syslog */
286 bb_info_msg("%s (v%s) started", applet_name, BB_VER); 286 bb_info_msg("%s (v"BB_VER") started", applet_name);
287 287
288 /* if not set, and not suppressed, setup the default client ID */ 288 /* if not set, and not suppressed, setup the default client ID */
289 if (!client_config.clientid && !(opt & OPT_C)) { 289 if (!client_config.clientid && !(opt & OPT_C)) {
diff --git a/networking/udhcp/dhcpd.c b/networking/udhcp/dhcpd.c
index 3466312d1..4343f1c0e 100644
--- a/networking/udhcp/dhcpd.c
+++ b/networking/udhcp/dhcpd.c
@@ -62,7 +62,7 @@ int udhcpd_main(int argc, char **argv)
62 write_pidfile(server_config.pidfile); 62 write_pidfile(server_config.pidfile);
63 /* if (!..) bb_perror_msg("cannot create pidfile %s", pidfile); */ 63 /* if (!..) bb_perror_msg("cannot create pidfile %s", pidfile); */
64 64
65 bb_info_msg("%s (v%s) started", applet_name, BB_VER); 65 bb_info_msg("%s (v"BB_VER") started", applet_name);
66 66
67 option = find_option(server_config.options, DHCP_LEASE_TIME); 67 option = find_option(server_config.options, DHCP_LEASE_TIME);
68 server_config.lease = LEASE_TIME; 68 server_config.lease = LEASE_TIME;
diff --git a/scripts/trylink b/scripts/trylink
index c621b7c01..de60a2cf7 100755
--- a/scripts/trylink
+++ b/scripts/trylink
@@ -101,35 +101,50 @@ else
101 >/dev/null 101 >/dev/null
102fi 102fi
103 103
104mkdir 0lib 2>/dev/null 104. .config
105test -d 0lib || exit 1
106ln -s libbusybox.so.1.8.0 0lib/libbusybox.so 2>/dev/null
107 105
108EXE="0lib/libbusybox.so.1.8.0" 106sharedlib_dir="0_lib"
109try $CC $LDFLAGS \ 107
108if test "$CONFIG_BUILD_LIBBUSYBOX" = y; then
109 mkdir "$sharedlib_dir" 2>/dev/null
110 test -d "$sharedlib_dir" || {
111 echo "Cannot make directory $sharedlib_dir"
112 exit 1
113 }
114 ln -s "libbusybox.so.$BB_VER" "$sharedlib_dir"/libbusybox.so 2>/dev/null
115
116 EXE="$sharedlib_dir/libbusybox.so.${BB_VER}_unstripped"
117 try $CC $LDFLAGS \
110 -o $EXE -Wl,-Map -Wl,$EXE.map \ 118 -o $EXE -Wl,-Map -Wl,$EXE.map \
111 -shared -fPIC -Wl,--enable-new-dtags \ 119 -shared -fPIC -Wl,--enable-new-dtags \
112 -Wl,--start-group -Wl,--whole-archive $A_FILES -Wl,--no-whole-archive -Wl,--end-group \ 120 -Wl,--start-group -Wl,--whole-archive $A_FILES -Wl,--no-whole-archive -Wl,--end-group \
113 $l_list -Wl,--verbose \ 121 $l_list -Wl,--verbose \
114 -Wl,-soname="libbusybox.so.1.8.0" \ 122 -Wl,-soname="libbusybox.so.$BB_VER" \
115 -Wl,-z,combreloc \ 123 -Wl,-z,combreloc \
116 >/dev/null \ 124 >/dev/null \
117|| { 125 || {
118 echo "Linking $EXE failed" 126 echo "Linking $EXE failed"
119 exit 1 127 cat $EXE.out
120} 128 exit 1
121strip -s --remove-section=.note --remove-section=.comment $EXE 129 }
130 strip -s --remove-section=.note --remove-section=.comment $EXE -o "$sharedlib_dir/libbusybox.so.$BB_VER"
131 echo "libbusybox: $sharedlib_dir/libbusybox.so.$BB_VER"
132fi
122 133
123EXE="0lib/busybox" 134if test "$CONFIG_FEATURE_SHARED_BUSYBOX" = y; then
124try $CC $LDFLAGS \ 135 EXE="$sharedlib_dir/busybox_unstripped"
136 try $CC $LDFLAGS \
125 -o $EXE -Wl,-Map -Wl,$EXE.map \ 137 -o $EXE -Wl,-Map -Wl,$EXE.map \
126 -Wl,--warn-common -Wl,--sort-common -Wl,--gc-sections \ 138 -Wl,--warn-common -Wl,--sort-common -Wl,--gc-sections \
127 -Wl,--start-group $O_FILES -Wl,--end-group \ 139 -Wl,--start-group $O_FILES -Wl,--end-group \
128 $l_list -Wl,--verbose \ 140 $l_list -Wl,--verbose \
129 -L"0lib" -lbusybox \ 141 -L"$sharedlib_dir" -lbusybox \
130 >/dev/null \ 142 >/dev/null \
131|| { 143 || {
132 echo "Linking $EXE failed" 144 echo "Linking $EXE failed"
133 exit 1 145 cat $EXE.out
134} 146 exit 1
135strip -s --remove-section=.note --remove-section=.comment $EXE 147 }
148 strip -s --remove-section=.note --remove-section=.comment $EXE -o "$sharedlib_dir/busybox"
149 echo "busybox linked against libbusybox: $sharedlib_dir/busybox"
150fi