diff options
Diffstat (limited to 'tools/configure')
-rw-r--r-- | tools/configure/Makefile.mingw | 34 | ||||
-rw-r--r-- | tools/configure/environment.cpp | 32 |
2 files changed, 59 insertions, 7 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 diff --git a/tools/configure/environment.cpp b/tools/configure/environment.cpp index 80542e7697..b9af9eca8f 100644 --- a/tools/configure/environment.cpp +++ b/tools/configure/environment.cpp @@ -76,9 +76,13 @@ struct CompilerInfo{ {CC_MINGW, "MinGW (Minimalist GNU for Windows)", 0, "g++.exe"}, {CC_INTEL, "Intel(R) C++ Compiler for 32-bit applications", 0, "icl.exe"}, // xilink.exe, xilink5.exe, xilink6.exe, xilib.exe {CC_NET2003, "Microsoft (R) 32-bit C/C++ Optimizing Compiler.NET 2003 (7.1)", "Software\\Microsoft\\VisualStudio\\7.1\\Setup\\VC\\ProductDir", "cl.exe"}, // link.exe, lib.exe + {CC_NET2003, "Microsoft (R) 32-bit C/C++ Optimizing Compiler.NET 2003 (7.1)", "Software\\Wow6432Node\\Microsoft\\VisualStudio\\7.1\\Setup\\VC\\ProductDir", "cl.exe"}, // link.exe, lib.exe {CC_NET2005, "Microsoft (R) 32-bit C/C++ Optimizing Compiler.NET 2005 (8.0)", "Software\\Microsoft\\VisualStudio\\SxS\\VC7\\8.0", "cl.exe"}, // link.exe, lib.exe + {CC_NET2005, "Microsoft (R) 32-bit C/C++ Optimizing Compiler.NET 2005 (8.0)", "Software\\Wow6432Node\\Microsoft\\VisualStudio\\SxS\\VC7\\8.0", "cl.exe"}, // link.exe, lib.exe {CC_NET2008, "Microsoft (R) 32-bit C/C++ Optimizing Compiler.NET 2008 (9.0)", "Software\\Microsoft\\VisualStudio\\SxS\\VC7\\9.0", "cl.exe"}, // link.exe, lib.exe + {CC_NET2008, "Microsoft (R) 32-bit C/C++ Optimizing Compiler.NET 2008 (9.0)", "Software\\Wow6432Node\\Microsoft\\VisualStudio\\SxS\\VC7\\9.0", "cl.exe"}, // link.exe, lib.exe {CC_NET2010, "Microsoft (R) 32-bit C/C++ Optimizing Compiler.NET 2010 (10.0)", "Software\\Microsoft\\VisualStudio\\SxS\\VC7\\10.0", "cl.exe"}, // link.exe, lib.exe + {CC_NET2010, "Microsoft (R) 32-bit C/C++ Optimizing Compiler.NET 2010 (10.0)", "Software\\Wow6432Node\\Microsoft\\VisualStudio\\SxS\\VC7\\10.0", "cl.exe"}, // link.exe, lib.exe {CC_UNKNOWN, "Unknown", 0, 0}, }; @@ -158,8 +162,18 @@ Compiler Environment::detectCompiler() QStringList::iterator it; for(it = pathlist.begin(); it != pathlist.end(); ++it) { if((*it).contains(productPath)) { - ++installed; - detectedCompiler = compiler_info[i].compiler; + if (detectedCompiler != compiler_info[i].compiler) { + ++installed; + detectedCompiler = compiler_info[i].compiler; + } + /* else { + + We detected the same compiler again, which happens when + configure is build with the 64-bit compiler. Skip the + duplicate so that we don't think it's installed twice. + + } + */ break; } } @@ -171,8 +185,18 @@ Compiler Environment::detectCompiler() for(int i = 0; compiler_info[i].compiler; ++i) { QString executable = QString(compiler_info[i].executable).toLower(); if (executable.length() && Environment::detectExecutable(executable)) { - ++installed; - detectedCompiler = compiler_info[i].compiler; + if (detectedCompiler != compiler_info[i].compiler) { + ++installed; + detectedCompiler = compiler_info[i].compiler; + } + /* else { + + We detected the same compiler again, which happens when + configure is build with the 64-bit compiler. Skip the + duplicate so that we don't think it's installed twice. + + } + */ break; } } |