Blame SOURCES/pr2842-02.patch

045ef6
# HG changeset patch
045ef6
# User ihse
045ef6
# Date 1454642639 0
045ef6
#      Fri Feb 05 03:23:59 2016 +0000
045ef6
# Node ID 61798573efe5a9efa67e268a52cf61263abb4396
045ef6
# Parent  842cc183c9f6d29270ff002238248978c08f0a66
045ef6
8148351, PR2842: Only display resolved symlink for compiler, do not change path
045ef6
Reviewed-by: erikj
045ef6
045ef6
diff --git a/common/autoconf/toolchain.m4 b/common/autoconf/toolchain.m4
045ef6
--- openjdk///common/autoconf/toolchain.m4
045ef6
+++ openjdk///common/autoconf/toolchain.m4
045ef6
@@ -198,38 +198,22 @@
045ef6
   fi
045ef6
   BASIC_FIXUP_EXECUTABLE($1)
045ef6
   TEST_COMPILER="[$]$1"
045ef6
-  # Don't remove symbolic links on AIX because 'xlc_r' and 'xlC_r' may all be links
045ef6
-  # to 'xlc' but it is crucial that we invoke the compiler with the right name!
045ef6
-  if test "x$OPENJDK_BUILD_OS" != xaix; then
045ef6
-    AC_MSG_CHECKING([resolved symbolic links for $1])
045ef6
-    BASIC_REMOVE_SYMBOLIC_LINKS(TEST_COMPILER)
045ef6
-    AC_MSG_RESULT([$TEST_COMPILER])
045ef6
-  fi
045ef6
-  AC_MSG_CHECKING([if $1 is disguised ccache])
045ef6
 
045ef6
-  COMPILER_BASENAME=`$BASENAME "$TEST_COMPILER"`
045ef6
-  if test "x$COMPILER_BASENAME" = "xccache"; then
045ef6
-    AC_MSG_RESULT([yes, trying to find proper $COMPILER_NAME compiler])
045ef6
-    # We /usr/lib/ccache in the path, so cc is a symlink to /usr/bin/ccache.
045ef6
-    # We want to control ccache invocation ourselves, so ignore this cc and try
045ef6
-    # searching again.
045ef6
+  AC_MSG_CHECKING([resolved symbolic links for $1])
045ef6
+  SYMLINK_ORIGINAL="$TEST_COMPILER"
045ef6
+  BASIC_REMOVE_SYMBOLIC_LINKS(SYMLINK_ORIGINAL)
045ef6
+  if test "x$TEST_COMPILER" = "x$SYMLINK_ORIGINAL"; then
045ef6
+    AC_MSG_RESULT([no symlink])
045ef6
+  else
045ef6
+    AC_MSG_RESULT([$SYMLINK_ORIGINAL])
045ef6
 
045ef6
-    # Remove the path to the fake ccache cc from the PATH
045ef6
-    RETRY_COMPILER_SAVED_PATH="$PATH"
045ef6
-    COMPILER_DIRNAME=`$DIRNAME [$]$1`
045ef6
-    PATH="`$ECHO $PATH | $SED -e "s,$COMPILER_DIRNAME,,g" -e "s,::,:,g" -e "s,^:,,g"`"
045ef6
-
045ef6
-    # Try again looking for our compiler
045ef6
-    AC_CHECK_TOOLS(PROPER_COMPILER_$1, $3)
045ef6
-    BASIC_FIXUP_EXECUTABLE(PROPER_COMPILER_$1)
045ef6
-    PATH="$RETRY_COMPILER_SAVED_PATH"
045ef6
-
045ef6
-    AC_MSG_CHECKING([for resolved symbolic links for $1])
045ef6
-    BASIC_REMOVE_SYMBOLIC_LINKS(PROPER_COMPILER_$1)
045ef6
-    AC_MSG_RESULT([$PROPER_COMPILER_$1])
045ef6
-    $1="$PROPER_COMPILER_$1"
045ef6
-  else
045ef6
-    AC_MSG_RESULT([no, keeping $1])
045ef6
+    # We can't handle ccache by gcc wrappers, since we need to know if we're
045ef6
+    # using ccache. Instead ccache usage must be controlled by a configure option.
045ef6
+    COMPILER_BASENAME=`$BASENAME "$SYMLINK_ORIGINAL"`
045ef6
+    if test "x$COMPILER_BASENAME" = "xccache"; then
045ef6
+      AC_MSG_NOTICE([Please use --enable-ccache instead of providing a wrapped compiler.])
045ef6
+      AC_MSG_ERROR([$TEST_COMPILER is a symbolic link to ccache. This is not supported.])
045ef6
+    fi
045ef6
   fi
045ef6
 
045ef6
   TOOLCHAIN_EXTRACT_COMPILER_VERSION([$1], [$COMPILER_NAME])