Applying diff3.txt from Andrew Luo JDK-8215445-branch
authorerikj
Wed, 19 Dec 2018 00:50:05 -0800
branchJDK-8215445-branch
changeset 57081 a55844323727
parent 57075 168830ded68a
child 57082 dc3a6c647672
Applying diff3.txt from Andrew Luo
doc/building.html
doc/building.md
make/autoconf/spec.gmk.in
make/autoconf/toolchain_windows.m4
--- a/doc/building.html	Mon Dec 17 09:35:15 2018 -0800
+++ b/doc/building.html	Wed Dec 19 00:50:05 2018 -0800
@@ -206,6 +206,7 @@
 <h4 id="windows-subsystem-for-linux-wsl">Windows Subsystem for Linux (WSL)</h4>
 <p>Only Windows 10 1803 or newer is supported due to a dependency on the wslpath utility and support for environment variable sharing through WSLENV.</p>
 <p>You may build both Windows and Linux binaries from WSL. To build Windows binaries, you must use a Windows boot JDK (located in a Windows-accessible directory). To build Linux binaries, you must use a Linux boot JDK. The default behavior is to build for Windows. To build for Linux, pass <code>--build=x86_64-unknown-linux-gnu</code> and <code>--host=x86_64-unknown-linux-gnu</code> to <code>configure</code>.</p>
+<p>If building Windows binaries, you must also have synced down the OpenJDK source code from Windows. This is because Windows executables (such as Visual Studio and the boot JDK) must be able to access the source code. Also, the directory where the OpenJDK source code is stored must be case-insensitive (either by setting the individual directory as case insensitive using fsutil, changing /etc/fstab to mount the drive as case-insensitive, or editing /etc/wsl.conf to mark all mounted Windows drives as case-insensitive).</p>
 <h4 id="cygwin">Cygwin</h4>
 <p>A functioning <a href="http://www.cygwin.com/">Cygwin</a> environment is thus required for building the JDK on Windows. If you have a 64-bit OS, we strongly recommend using the 64-bit version of Cygwin.</p>
 <p><strong>Note:</strong> Cygwin has a model of continuously updating all packages without any easy way to install or revert to a specific version of a package. This means that whenever you add or update a package in Cygwin, you might (inadvertently) update tools that are used by the JDK build process, and that can cause unexpected build problems.</p>
--- a/doc/building.md	Mon Dec 17 09:35:15 2018 -0800
+++ b/doc/building.md	Wed Dec 19 00:50:05 2018 -0800
@@ -197,6 +197,14 @@
 Windows. To build for Linux, pass `--build=x86_64-unknown-linux-gnu` and 
 `--host=x86_64-unknown-linux-gnu` to `configure`.
 
+If building Windows binaries, you must also have synced down the OpenJDK source code 
+from Windows. This is because Windows executables (such as Visual Studio and the boot
+JDK) must be able to access the source code. Also, the directory where the OpenJDK
+source code is stored must be case-insensitive (either by setting the individual
+directory as case insensitive using fsutil, changing /etc/fstab to mount the drive as
+case-insensitive, or editing /etc/wsl.conf to mark all mounted Windows drives as 
+case-insensitive).
+
 #### Cygwin
 
 A functioning [Cygwin](http://www.cygwin.com/) environment is thus required for
--- a/make/autoconf/spec.gmk.in	Mon Dec 17 09:35:15 2018 -0800
+++ b/make/autoconf/spec.gmk.in	Wed Dec 19 00:50:05 2018 -0800
@@ -123,7 +123,8 @@
   # On Windows, the Visual Studio toolchain needs the PATH to be adjusted
   # to include Visual Studio tools (this needs to be in cygwin/msys style).
   ifeq ($(OPENJDK_TARGET_OS_ENV), windows.wsl)
-    export FIXPATH_WSL:=@FIXPATH_WSL@
+    export FIXPATH_PATH:=@VS_PATH_WINDOWS@
+    export WSLENV:=$(WSLENV):FIXPATH_PATH:DEBUG_FIXPATH
   else
     export PATH:=@VS_PATH@
   endif
--- a/make/autoconf/toolchain_windows.m4	Mon Dec 17 09:35:15 2018 -0800
+++ b/make/autoconf/toolchain_windows.m4	Wed Dec 19 00:50:05 2018 -0800
@@ -389,24 +389,43 @@
       # In some cases, the VS_ENV_CMD will change directory, change back so
       # the set-vs-env.sh ends up in the right place.
       $ECHO 'cd %~dp0' >> $EXTRACT_VC_ENV_BAT_FILE
-      # These will end up something like:
-      # C:/CygWin/bin/bash -c 'echo VS_PATH=\"$PATH\" > localdevenv.sh
-      # The trailing space for everyone except PATH is no typo, but is needed due
-      # to trailing \ in the Windows paths. These will be stripped later.
-      # Trying pure CMD extract. This results in windows paths that need to
-      # be converted post extraction, but a simpler script.
-      $ECHO 'echo VS_PATH="%PATH%" > set-vs-env.sh' \
-          >> $EXTRACT_VC_ENV_BAT_FILE
-      $ECHO 'echo VS_INCLUDE="%INCLUDE% " >> set-vs-env.sh' \
-          >> $EXTRACT_VC_ENV_BAT_FILE
-      $ECHO 'echo VS_LIB="%LIB% " >> set-vs-env.sh' \
-          >> $EXTRACT_VC_ENV_BAT_FILE
-      $ECHO 'echo VCINSTALLDIR="%VCINSTALLDIR% " >> set-vs-env.sh' \
-          >> $EXTRACT_VC_ENV_BAT_FILE
-      $ECHO 'echo WindowsSdkDir="%WindowsSdkDir% " >> set-vs-env.sh' \
-          >> $EXTRACT_VC_ENV_BAT_FILE
-      $ECHO 'echo WINDOWSSDKDIR="%WINDOWSSDKDIR% " >> set-vs-env.sh' \
-          >> $EXTRACT_VC_ENV_BAT_FILE
+      if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.wsl"; then
+        # These will end up something like:
+        # echo VS_PATH=\"$PATH\" > set-vs-env.sh
+        # The trailing space for everyone except PATH is no typo, but is needed due
+        # to trailing \ in the Windows paths. These will be stripped later.
+        # Trying pure CMD extract. This results in windows paths that need to
+        # be converted post extraction, but a simpler script.
+        $ECHO 'echo VS_PATH="%PATH%" > set-vs-env.sh' \
+            >> $EXTRACT_VC_ENV_BAT_FILE
+        $ECHO 'echo VS_INCLUDE="%INCLUDE% " >> set-vs-env.sh' \
+            >> $EXTRACT_VC_ENV_BAT_FILE
+        $ECHO 'echo VS_LIB="%LIB% " >> set-vs-env.sh' \
+            >> $EXTRACT_VC_ENV_BAT_FILE
+        $ECHO 'echo VCINSTALLDIR="%VCINSTALLDIR% " >> set-vs-env.sh' \
+            >> $EXTRACT_VC_ENV_BAT_FILE
+        $ECHO 'echo WindowsSdkDir="%WindowsSdkDir% " >> set-vs-env.sh' \
+            >> $EXTRACT_VC_ENV_BAT_FILE
+        $ECHO 'echo WINDOWSSDKDIR="%WINDOWSSDKDIR% " >> set-vs-env.sh' \
+            >> $EXTRACT_VC_ENV_BAT_FILE
+      else
+        # These will end up something like:
+        # C:/CygWin/bin/bash -c 'echo VS_PATH=\"$PATH\" > localdevenv.sh
+        # The trailing space for everyone except PATH is no typo, but is needed due
+        # to trailing \ in the Windows paths. These will be stripped later.
+        $ECHO "$WINPATH_BASH -c 'echo VS_PATH="'\"$PATH\" > set-vs-env.sh' \
+            >> $EXTRACT_VC_ENV_BAT_FILE
+        $ECHO "$WINPATH_BASH -c 'echo VS_INCLUDE="'\"$INCLUDE\;$include \" >> set-vs-env.sh' \
+            >> $EXTRACT_VC_ENV_BAT_FILE
+        $ECHO "$WINPATH_BASH -c 'echo VS_LIB="'\"$LIB\;$lib \" >> set-vs-env.sh' \
+            >> $EXTRACT_VC_ENV_BAT_FILE
+        $ECHO "$WINPATH_BASH -c 'echo VCINSTALLDIR="'\"$VCINSTALLDIR \" >> set-vs-env.sh' \
+            >> $EXTRACT_VC_ENV_BAT_FILE
+        $ECHO "$WINPATH_BASH -c 'echo WindowsSdkDir="'\"$WindowsSdkDir \" >> set-vs-env.sh' \
+            >> $EXTRACT_VC_ENV_BAT_FILE
+        $ECHO "$WINPATH_BASH -c 'echo WINDOWSSDKDIR="'\"$WINDOWSSDKDIR \" >> set-vs-env.sh' \
+            >> $EXTRACT_VC_ENV_BAT_FILE
+      fi
 
       # Now execute the newly created bat file.
       # The | cat is to stop SetEnv.Cmd to mess with system colors on msys.