diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-08-21 10:38:57 +0200 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-08-21 11:03:18 +0200 |
commit | c8ca300e491c186304d0864a9e870337e891e6f7 (patch) | |
tree | f1d991c5960b5acc0bf2a709960e871d48d91acf /tools/configure | |
parent | 31c96d34d27f8cad020238df28c10a71b2c4a34f (diff) | |
parent | 8b540f68a8404e4b9e3ac65a22c11416a91ee749 (diff) |
Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
qmake/doc/src/qmake-manual.qdoc
src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
src/src.pro
Change-Id: I0a560826c420e46988da3776bd8f9160c365459a
Diffstat (limited to 'tools/configure')
-rw-r--r-- | tools/configure/Makefile.mingw | 1 | ||||
-rw-r--r-- | tools/configure/Makefile.win32 | 2 | ||||
-rw-r--r-- | tools/configure/configureapp.cpp | 141 | ||||
-rw-r--r-- | tools/configure/configureapp.h | 3 | ||||
-rw-r--r-- | tools/configure/main.cpp | 5 |
5 files changed, 120 insertions, 32 deletions
diff --git a/tools/configure/Makefile.mingw b/tools/configure/Makefile.mingw index 7212b0d3a7..1994c9a52b 100644 --- a/tools/configure/Makefile.mingw +++ b/tools/configure/Makefile.mingw @@ -69,7 +69,6 @@ OBJECTS = \ qxmlstream.o \ qxmlutils.o \ quuid.o \ - qcryptographichash.o \ registry.o $(TARGET): $(OBJECTS) diff --git a/tools/configure/Makefile.win32 b/tools/configure/Makefile.win32 index 5b0a21a669..17c2d1089c 100644 --- a/tools/configure/Makefile.win32 +++ b/tools/configure/Makefile.win32 @@ -67,7 +67,6 @@ OBJECTS = \ qxmlstream.obj \ qxmlutils.obj \ quuid.obj \ - qcryptographichash.obj \ registry.obj \ configure_pch.obj @@ -142,7 +141,6 @@ qmalloc.obj: $(CORESRC)\global\qmalloc.cpp $(PCH) qxmlstream.obj: $(CORESRC)\xml\qxmlstream.cpp $(PCH) qxmlutils.obj: $(CORESRC)\xml\qxmlutils.cpp $(PCH) quuid.obj: $(CORESRC)\plugin\quuid.cpp $(PCH) -qcryptographichash.obj: $(CORESRC)\tools\qcryptographichash.cpp $(PCH) {$(CONFSRC)}.cpp{}.obj:: $(CXX) -c $(CXXFLAGS) $< diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index e2cddbc565..d31232262a 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -485,6 +485,14 @@ void Configure::parseCmdLine() || configCmdLine.at(i) == "-device") { ++i; // do nothing + } else if (configCmdLine.at(i) == "-device-option") { + ++i; + const QString option = configCmdLine.at(i); + QString &devOpt = dictionary["DEVICE_OPTION"]; + if (!devOpt.isEmpty()) + devOpt.append("\n").append(option); + else + devOpt = option; } else if (configCmdLine.at(i) == "-no-zlib") { @@ -1150,6 +1158,13 @@ void Configure::parseCmdLine() dictionary[ "QT_HOST_DATA" ] = configCmdLine.at(i); } + else if (configCmdLine.at(i) == "-extprefix") { + ++i; + if (i == argCount) + break; + dictionary[ "QT_EXT_PREFIX" ] = configCmdLine.at(i); + } + else if (configCmdLine.at(i) == "-make-tool") { ++i; if (i == argCount) @@ -1634,8 +1649,10 @@ bool Configure::displayHelp() desc( "-prefix <dir>", "This will install everything relative to <dir> (default $QT_INSTALL_PREFIX)\n"); + desc( "-extprefix <dir>", "When -sysroot is used, install everything to <dir>, rather than into SYSROOT/PREFIX.\n"); + desc( "-hostprefix [dir]", "Tools and libraries needed when developing applications are installed in [dir]. " - "If [dir] is not given, the current build directory will be used. (default PREFIX)\n"); + "If [dir] is not given, the current build directory will be used. (default EXTPREFIX)\n"); desc("You may use these to separate different parts of the install:\n\n"); @@ -3053,6 +3070,41 @@ bool Configure::compilerSupportsFlag(const QString &compilerAndArgs) return code == 0; } +void Configure::generateQDevicePri() +{ + FileWriter deviceStream(buildPath + "/mkspecs/qdevice.pri"); + if (dictionary.contains("DEVICE_OPTION")) { + const QString devoptionlist = dictionary["DEVICE_OPTION"]; + const QStringList optionlist = devoptionlist.split(QStringLiteral("\n")); + foreach (const QString &entry, optionlist) + deviceStream << entry << "\n"; + } + if (dictionary.contains("ANDROID_SDK_ROOT") && dictionary.contains("ANDROID_NDK_ROOT")) { + QString android_platform(dictionary.contains("ANDROID_PLATFORM") + ? dictionary["ANDROID_PLATFORM"] + : QString("android-9")); + deviceStream << "android_install {" << endl; + deviceStream << " DEFAULT_ANDROID_SDK_ROOT = " << formatPath(dictionary["ANDROID_SDK_ROOT"]) << endl; + deviceStream << " DEFAULT_ANDROID_NDK_ROOT = " << formatPath(dictionary["ANDROID_NDK_ROOT"]) << endl; + deviceStream << " DEFAULT_ANDROID_PLATFORM = " << android_platform << endl; + if (QSysInfo::WordSize == 64) + deviceStream << " DEFAULT_ANDROID_NDK_HOST = windows-x86_64" << endl; + else + deviceStream << " DEFAULT_ANDROID_NDK_HOST = windows" << endl; + QString android_arch(dictionary.contains("ANDROID_TARGET_ARCH") + ? dictionary["ANDROID_TARGET_ARCH"] + : QString("armeabi-v7a")); + QString android_tc_vers(dictionary.contains("ANDROID_NDK_TOOLCHAIN_VERSION") + ? dictionary["ANDROID_NDK_TOOLCHAIN_VERSION"] + : QString("4.7")); + deviceStream << " DEFAULT_ANDROID_TARGET_ARCH = " << android_arch << endl; + deviceStream << " DEFAULT_ANDROID_NDK_TOOLCHAIN_VERSION = " << android_tc_vers << endl; + deviceStream << "}" << endl; + } + if (!deviceStream.flush()) + dictionary[ "DONE" ] = "error"; +} + void Configure::generateQConfigPri() { // Generate qconfig.pri @@ -3341,33 +3393,6 @@ void Configure::generateConfigfiles() dictionary[ "DONE" ] = "error"; } - { - FileWriter tmpStream(buildPath + "/mkspecs/qdevice.pri"); - - QString android_platform(dictionary.contains("ANDROID_PLATFORM") - ? dictionary["ANDROID_PLATFORM"] - : QString("android-9")); - tmpStream << "android_install {" << endl; - tmpStream << " DEFAULT_ANDROID_SDK_ROOT = " << formatPath(dictionary["ANDROID_SDK_ROOT"]) << endl; - tmpStream << " DEFAULT_ANDROID_NDK_ROOT = " << formatPath(dictionary["ANDROID_NDK_ROOT"]) << endl; - tmpStream << " DEFAULT_ANDROID_PLATFORM = " << android_platform << endl; - if (QSysInfo::WordSize == 64) - tmpStream << " DEFAULT_ANDROID_NDK_HOST = windows-x86_64" << endl; - else - tmpStream << " DEFAULT_ANDROID_NDK_HOST = windows" << endl; - QString android_arch(dictionary.contains("ANDROID_TARGET_ARCH") - ? dictionary["ANDROID_TARGET_ARCH"] - : QString("armeabi-v7a")); - QString android_tc_vers(dictionary.contains("ANDROID_NDK_TOOLCHAIN_VERSION") - ? dictionary["ANDROID_NDK_TOOLCHAIN_VERSION"] - : QString("4.7")); - tmpStream << " DEFAULT_ANDROID_TARGET_ARCH = " << android_arch << endl; - tmpStream << " DEFAULT_ANDROID_NDK_TOOLCHAIN_VERSION = " << android_tc_vers << endl; - tmpStream << "}" << endl; - - if (!tmpStream.flush()) - dictionary[ "DONE" ] = "error"; - } } void Configure::displayConfig() @@ -3610,6 +3635,13 @@ static QString stripPrefix(const QString &str, const QString &pfx) return str.startsWith(pfx) ? str.mid(pfx.length()) : str; } +void Configure::substPrefix(QString *path) +{ + QString spfx = dictionary["QT_SYSROOT_PREFIX"]; + if (path->startsWith(spfx)) + path->replace(0, spfx.size(), dictionary["QT_EXT_PREFIX"]); +} + void Configure::generateQConfigCpp() { // if QT_INSTALL_* have not been specified on commandline, define them now from QT_INSTALL_PREFIX @@ -3649,6 +3681,39 @@ void Configure::generateQConfigCpp() if (!dictionary["QT_INSTALL_TESTS"].size()) dictionary["QT_INSTALL_TESTS"] = qipempty ? "" : dictionary["QT_INSTALL_PREFIX"] + "/tests"; + QChar sysrootifyPrefix = QLatin1Char('y'); + dictionary["QT_SYSROOT_PREFIX"] = dictionary["QT_INSTALL_PREFIX"]; + dictionary["QT_SYSROOT_HEADERS"] = dictionary["QT_INSTALL_HEADERS"]; + dictionary["QT_SYSROOT_LIBS"] = dictionary["QT_INSTALL_LIBS"]; + dictionary["QT_SYSROOT_ARCHDATA"] = dictionary["QT_INSTALL_ARCHDATA"]; + dictionary["QT_SYSROOT_LIBEXECS"] = dictionary["QT_INSTALL_LIBEXECS"]; + dictionary["QT_SYSROOT_BINS"] = dictionary["QT_INSTALL_BINS"]; + dictionary["QT_SYSROOT_PLUGINS"] = dictionary["QT_INSTALL_PLUGINS"]; + dictionary["QT_SYSROOT_IMPORTS"] = dictionary["QT_INSTALL_IMPORTS"]; + dictionary["QT_SYSROOT_QML"] = dictionary["QT_INSTALL_QML"]; + dictionary["QT_SYSROOT_DATA"] = dictionary["QT_INSTALL_DATA"]; + dictionary["QT_SYSROOT_DOCS"] = dictionary["QT_INSTALL_DOCS"]; + dictionary["QT_SYSROOT_TRANSLATIONS"] = dictionary["QT_INSTALL_TRANSLATIONS"]; + dictionary["QT_SYSROOT_EXAMPLES"] = dictionary["QT_INSTALL_EXAMPLES"]; + dictionary["QT_SYSROOT_TESTS"] = dictionary["QT_INSTALL_TESTS"]; + if (dictionary["QT_EXT_PREFIX"].size()) { + sysrootifyPrefix = QLatin1Char('n'); + dictionary["QT_INSTALL_PREFIX"] = dictionary["QT_EXT_PREFIX"]; + substPrefix(&dictionary["QT_INSTALL_HEADERS"]); + substPrefix(&dictionary["QT_INSTALL_LIBS"]); + substPrefix(&dictionary["QT_INSTALL_ARCHDATA"]); + substPrefix(&dictionary["QT_INSTALL_LIBEXECS"]); + substPrefix(&dictionary["QT_INSTALL_BINS"]); + substPrefix(&dictionary["QT_INSTALL_PLUGINS"]); + substPrefix(&dictionary["QT_INSTALL_IMPORTS"]); + substPrefix(&dictionary["QT_INSTALL_QML"]); + substPrefix(&dictionary["QT_INSTALL_DATA"]); + substPrefix(&dictionary["QT_INSTALL_DOCS"]); + substPrefix(&dictionary["QT_INSTALL_TRANSLATIONS"]); + substPrefix(&dictionary["QT_INSTALL_EXAMPLES"]); + substPrefix(&dictionary["QT_INSTALL_TESTS"]); + } + bool haveHpx = false; if (dictionary["QT_HOST_PREFIX"].isEmpty()) dictionary["QT_HOST_PREFIX"] = dictionary["QT_INSTALL_PREFIX"]; @@ -3676,6 +3741,22 @@ void Configure::generateQConfigCpp() << "static const char qt_configure_installation [11 + 12] = \"qt_instdate=" << QDate::currentDate().toString(Qt::ISODate) << "\";" << endl << endl << "static const char qt_configure_prefix_path_strs[][12 + 512] = {" << endl + << "#ifndef QT_BUILD_QMAKE" << endl + << " \"qt_prfxpath=" << formatPath(dictionary["QT_SYSROOT_PREFIX"]) << "\"," << endl + << " \"qt_docspath=" << formatPath(dictionary["QT_SYSROOT_DOCS"]) << "\"," << endl + << " \"qt_hdrspath=" << formatPath(dictionary["QT_SYSROOT_HEADERS"]) << "\"," << endl + << " \"qt_libspath=" << formatPath(dictionary["QT_SYSROOT_LIBS"]) << "\"," << endl + << " \"qt_lbexpath=" << formatPath(dictionary["QT_SYSROOT_LIBEXECS"]) << "\"," << endl + << " \"qt_binspath=" << formatPath(dictionary["QT_SYSROOT_BINS"]) << "\"," << endl + << " \"qt_plugpath=" << formatPath(dictionary["QT_SYSROOT_PLUGINS"]) << "\"," << endl + << " \"qt_impspath=" << formatPath(dictionary["QT_SYSROOT_IMPORTS"]) << "\"," << endl + << " \"qt_qml2path=" << formatPath(dictionary["QT_SYSROOT_QML"]) << "\"," << endl + << " \"qt_adatpath=" << formatPath(dictionary["QT_SYSROOT_ARCHDATA"]) << "\"," << endl + << " \"qt_datapath=" << formatPath(dictionary["QT_SYSROOT_DATA"]) << "\"," << endl + << " \"qt_trnspath=" << formatPath(dictionary["QT_SYSROOT_TRANSLATIONS"]) << "\"," << endl + << " \"qt_xmplpath=" << formatPath(dictionary["QT_SYSROOT_EXAMPLES"]) << "\"," << endl + << " \"qt_tstspath=" << formatPath(dictionary["QT_SYSROOT_TESTS"]) << "\"," << endl + << "#else" << endl << " \"qt_prfxpath=" << formatPath(dictionary["QT_INSTALL_PREFIX"]) << "\"," << endl << " \"qt_docspath=" << formatPath(dictionary["QT_INSTALL_DOCS"]) << "\"," << endl << " \"qt_hdrspath=" << formatPath(dictionary["QT_INSTALL_HEADERS"]) << "\"," << endl @@ -3690,7 +3771,6 @@ void Configure::generateQConfigCpp() << " \"qt_trnspath=" << formatPath(dictionary["QT_INSTALL_TRANSLATIONS"]) << "\"," << endl << " \"qt_xmplpath=" << formatPath(dictionary["QT_INSTALL_EXAMPLES"]) << "\"," << endl << " \"qt_tstspath=" << formatPath(dictionary["QT_INSTALL_TESTS"]) << "\"," << endl - << "#ifdef QT_BUILD_QMAKE" << endl << " \"qt_ssrtpath=" << formatPath(dictionary["CFG_SYSROOT"]) << "\"," << endl << " \"qt_hpfxpath=" << formatPath(dictionary["QT_HOST_PREFIX"]) << "\"," << endl << " \"qt_hbinpath=" << formatPath(dictionary["QT_HOST_BINS"]) << "\"," << endl @@ -3705,6 +3785,9 @@ void Configure::generateQConfigCpp() tmpStream << "static const char qt_configure_settings_path_str [256 + 12] = \"qt_stngpath=" << formatPath(dictionary["QT_INSTALL_SETTINGS"]) << "\";" << endl; tmpStream << endl + << "#ifdef QT_BUILD_QMAKE\n" + << "static const char qt_sysrootify_prefix[] = \"qt_ssrtfpfx=" << sysrootifyPrefix << "\";\n" + << "#endif\n\n" << "/* strlen( \"qt_lcnsxxxx\") == 12 */" << endl << "#define QT_CONFIGURE_LICENSEE qt_configure_licensee_str + 12;" << endl << "#define QT_CONFIGURE_LICENSED_PRODUCTS qt_configure_licensed_products_str + 12;" << endl; diff --git a/tools/configure/configureapp.h b/tools/configure/configureapp.h index 33fc22b27a..8a22cea6ec 100644 --- a/tools/configure/configureapp.h +++ b/tools/configure/configureapp.h @@ -77,6 +77,7 @@ public: void generateConfigfiles(); void detectArch(); void generateQConfigPri(); + void generateQDevicePri(); void prepareConfigTests(); void showSummary(); QString firstLicensePath(); @@ -158,6 +159,8 @@ private: int descIndent; int outputWidth; + void substPrefix(QString *path); + QString formatPath(const QString &path); QString formatPaths(const QStringList &paths); diff --git a/tools/configure/main.cpp b/tools/configure/main.cpp index 9beee36a50..fb815b287e 100644 --- a/tools/configure/main.cpp +++ b/tools/configure/main.cpp @@ -81,6 +81,11 @@ int runConfigure( int argc, char** argv ) if (!app.isOk()) return 3; + // Generate qdevice.pri + app.generateQDevicePri(); + if (!app.isOk()) + return 3; + // Prepare the config test build directory. app.prepareConfigTests(); if (!app.isOk()) |