diff options
author | Brian Fraser <fraserbn@gmail.com> | 2014-01-13 02:00:43 -0300 |
---|---|---|
committer | Brian Fraser <fraserbn@gmail.com> | 2014-01-17 11:35:46 -0300 |
commit | 59b6bb412383ca68669f605ae7673af75ee7f4bb (patch) | |
tree | fd1ca32ef24beeb86cc6584275aa5e08c8016b75 /Configure | |
parent | 8da14febc3ac6edf595a07bc93e3f75859c6ee64 (diff) | |
download | perl-59b6bb412383ca68669f605ae7673af75ee7f4bb.tar.gz |
Configure: use $sysroot, if available, in checkccflags
If the user specified -Dsysroot but we don't use it, then the results can
be entirely off.
This also introduces an internal variable for Configure, _sysroot,
which is just "--sysroot=$sysroot", for use in places like checkccflags that
need --sysroot but don't need the other flags.
Diffstat (limited to 'Configure')
-rwxr-xr-x | Configure | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -1960,20 +1960,23 @@ if test "X$sysroot" != X; then case "$cc" in *gcc*|*g++*) echo "Using $sysroot to find your headers and libraries, adding to ccflags" + # _sysroot is used in places where we need --sysroot=foo + # but using the rest of the flags could cause issues. + _sysroot="--sysroot=$sysroot"; case "$ccflags" in *sysroot*) ;; 'undef'|*) - ccflags="$ccflags --sysroot=$sysroot" + ccflags="$ccflags $_sysroot" esac case "$ldflags" in *sysroot*) ;; 'undef'|*) - ldflags="$ldflags --sysroot=$sysroot" + ldflags="$ldflags $_sysroot" esac case "$cppflags" in *sysroot*) ;; 'undef'|*) - cppflags="$cppflags --sysroot=$sysroot" + cppflags="$cppflags $_sysroot" esac # lddlflags updated below in lddlflags section; # same with cccdlflags @@ -5152,7 +5155,7 @@ checkccflag='check=$1; flag=$2; callback=$3; echo " "; echo "Checking if your compiler accepts $flag" 2>&1; echo "int main(void) { return 0; }" > gcctest.c; -if $cc -O2 $flag -o gcctest gcctest.c 2>gcctest.out && ./gcctest; then +if $cc $_sysroot -O2 $flag -o gcctest gcctest.c 2>gcctest.out && $run ./gcctest; then echo "Yes, it does." 2>&1; if $test -s gcctest.out ; then echo "But your platform does not like it:"; |