1.1 --- a/common/autoconf/toolchain.m4 Thu Mar 07 11:17:28 2013 -0800 1.2 +++ b/common/autoconf/toolchain.m4 Tue Mar 12 16:38:11 2013 -0700 1.3 @@ -248,30 +248,38 @@ 1.4 1.5 ### Locate C compiler (CC) 1.6 1.7 -# gcc is almost always present, but on Windows we 1.8 -# prefer cl.exe and on Solaris we prefer CC. 1.9 -# Thus test for them in this order. 1.10 -if test "x$OPENJDK_TARGET_OS" = xmacosx; then 1.11 - # Do not probe for cc on MacOSX. 1.12 - COMPILER_CHECK_LIST="cl gcc" 1.13 +# On windows, only cl.exe is supported. 1.14 +# On Solaris, cc is preferred to gcc. 1.15 +# Elsewhere, gcc is preferred to cc. 1.16 + 1.17 +if test "x$CC" != x; then 1.18 + COMPILER_CHECK_LIST="$CC" 1.19 +elif test "x$OPENJDK_TARGET_OS" = "xwindows"; then 1.20 + COMPILER_CHECK_LIST="cl" 1.21 +elif test "x$OPENJDK_TARGET_OS" = "xsolaris"; then 1.22 + COMPILER_CHECK_LIST="cc gcc" 1.23 else 1.24 - COMPILER_CHECK_LIST="cl cc gcc" 1.25 + COMPILER_CHECK_LIST="gcc cc" 1.26 fi 1.27 1.28 TOOLCHAIN_FIND_COMPILER([CC],[C],[$COMPILER_CHECK_LIST]) 1.29 -# Now that we have resolved CC ourself, let autoconf have it's go at it 1.30 +# Now that we have resolved CC ourself, let autoconf have its go at it 1.31 AC_PROG_CC([$CC]) 1.32 1.33 ### Locate C++ compiler (CXX) 1.34 1.35 -if test "x$OPENJDK_TARGET_OS" = xmacosx; then 1.36 - # Do not probe for CC on MacOSX. 1.37 - COMPILER_CHECK_LIST="cl g++" 1.38 +if test "x$CXX" != x; then 1.39 + COMPILER_CHECK_LIST="$CXX" 1.40 +elif test "x$OPENJDK_TARGET_OS" = "xwindows"; then 1.41 + COMPILER_CHECK_LIST="cl" 1.42 +elif test "x$OPENJDK_TARGET_OS" = "xsolaris"; then 1.43 + COMPILER_CHECK_LIST="CC g++" 1.44 else 1.45 - COMPILER_CHECK_LIST="cl CC g++" 1.46 + COMPILER_CHECK_LIST="g++ CC" 1.47 fi 1.48 + 1.49 TOOLCHAIN_FIND_COMPILER([CXX],[C++],[$COMPILER_CHECK_LIST]) 1.50 -# Now that we have resolved CXX ourself, let autoconf have it's go at it 1.51 +# Now that we have resolved CXX ourself, let autoconf have its go at it 1.52 AC_PROG_CXX([$CXX]) 1.53 1.54 ### Locate other tools