diff options
| author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-06-14 15:50:55 +0000 |
|---|---|---|
| committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-06-14 15:50:55 +0000 |
| commit | dd316dd283704b9adb588c3fb7cdec6ba5fbceb8 (patch) | |
| tree | 7e5a4f524e01190d04bc79a4814c4ff6dce9d40d /scripts | |
| parent | a84420062a1e7a6e149b7d1ca77e1a787e55d45b (diff) | |
| download | busybox-w32-dd316dd283704b9adb588c3fb7cdec6ba5fbceb8.tar.gz busybox-w32-dd316dd283704b9adb588c3fb7cdec6ba5fbceb8.tar.bz2 busybox-w32-dd316dd283704b9adb588c3fb7cdec6ba5fbceb8.zip | |
hush: add support for ':'; create testsuite entries
text data bss dec hex filename
809569 612 7044 817225 c7849 busybox_old
809528 612 7044 817184 c7820 busybox_unstripped
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/trylink | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/scripts/trylink b/scripts/trylink index c24d49d52..adc045ad8 100755 --- a/scripts/trylink +++ b/scripts/trylink | |||
| @@ -126,11 +126,12 @@ try $CC $CFLAGS $LDFLAGS \ | |||
| 126 | while test "$LDLIBS"; do | 126 | while test "$LDLIBS"; do |
| 127 | $debug && echo "Trying libraries: $LDLIBS" | 127 | $debug && echo "Trying libraries: $LDLIBS" |
| 128 | all_needed=true | 128 | all_needed=true |
| 129 | last_needed=false | ||
| 129 | for one in $LDLIBS; do | 130 | for one in $LDLIBS; do |
| 130 | without_one=`echo " $LDLIBS " | sed "s/ $one / /g" | xargs` | 131 | without_one=`echo " $LDLIBS " | sed "s/ $one / /g" | xargs` |
| 131 | # "lib1 lib2 lib3" -> "-llib1 -llib2 -llib3" | 132 | # "lib1 lib2 lib3" -> "-llib1 -llib2 -llib3" |
| 132 | l_list=`echo "$without_one" | sed -e 's/ / -l/g' -e 's/^/-l/' -e 's/^-l$//'` | 133 | l_list=`echo "$without_one" | sed -e 's/ / -l/g' -e 's/^/-l/' -e 's/^-l$//'` |
| 133 | test "x$l_list" != "x" && l_list="-Wl,--start-group $l_list -Wl,--end-group" | 134 | test x"$l_list" != x"" && l_list="-Wl,--start-group $l_list -Wl,--end-group" |
| 134 | $debug && echo "Trying -l options: '$l_list'" | 135 | $debug && echo "Trying -l options: '$l_list'" |
| 135 | try $CC $CFLAGS $LDFLAGS \ | 136 | try $CC $CFLAGS $LDFLAGS \ |
| 136 | -o $EXE \ | 137 | -o $EXE \ |
| @@ -143,16 +144,19 @@ while test "$LDLIBS"; do | |||
| 143 | echo " Library $one is not needed" | 144 | echo " Library $one is not needed" |
| 144 | LDLIBS="$without_one" | 145 | LDLIBS="$without_one" |
| 145 | all_needed=false | 146 | all_needed=false |
| 147 | last_needed=false | ||
| 146 | else | 148 | else |
| 147 | echo " Library $one is needed" | 149 | echo " Library $one is needed" |
| 150 | last_needed=true | ||
| 148 | fi | 151 | fi |
| 149 | done | 152 | done |
| 150 | # All libs were needed, can't remove any | 153 | # All libs were needed, can't remove any |
| 151 | $all_needed && break | 154 | $all_needed && break |
| 152 | # If there is no space char, the list has just one lib. | 155 | # Optimization: was the last tried lib needed? |
| 153 | # I'm not sure that in this case lib really is 100% needed. | 156 | if $last_needed; then |
| 154 | # Let's try linking without it anyway... thus commented out. | 157 | # Was it the only one lib left? Don't test again then. |
| 155 | #{ echo "$LDLIBS" | grep -q ' '; } || break | 158 | { echo "$LDLIBS" | grep -q ' '; } || break |
| 159 | fi | ||
| 156 | done | 160 | done |
| 157 | 161 | ||
| 158 | # Make the binary with final, minimal list of libs | 162 | # Make the binary with final, minimal list of libs |
