trylink: respect compiler settings when probing features

The CPPFLAGS/CFLAGS settings might have features that matter, so make
sure we utilize them when testing the compiler.

URL: https://bugs.gentoo.org/471118
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
This commit is contained in:
Mike Frysinger 2015-03-16 17:47:01 -04:00
parent 4a08e82d44
commit 6798564b9e

View File

@ -49,7 +49,7 @@ check_cc() {
local tempname="$(mktemp)" local tempname="$(mktemp)"
# Can use "-o /dev/null", but older gcc tend to *unlink it* on failure! :( # Can use "-o /dev/null", but older gcc tend to *unlink it* on failure! :(
# "-xc": C language. "/dev/null" is an empty source file. # "-xc": C language. "/dev/null" is an empty source file.
if $CC $1 -shared -xc /dev/null -o "$tempname".o >/dev/null 2>&1; then if $CC $CPPFLAGS $CFLAGS $1 -shared -xc /dev/null -o "$tempname".o >/dev/null 2>&1; then
echo "$1"; echo "$1";
else else
echo "$2"; echo "$2";
@ -66,7 +66,7 @@ check_libc_is_glibc() {
syntax error here syntax error here
#endif #endif
" >"$tempname".c " >"$tempname".c
if $CC "$tempname".c -c -o "$tempname".o >/dev/null 2>&1; then if $CC $CPPFLAGS $CFLAGS "$tempname".c -c -o "$tempname".o >/dev/null 2>&1; then
echo "$2"; echo "$2";
else else
echo "$1"; echo "$1";