From 11e820a6a1cee10bed2992a594407dadc9d4dab5 Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Thu, 18 Oct 2012 16:40:33 +0200 Subject: configure: state compiler explicitly when testing for supported flags ... so we can test those functions with host and cross compilers. Additionally, make sure we check the host compiler for QMAKE_LFLAGS. (backport of commit 1da978416d89b86d92087e8dc51bdb305b6ed58c) Change-Id: Id3f5f55e3a9e6b3d0dc72f96aa136f64390d08a4 Reviewed-by: Oswald Buddenhagen --- configure | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'configure') diff --git a/configure b/configure index 86d456c732..5187e51549 100755 --- a/configure +++ b/configure @@ -201,28 +201,28 @@ getXQMakeConf() getQMakeConf3 "$1" "$xspecvals" } -# relies on $TEST_COMPILER being set correctly compilerSupportsFlag() { cat >conftest.cpp </dev/null 2>&1 + compilerSupportsFlag $compiler $lflags >/dev/null 2>&1 } #------------------------------------------------------------------------------- @@ -3396,7 +3396,7 @@ fi SYSROOT_FLAG= if [ -n "$CFG_SYSROOT" ]; then - if compilerSupportsFlag -c --sysroot="$CFG_SYSROOT"; then + if compilerSupportsFlag $TEST_COMPILER -c --sysroot="$CFG_SYSROOT"; then [ "$OPT_VERBOSE" = "yes" ] && echo "Setting sysroot to: $CFG_SYSROOT" SYSROOT_FLAG="--sysroot=$CFG_SYSROOT" else @@ -3484,7 +3484,7 @@ fi # auto-detect -fstack-protector-strong support (for QNX only currently) if [ "$XPLATFORM_QNX" = "yes" ]; then - if compilerSupportsFlag -fstack-protector-strong; then + if compilerSupportsFlag $TEST_COMPILER -fstack-protector-strong; then CFG_STACK_PROTECTOR_STRONG=yes else CFG_STACK_PROTECTOR_STRONG=no @@ -8640,7 +8640,8 @@ QMAKE_LIBDIR_QT = \$\$QT_BUILD_TREE/lib EOF # Ensure we can link to uninistalled libraries -if [ "$XPLATFORM_MINGW" != "yes" ] && [ "$CFG_EMBEDDED" != "nacl" ] && linkerSupportsFlag -rpath-link "$outpath/lib"; then +QMAKE_COMPILER="`getQMakeConf QMAKE_CXX`" +if [ "$XPLATFORM_MINGW" != "yes" ] && [ "$CFG_EMBEDDED" != "nacl" ] && linkerSupportsFlag "$QMAKE_COMPILER" -rpath-link "$outpath/lib"; then echo "QMAKE_LFLAGS = -Wl,-rpath-link,\$\$QT_BUILD_TREE/lib \$\$QMAKE_LFLAGS" >> "$CACHEFILE.tmp" fi if [ -n "$QT_CFLAGS_PSQL" ]; then -- cgit v1.2.3