8035725: Must keep microsoft VS_PATH on PATH after toolchain detection
authorihse
Tue, 25 Feb 2014 15:19:32 +0100
changeset 22724 072f729936a9
parent 22722 03797b5d2ba3
child 22725 c382bed20726
8035725: Must keep microsoft VS_PATH on PATH after toolchain detection Reviewed-by: erikj
common/autoconf/generated-configure.sh
common/autoconf/toolchain.m4
--- a/common/autoconf/generated-configure.sh	Mon Feb 24 13:29:26 2014 +0100
+++ b/common/autoconf/generated-configure.sh	Tue Feb 25 15:19:32 2014 +0100
@@ -4220,7 +4220,7 @@
 #CUSTOM_AUTOCONF_INCLUDE
 
 # Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1393244882
+DATE_WHEN_GENERATED=1393327380
 
 ###############################################################################
 #
@@ -26393,18 +26393,10 @@
   ORG_CXXFLAGS="$CXXFLAGS"
   ORG_OBJCFLAGS="$OBJCFLAGS"
 
-  # autoconf magic only relies on PATH, so update it if tools dir is specified
-  OLD_PATH="$PATH"
-
-  # For solaris we really need solaris tools, and not the GNU equivalent.
-  # The build tools on Solaris reside in /usr/ccs (C Compilation System),
-  # so add that to path before starting to probe.
-  # FIXME: This was originally only done for AS,NM,GNM,STRIP,MCS,OBJCOPY,OBJDUMP.
-  if test "x$OPENJDK_BUILD_OS" = xsolaris; then
-    PATH="/usr/ccs/bin:$PATH"
-  fi
-
   # On Windows, we need to detect the visual studio installation first.
+  # This will change the PATH, but we need to keep that new PATH even
+  # after toolchain detection is done, since the compiler (on x86) uses
+  # it for DLL resolution in runtime.
   if test "x$OPENJDK_BUILD_OS" = "xwindows" && test "x$TOOLCHAIN_TYPE" = "xmicrosoft"; then
 
   # Store path to cygwin link.exe to help excluding it when searching for
@@ -27215,6 +27207,17 @@
 
   fi
 
+  # autoconf magic only relies on PATH, so update it if tools dir is specified
+  OLD_PATH="$PATH"
+
+  # For solaris we really need solaris tools, and not the GNU equivalent.
+  # The build tools on Solaris reside in /usr/ccs (C Compilation System),
+  # so add that to path before starting to probe.
+  # FIXME: This was originally only done for AS,NM,GNM,STRIP,MCS,OBJCOPY,OBJDUMP.
+  if test "x$OPENJDK_BUILD_OS" = xsolaris; then
+    PATH="/usr/ccs/bin:$PATH"
+  fi
+
   # Finally add TOOLS_DIR at the beginning, to allow --with-tools-dir to
   # override all other locations.
   if test "x$TOOLS_DIR" != x; then
--- a/common/autoconf/toolchain.m4	Mon Feb 24 13:29:26 2014 +0100
+++ b/common/autoconf/toolchain.m4	Tue Feb 25 15:19:32 2014 +0100
@@ -164,6 +164,14 @@
   ORG_CXXFLAGS="$CXXFLAGS"
   ORG_OBJCFLAGS="$OBJCFLAGS"
 
+  # On Windows, we need to detect the visual studio installation first.
+  # This will change the PATH, but we need to keep that new PATH even 
+  # after toolchain detection is done, since the compiler (on x86) uses
+  # it for DLL resolution in runtime.
+  if test "x$OPENJDK_BUILD_OS" = "xwindows" && test "x$TOOLCHAIN_TYPE" = "xmicrosoft"; then
+    TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV
+  fi
+
   # autoconf magic only relies on PATH, so update it if tools dir is specified
   OLD_PATH="$PATH"
 
@@ -175,11 +183,6 @@
     PATH="/usr/ccs/bin:$PATH"
   fi
 
-  # On Windows, we need to detect the visual studio installation first.
-  if test "x$OPENJDK_BUILD_OS" = "xwindows" && test "x$TOOLCHAIN_TYPE" = "xmicrosoft"; then
-    TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV
-  fi
-
   # Finally add TOOLS_DIR at the beginning, to allow --with-tools-dir to 
   # override all other locations.
   if test "x$TOOLS_DIR" != x; then
@@ -663,7 +666,7 @@
   # Check for extra potential brokenness.
   if test  "x$TOOLCHAIN_TYPE" = xmicrosoft; then
     # On Windows, double-check that we got the right compiler.
-    CC_VERSION_OUTPUT=`$CC 2>&1 | $HEAD -n 1 | $TR -d '\r'`    
+    CC_VERSION_OUTPUT=`$CC 2>&1 | $HEAD -n 1 | $TR -d '\r'`
     COMPILER_CPU_TEST=`$ECHO $CC_VERSION_OUTPUT | $SED -n "s/^.* \(.*\)$/\1/p"`
     if test "x$OPENJDK_TARGET_CPU" = "xx86"; then
       if test "x$COMPILER_CPU_TEST" != "x80x86"; then