From ba6952b28d17b6b34f65510be645e414fa1ef6a2 Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Tue, 14 Feb 2012 10:01:17 +0100 Subject: Remove -arch argument and #define QT_ARCH from configures MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Do not try to detect the host or target architectures using uname or similar, and do not override with the -arch or -host-arch configure arguments. The configures will still accept the -arch and -host-arch arguments, but it ignores them and instead outputs a warning stating that these arguments are obsolete and should not be used. Set QT_ARCH and QT_HOST_ARCH qconfig.pri variables based on the compiler target. This is done by running qmake (twice when cross-compiling) on config.tests/arch/arch.pro, which preprocesses a file that contains all knowns processors. On Windows, configure.exe has never run any config.tests before, and does not currently have a function to run a program and capture its output. Use _popen() to accomplish this (as qmake does for its system() function). This needs to be done after qmake is built, as does the mkspecs/qconfig.pri generation. As a side effect, the configure steps have been slightly re-ordered, but the overall result is the same. The displayConfig() call is moved to just before generating Makefiles, so that it can show the detected architecture(s). Change-Id: I77666c77a93b48848f87648d08e79a42f721683f Reviewed-by: Morten Johan Sørvig Reviewed-by: Oswald Buddenhagen --- tools/configure/configureapp.cpp | 121 +++++++++++++++++++++++++++++++-------- tools/configure/configureapp.h | 2 + tools/configure/environment.cpp | 22 +++++++ tools/configure/environment.h | 1 + tools/configure/main.cpp | 10 +++- 5 files changed, 130 insertions(+), 26 deletions(-) (limited to 'tools') diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 8423953d7d..165dc0a043 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -188,7 +188,6 @@ Configure::Configure(int& argc, char** argv) dictionary[ "QMAKESPEC_FROM" ] = "env"; } - dictionary[ "ARCHITECTURE" ] = "windows"; dictionary[ "QCONFIG" ] = "full"; dictionary[ "EMBEDDED" ] = "no"; dictionary[ "BUILD_QMAKE" ] = "yes"; @@ -470,11 +469,7 @@ void Configure::parseCmdLine() ++i; if (i == argCount) break; - dictionary[ "ARCHITECTURE" ] = configCmdLine.at(i); - if (configCmdLine.at(i) == "boundschecker") { - dictionary[ "ARCHITECTURE" ] = "generic"; // Boundschecker uses the generic arch, - qtConfig += "boundschecker"; // but also needs this CONFIG option - } + dictionary["OBSOLETE_ARCH_ARG"] = "yes"; } else if (configCmdLine.at(i) == "-embedded") { dictionary[ "EMBEDDED" ] = "yes"; } else if (configCmdLine.at(i) == "-xplatform") { @@ -1365,7 +1360,6 @@ void Configure::applySpecSpecifics() dictionary[ "STL" ] = "no"; dictionary[ "EXCEPTIONS" ] = "no"; dictionary[ "RTTI" ] = "no"; - dictionary[ "ARCHITECTURE" ] = "windowsce"; dictionary[ "3DNOW" ] = "no"; dictionary[ "SSE" ] = "no"; dictionary[ "SSE2" ] = "no"; @@ -1451,7 +1445,7 @@ bool Configure::displayHelp() "[-no-fast] [-fast] [-no-exceptions] [-exceptions]\n" "[-no-accessibility] [-accessibility] [-no-rtti] [-rtti]\n" "[-no-stl] [-stl] [-no-sql-] [-qt-sql-]\n" - "[-plugin-sql-] [-system-sqlite] [-arch ]\n" + "[-plugin-sql-] [-system-sqlite]\n" "[-D ] [-I ] [-L ]\n" "[-help] [-no-dsp] [-dsp] [-no-vcproj] [-vcproj]\n" "[-no-qmake] [-qmake] [-dont-process] [-process]\n" @@ -1623,13 +1617,6 @@ bool Configure::displayHelp() desc("DIRECTWRITE", "no", "-no-directwrite", "Do not build support for DirectWrite font rendering"); desc("DIRECTWRITE", "yes", "-directwrite", "Build support for DirectWrite font rendering (experimental, requires DirectWrite availability on target systems, e.g. Windows Vista with Platform Update, Windows 7, etc.)"); - desc( "-arch ", "Specify an architecture.\n" - "Available values for :"); - desc("ARCHITECTURE","windows", "", " windows", ' '); - desc("ARCHITECTURE","windowsce", "", " windowsce", ' '); - desc("ARCHITECTURE","boundschecker", "", " boundschecker", ' '); - desc("ARCHITECTURE","generic", "", " generic\n", ' '); - desc( "-no-style-