1.1 --- a/common/autoconf/toolchain.m4 Thu Apr 05 07:59:52 2018 -0700 1.2 +++ b/common/autoconf/toolchain.m4 Thu Apr 05 08:14:51 2018 -0700 1.3 @@ -217,6 +217,14 @@ 1.4 ORG_CXXFLAGS="$CXXFLAGS" 1.5 ORG_OBJCFLAGS="$OBJCFLAGS" 1.6 1.7 + # On Windows, we need to detect the visual studio installation first. 1.8 + # This will change the PATH, but we need to keep that new PATH even 1.9 + # after toolchain detection is done, since the compiler (on x86) uses 1.10 + # it for DLL resolution in runtime. 1.11 + if test "x$OPENJDK_BUILD_OS" = "xwindows" && test "x$TOOLCHAIN_TYPE" = "xmicrosoft"; then 1.12 + TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV 1.13 + fi 1.14 + 1.15 # autoconf magic only relies on PATH, so update it if tools dir is specified 1.16 OLD_PATH="$PATH" 1.17 1.18 @@ -309,11 +317,6 @@ 1.19 PATH="/usr/ccs/bin:$PATH" 1.20 fi 1.21 1.22 - # On Windows, we need to detect the visual studio installation first. 1.23 - if test "x$OPENJDK_BUILD_OS" = "xwindows" && test "x$TOOLCHAIN_TYPE" = "xmicrosoft"; then 1.24 - TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV 1.25 - fi 1.26 - 1.27 # Finally add TOOLS_DIR at the beginning, to allow --with-tools-dir to 1.28 # override all other locations. 1.29 if test "x$TOOLS_DIR" != x; then