aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2013-09-12 00:29:40 -0400
committerMike Frysinger <vapier@gentoo.org>2013-09-28 18:40:07 -0400
commit3eab2b7675fc7e2889cd69285a2a31980a4bf504 (patch)
tree2813623a17310159f747aba2ddfd49005d960295 /scripts
parent054f3eb7848230702b149a7e17f05314cb0157cb (diff)
downloadbusybox-w32-3eab2b7675fc7e2889cd69285a2a31980a4bf504.tar.gz
busybox-w32-3eab2b7675fc7e2889cd69285a2a31980a4bf504.tar.bz2
busybox-w32-3eab2b7675fc7e2889cd69285a2a31980a4bf504.zip
trylink: only prefix libs with -l
If our pkg-config queries pass back a flag like -pthread, the trylink script will expand that to -l-pthread. So change trylink to only add the -l prefix to a value that doesn't have a - prefix already. Reported-by: thaehaid@incognitomail.org Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/trylink6
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/trylink b/scripts/trylink
index a8b0b2e03..e47169917 100755
--- a/scripts/trylink
+++ b/scripts/trylink
@@ -117,7 +117,7 @@ LDLIBS=`echo "$LDLIBS" | xargs -n1 | sort | uniq | xargs`
117# First link with all libs. If it fails, bail out 117# First link with all libs. If it fails, bail out
118echo "Trying libraries: $LDLIBS" 118echo "Trying libraries: $LDLIBS"
119# "lib1 lib2 lib3" -> "-llib1 -llib2 -llib3" 119# "lib1 lib2 lib3" -> "-llib1 -llib2 -llib3"
120l_list=`echo "$LDLIBS" | sed -e 's/ / -l/g' -e 's/^/-l/' -e 's/^-l$//'` 120l_list=`echo " $LDLIBS " | sed -e 's: \([^- ][^ ]*\): -l\1:g'`
121test "x$l_list" != "x" && l_list="$START_GROUP $l_list $END_GROUP" 121test "x$l_list" != "x" && l_list="$START_GROUP $l_list $END_GROUP"
122try $CC $CFLAGS $LDFLAGS \ 122try $CC $CFLAGS $LDFLAGS \
123 -o $EXE \ 123 -o $EXE \
@@ -141,7 +141,7 @@ while test "$LDLIBS"; do
141 for one in $LDLIBS; do 141 for one in $LDLIBS; do
142 without_one=`echo " $LDLIBS " | sed "s/ $one / /g" | xargs` 142 without_one=`echo " $LDLIBS " | sed "s/ $one / /g" | xargs`
143 # "lib1 lib2 lib3" -> "-llib1 -llib2 -llib3" 143 # "lib1 lib2 lib3" -> "-llib1 -llib2 -llib3"
144 l_list=`echo "$without_one" | sed -e 's/ / -l/g' -e 's/^/-l/' -e 's/^-l$//'` 144 l_list=`echo " $without_one " | sed -e 's: \([^- ][^ ]*\): -l\1:g'`
145 test x"$l_list" != x"" && l_list="$START_GROUP $l_list $END_GROUP" 145 test x"$l_list" != x"" && l_list="$START_GROUP $l_list $END_GROUP"
146 $debug && echo "Trying -l options: '$l_list'" 146 $debug && echo "Trying -l options: '$l_list'"
147 try $CC $CFLAGS $LDFLAGS \ 147 try $CC $CFLAGS $LDFLAGS \
@@ -172,7 +172,7 @@ done
172 172
173# Make the binary with final, minimal list of libs 173# Make the binary with final, minimal list of libs
174echo "Final link with: ${LDLIBS:-<none>}" 174echo "Final link with: ${LDLIBS:-<none>}"
175l_list=`echo "$LDLIBS" | sed -e 's/ / -l/g' -e 's/^/-l/' -e 's/^-l$//'` 175l_list=`echo " $LDLIBS " | sed -e 's: \([^- ][^ ]*\): -l\1:g'`
176test "x$l_list" != "x" && l_list="$START_GROUP $l_list $END_GROUP" 176test "x$l_list" != "x" && l_list="$START_GROUP $l_list $END_GROUP"
177# --verbose gives us gobs of info to stdout (e.g. linker script used) 177# --verbose gives us gobs of info to stdout (e.g. linker script used)
178if ! test -f busybox_ldscript; then 178if ! test -f busybox_ldscript; then