diff options
-rwxr-xr-x | scripts/trylink | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/scripts/trylink b/scripts/trylink index 4eaa334d5..69473076b 100755 --- a/scripts/trylink +++ b/scripts/trylink | |||
@@ -39,8 +39,17 @@ while test "$BBOX_LIB_LIST"; do | |||
39 | for one in $BBOX_LIB_LIST; do | 39 | for one in $BBOX_LIB_LIST; do |
40 | without_one=`echo " $BBOX_LIB_LIST " | sed "s/ $one / /g" | xargs` | 40 | without_one=`echo " $BBOX_LIB_LIST " | sed "s/ $one / /g" | xargs` |
41 | l_list=`echo "$without_one" | sed -e 's/ / -l/g' -e 's/^/-l/'` | 41 | l_list=`echo "$without_one" | sed -e 's/ / -l/g' -e 's/^/-l/'` |
42 | $debug && echo "Trying -l options: $l_list" | 42 | # If l_list is just "-l" without a lib, then make sure to test the |
43 | if try "-Wl,--start-group $l_list -Wl,--end-group" "$@"; then | 43 | # correct thing to fail: just using -l will fail, so the last lib |
44 | # (usually m in my case) will incorrectly be added as needed. | ||
45 | if test "x$without_one" != "x"; then | ||
46 | l_list="-Wl,--start-group $l_list -Wl,--end-group" | ||
47 | else | ||
48 | # without_one is empty, so l_list has to be empty too | ||
49 | l_list="" | ||
50 | fi | ||
51 | $debug && echo "Trying -l options: '$l_list'" | ||
52 | if try "$l_list" "$@"; then | ||
44 | echo "Library $one is not needed" | 53 | echo "Library $one is not needed" |
45 | BBOX_LIB_LIST="$without_one" | 54 | BBOX_LIB_LIST="$without_one" |
46 | all_needed=false | 55 | all_needed=false |