mirror of
https://git.musl-libc.org/git/musl
synced 2025-01-23 06:32:05 +03:00
further pcc fixes in configure
-lpcc only works if -nostdlib is not passed, so it's useless. instead, use -print-file-name to look up the full pathname for libpcc.a, and check whether that succeeds before trying to link with the result. also, silence pcc's junk printed on stdout during tests.
This commit is contained in:
parent
3d99266b5e
commit
cd31a1fc08
7
configure
vendored
7
configure
vendored
@ -58,7 +58,7 @@ else eval "fnmatch '*/' \"\${$1}\"" && eval "$1=\${$1%/}" ; fi
|
|||||||
tryflag () {
|
tryflag () {
|
||||||
printf "checking whether compiler accepts %s... " "$2"
|
printf "checking whether compiler accepts %s... " "$2"
|
||||||
echo "typedef int x;" > "$tmpc"
|
echo "typedef int x;" > "$tmpc"
|
||||||
if $CC "$2" -c -o /dev/null "$tmpc" 2>/dev/null ; then
|
if $CC "$2" -c -o /dev/null "$tmpc" >/dev/null 2>&1 ; then
|
||||||
printf "yes\n"
|
printf "yes\n"
|
||||||
eval "$1=\"\${$1} \$2\""
|
eval "$1=\"\${$1} \$2\""
|
||||||
eval "$1=\${$1# }"
|
eval "$1=\${$1# }"
|
||||||
@ -72,7 +72,7 @@ fi
|
|||||||
tryldflag () {
|
tryldflag () {
|
||||||
printf "checking whether linker accepts %s... " "$2"
|
printf "checking whether linker accepts %s... " "$2"
|
||||||
echo "typedef int x;" > "$tmpc"
|
echo "typedef int x;" > "$tmpc"
|
||||||
if $CC -nostdlib -shared "$2" -o /dev/null "$tmpc" 2>/dev/null ; then
|
if $CC -nostdlib -shared "$2" -o /dev/null "$tmpc" >/dev/null 2>&1 ; then
|
||||||
printf "yes\n"
|
printf "yes\n"
|
||||||
eval "$1=\"\${$1} \$2\""
|
eval "$1=\"\${$1} \$2\""
|
||||||
eval "$1=\${$1# }"
|
eval "$1=\${$1# }"
|
||||||
@ -299,7 +299,8 @@ shared=no
|
|||||||
# Find compiler runtime library
|
# Find compiler runtime library
|
||||||
test -z "$LIBCC" && tryldflag LIBCC -lgcc && tryldflag LIBCC -lgcc_eh
|
test -z "$LIBCC" && tryldflag LIBCC -lgcc && tryldflag LIBCC -lgcc_eh
|
||||||
test -z "$LIBCC" && tryldflag LIBCC -lcompiler_rt
|
test -z "$LIBCC" && tryldflag LIBCC -lcompiler_rt
|
||||||
test -z "$LIBCC" && tryldflag LIBCC -lpcc
|
test -z "$LIBCC" && try_libcc=`$CC -print-file-name=libpcc.a 2>/dev/null` \
|
||||||
|
&& tryldflag LIBCC "$try_libcc"
|
||||||
printf "using compiler runtime libraries: %s\n" "$LIBCC"
|
printf "using compiler runtime libraries: %s\n" "$LIBCC"
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user