diff options
| author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-07-20 21:28:41 +0000 |
|---|---|---|
| committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-07-20 21:28:41 +0000 |
| commit | 21d1014b5b91d1a1319273945291b7a9f4717827 (patch) | |
| tree | b84eadba35d31f923ef62579652e4e5d76678c38 /scripts/trylink | |
| parent | 2f6ae43b9c74d393a139007377895e8c50b8af9a (diff) | |
| download | busybox-w32-21d1014b5b91d1a1319273945291b7a9f4717827.tar.gz busybox-w32-21d1014b5b91d1a1319273945291b7a9f4717827.tar.bz2 busybox-w32-21d1014b5b91d1a1319273945291b7a9f4717827.zip | |
chpasswd: new applet by Alexander Shishkin <virtuoso@slind.org>
Diffstat (limited to 'scripts/trylink')
| -rwxr-xr-x | scripts/trylink | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/scripts/trylink b/scripts/trylink index ddd7fb179..cbd702338 100755 --- a/scripts/trylink +++ b/scripts/trylink | |||
| @@ -22,9 +22,11 @@ try "-Wl,--start-group $l_list -Wl,--end-group" "$@" \ | |||
| 22 | cat busybox_ld.err | 22 | cat busybox_ld.err |
| 23 | exit 1 | 23 | exit 1 |
| 24 | } | 24 | } |
| 25 | mv busybox_unstripped busybox_unstripped.tmp | ||
| 25 | 26 | ||
| 26 | # Now try to remove each lib and build without. | 27 | # Now try to remove each lib and build without. |
| 27 | # Stop when no lib can be removed. | 28 | # Stop when no lib can be removed. |
| 29 | ever_discarded=false | ||
| 28 | while test "$BBOX_LIB_LIST"; do | 30 | while test "$BBOX_LIB_LIST"; do |
| 29 | $debug && echo "Trying libraries: $BBOX_LIB_LIST" | 31 | $debug && echo "Trying libraries: $BBOX_LIB_LIST" |
| 30 | all_needed=true | 32 | all_needed=true |
| @@ -36,6 +38,7 @@ while test "$BBOX_LIB_LIST"; do | |||
| 36 | echo "Library $one is not needed" | 38 | echo "Library $one is not needed" |
| 37 | BBOX_LIB_LIST="$without_one" | 39 | BBOX_LIB_LIST="$without_one" |
| 38 | all_needed=false | 40 | all_needed=false |
| 41 | ever_discarded=true | ||
| 39 | else | 42 | else |
| 40 | echo "Library $one is needed" | 43 | echo "Library $one is needed" |
| 41 | fi | 44 | fi |
| @@ -48,7 +51,11 @@ while test "$BBOX_LIB_LIST"; do | |||
| 48 | #echo "$BBOX_LIB_LIST" | grep -q ' ' || break | 51 | #echo "$BBOX_LIB_LIST" | grep -q ' ' || break |
| 49 | done | 52 | done |
| 50 | 53 | ||
| 51 | # Ok, make the binary | 54 | mv busybox_unstripped.tmp busybox_unstripped |
| 52 | echo "Final link with: $BBOX_LIB_LIST" | 55 | $ever_discarded && { |
| 53 | l_list=`echo "$BBOX_LIB_LIST" | sed -e 's/ / -l/g' -e 's/^/-l/'` | 56 | # Ok, make the binary |
| 54 | try "-Wl,--start-group $l_list -Wl,--end-group" "$@" | 57 | echo "Final link with: $BBOX_LIB_LIST" |
| 58 | l_list=`echo "$BBOX_LIB_LIST" | sed -e 's/ / -l/g' -e 's/^/-l/'` | ||
| 59 | try "-Wl,--start-group $l_list -Wl,--end-group" "$@" | ||
| 60 | } | ||
| 61 | exit 0 # Ensure "success" exit code | ||
