diff options
Diffstat (limited to 'tools/configure')
-rw-r--r-- | tools/configure/Makefile.mingw | 2 | ||||
-rw-r--r-- | tools/configure/Makefile.win32 | 2 | ||||
-rw-r--r-- | tools/configure/configure.pro | 2 | ||||
-rw-r--r-- | tools/configure/configureapp.cpp | 210 | ||||
-rw-r--r-- | tools/configure/configureapp.h | 3 | ||||
-rw-r--r-- | tools/configure/main.cpp | 8 |
6 files changed, 118 insertions, 109 deletions
diff --git a/tools/configure/Makefile.mingw b/tools/configure/Makefile.mingw index 07d679ab58..0c5c0b577d 100644 --- a/tools/configure/Makefile.mingw +++ b/tools/configure/Makefile.mingw @@ -5,7 +5,7 @@ CONFSRC = $(TOOLSRC)/configure RAW_PCH = configure_pch.h PCH = $(RAW_PCH).gch/c++ CXX = g++ -DEFINES = -DUNICODE -DQT_NODLL -DQT_NO_DATASTREAM -DQT_NO_CODECS -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_LITE_COMPONENT -DQT_NO_COMPRESS -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -D_CRT_SECURE_NO_DEPRECATE -DQT_BOOTSTRAPPED -DCOMMERCIAL_VERSION +DEFINES = -DUNICODE -DQT_NO_DATASTREAM -DQT_NO_CODECS -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_LITE_COMPONENT -DQT_NO_COMPRESS -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -D_CRT_SECURE_NO_DEPRECATE -DQT_BOOTSTRAPPED -DCOMMERCIAL_VERSION INCPATH = -I"../../include" -I"../../include/QtCore" -I"../../include/QtCore/$(QTVERSION)" -I"../../include/QtCore/$(QTVERSION)/QtCore" -I"$(TOOLSRC)/shared" -I"$(QTSRC)mkspecs/win32-g++" CXXFLAGS_BARE = -fno-rtti -fno-exceptions -mthreads -Wall -Wextra $(DEFINES) $(INCPATH) CXXFLAGS = -include $(RAW_PCH) $(CXXFLAGS_BARE) diff --git a/tools/configure/Makefile.win32 b/tools/configure/Makefile.win32 index 7833db504b..2e05d53e65 100644 --- a/tools/configure/Makefile.win32 +++ b/tools/configure/Makefile.win32 @@ -3,7 +3,7 @@ TOOLSRC = $(QTSRC)tools CONFSRC = $(TOOLSRC)\configure PCH = configure_pch.pch -DEFINES = -DUNICODE -DQT_NODLL -DQT_NO_CODECS -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_LITE_COMPONENT -DQT_NO_COMPRESS -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -D_CRT_SECURE_NO_DEPRECATE -DQT_BOOTSTRAPPED -DCOMMERCIAL_VERSION +DEFINES = -DUNICODE -DQT_NO_CODECS -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_LITE_COMPONENT -DQT_NO_COMPRESS -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -D_CRT_SECURE_NO_DEPRECATE -DQT_BOOTSTRAPPED -DCOMMERCIAL_VERSION INCPATH = -I"..\..\include" -I"..\..\include\QtCore" -I"..\..\include\QtCore\$(QTVERSION)" -I"..\..\include\QtCore\$(QTVERSION)\QtCore" -I"$(TOOLSRC)\shared" -I"$(QTSRC)mkspecs\win32-msvc2008" CXXFLAGS_BARE = -nologo -Zm200 -Zc:wchar_t -MT -W3 -GR -EHsc -w34100 -w34189 $(EXTRA_CXXFLAGS) $(DEFINES) $(INCPATH) CXXFLAGS = -FIconfigure_pch.h -Yuconfigure_pch.h -Fp$(PCH) -MP $(CXXFLAGS_BARE) diff --git a/tools/configure/configure.pro b/tools/configure/configure.pro index 2ad2ab1502..16e4d2efb2 100644 --- a/tools/configure/configure.pro +++ b/tools/configure/configure.pro @@ -3,7 +3,7 @@ DESTDIR = $$PWD/../.. # build directly in source dir CONFIG += console flat stl rtti_off CONFIG -= moc qt -DEFINES = UNICODE QT_NODLL QT_NO_CODECS QT_NO_TEXTCODEC QT_NO_UNICODETABLES QT_LITE_COMPONENT QT_NO_COMPRESS QT_NO_THREAD QT_NO_QOBJECT QT_NO_GEOM_VARIANT _CRT_SECURE_NO_DEPRECATE +DEFINES = UNICODE QT_NO_CODECS QT_NO_TEXTCODEC QT_NO_UNICODETABLES QT_LITE_COMPONENT QT_NO_COMPRESS QT_NO_THREAD QT_NO_QOBJECT QT_NO_GEOM_VARIANT _CRT_SECURE_NO_DEPRECATE DEFINES += QT_BOOTSTRAPPED win32 : LIBS += -lole32 -ladvapi32 diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 9086007093..fb666e221e 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -1494,6 +1494,7 @@ void Configure::applySpecSpecifics() dictionary[ "IWMMXT" ] = "no"; dictionary[ "CE_CRT" ] = "yes"; dictionary[ "DIRECTSHOW" ] = "no"; + dictionary[ "LARGE_FILE" ] = "no"; // We only apply MMX/IWMMXT for mkspecs we know they work if (dictionary[ "XQMAKESPEC" ].startsWith("wincewm")) { dictionary[ "MMX" ] = "yes"; @@ -2304,6 +2305,11 @@ void Configure::generateOutputVars() qtConfig += "release"; } + if (dictionary[ "SHARED" ] == "no") + qtConfig += "static"; + else + qtConfig += "shared"; + if (dictionary[ "WIDGETS" ] == "no") qtConfig += "no-widgets"; @@ -2573,43 +2579,6 @@ void Configure::generateOutputVars() // Directories and settings for .qmake.cache -------------------- - // if QT_INSTALL_* have not been specified on commandline, define them now from QT_INSTALL_PREFIX - // if prefix is empty (WINCE), make all of them empty, if they aren't set - bool qipempty = false; - if (dictionary[ "QT_INSTALL_PREFIX" ].isEmpty()) - qipempty = true; - - if (!dictionary[ "QT_INSTALL_DOCS" ].size()) - dictionary[ "QT_INSTALL_DOCS" ] = qipempty ? "" : dictionary[ "QT_INSTALL_PREFIX" ] + "/doc"; - if (!dictionary[ "QT_INSTALL_HEADERS" ].size()) - dictionary[ "QT_INSTALL_HEADERS" ] = qipempty ? "" : dictionary[ "QT_INSTALL_PREFIX" ] + "/include"; - if (!dictionary[ "QT_INSTALL_LIBS" ].size()) - dictionary[ "QT_INSTALL_LIBS" ] = qipempty ? "" : dictionary[ "QT_INSTALL_PREFIX" ] + "/lib"; - if (!dictionary[ "QT_INSTALL_BINS" ].size()) - dictionary[ "QT_INSTALL_BINS" ] = qipempty ? "" : dictionary[ "QT_INSTALL_PREFIX" ] + "/bin"; - if (!dictionary[ "QT_INSTALL_PLUGINS" ].size()) - dictionary[ "QT_INSTALL_PLUGINS" ] = qipempty ? "" : dictionary[ "QT_INSTALL_PREFIX" ] + "/plugins"; - if (!dictionary[ "QT_INSTALL_IMPORTS" ].size()) - dictionary[ "QT_INSTALL_IMPORTS" ] = qipempty ? "" : dictionary[ "QT_INSTALL_PREFIX" ] + "/imports"; - if (!dictionary[ "QT_INSTALL_DATA" ].size()) - dictionary[ "QT_INSTALL_DATA" ] = qipempty ? "" : dictionary[ "QT_INSTALL_PREFIX" ]; - if (!dictionary[ "QT_INSTALL_TRANSLATIONS" ].size()) - dictionary[ "QT_INSTALL_TRANSLATIONS" ] = qipempty ? "" : dictionary[ "QT_INSTALL_PREFIX" ] + "/translations"; - if (!dictionary[ "QT_INSTALL_EXAMPLES" ].size()) - dictionary[ "QT_INSTALL_EXAMPLES" ] = qipempty ? "" : dictionary[ "QT_INSTALL_PREFIX" ] + "/examples"; - if (!dictionary[ "QT_INSTALL_TESTS" ].size()) - dictionary[ "QT_INSTALL_TESTS" ] = qipempty ? "" : dictionary[ "QT_INSTALL_PREFIX" ] + "/tests"; - - bool haveHpx = false; - if (dictionary[ "QT_HOST_PREFIX" ].isEmpty()) - dictionary[ "QT_HOST_PREFIX" ] = dictionary[ "QT_INSTALL_PREFIX" ]; - else - haveHpx = true; - if (dictionary[ "QT_HOST_BINS" ].isEmpty()) - dictionary[ "QT_HOST_BINS" ] = haveHpx ? dictionary[ "QT_HOST_PREFIX" ] + "/bin" : dictionary[ "QT_INSTALL_BINS" ]; - if (dictionary[ "QT_HOST_DATA" ].isEmpty()) - dictionary[ "QT_HOST_DATA" ] = haveHpx ? dictionary[ "QT_HOST_PREFIX" ] : dictionary[ "QT_INSTALL_DATA" ]; - if (dictionary.contains("XQMAKESPEC") && dictionary[ "XQMAKESPEC" ].startsWith("linux")) dictionary[ "QMAKE_RPATHDIR" ] = dictionary[ "QT_INSTALL_LIBS" ]; @@ -2936,10 +2905,6 @@ void Configure::generateQConfigPri() configStream << "CONFIG+= "; configStream << dictionary[ "BUILD" ]; - if (dictionary[ "SHARED" ] == "yes") - configStream << " shared"; - else - configStream << " static"; if (dictionary[ "LTCG" ] == "yes") configStream << " ltcg"; @@ -3101,12 +3066,13 @@ void Configure::generateConfigfiles() } tmpStream << endl; - if (dictionary[ "SHARED" ] == "yes") { - tmpStream << "#ifndef QT_DLL" << endl; - tmpStream << "#define QT_DLL" << endl; - tmpStream << "#endif" << endl; + if (dictionary[ "SHARED" ] == "no") { + tmpStream << "/* Qt was configured for a static build */" << endl + << "#if !defined(QT_SHARED) && !defined(QT_STATIC)" << endl + << "# define QT_STATIC" << endl + << "#endif" << endl + << endl; } - tmpStream << endl; tmpStream << "/* License information */" << endl; tmpStream << "#define QT_PRODUCT_LICENSEE \"" << licenseInfo[ "LICENSEE" ] << "\"" << endl; tmpStream << "#define QT_PRODUCT_LICENSE \"" << dictionary[ "EDITION" ] << "\"" << endl; @@ -3265,63 +3231,6 @@ void Configure::generateConfigfiles() || !copySpec("default-host", "host ", dictionary["QMAKESPEC"])) return; - // Generate the new qconfig.cpp file - QDir(buildPath).mkpath("src/corelib/global"); - outName = buildPath + "/src/corelib/global/qconfig.cpp"; - - QTemporaryFile tmpFile2; - if (tmpFile2.open()) { - tmpStream.setDevice(&tmpFile2); - tmpStream << "/* Licensed */" << endl - << "static const char qt_configure_licensee_str [512 + 12] = \"qt_lcnsuser=" << licenseInfo["LICENSEE"] << "\";" << endl - << "static const char qt_configure_licensed_products_str [512 + 12] = \"qt_lcnsprod=" << dictionary["EDITION"] << "\";" << endl - << endl - << "/* Build date */" << endl - << "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 - << " \"qt_prfxpath=" << formatPath(dictionary["QT_INSTALL_PREFIX"]) << "\"," << endl - << " \"qt_docspath=" << formatPath(dictionary["QT_INSTALL_DOCS"]) << "\"," << endl - << " \"qt_hdrspath=" << formatPath(dictionary["QT_INSTALL_HEADERS"]) << "\"," << endl - << " \"qt_libspath=" << formatPath(dictionary["QT_INSTALL_LIBS"]) << "\"," << endl - << " \"qt_binspath=" << formatPath(dictionary["QT_INSTALL_BINS"]) << "\"," << endl - << " \"qt_plugpath=" << formatPath(dictionary["QT_INSTALL_PLUGINS"]) << "\"," << endl - << " \"qt_impspath=" << formatPath(dictionary["QT_INSTALL_IMPORTS"]) << "\"," << endl - << " \"qt_datapath=" << formatPath(dictionary["QT_INSTALL_DATA"]) << "\"," << endl - << " \"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 - << " \"qt_hdatpath=" << formatPath(dictionary["QT_HOST_DATA"]) << "\"," << endl - << "#endif" << endl - << "};" << endl; - - if ((platform() != WINDOWS) && (platform() != WINDOWS_CE)) - tmpStream << "static const char qt_configure_settings_path_str [256 + 12] = \"qt_stngpath=" << formatPath(dictionary["QT_INSTALL_SETTINGS"]) << "\";" << endl; - - tmpStream << endl - << "/* 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; - - if ((platform() != WINDOWS) && (platform() != WINDOWS_CE)) - tmpStream << "#define QT_CONFIGURE_SETTINGS_PATH qt_configure_settings_path_str + 12;" << endl; - - tmpStream << endl; - - tmpStream.flush(); - tmpFile2.flush(); - - // Replace old qconfig.cpp with new one - ::SetFileAttributes((wchar_t*)outName.utf16(), FILE_ATTRIBUTE_NORMAL); - QFile::remove(outName); - tmpFile2.copy(outName); - tmpFile2.close(); - } - QTemporaryFile tmpFile3; if (tmpFile3.open()) { tmpStream.setDevice(&tmpFile3); @@ -3560,6 +3469,101 @@ void Configure::generateHeaders() } } +void Configure::generateQConfigCpp() +{ + // if QT_INSTALL_* have not been specified on commandline, define them now from QT_INSTALL_PREFIX + // if prefix is empty (WINCE), make all of them empty, if they aren't set + bool qipempty = false; + if (dictionary["QT_INSTALL_PREFIX"].isEmpty()) + qipempty = true; + + if (!dictionary["QT_INSTALL_DOCS"].size()) + dictionary["QT_INSTALL_DOCS"] = qipempty ? "" : dictionary["QT_INSTALL_PREFIX"] + "/doc"; + if (!dictionary["QT_INSTALL_HEADERS"].size()) + dictionary["QT_INSTALL_HEADERS"] = qipempty ? "" : dictionary["QT_INSTALL_PREFIX"] + "/include"; + if (!dictionary["QT_INSTALL_LIBS"].size()) + dictionary["QT_INSTALL_LIBS"] = qipempty ? "" : dictionary["QT_INSTALL_PREFIX"] + "/lib"; + if (!dictionary["QT_INSTALL_BINS"].size()) + dictionary["QT_INSTALL_BINS"] = qipempty ? "" : dictionary["QT_INSTALL_PREFIX"] + "/bin"; + if (!dictionary["QT_INSTALL_PLUGINS"].size()) + dictionary["QT_INSTALL_PLUGINS"] = qipempty ? "" : dictionary["QT_INSTALL_PREFIX"] + "/plugins"; + if (!dictionary["QT_INSTALL_IMPORTS"].size()) + dictionary["QT_INSTALL_IMPORTS"] = qipempty ? "" : dictionary["QT_INSTALL_PREFIX"] + "/imports"; + if (!dictionary["QT_INSTALL_DATA"].size()) + dictionary["QT_INSTALL_DATA"] = qipempty ? "" : dictionary["QT_INSTALL_PREFIX"]; + if (!dictionary["QT_INSTALL_TRANSLATIONS"].size()) + dictionary["QT_INSTALL_TRANSLATIONS"] = qipempty ? "" : dictionary["QT_INSTALL_PREFIX"] + "/translations"; + if (!dictionary["QT_INSTALL_EXAMPLES"].size()) + dictionary["QT_INSTALL_EXAMPLES"] = qipempty ? "" : dictionary["QT_INSTALL_PREFIX"] + "/examples"; + if (!dictionary["QT_INSTALL_TESTS"].size()) + dictionary["QT_INSTALL_TESTS"] = qipempty ? "" : dictionary["QT_INSTALL_PREFIX"] + "/tests"; + + bool haveHpx = false; + if (dictionary["QT_HOST_PREFIX"].isEmpty()) + dictionary["QT_HOST_PREFIX"] = dictionary["QT_INSTALL_PREFIX"]; + else + haveHpx = true; + if (dictionary["QT_HOST_BINS"].isEmpty()) + dictionary["QT_HOST_BINS"] = haveHpx ? dictionary["QT_HOST_PREFIX"] + "/bin" : dictionary["QT_INSTALL_BINS"]; + if (dictionary["QT_HOST_DATA"].isEmpty()) + dictionary["QT_HOST_DATA"] = haveHpx ? dictionary["QT_HOST_PREFIX"] : dictionary["QT_INSTALL_DATA"]; + + // Generate the new qconfig.cpp file + QDir(buildPath).mkpath("src/corelib/global"); + const QString outName(buildPath + "/src/corelib/global/qconfig.cpp"); + + QTemporaryFile tmpFile; + if (tmpFile.open()) { + QTextStream tmpStream(&tmpFile); + tmpStream << "/* Licensed */" << endl + << "static const char qt_configure_licensee_str [512 + 12] = \"qt_lcnsuser=" << licenseInfo["LICENSEE"] << "\";" << endl + << "static const char qt_configure_licensed_products_str [512 + 12] = \"qt_lcnsprod=" << dictionary["EDITION"] << "\";" << endl + << endl + << "/* Build date */" << endl + << "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 + << " \"qt_prfxpath=" << formatPath(dictionary["QT_INSTALL_PREFIX"]) << "\"," << endl + << " \"qt_docspath=" << formatPath(dictionary["QT_INSTALL_DOCS"]) << "\"," << endl + << " \"qt_hdrspath=" << formatPath(dictionary["QT_INSTALL_HEADERS"]) << "\"," << endl + << " \"qt_libspath=" << formatPath(dictionary["QT_INSTALL_LIBS"]) << "\"," << endl + << " \"qt_binspath=" << formatPath(dictionary["QT_INSTALL_BINS"]) << "\"," << endl + << " \"qt_plugpath=" << formatPath(dictionary["QT_INSTALL_PLUGINS"]) << "\"," << endl + << " \"qt_impspath=" << formatPath(dictionary["QT_INSTALL_IMPORTS"]) << "\"," << endl + << " \"qt_datapath=" << formatPath(dictionary["QT_INSTALL_DATA"]) << "\"," << endl + << " \"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 + << " \"qt_hdatpath=" << formatPath(dictionary["QT_HOST_DATA"]) << "\"," << endl + << "#endif" << endl + << "};" << endl; + + if ((platform() != WINDOWS) && (platform() != WINDOWS_CE)) + tmpStream << "static const char qt_configure_settings_path_str [256 + 12] = \"qt_stngpath=" << formatPath(dictionary["QT_INSTALL_SETTINGS"]) << "\";" << endl; + + tmpStream << endl + << "/* 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; + + if ((platform() != WINDOWS) && (platform() != WINDOWS_CE)) + tmpStream << "#define QT_CONFIGURE_SETTINGS_PATH qt_configure_settings_path_str + 12;" << endl; + + tmpStream.flush(); + tmpFile.flush(); + + // Replace old qconfig.cpp with new one + ::SetFileAttributes((wchar_t*)outName.utf16(), FILE_ATTRIBUTE_NORMAL); + QFile::remove(outName); + tmpFile.copy(outName); + tmpFile.close(); + } +} + void Configure::buildQmake() { if (dictionary[ "BUILD_QMAKE" ] == "yes") { diff --git a/tools/configure/configureapp.h b/tools/configure/configureapp.h index c16b9e2ad3..ff5050ad8d 100644 --- a/tools/configure/configureapp.h +++ b/tools/configure/configureapp.h @@ -64,6 +64,8 @@ public: QString defaultTo(const QString &option); bool checkAvailability(const QString &part); + void generateQConfigCpp(); + void buildQmake(); void autoDetection(); bool verifyConfiguration(); @@ -73,7 +75,6 @@ public: void generateBuildKey(); void generateCachefile(); void displayConfig(); - void buildQmake(); #endif void generateMakefiles(); void appendMakeItem(int inList, const QString &item); diff --git a/tools/configure/main.cpp b/tools/configure/main.cpp index 794793b52f..e153cf1eb0 100644 --- a/tools/configure/main.cpp +++ b/tools/configure/main.cpp @@ -68,6 +68,12 @@ int runConfigure( int argc, char** argv ) if (!app.isOk()) return 3; + app.generateQConfigCpp(); + + app.buildQmake(); + if (!app.isOk()) + return 3; + // Auto-detect modules and settings. app.autoDetection(); @@ -88,8 +94,6 @@ int runConfigure( int argc, char** argv ) app.generateConfigfiles(); if( !app.isDone() ) app.generateHeaders(); - if( !app.isDone() ) - app.buildQmake(); // must be done after buildQmake() if (!app.isDone()) app.detectArch(); |