summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Hartmann <phartmann@rim.com>2012-10-18 14:40:33 (GMT)
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-10-21 20:18:37 (GMT)
commit11e820a6a1cee10bed2992a594407dadc9d4dab5 (patch)
treec831ac20711e199112723dbf9aec6622da898036
parent2ddf396d66eccccdc7dc2befbf9b9eff19418303 (diff)
downloadQt-11e820a6a1cee10bed2992a594407dadc9d4dab5.zip
Qt-11e820a6a1cee10bed2992a594407dadc9d4dab5.tar.gz
Qt-11e820a6a1cee10bed2992a594407dadc9d4dab5.tar.bz2
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 <oswald.buddenhagen@digia.com>
-rwxr-xr-xconfigure15
1 files changed, 8 insertions, 7 deletions
diff --git a/configure b/configure
index 86d456c..5187e51 100755
--- a/configure
+++ b/configure
@@ -201,28 +201,28 @@ getXQMakeConf()
getQMakeConf3 "$1" "$xspecvals"
}
-# relies on $TEST_COMPILER being set correctly
compilerSupportsFlag()
{
cat >conftest.cpp <<EOF
int main() { return 0; }
EOF
- $TEST_COMPILER "$@" -o conftest-out.o conftest.cpp
+ "$@" -o conftest-out.o conftest.cpp
ret=$?
rm -f conftest.cpp conftest-out.o
return $ret
}
-# relies on $TEST_COMPILER being set correctly
linkerSupportsFlag()
{
+ compiler=$1
+ shift
lflags=-Wl
for flag
do
safe_flag=`shellEscape "$flag"`
lflags=$lflags,$safe_flag
done
- compilerSupportsFlag "$lflags" >/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