diff options
author | Jerome Pasion <jerome.pasion@digia.com> | 2012-11-02 14:41:27 +0100 |
---|---|---|
committer | Jerome Pasion <jerome.pasion@digia.com> | 2012-11-02 14:41:27 +0100 |
commit | c808dd27459e030fde0577feb8ba06e3bd465526 (patch) | |
tree | 4bf898dc4a88e2b03c9716f940638a2e01c6c0ce /tools | |
parent | d9d8845d507a6bdbc9c9f24c0d9d86dca513461d (diff) | |
parent | 300534fc214f2547a63594ce0891e9a54c8f33ca (diff) |
Merge branch 'master' of ssh://codereview.qt-project.org/qt/qtbase into newdocs
Change-Id: I7e6cee190a341901dfbf8effb54ebccb91bf7a17
Diffstat (limited to 'tools')
-rw-r--r-- | tools/configure/configureapp.cpp | 88 | ||||
-rw-r--r-- | tools/configure/configureapp.h | 2 | ||||
-rw-r--r-- | tools/configure/main.cpp | 4 |
3 files changed, 51 insertions, 43 deletions
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index e085b87f35..6280e27f4a 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -236,6 +236,7 @@ Configure::Configure(int& argc, char** argv) dictionary[ "QT_CUPS" ] = "auto"; dictionary[ "CFG_GCC_SYSROOT" ] = "yes"; dictionary[ "SLOG2" ] = "no"; + dictionary[ "SYSTEM_PROXIES" ] = "no"; //Only used when cross compiling. dictionary[ "QT_INSTALL_SETTINGS" ] = "/etc/xdg"; @@ -877,6 +878,10 @@ void Configure::parseCmdLine() dictionary[ "SLOG2" ] = "no"; } else if (configCmdLine.at(i) == "-slog2") { dictionary[ "SLOG2" ] = "yes"; + } else if (configCmdLine.at(i) == "-no-system-proxies") { + dictionary[ "SYSTEM_PROXIES" ] = "no"; + } else if (configCmdLine.at(i) == "-system-proxies") { + dictionary[ "SYSTEM_PROXIES" ] = "yes"; } // Work around compiler nesting limitation @@ -1682,6 +1687,10 @@ bool Configure::displayHelp() desc("QT_INSTALL_SETTINGS", "auto", "-sysconfdir <dir>", "Settings used by Qt programs will be looked for in\n<dir>.\n"); + desc("SYSTEM_PROXIES", "yes", "-system-proxies", "Use system network proxies by default."); + desc("SYSTEM_PROXIES", "no", "-no-system-proxies", "Do not use system network proxies by default.\n"); + + #if !defined(EVAL) desc( "-qtnamespace <name>", "Wraps all Qt library code in 'namespace name {...}'."); desc( "-qtlibinfix <infix>", "Renames all Qt* libs to Qt*<infix>.\n"); @@ -2303,6 +2312,25 @@ void Configure::generateBuildKey() build_defines.sort(); } +void Configure::generateSystemVars() +{ + // Generate an empty .qmake.cache file for config.tests + QDir buildDir(buildPath); + bool success = true; + if (!buildDir.exists("config.tests")) + success = buildDir.mkdir("config.tests"); + + QString fileName(buildPath + "/config.tests/.qmake.cache"); + QFile cacheFile(fileName); + success &= cacheFile.open(QIODevice::WriteOnly); + cacheFile.close(); + + if (!success) { + cout << "Failed to create file " << qPrintable(QDir::toNativeSeparators(fileName)) << endl; + dictionary[ "DONE" ] = "error"; + } +} + void Configure::generateOutputVars() { // Generate variables for output @@ -2560,6 +2588,9 @@ void Configure::generateOutputVars() if (dictionary[ "V8SNAPSHOT" ] == "yes") qtConfig += "v8snapshot"; + if (dictionary[ "SYSTEM_PROXIES" ] == "yes") + qtConfig += "system-proxies"; + // Add config levels -------------------------------------------- QStringList possible_configs = QStringList() << "minimal" @@ -2680,7 +2711,6 @@ void Configure::generateCachefile() for (QStringList::Iterator var = qmakeVars.begin(); var != qmakeVars.end(); ++var) { cacheStream << (*var) << endl; } - cacheStream << "CONFIG += " << qmakeConfig.join(' ') << "no_private_qt_headers_warning QTDIR_build" << endl; cacheStream.flush(); cacheFile.close(); @@ -2720,7 +2750,8 @@ void Configure::generateCachefile() if (!dictionary["DECORATIONS"].isEmpty()) moduleStream << "decorations += "<<dictionary["DECORATIONS"]<<endl; - moduleStream << "CONFIG += create_prl link_prl prepare_docs"; + moduleStream << "CONFIG += " << qmakeConfig.join(' ') + << " create_prl link_prl prepare_docs no_private_qt_headers_warning QTDIR_build"; if (dictionary[ "SSE2" ] == "yes") moduleStream << " sse2"; if (dictionary[ "SSE3" ] == "yes") @@ -3043,37 +3074,6 @@ QString Configure::addDefine(QString def) } #if !defined(EVAL) -bool Configure::copySpec(const char *name, const char *pfx, const QString &spec) -{ - // "Link" configured mkspec to default directory, but remove the old one first, if there is any - QString defSpec = buildPath + "/mkspecs/" + name; - QFileInfo defSpecInfo(defSpec); - if (defSpecInfo.exists()) { - if (!Environment::rmdir(defSpec)) { - cout << "Couldn't update default " << pfx << "mkspec! Are files in " << qPrintable(defSpec) << " read-only?" << endl; - dictionary["DONE"] = "error"; - return false; - } - } - - QDir::current().mkpath(defSpec); - QFile qfile(defSpec + "/qmake.conf"); - if (qfile.open(QFile::WriteOnly | QFile::Text)) { - QTextStream fileStream; - fileStream.setDevice(&qfile); - QString srcSpec = buildPath + "/mkspecs/" + spec; // We copied it to the build dir - fileStream << "QMAKESPEC_ORIGINAL = " << formatPath(srcSpec) << endl; - fileStream << "include($$QMAKESPEC_ORIGINAL/qmake.conf)" << endl; - qfile.close(); - } - if (qfile.error() != QFile::NoError) { - cout << "Couldn't update default " << pfx << "mkspec: " << qPrintable(qfile.errorString()) << endl; - dictionary["DONE"] = "error"; - return false; - } - return true; -} - void Configure::generateConfigfiles() { QDir(buildPath).mkpath("src/corelib/global"); @@ -3328,7 +3328,8 @@ void Configure::displayConfig() sout << "QtDBus support.............." << dictionary[ "DBUS" ] << endl; sout << "QtWidgets module support...." << dictionary[ "WIDGETS" ] << endl; sout << "QML debugging..............." << dictionary[ "QML_DEBUG" ] << endl; - sout << "DirectWrite support........." << dictionary[ "DIRECTWRITE" ] << endl << endl; + sout << "DirectWrite support........." << dictionary[ "DIRECTWRITE" ] << endl; + sout << "Use system proxies.........." << dictionary[ "SYSTEM_PROXIES" ] << endl << endl; sout << "Third Party Libraries:" << endl; sout << " ZLIB support............" << dictionary[ "ZLIB" ] << endl; @@ -3478,6 +3479,11 @@ void Configure::generateHeaders() } } +static QString stripPrefix(const QString &str, const QString &pfx) +{ + return str.startsWith(pfx) ? str.mid(pfx.length()) : str; +} + void Configure::generateQConfigCpp() { // if QT_INSTALL_* have not been specified on commandline, define them now from QT_INSTALL_PREFIX @@ -3521,6 +3527,10 @@ void Configure::generateQConfigCpp() QDir(buildPath).mkpath("src/corelib/global"); const QString outName(buildPath + "/src/corelib/global/qconfig.cpp"); + QString specPfx = dictionary["QT_HOST_DATA"] + "/mkspecs/"; + QString hostSpec = stripPrefix(dictionary["QMAKESPEC"], specPfx); + QString targSpec = dictionary.contains("XQMAKESPEC") ? stripPrefix(dictionary["XQMAKESPEC"], specPfx) : hostSpec; + QTemporaryFile tmpFile; if (tmpFile.open()) { QTextStream tmpStream(&tmpFile); @@ -3548,6 +3558,8 @@ void Configure::generateQConfigCpp() << " \"qt_hpfxpath=" << formatPath(dictionary["QT_HOST_PREFIX"]) << "\"," << endl << " \"qt_hbinpath=" << formatPath(dictionary["QT_HOST_BINS"]) << "\"," << endl << " \"qt_hdatpath=" << formatPath(dictionary["QT_HOST_DATA"]) << "\"," << endl + << " \"qt_targspec=" << targSpec << "\"," << endl + << " \"qt_hostspec=" << hostSpec << "\"," << endl << "#endif" << endl << "};" << endl; @@ -3660,14 +3672,6 @@ void Configure::buildQmake() confFile.close(); } - //create default mkspecs - QString spec = dictionary.contains("XQMAKESPEC") ? dictionary["XQMAKESPEC"] : dictionary["QMAKESPEC"]; - if (!copySpec("default", "", spec) - || !copySpec("default-host", "host ", dictionary["QMAKESPEC"])) { - cout << "Error installing default mkspecs" << endl << endl; - exit(EXIT_FAILURE); - } - } #endif diff --git a/tools/configure/configureapp.h b/tools/configure/configureapp.h index 8cae9da4f8..bfec520c39 100644 --- a/tools/configure/configureapp.h +++ b/tools/configure/configureapp.h @@ -79,10 +79,10 @@ public: void generateMakefiles(); void appendMakeItem(int inList, const QString &item); #if !defined(EVAL) - bool copySpec(const char *name, const char *pfx, const QString &spec); void generateConfigfiles(); void detectArch(); void generateQConfigPri(); + void generateSystemVars(); #endif void showSummary(); void findProjects( const QString& dirName ); diff --git a/tools/configure/main.cpp b/tools/configure/main.cpp index 53013c969d..e917137837 100644 --- a/tools/configure/main.cpp +++ b/tools/configure/main.cpp @@ -78,6 +78,10 @@ int runConfigure( int argc, char** argv ) if (!app.isOk()) return 3; + app.generateSystemVars(); + if (!app.isOk()) + return 3; + // Auto-detect modules and settings. app.autoDetection(); |