diff options
Diffstat (limited to 'configure.in')
-rwxr-xr-x | configure.in | 49 |
1 files changed, 33 insertions, 16 deletions
diff --git a/configure.in b/configure.in index 922e3eceac13..18de3ffa733b 100755 --- a/configure.in +++ b/configure.in @@ -2113,6 +2113,7 @@ fi dnl =================================================================== dnl Check which Microsoft C/C++ or MinGW compiler is used for WINNT dnl =================================================================== +SHOWINCLUDES_PREFIX= if test "$_os" = "WINNT"; then if test "$WITH_MINGW" != "yes"; then AC_MSG_CHECKING([for a friendly Microsoft C/C++ compiler installation path]) @@ -2130,7 +2131,7 @@ if test "$_os" = "WINNT"; then else with_cl_home=`cygpath -u "$with_cl_home"` fi - AC_MSG_RESULT([done]) + AC_MSG_RESULT([$with_cl_home]) dnl =========================================================== dnl Check for mspdb80.dll/mspdb100.dll @@ -2163,7 +2164,7 @@ if test "$_os" = "WINNT"; then fi if test -z "$MSPDB_PATH"; then - AC_MSG_ERROR([You need a mspdb80.dllor mspdb100.dll, make sure it's in the path or use --with-mspdb-path]) + AC_MSG_ERROR([You need a mspdb80.dllor mspdb100.dll, make sure it is in the path or use --with-mspdb-path]) fi MSPDB_PATH=`cygpath -d "$MSPDB_PATH"` MSPDB_PATH=`cygpath -u "$MSPDB_PATH"` @@ -2171,27 +2172,29 @@ if test "$_os" = "WINNT"; then PATH="$MSPDB_PATH:$PATH" AC_MSG_CHECKING([the Microsoft C/C++ Compiler]) - if test "$CL_X64" = ""; then - if test -x "$with_cl_home/bin/cl.exe"; then - CC="$with_cl_home/bin/cl.exe" + if test -z "$CC"; then + if test "$CL_X64" = ""; then + if test -x "$with_cl_home/bin/cl.exe"; then + CC="$with_cl_home/bin/cl.exe" + fi + else + if test -x "$with_cl_home/bin/amd64/cl.exe"; then + CC="$with_cl_home/bin/amd64/cl.exe" + fi fi - else - if test -x "$with_cl_home/bin/amd64/cl.exe"; then - CC="$with_cl_home/bin/amd64/cl.exe" + if test -z "$CC"; then + AC_PATH_PROG(CC, cl.exe) fi - fi - if test -z "$CC"; then - AC_PATH_PROG(CC, cl.exe) - fi - - if test -e "$CC"; then # This gives us a posix path with 8.3 filename restrictions CC=`cygpath -d "$CC"` CC=`cygpath -u "$CC"` + fi + + if test -n "$CC"; then # Remove /cl.exe from CC case insensitive AC_MSG_RESULT([found ($CC)]) if test "$CL_X64" = ""; then - COMPATH=`echo $CC | $SED 's@\/[[Bb]][[Ii]][[Nn]]\/[[cC]][[lL]]\.[[eE]][[xX]][[eE]]@@'` + COMPATH=`echo $CC | $SED -e 's@\/[[Bb]][[Ii]][[Nn]]\/[[cC]][[lL]]\.[[eE]][[xX]][[eE]].*@@' -e 's@^.* @@'` else if test -n "$with_cl_home"; then COMPATH=`echo $with_cl_home` @@ -2222,6 +2225,19 @@ dnl The following find microsoft, matches nn.nn.nnnn then pulls numbers out else AC_MSG_ERROR([Microsoft C/C++ Compiler not found. Use --with-cl-home or set path to cl.exe.]) fi + + dnl We need to guess the prefix of the -showIncludes output, it can be + dnl localized + AC_MSG_CHECKING([the dependency generation prefix (cl.exe -showIncludes)]) + echo "#include <stdlib.h>" > conftest.c + SHOWINCLUDES_PREFIX=`$CC -c -showIncludes conftest.c 2>/dev/null | \ + grep 'stdlib\.h' | head -n1 | sed 's/ [[[:alpha:]]]:.*//'` + rm -f conftest.c conftest.obj + if test -z "$SHOWINCLUDES_PREFIX" ; then + AC_MSG_ERROR([cannot determine the -showIncludes prefix]) + else + AC_MSG_RESULT(["$SHOWINCLUDES_PREFIX"]) + fi else AC_MSG_CHECKING([the MinGW C++ Compiler]) if test `$CC -dumpmachine | $SED -e 's/^.*-//'` = "mingw32"; then @@ -2239,6 +2255,7 @@ fi AC_SUBST(COMEX) AC_SUBST(MSPDB_PATH) AC_SUBST(USE_MINGW) +AC_SUBST(SHOWINCLUDES_PREFIX) dnl =================================================================== dnl .NET needs special treatment @@ -2412,7 +2429,7 @@ dnl =================================================================== dnl Testing for c++ compiler and version... dnl =================================================================== if test "$_os" = "WINNT" -a "$WITH_MINGW" != "yes"; then - if test -e "$CC"; then + if test -n "$CC" -a -z "$CXX"; then CXX="$CC" fi fi |