From 6d8f350808d36aac807cd55eafc447e80af671ad Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sat, 1 May 2010 23:13:44 +0200 Subject: Unix configure: Add support for --sysroot Reviewed-By: axis --- config.tests/unix/compile.test | 4 ++-- 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 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 -- cgit v0.12