From 18654058265dd1198c64d4c742ed4b651a2a7b90 Mon Sep 17 00:00:00 2001 From: Thomas Senyk Date: Thu, 12 Jul 2012 13:03:16 +0200 Subject: Adding configure option: -no-gcc-sysroot This option is important if you want to use configure's and qmake's -sysroot (e.g. PKG_CONFIG settings, device-files), but the toolchain (in combination with the rootfs) is not able to handle gcc's --sysroot. One known case is freescale's ltib setup where the toolchain itself comes with all the essential files (e.g. crt1.o), while the rootfs has none of those files, so gcc's --sysroot can't be used. The rootfs on the other hand contains all kinds of "less important" files/packages (e.g. libdbus). For those "less important" files/packages Qt needs pkg-config to be able to include/link properly. Therefore one needs configures -sysroot without gcc's --sysroot. Change-Id: Iaec9b07012f2945f3ecb3ced0ed95176721b5ecd Reviewed-by: Oswald Buddenhagen --- tools/configure/configureapp.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'tools') 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 ", "The operating system and compiler you are building on.\n(default %QMAKESPEC%)\n"); desc( "-xplatform ", "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 ", "Sets as the target compiler's and qmake's sysroot."); + desc( "-sysroot ", "Sets 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 -- cgit v1.2.3