aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormartin <none@none>2013-03-05 13:16:40 -0800
committermartin <none@none>2013-03-05 13:16:40 -0800
commit75e9afb2f7a835ddf176c98285c5f2b46e1bb286 (patch)
treeb5f070851ed052927818ee5f01745c4926e6d32b
parentb5f2a50bd8801db7d6efe8ff22dbdcd00685927d (diff)
8006988: build-infra: Configure fails if 'cl' is in path on linux
Summary: Respect user CC and CXX environment variables; use cl iff on windows Reviewed-by: erikj
-rw-r--r--common/autoconf/generated-configure.sh36
-rw-r--r--common/autoconf/toolchain.m434
2 files changed, 43 insertions, 27 deletions
diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh
index 04bef5c..5772ad3 100644
--- a/common/autoconf/generated-configure.sh
+++ b/common/autoconf/generated-configure.sh
@@ -3733,7 +3733,7 @@ fi
#CUSTOM_AUTOCONF_INCLUDE
# Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1361899489
+DATE_WHEN_GENERATED=1362517596
###############################################################################
#
@@ -18105,14 +18105,18 @@ fi
### Locate C compiler (CC)
-# gcc is almost always present, but on Windows we
-# prefer cl.exe and on Solaris we prefer CC.
-# Thus test for them in this order.
-if test "x$OPENJDK_TARGET_OS" = xmacosx; then
- # Do not probe for cc on MacOSX.
- COMPILER_CHECK_LIST="cl gcc"
+# On windows, only cl.exe is supported.
+# On Solaris, cc is preferred to gcc.
+# Elsewhere, gcc is preferred to cc.
+
+if test "x$CC" != x; then
+ COMPILER_CHECK_LIST="$CC"
+elif test "x$OPENJDK_TARGET_OS" = "xwindows"; then
+ COMPILER_CHECK_LIST="cl"
+elif test "x$OPENJDK_TARGET_OS" = "xsolaris"; then
+ COMPILER_CHECK_LIST="cc gcc"
else
- COMPILER_CHECK_LIST="cl cc gcc"
+ COMPILER_CHECK_LIST="gcc cc"
fi
@@ -19076,7 +19080,7 @@ $as_echo "$as_me: The result from running with --version was: \"$COMPILER_VERSIO
$as_echo "$as_me: Using $COMPILER_VENDOR $COMPILER_NAME compiler version $COMPILER_VERSION (located at $COMPILER)" >&6;}
-# Now that we have resolved CC ourself, let autoconf have it's go at it
+# Now that we have resolved CC ourself, let autoconf have its go at it
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -19678,13 +19682,17 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
### Locate C++ compiler (CXX)
-if test "x$OPENJDK_TARGET_OS" = xmacosx; then
- # Do not probe for CC on MacOSX.
- COMPILER_CHECK_LIST="cl g++"
+if test "x$CXX" != x; then
+ COMPILER_CHECK_LIST="$CXX"
+elif test "x$OPENJDK_TARGET_OS" = "xwindows"; then
+ COMPILER_CHECK_LIST="cl"
+elif test "x$OPENJDK_TARGET_OS" = "xsolaris"; then
+ COMPILER_CHECK_LIST="CC g++"
else
- COMPILER_CHECK_LIST="cl CC g++"
+ COMPILER_CHECK_LIST="g++ CC"
fi
+
COMPILER_NAME=C++
CXX=
@@ -20645,7 +20653,7 @@ $as_echo "$as_me: The result from running with --version was: \"$COMPILER_VERSIO
$as_echo "$as_me: Using $COMPILER_VENDOR $COMPILER_NAME compiler version $COMPILER_VERSION (located at $COMPILER)" >&6;}
-# Now that we have resolved CXX ourself, let autoconf have it's go at it
+# Now that we have resolved CXX ourself, let autoconf have its go at it
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
diff --git a/common/autoconf/toolchain.m4 b/common/autoconf/toolchain.m4
index 740b0c4..80d81c4 100644
--- a/common/autoconf/toolchain.m4
+++ b/common/autoconf/toolchain.m4
@@ -248,30 +248,38 @@ fi
### Locate C compiler (CC)
-# gcc is almost always present, but on Windows we
-# prefer cl.exe and on Solaris we prefer CC.
-# Thus test for them in this order.
-if test "x$OPENJDK_TARGET_OS" = xmacosx; then
- # Do not probe for cc on MacOSX.
- COMPILER_CHECK_LIST="cl gcc"
+# On windows, only cl.exe is supported.
+# On Solaris, cc is preferred to gcc.
+# Elsewhere, gcc is preferred to cc.
+
+if test "x$CC" != x; then
+ COMPILER_CHECK_LIST="$CC"
+elif test "x$OPENJDK_TARGET_OS" = "xwindows"; then
+ COMPILER_CHECK_LIST="cl"
+elif test "x$OPENJDK_TARGET_OS" = "xsolaris"; then
+ COMPILER_CHECK_LIST="cc gcc"
else
- COMPILER_CHECK_LIST="cl cc gcc"
+ COMPILER_CHECK_LIST="gcc cc"
fi
TOOLCHAIN_FIND_COMPILER([CC],[C],[$COMPILER_CHECK_LIST])
-# Now that we have resolved CC ourself, let autoconf have it's go at it
+# Now that we have resolved CC ourself, let autoconf have its go at it
AC_PROG_CC([$CC])
### Locate C++ compiler (CXX)
-if test "x$OPENJDK_TARGET_OS" = xmacosx; then
- # Do not probe for CC on MacOSX.
- COMPILER_CHECK_LIST="cl g++"
+if test "x$CXX" != x; then
+ COMPILER_CHECK_LIST="$CXX"
+elif test "x$OPENJDK_TARGET_OS" = "xwindows"; then
+ COMPILER_CHECK_LIST="cl"
+elif test "x$OPENJDK_TARGET_OS" = "xsolaris"; then
+ COMPILER_CHECK_LIST="CC g++"
else
- COMPILER_CHECK_LIST="cl CC g++"
+ COMPILER_CHECK_LIST="g++ CC"
fi
+
TOOLCHAIN_FIND_COMPILER([CXX],[C++],[$COMPILER_CHECK_LIST])
-# Now that we have resolved CXX ourself, let autoconf have it's go at it
+# Now that we have resolved CXX ourself, let autoconf have its go at it
AC_PROG_CXX([$CXX])
### Locate other tools