aboutsummaryrefslogtreecommitdiff
path: root/scripts/trylink
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 /scripts/trylink
parent76a6b236a9e2654e8c296c61cf71e0cf8bf4a64c (diff)
downloadbusybox-w32-def88985966a9351911844d42e06b735977bcb72.tar.gz
busybox-w32-def88985966a9351911844d42e06b735977bcb72.tar.bz2
busybox-w32-def88985966a9351911844d42e06b735977bcb72.zip
reviving libbusybox, adding CONFIG_INDIVIDUAL part 3
Diffstat (limited to 'scripts/trylink')
-rwxr-xr-xscripts/trylink53
1 files changed, 34 insertions, 19 deletions
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