summaryrefslogtreecommitdiffstats
path: root/tools/configure
diff options
context:
space:
mode:
authorRay Donnelly <mingw.android@gmail.com>2013-02-02 12:31:53 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-02-19 10:35:06 +0100
commit1a0924dfc008b60b98bc921a3e64c3a920158b60 (patch)
tree232ba1bfd0d66dc42329fe90d55f6b57f158b290 /tools/configure
parent5ec342fefdb00406d3bf6f3943d4b235b9094cc9 (diff)
Unify win32-g++ and Unix qmake Makefiles.
Replace the old sed / template @FOO@ method with echo. Enable MSYS bash to build qmake.exe Use qmake/Makefile.unix for all win32-g++ builds. Change-Id: I6e27d69b28d27131838bbbb3a4ee5a08b470f31b Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Diffstat (limited to 'tools/configure')
-rw-r--r--tools/configure/configureapp.cpp62
1 files changed, 57 insertions, 5 deletions
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp
index 5fe1e029fb..3d9c0c8ab4 100644
--- a/tools/configure/configureapp.cpp
+++ b/tools/configure/configureapp.cpp
@@ -1277,7 +1277,7 @@ void Configure::parseCmdLine()
dictionary[ "QMAKEMAKEFILE" ] = "Makefile.win32";
} else if (dictionary[ "QMAKESPEC" ] == QString("win32-g++")) {
if (dictionary[ "MAKE" ].isEmpty()) dictionary[ "MAKE" ] = "mingw32-make";
- dictionary[ "QMAKEMAKEFILE" ] = "Makefile.win32-g++";
+ dictionary[ "QMAKEMAKEFILE" ] = "Makefile.unix";
} else {
if (dictionary[ "MAKE" ].isEmpty()) dictionary[ "MAKE" ] = "make";
dictionary[ "QMAKEMAKEFILE" ] = "Makefile.win32";
@@ -3687,12 +3687,64 @@ void Configure::buildQmake()
stream << "#AutoGenerated by configure.exe" << endl
<< "BUILD_PATH = " << QDir::toNativeSeparators(buildPath) << endl
<< "SOURCE_PATH = " << QDir::toNativeSeparators(sourcePath) << endl;
- stream << "QMAKESPEC = " << dictionary["QMAKESPEC"] << endl
- << "QT_VERSION = " << dictionary["VERSION"] << endl;
-
+ stream << "QT_VERSION = " << dictionary["VERSION"] << endl;
+ if (dictionary[ "QMAKESPEC" ] == QString("win32-g++")) {
+ stream << "QMAKESPEC = $(SOURCE_PATH)\\mkspecs\\win32-g++" << endl
+ << "EXTRA_CFLAGS = -DUNICODE" << endl
+ << "EXTRA_CXXFLAGS = -DUNICODE" << endl
+ << "QTOBJS = qfilesystemengine_win.o \\" << endl
+ << " qfilesystemiterator_win.o \\" << endl
+ << " qfsfileengine_win.o \\" << endl
+ << " qlocale_win.o \\" << endl
+ << " qsettings_win.o \\" << endl
+ << " qsystemlibrary.o \\" << endl
+ << " registry.o" << endl
+ << "QTSRCS=\"$(SOURCE_PATH)/src/corelib/io/qfilesystemengine_win.cpp\" \\" << endl
+ << " \"$(SOURCE_PATH)/src/corelib/io/qfilesystemiterator_win.cpp\" \\" << endl
+ << " \"$(SOURCE_PATH)/src/corelib/io/qfsfileengine_win.cpp\" \\" << endl
+ << " \"$(SOURCE_PATH)/src/corelib/io/qsettings_win.cpp\" \\" << endl
+ << " \"$(SOURCE_PATH)/src/corelib/tools/qlocale_win.cpp\" \\" << endl\
+ << " \"$(SOURCE_PATH)/src/corelib/plugin/qsystemlibrary.cpp\" \\" << endl
+ << " \"$(SOURCE_PATH)/tools/shared/windows/registry.cpp\"" << endl
+ << "EXEEXT=.exe" << endl
+ << "LFLAGS=-static -s -lole32 -luuid -ladvapi32 -lkernel32" << endl;
+ /*
+ ** SHELL is the full path of sh.exe, unless
+ ** 1) it is found in the current directory
+ ** 2) it is not found at all
+ ** 3) it is overridden on the command line with an existing file
+ ** ... otherwise it is always sh.exe. Specifically, SHELL from the
+ ** environment has no effect.
+ **
+ ** This check will fail if SHELL is explicitly set to a not
+ ** sh-compatible shell. This is not a problem, because configure.bat
+ ** will not do that.
+ */
+ stream << "ifeq ($(SHELL), sh.exe)" << endl
+ << " ifeq ($(wildcard $(CURDIR)/sh.exe), )" << endl
+ << " SH = 0" << endl
+ << " else" << endl
+ << " SH = 1" << endl
+ << " endif" << endl
+ << "else" << endl
+ << " SH = 1" << endl
+ << "endif" << endl
+ << "\n"
+ << "ifeq ($(SH), 1)" << endl
+ << " RM_F = rm -f" << endl
+ << " RM_RF = rm -rf" << endl
+ << "else" << endl
+ << " RM_F = del /f" << endl
+ << " RM_RF = rmdir /s /q" << endl
+ << "endif" << endl;
+ stream << "\n\n";
+ } else {
+ stream << "QMAKESPEC = " << dictionary["QMAKESPEC"] << endl;
+ }
if (dictionary["EDITION"] == "OpenSource" ||
dictionary["QT_EDITION"].contains("OPENSOURCE"))
- stream << "QMAKE_OPENSOURCE_EDITION = yes" << endl;
+ stream << "EXTRA_CPPFLAGS = -DQMAKE_OPENSOURCE_EDITION" << endl;
+
stream << "\n\n";
QFile in(sourcePath + "/qmake/" + dictionary["QMAKEMAKEFILE"]);