diff options
author | Jan Holesovsky <kendy@suse.cz> | 2011-04-06 11:19:15 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@suse.cz> | 2011-04-15 14:20:36 +0200 |
commit | 823a2d5de8b3f5d9f93bd9404aa0456736aa3ee1 (patch) | |
tree | 26a441eced69fab9bb17a4d8c1c69872dcce77e1 | |
parent | 35146032664093e90c2841e50d76f569df2adeb5 (diff) |
Don't override CC and CXX on Windows when set, handle ccache.
This is to allow use of ccache by specifying something like:
export CC="ccache C:/path/to/cl.exe"
export CXX="ccache C:/patch/to/cl.exe"
before running ./autogen.sh
-rwxr-xr-x | configure.in | 32 | ||||
-rwxr-xr-x | set_soenv.in | 8 |
2 files changed, 19 insertions, 21 deletions
diff --git a/configure.in b/configure.in index c3741aa87..18de3ffa7 100755 --- a/configure.in +++ b/configure.in @@ -2131,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 @@ -2172,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` @@ -2427,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 diff --git a/set_soenv.in b/set_soenv.in index 8e66789e1..14f59b349 100755 --- a/set_soenv.in +++ b/set_soenv.in @@ -125,12 +125,8 @@ $JDK = '@JDK@'; $JAVAFLAGS = '@JAVAFLAGS@'; $MINGW = '@WITH_MINGW@'; # use MinGW for Windows build $USE_MINGW = '@USE_MINGW@'; # use MinGW in cygwin or pure-mingw -if ( $MINGW eq "yes" ) -{ $CC = '@CC@'; # C compiler - $CXX = '@CXX@'; } # C++ compiler -else -{ $CC = PathFormat('@CC@'); # C compiler - $CXX = PathFormat('@CXX@'); } # C++ compiler +$CC = '@CC@'; # C compiler +$CXX = '@CXX@'; # C++ compiler $MOZILLA_VERSION = '@MOZILLA_VERSION@'; # mozilla version to use to build mozilla $MOZILLA_TOOLKIT = '@MOZILLA_TOOLKIT@'; # GUI toolkit to use to build mozilla $FLIPCMD = ""; # Flip '/' to '\' wrapper (only for winnt) |