summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure25
1 files changed, 25 insertions, 0 deletions
diff --git a/configure b/configure
index e88373e..382df60 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