diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2010-05-01 21:13:44 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2011-03-29 10:44:44 (GMT) |
commit | 6d8f350808d36aac807cd55eafc447e80af671ad (patch) | |
tree | 9f330d0f6ebb612a34144d8131b31a28fd045337 | |
parent | 15b58e2b7d0550c433531550d9ad21e44a3435d8 (diff) | |
download | Qt-6d8f350808d36aac807cd55eafc447e80af671ad.zip Qt-6d8f350808d36aac807cd55eafc447e80af671ad.tar.gz Qt-6d8f350808d36aac807cd55eafc447e80af671ad.tar.bz2 |
Unix configure: Add support for --sysroot
Reviewed-By: axis
-rwxr-xr-x | config.tests/unix/compile.test | 4 | ||||
-rwxr-xr-x | configure | 25 |
2 files changed, 27 insertions, 2 deletions
diff --git a/config.tests/unix/compile.test b/config.tests/unix/compile.test index 29ddea7..f4a7f29 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 @@ -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 |