summaryrefslogtreecommitdiffstats
path: root/tools/configure/Makefile.mingw
diff options
context:
space:
mode:
authorJonathan Liu <net147@gmail.com>2012-02-24 22:36:59 +1100
committerQt by Nokia <qt-info@nokia.com>2012-02-25 15:28:11 +0100
commitbc8bc6018e8ad34512d3de3265f7ad34f91f59ff (patch)
treeca639632b5bed24dca1bd617d57c72a3f3acf0a6 /tools/configure/Makefile.mingw
parentf5a03eec2d0f12917572bfa9cb48b4145768480a (diff)
Fix MinGW configure bootstrap
Makefile.mingw was using the test command which requires sh.exe. This adds support for bootstrap using cmd.exe instead. Change-Id: Ieb67843170d2745ce119cc8feaa5433aa82fd7d7 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Diffstat (limited to 'tools/configure/Makefile.mingw')
-rw-r--r--tools/configure/Makefile.mingw34
1 files changed, 31 insertions, 3 deletions
diff --git a/tools/configure/Makefile.mingw b/tools/configure/Makefile.mingw
index 5951cb4e92..086dd71a85 100644
--- a/tools/configure/Makefile.mingw
+++ b/tools/configure/Makefile.mingw
@@ -74,10 +74,38 @@ $(TARGET): $(OBJECTS)
$(OBJECTS): $(PCH)
-CHK_DIR_EXISTS = test -d
-MKDIR=mkdir -p
+# 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.
+ifeq ($(SHELL), sh.exe)
+ ifeq ($(wildcard $(CURDIR)/sh.exe), )
+ SH = 0
+ else
+ SH = 1
+ endif
+else
+ SH = 1
+endif
+
+ifeq ($(SH), 1)
+ CHK_DIR_EXISTS = test -d
+ CHK_DIR_EXISTS_GLUE = ||
+ MKDIR = mkdir -p
+else
+ CHK_DIR_EXISTS = if not exist
+ CHK_DIR_EXISTS_GLUE =
+ MKDIR = md
+endif
+
$(PCH): $(CONFSRC)/configure_pch.h
- @$(CHK_DIR_EXISTS) $(RAW_PCH).gch || $(MKDIR) $(RAW_PCH).gch
+ @$(CHK_DIR_EXISTS) $(RAW_PCH).gch $(CHK_DIR_EXISTS_GLUE) $(MKDIR) $(RAW_PCH).gch
$(CXX) -x c++-header -c $(CXXFLAGS_BARE) -o $@ $<
VPATH = $(CONFSRC):$(TOOLSRC)/shared/windows:$(CORESRC)/global:$(CORESRC)/kernel:$(CORESRC)/tools:$(CORESRC)/codecs:$(CORESRC)/io:$(CORESRC)/xml:$(CORESRC)/plugin