From d62fd84d4b309bc5fa6548288b82f21189d4f53f Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Sun, 7 Oct 2007 20:46:34 +0000 Subject: libbusybox: move (possibly compressed) help stuff into libbusybox. Makes individual binaries much smaller. --- scripts/trylink | 39 +++++++++------------------------------ 1 file changed, 9 insertions(+), 30 deletions(-) (limited to 'scripts/trylink') diff --git a/scripts/trylink b/scripts/trylink index a87d67225..e756461c8 100755 --- a/scripts/trylink +++ b/scripts/trylink @@ -128,6 +128,7 @@ if test "$CONFIG_BUILD_LIBBUSYBOX" = y; then exit 1 } strip -s --remove-section=.note --remove-section=.comment $EXE -o "$sharedlib_dir/libbusybox.so.$BB_VER" + chmod a+x "$sharedlib_dir/libbusybox.so.$BB_VER" echo "libbusybox: $sharedlib_dir/libbusybox.so.$BB_VER" fi @@ -160,41 +161,15 @@ if test "$CONFIG_FEATURE_INDIVIDUAL" = y; then test x"$cname" = "x[[" && cname=test echo "\ -#include -#include -#include -#include -#include \"../include/autoconf.h\" -#include \"../include/usage.h\" - -#ifdef __GLIBC__ -/* Make it reside in R/W memory: */ -int *const bb_errno __attribute__ ((section (\".data\"))); -#endif +void bbox_prepare_main(void); +int $main(int argc, char **argv); const char *applet_name = \"$name\"; -void bb_show_usage(void) -{ - fprintf(stderr, \"Usage: $name \" -#ifdef ${cname}_trivial_usage - ${cname}_trivial_usage -#endif -#ifdef ${cname}_full_usage - \"\\n\\n\" ${cname}_full_usage -#endif - \"\\n\\n\"); - exit(1); -} - -int $main(int argc, char **argv); - int main(int argc, char **argv) { -#ifdef __GLIBC__ - (*(int **)&bb_errno) = __errno_location(); -#endif - return $main(argc, argv); + bbox_prepare_main(); + return $main(argc, argv); } " >"$sharedlib_dir/applet.c" @@ -215,3 +190,7 @@ int main(int argc, char **argv) done /dev/null -- cgit v1.2.3