diff options
-rwxr-xr-x | configure | 11 | ||||
-rw-r--r-- | tools/configure/configureapp.cpp | 9 |
2 files changed, 15 insertions, 5 deletions
@@ -835,6 +835,7 @@ QT_INSTALL_SETTINGS= QT_INSTALL_EXAMPLES= QT_INSTALL_TESTS= CFG_SYSROOT= +CFG_GCC_SYSROOT="yes" QT_HOST_PREFIX= QT_HOST_BINS= QT_HOST_DATA= @@ -1173,6 +1174,9 @@ while [ "$#" -gt 0 ]; do sysroot) CFG_SYSROOT="$VAL" ;; + gcc-sysroot) + CFG_GCC_SYSROOT="$VAL" + ;; bindir) QT_INSTALL_BINS="$VAL" ;; @@ -2536,7 +2540,7 @@ if [ -n "$GCC_MACHINE_DUMP" ]; then DeviceVar set GCC_MACHINE_DUMP $($TEST_COMPILER -dumpmachine) fi -if [ -n "$CFG_SYSROOT" ]; then +if [ -n "$CFG_SYSROOT" ] && [ "$CFG_GCC_SYSROOT" = "yes" ]; then SYSROOT_FLAG="--sysroot=$CFG_SYSROOT" else SYSROOT_FLAG= @@ -3183,7 +3187,8 @@ Additional options: -xplatform target ... The target platform when cross-compiling. - -sysroot <dir> ...... Sets <dir> as the target compiler's and qmake's sysroot. + -sysroot <dir> ...... Sets <dir> as the target compiler's and qmake's sysroot and also sets pkg-config paths. + -no-gcc-sysroot ..... When using -sysroot, it disables the passing of --sysroot to the compiler -no-feature-<feature> Do not compile in <feature>. -feature-<feature> .. Compile in <feature>. The available features @@ -5910,7 +5915,7 @@ if [ -n "$PKG_CONFIG_SYSROOT_DIR" ] || [ -n "$PKG_CONFIG_LIBDIR" ]; then echo >> "$QTCONFIG.tmp" fi -if [ -n "$CFG_SYSROOT" ]; then +if [ -n "$CFG_SYSROOT" ] && [ "$CFG_GCC_SYSROOT" = "yes"]; then echo "# sysroot" >>"$QTCONFIG.tmp" echo "!host_build {" >>"$QTCONFIG.tmp" echo " QMAKE_CFLAGS += --sysroot=\$\$[QT_SYSROOT]" >>"$QTCONFIG.tmp" diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index b2e484d2a8..382c836896 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -239,6 +239,7 @@ Configure::Configure(int& argc, char** argv) dictionary[ "QT_GLIB" ] = "no"; dictionary[ "QT_ICONV" ] = "auto"; dictionary[ "QT_CUPS" ] = "auto"; + dictionary[ "CFG_GCC_SYSROOT" ] = "yes"; //Only used when cross compiling. dictionary[ "QT_INSTALL_SETTINGS" ] = "/etc/xdg"; @@ -1090,6 +1091,9 @@ void Configure::parseCmdLine() break; dictionary[ "CFG_SYSROOT" ] = configCmdLine.at(i); } + else if (configCmdLine.at(i) == "-no-gcc-sysroot") { + dictionary[ "CFG_GCC_SYSROOT" ] = "no"; + } else if (configCmdLine.at(i) == "-hostprefix") { ++i; @@ -1692,7 +1696,8 @@ bool Configure::displayHelp() desc( "-platform <spec>", "The operating system and compiler you are building on.\n(default %QMAKESPEC%)\n"); desc( "-xplatform <spec>", "The operating system and compiler you are cross compiling to.\n"); desc( "", "See the README file for a list of supported operating systems and compilers.\n", false, ' '); - desc( "-sysroot <dir>", "Sets <dir> as the target compiler's and qmake's sysroot."); + desc( "-sysroot <dir>", "Sets <dir> as the target compiler's and qmake's sysroot and also sets pkg-config paths."); + desc( "-no-gcc-sysroot", "When using -sysroot, it disables the passing of --sysroot to the compiler "); desc("NIS", "no", "-no-nis", "Do not build NIS support."); desc("NIS", "yes", "-nis", "Build NIS support."); @@ -2957,7 +2962,7 @@ void Configure::generateQConfigPri() << "QT_MINOR_VERSION = " << dictionary["VERSION_MINOR"] << endl << "QT_PATCH_VERSION = " << dictionary["VERSION_PATCH"] << endl; - if (!dictionary["CFG_SYSROOT"].isEmpty()) { + if (!dictionary["CFG_SYSROOT"].isEmpty() && dictionary["CFG_GCC_SYSROOT"] == "yes") { configStream << endl << "# sysroot" << endl << "!host_build {" << endl |