summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2010-05-01 23:13:44 +0200
committerThiago Macieira <thiago.macieira@nokia.com>2011-03-29 12:44:44 +0200
commit6d8f350808d36aac807cd55eafc447e80af671ad (patch)
tree9f330d0f6ebb612a34144d8131b31a28fd045337
parent15b58e2b7d0550c433531550d9ad21e44a3435d8 (diff)
downloadqt4-tools-6d8f350808d36aac807cd55eafc447e80af671ad.tar.gz
Unix configure: Add support for --sysroot
Reviewed-By: axis
-rwxr-xr-xconfig.tests/unix/compile.test4
-rwxr-xr-xconfigure25
2 files changed, 27 insertions, 2 deletions
diff --git a/config.tests/unix/compile.test b/config.tests/unix/compile.test
index 29ddea7ce6..f4a7f29b1a 100755
--- a/config.tests/unix/compile.test
+++ b/config.tests/unix/compile.test
@@ -11,9 +11,9 @@ TEST=$6
EXE=`basename "$6"`
DESCRIPTION=$7
shift 7
-LFLAGS=""
+LFLAGS="$SYSROOT_FLAG"
INCLUDEPATH=""
-CXXFLAGS=""
+CXXFLAGS="$SYSROOT_FLAG"
MAC_ARCH_CXXFLAGS=""
MAC_ARCH_LFLAGS=""
while [ "$#" -gt 0 ]; do
diff --git a/configure b/configure
index e88373e5c7..382df60291 100755
--- a/configure
+++ b/configure
@@ -1316,6 +1316,9 @@ while [ "$#" -gt 0 ]; do
qconfig)
CFG_QCONFIG="$VAL"
;;
+ sysroot)
+ CFG_SYSROOT="$VAL"
+ ;;
bindir)
QT_INSTALL_BINS="$VAL"
;;
@@ -3310,6 +3313,18 @@ if [ "$CFG_EMBEDDED" = "nacl" ]; then
TEST_COMPILER="nacl-gcc"
fi
+SYSROOT_FLAG=
+if [ -n "$CFG_SYSROOT" ]; then
+ if compilerSupportsFlag --sysroot="$CFG_SYSROOT"; then
+ [ "$OPT_VERBOSE" = "yes" ] && echo "Setting sysroot to: $CFG_SYSROOT"
+ SYSROOT_FLAG="--sysroot=$CFG_SYSROOT"
+ else
+ echo >&2 "The compiler doesn't support the --sysroot flag, I can't set the sysroot"
+ exit 1
+ fi
+fi
+export SYSROOT_FLAG # used by config.tests/unix/compile.test
+
# auto-detect precompiled header support
if [ "$CFG_PRECOMPILE" = "auto" ]; then
if [ `echo "$CFG_MAC_ARCHS" | wc -w` -gt 1 ]; then
@@ -8316,6 +8331,16 @@ QT_NAMESPACE = $QT_NAMESPACE
QT_NAMESPACE_MAC_CRC = $QT_NAMESPACE_MAC_CRC
EOF
+if [ -n "$CFG_SYSROOT" ]; then
+ echo "# sysroot" >>"$QTCONFIG.tmp"
+ echo `basename "$XQMAKESPEC"` \{ >>"$QTCONFIG.tmp"
+ echo " QT_SYSROOT += \$\$quote($CFG_SYSROOT)" >>"$QTCONFIG.tmp"
+ echo " QMAKE_CFLAGS += --sysroot=\$\$QT_SYSROOT" >>"$QTCONFIG.tmp"
+ echo " QMAKE_CXXFLAGS += --sysroot=\$\$QT_SYSROOT" >>"$QTCONFIG.tmp"
+ echo " QMAKE_LFLAGS += --sysroot=\$\$QT_SYSROOT" >>"$QTCONFIG.tmp"
+ echo "}" >> "$QTCONFIG.tmp"
+ echo >> "$QTCONFIG.tmp"
+fi
if [ "$CFG_RPATH" = "yes" ]; then
echo "QMAKE_RPATHDIR += \"$QT_INSTALL_LIBS\"" >> "$QTCONFIG.tmp"
fi