Hi,

Yes, I've signed an OCA (I've also contributed changes to other groups before, 
but not build).

Okay, I have fixed the autconf-config* files.

Unfortunately, as Erik mentioned, there is no (supported/reliable) way to 
access the WSL root / from /cygdrive/c, or even from Windows (there is a way in 
reality, however, it's not documented/supported by Microsoft and the location 
changes depending on the distribution/store app id/etc. so best to avoid using 
it.)  I can see if we can print information about versions however.

Right, WSL requires the .exe extension when accessing an executable, as this is 
Linux behavior (Linux doesn't have extensions for executables generally, but 
that's besides the point)...

I fixed BASIC_REMOVE_SYMBOLIC_LINKS - a leftover from another approach I tried.

For the redirect, redirect doesn't seem to be working when you have a bash 
shell input piped into a Win32 executable reading from stdin using WINAPI.  I'm 
not sure this is supported by the OpenJDK, more likely it might be a Microsoft 
issue.  For some reason, the stdin would be cut off (or I would see an 
exception thrown from available0 in FileInputStream).  I personally didn't see 
any harm in changing piping into input/output files (since all the 
inputs/outputs are files anyways!).

I fixed TOOLCHAIN_FIND_VISUAL_STUDIO_BAT_FILE - this was also from a few things 
I had tried earlier.

I disabled the $BASH code because to call bash from Win32 the correct way is 
either "wsl /bin/bash" or just "bash".  $BASH correctly evaluates to /bin/bash, 
however BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH is implemented in terms of 
wslpath, which can only convert a path under /mnt/c back to a Windows path.  
Other files under /, for example /bin and /bin/bash, cannot be converted to a 
Windwos path.

The escaping changes I made because it wasn't working.  This does work with 
spaces in the path on WSL.  I don't have a Cygwin environment to check, perhaps 
someone else here could help out?  Otherwise I can refactor that code to use 
that echo statement for WSL and use the old echo statement for Cygwin.

I have fixed the extraneous debug print statement.

As for Windows vs Linux output - you can still force it to build a Linux output 
binary.  You just need to run configure as follows:

./configure --with-boot-jdk=/home/andrew/jdk-11.0.1 
----build=x86_64-unknown-linux-gnu --host=x86_64-unknown-linux-gnu

However, there is a behavior change: now, on WSL, by default, Windows binaries 
are targeted.  Previously, Linux binaries were the default target.  (Also, you 
can run configure twice and two sets of configurations will be generated, you 
can actually build both images by setting CONF=linux-x86_64-server-release or 
CONF=windows-x86_64-server-release)

As for BASIC_MAKE_WINDOWS_SPACE_SAFE_CYGWIN, wslpath does not support 8.3 
names.  But perhaps the symlink workaround is acceptable for now and we can 
handle the 8.3 naming on WSL in a separate change, what do you guys think - 
personally I think what we have (assuming Cygwin still works) is at least a MVP 
for WSL devs.  Anyways, at least some people may have to use the symlink 
workaround if they've disabled 8.3 on NTFS.

Attaching my latest patch (generated using powershell, so to properly import 
you may need to convert UTF16 -> UTF8 and change CRLF to just LF, hg tends to 
be picky)...

Thanks,

-Andrew


-----Original Message-----
From: Erik Joelsson <erik.joels...@oracle.com> 
Sent: Monday, December 10, 2018 9:19 AM
To: Magnus Ihse Bursie <magnus.ihse.bur...@oracle.com>; Andrew Luo 
<andrewluotechnolog...@outlook.com>; build-dev@openjdk.java.net
Subject: Re: [PATCH] Support for building using WSL (Windows Subsystem for 
Linux) on Windows

Hello,

On 2018-12-10 02:06, Magnus Ihse Bursie wrote:
>
> On 2018-12-09 20:11, Andrew Luo wrote:
>>
>> One important thing to note is that the WSL build targets Windows. It 
>> is also possible to use WSL to target itself (a WSL Linux binary) or 
>> even other distributions of Linux.  I have not implemented that yet, 
>> but I think I could do that as a next step if you guys think it would 
>> be useful (at least I think it would be useful, then you can test 
>> your changes for both Windows and Linux on one system...).
> I think if you just run configure ordinarily, it will behave like a 
> Linux system and build the Linux image right out-of-the-box..? But 
> then again, maybe that behavior is negated by your changes to 
> config.guess and platform.m4. So maybe we need a flag to configure to 
> control this...

It is indeed possible to build a pure Linux binary in WSL today so I think it 
would be bad to lose that functionality. We certainly need a configure flag to 
control if a Windows or Linux build should be produced in this case. This is 
something I have been thinking about when I started tackling WSL builds some 
time ago but didn't really come up with a good solution. I didn't have the time 
to spend to really see it through though, so it's nice to see that someone else 
is trying.

We could simply use the --with-openjdk-target, that would perhaps be the 
cleanest, but it's also a bit cumbersome. We may need some simplification 
similar to how we have --with-target-bits=32/64 as a simple switch (e.g. 
--with-wsl-target=linux/windows?).

>>
>> Steps in case you want to try this out:
>>
>>
>> 1.       Due to autotools not handling spaces well, you have to 
>> create symlinks in Windows that will allow you to access Windows Kits 
>> and the VC++ compiler without spaces in the path:
>>
>> mklink /D C:\VS "C:\Program Files (x86)\Microsoft Visual Studio"
>>
>> mklink /D C:\WindowsKits "C:\Program Files (x86)\Windows Kits"
> That's a bit odd. We encounter spaces in paths on Windows normally on 
> cygwin and msys, and that works fine. I suspect there is something 
> missing with the rewriting functions. What we do, is that we rewrite 
> paths with spaces to paths without spaces, by using the old 8+3 
> compatibility names, so we get something like 
> "/cygdrive/c/progra~1/microso~2" from "C:\Program Files 
> (x86)\Microsoft Visual Studio". Have a look at 
> BASIC_MAKE_WINDOWS_SPACE_SAFE_CYGWIN. I think you need a WSL version 
> of that, as well as of BASIC_FIXUP_PATH_CYGWIN. (And you need to call 
> the BASIC_FIXUP_PATH_WSL from BASIC_FIXUP_PATH.)
>
> If you get these parts right, I don't think you will need any of the 
> special instructions below to build. In fact, as long as C:\... is 
> properly remapped, the normal VS autodetect code should work just 
> fine. And perhaps you can even revert some of the scarier changes in 
> toolchain_windows.m4.
>
I definitely agree with Magnus that to make WSL truly supported, the 
path handling macros need to be replicated. I'm not sure how to solve it 
properly. The root path Magnus is asking for is not defined in WSL. In 
fact, from windows you cannot reach any path in the WSL filesystem. Only 
Windows drives are mounted in WSL, not the other way around. To convert 
to old style paths in Cygwin we rely on the cygpath utility. There is a 
wslpath utility but does it support old style path conversions? If not, 
maybe it's possible to write such a tool in CMD/PowerShell?

/Erik


>> 2.       wsl must be started from a Windows Developer command 
>> prompt.  To ensure the correct environment variables are propagated 
>> from Windows to WSL, you can run the following commands:
>>
>> set WSLENV=INCLUDE/l:LIBPATH/l
>>
>> 3.       Start wsl (bash):
>>
>> wsl
>>
>> 4.       After starting bash you must set your compiler variables to 
>> explicitly point to the correct tools:
>>
>> export 
>> AR=/mnt/c/VS/2017/Enterprise/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64/lib.exe
>>
>> export 
>> CC=/mnt/c/VS/2017/Enterprise/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64/cl.exe
>>
>> export 
>> CXX=/mnt/c/VS/2017/Enterprise/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64/cl.exe
>>
>> export 
>> LD=/mnt/c/VS/2017/Enterprise/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64/link.exe
>>
>> export RC=/mnt/c/WindowsKits/10/bin/10.0.17763.0/x64/rc.exe
>>
>> export MT=/mnt/c/WindowsKits/10/bin/10.0.17763.0/x64/mt.exe
>>
>> export 
>> DUMPBIN=/mnt/c/VS/2017/Enterprise/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64/dumpbin.exe
>>
>> 5.       Run configure:
>>
>> ./configure 
>> --with-boot-jdk=/mnt/c/Users/Andrew/Downloads/openjdk-11.0.1_windows-x64_bin/jdk-11.0.1
>>  
>> --with-tools-dir="C:\VS\2017\Enterprise\VC\Auxiliary" 
>> --with-ucrt-dll-dir="/mnt/c/WindowsKits/10/Redist/ucrt/DLLs/x64"
>>
>> 6.       Run make
>>
>> I've tested make with the default target as well as "make images"
>>
>> Let me know if you have any feedback/comments.
>>
>> Thanks,
>>
>> -Andrew
>>
>
ÿþdiff -r 4bef1957a1d8 make/Images.gmk

--- a/make/Images.gmk     Thu Nov 22 
10:15:32 2018 -0800

+++ b/make/Images.gmk     Mon Dec 10 
21:17:00 2018 -0800

@@ -99,7 +99,7 @@

      )

         ifeq ($(BUILD_CDS_ARCHIVE), 
true)

        $(call LogWarn, Creating CDS 
archive for jdk image)

-       $(JDK_IMAGE_DIR)/bin/java 
-Xshare:dump -Xmx128M -Xms128M 
$(LOG_INFO)

+       
$(JDK_IMAGE_DIR)/bin/java$(EXE_SUFFIX) 
-Xshare:dump -Xmx128M -Xms128M 
$(LOG_INFO)

         endif

      $(TOUCH) $@

 

@@ -114,7 +114,7 @@

      )

         ifeq ($(BUILD_CDS_ARCHIVE), 
true)

        $(call LogWarn, Creating CDS 
archive for jre image)

-       $(JRE_IMAGE_DIR)/bin/java 
-Xshare:dump -Xmx128M -Xms128M 
$(LOG_INFO)

+       
$(JRE_IMAGE_DIR)/bin/java$(EXE_SUFFIX) 
-Xshare:dump -Xmx128M -Xms128M 
$(LOG_INFO)

         endif

      $(TOUCH) $@

 

diff -r 4bef1957a1d8 
make/autoconf/basics.m4

--- a/make/autoconf/basics.m4     Thu Nov 
22 10:15:32 2018 -0800

+++ b/make/autoconf/basics.m4     Mon Dec 
10 21:17:00 2018 -0800

@@ -607,6 +607,7 @@

 

   # These are not required on all 
platforms

   BASIC_PATH_PROGS(CYGPATH, cygpath)

+  BASIC_PATH_PROGS(WSLPATH, wslpath)

   BASIC_PATH_PROGS(DF, df)

   BASIC_PATH_PROGS(CPIO, [cpio 
bsdcpio])

   BASIC_PATH_PROGS(NICE, nice)

@@ -634,8 +635,10 @@

     BASIC_CHECK_PATHS_WINDOWS

   else

     PATH_SEP=":"

+     EXECUTABLE_SUFFIX=""

   fi

   AC_SUBST(PATH_SEP)

+  AC_SUBST(EXECUTABLE_SUFFIX)

 

   # We get the top-level directory 
from the supporting wrappers.

   AC_MSG_CHECKING([for top-level 
directory])

@@ -980,6 +983,8 @@

             MAKE_EXPECTED_ENV='cygwin'

           elif test 
"x$OPENJDK_BUILD_OS_ENV" = 
"xwindows.msys"; then

             MAKE_EXPECTED_ENV='msys'

+          elif test 
"x$OPENJDK_BUILD_OS_ENV" = 
"xwindows.wsl"; then

+            
MAKE_EXPECTED_ENV='x86_64-pc-linux-gnu'

           else

             AC_MSG_ERROR([Unknown 
Windows environment])

           fi

diff -r 4bef1957a1d8 
make/autoconf/basics_windows.m4

--- a/make/autoconf/basics_windows.m4     
Thu Nov 22 10:15:32 2018 -0800

+++ b/make/autoconf/basics_windows.m4     
Mon Dec 10 21:17:00 2018 -0800

@@ -32,6 +32,9 @@

   elif test "x$OPENJDK_BUILD_OS_ENV" = 
"xwindows.msys"; then

     unix_path=`$ECHO "$windows_path" | 
$SED -e 's,^\\(.\\):,/\\1,g' -e 
's,\\\\,/,g'`

     $1="$unix_path"

+  elif test "x$OPENJDK_BUILD_OS_ENV" = 
"xwindows.wsl"; then

+    unix_path=`$WSLPATH -u 
"$windows_path"`

+    $1="$unix_path"

   fi

 ])

 

@@ -44,6 +47,9 @@

   elif test "x$OPENJDK_BUILD_OS_ENV" = 
"xwindows.msys"; then

     windows_path=`cmd //c echo 
$unix_path`

     $1="$windows_path"

+  elif test "x$OPENJDK_BUILD_OS_ENV" = 
"xwindows.wsl"; then

+    windows_path=`$WSLPATH -m 
"$unix_path"`

+    $1="$windows_path"

   fi

 ])

 

@@ -339,6 +345,7 @@

     if test "x$test_cygdrive_prefix" = 
x; then

       AC_MSG_ERROR([Your cygdrive 
prefix is not /cygdrive. This is 
currently not supported. Change with 
mount -c.])

     fi

+     EXECUTABLE_SUFFIX=""

   elif test "x$OPENJDK_BUILD_OS_ENV" = 
"xwindows.msys"; then

     AC_MSG_CHECKING([msys release])

     MSYS_VERSION=`$UNAME -r`

@@ -353,8 +360,11 @@

     
BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(MSYS_ROOT_PATH)

     AC_MSG_RESULT([$MSYS_ROOT_PATH])

     
WINDOWS_ENV_ROOT_PATH="$MSYS_ROOT_PATH"

+     EXECUTABLE_SUFFIX=""

+  elif test "x$OPENJDK_BUILD_OS_ENV" = 
"xwindows.wsl"; then

+     EXECUTABLE_SUFFIX=".exe"

   else

-    AC_MSG_ERROR([Unknown Windows 
environment. Neither cygwin nor msys 
was detected.])

+    AC_MSG_ERROR([Unknown Windows 
environment. Neither cygwin, msys, nor 
wsl was detected.])

   fi

 

   # Test if windows or unix 
(cygwin/msys) find is first in path.

@@ -395,6 +405,8 @@

           | tr ' ' '\n' | $GREP '^/./' 
| $SORT | $UNIQ`

       fixpath_argument_list=`echo 
$all_unique_prefixes  | tr ' ' '@'`

       FIXPATH="$FIXPATH_BIN 
-m$fixpath_argument_list"

+     elif test "x$OPENJDK_BUILD_OS_ENV" 
= xwindows.wsl; then

+      FIXPATH="$FIXPATH_BIN -w"

     fi

     FIXPATH_SRC_W="$FIXPATH_SRC"

     FIXPATH_BIN_W="$FIXPATH_BIN"

diff -r 4bef1957a1d8 
make/autoconf/boot-jdk.m4

--- a/make/autoconf/boot-jdk.m4 Thu Nov 
22 10:15:32 2018 -0800

+++ b/make/autoconf/boot-jdk.m4 Mon Dec 
10 21:17:00 2018 -0800

@@ -63,18 +63,18 @@

     # If previous step claimed to have 
found a JDK, check it to see if it 
seems to be valid.

     if test "x$BOOT_JDK_FOUND" = 
xmaybe; then

       # Do we have a bin/java?

-      if test ! -x 
"$BOOT_JDK/bin/java"; then

+      if test ! -x 
"$BOOT_JDK/bin/java$EXECUTABLE_SUFFIX"; 
then

         AC_MSG_NOTICE([Potential Boot 
JDK found at $BOOT_JDK did not contain 
bin/java; ignoring])

         BOOT_JDK_FOUND=no

       else

         # Do we have a bin/javac?

-        if test ! -x 
"$BOOT_JDK/bin/javac"; then

+        if test ! -x 
"$BOOT_JDK/bin/javac$EXECUTABLE_SUFFIX";
 then

           AC_MSG_NOTICE([Potential 
Boot JDK found at $BOOT_JDK did not 
contain bin/javac; ignoring])

           AC_MSG_NOTICE([(This might 
be an JRE instead of an JDK)])

           BOOT_JDK_FOUND=no

         else

           # Oh, this is looking good! 
We probably have found a proper JDK. Is 
it the correct version?

-          
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" 
$USER_BOOT_JDK_OPTIONS -version 2>&1 | 
$HEAD -n 1`

+          
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java$EXECUTABLE_SUFFIX"
 $USER_BOOT_JDK_OPTIONS -version 2>&1 | 
$HEAD -n 1`

           if [ [[ "$BOOT_JDK_VERSION" 
=~ "Picked up" ]] ]; then

             AC_MSG_NOTICE([You have 
_JAVA_OPTIONS or JAVA_TOOL_OPTIONS set. 
This can mess up the build. Please use 
--with-boot-jdk-jvmargs instead.])

             AC_MSG_NOTICE([Java 
reports: "$BOOT_JDK_VERSION".])

@@ -101,7 +101,7 @@

             AC_MSG_CHECKING([for Boot 
JDK])

             AC_MSG_RESULT([$BOOT_JDK])

             AC_MSG_CHECKING([Boot JDK 
version])

-            
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" 
$USER_BOOT_JDK_OPTIONS -version 2>&1 | 
$TR '\n\r' '  '`

+            
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java$EXECUTABLE_SUFFIX"
 $USER_BOOT_JDK_OPTIONS -version 2>&1 | 
$TR '\n\r' '  '`

             
AC_MSG_RESULT([$BOOT_JDK_VERSION])

           fi # end check jdk version

         fi # end check javac

@@ -335,11 +335,11 @@

   AC_SUBST(BOOT_JDK)

 

   # Setup tools from the Boot JDK.

-  BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAVA, 
java)

-  BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAVAC, 
javac)

-  
BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAVADOC, 
javadoc)

-  BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAR, 
jar)

-  
BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JARSIGNER,
 jarsigner)

+  BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAVA, 
java$EXECUTABLE_SUFFIX)

+  BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAVAC, 
javac$EXECUTABLE_SUFFIX)

+  
BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAVADOC, 
javadoc$EXECUTABLE_SUFFIX)

+  BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAR, 
jar$EXECUTABLE_SUFFIX)

+  
BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JARSIGNER,
 jarsigner$EXECUTABLE_SUFFIX)

 

   # Finally, set some other options...

 

diff -r 4bef1957a1d8 
make/autoconf/build-aux/config.guess

--- 
a/make/autoconf/build-aux/config.guess   
Thu Nov 22 10:15:32 2018 -0800

+++ 
b/make/autoconf/build-aux/config.guess   
Mon Dec 10 21:17:00 2018 -0800

@@ -60,6 +60,15 @@

   esac

 fi

 

+# Test and fix wsl

+echo $OUT | grep 
x86_64-unknown-linux-gnu > /dev/null 2> 
/dev/null

+if test $? = 0; then

+  uname -r | grep Microsoft > 
/dev/null 2> /dev/null

+  if test $? = 0; then

+    OUT="x86_64-pc-wsl"

+  fi

+fi

+

 # Test and fix architecture string on 
AIX

 # On AIX 'config.guess' returns 
'powerpc' as architecture but 'powerpc' 
is

 # implicitely handled as 32-bit 
architecture in 'platform.m4' so we 
check

diff -r 4bef1957a1d8 
make/autoconf/build-aux/config.sub

--- 
a/make/autoconf/build-aux/config.sub       
Thu Nov 22 10:15:32 2018 -0800

+++ 
b/make/autoconf/build-aux/config.sub       
Mon Dec 10 21:17:00 2018 -0800

@@ -29,7 +29,13 @@

 

 DIR=`dirname $0`

 

-# First, filter out everything that 
doesn't begin with "aarch64-"

+# Allow wsl

+if echo $* | grep x86_64-pc-wsl 
>/dev/null ; then

+    echo $*

+    exit

+fi

+

+# Filter out everything that doesn't 
begin with "aarch64-"

 if ! echo $* | grep '^aarch64-' 
>/dev/null ; then

     . $DIR/autoconf-config.sub "$@"

     # autoconf-config.sub exits, so we 
never reach here, but just in

diff -r 4bef1957a1d8 
make/autoconf/platform.m4

--- a/make/autoconf/platform.m4 Thu Nov 
22 10:15:32 2018 -0800

+++ b/make/autoconf/platform.m4 Mon Dec 
10 21:17:00 2018 -0800

@@ -188,6 +188,10 @@

       VAR_OS=windows

       VAR_OS_ENV=windows.cygwin

       ;;

+    *wsl*)

+      VAR_OS=windows

+      VAR_OS_ENV=windows.wsl

+      ;;

     *mingw*)

       VAR_OS=windows

       VAR_OS_ENV=windows.msys

diff -r 4bef1957a1d8 
make/autoconf/toolchain.m4

--- a/make/autoconf/toolchain.m4       Thu 
Nov 22 10:15:32 2018 -0800

+++ b/make/autoconf/toolchain.m4       Mon 
Dec 10 21:17:00 2018 -0800

@@ -281,13 +281,13 @@

 

   TOOLCHAIN_CC_BINARY_clang="clang"

   TOOLCHAIN_CC_BINARY_gcc="gcc"

-  TOOLCHAIN_CC_BINARY_microsoft="cl"

+  
TOOLCHAIN_CC_BINARY_microsoft="cl$EXECUTABLE_SUFFIX"

   TOOLCHAIN_CC_BINARY_solstudio="cc"

   TOOLCHAIN_CC_BINARY_xlc="xlc_r"

 

   TOOLCHAIN_CXX_BINARY_clang="clang++"

   TOOLCHAIN_CXX_BINARY_gcc="g++"

-  TOOLCHAIN_CXX_BINARY_microsoft="cl"

+  
TOOLCHAIN_CXX_BINARY_microsoft="cl$EXECUTABLE_SUFFIX"

   TOOLCHAIN_CXX_BINARY_solstudio="CC"

   TOOLCHAIN_CXX_BINARY_xlc="xlC_r"

 

@@ -430,7 +430,7 @@

     # There is no specific version 
flag, but all output starts with a 
version string.

     # First line typically looks 
something like:

     # Microsoft (R) 32-bit C/C++ 
Optimizing Compiler Version 
16.00.40219.01 for 80x86

-    COMPILER_VERSION_OUTPUT=`$COMPILER 
2>&1 | $HEAD -n 1 | $TR -d '\r'`

+    
COMPILER_VERSION_OUTPUT=`"$COMPILER" 
2>&1 | $HEAD -n 1 | $TR -d '\r'`

     # Check that this is likely to be 
Microsoft CL.EXE.

     $ECHO "$COMPILER_VERSION_OUTPUT" | 
$GREP "Microsoft.*Compiler" > /dev/null

     if test $? -ne 0; then

diff -r 4bef1957a1d8 
make/autoconf/toolchain_windows.m4

--- 
a/make/autoconf/toolchain_windows.m4       
Thu Nov 22 10:15:32 2018 -0800

+++ 
b/make/autoconf/toolchain_windows.m4       
Mon Dec 10 21:17:00 2018 -0800

@@ -115,7 +115,7 @@

         
VCVARSFILES="vc/bin/vcvars32.bat 
vc/auxiliary/build/vcvars32.bat"

       else

         
VCVARSFILES="vc/bin/amd64/vcvars64.bat 
vc/bin/x86_amd64/vcvarsx86_amd64.bat \

-            
vc/auxiliary/build/vcvarsx86_amd64.bat 
vc/auxiliary/build/vcvars64.bat"

+            
VC/Auxiliary/Build/vcvarsx86_amd64.bat 
VC/Auxiliary/Build/vcvars64.bat"

       fi

 

       for VCVARSFILE in $VCVARSFILES; 
do

@@ -222,7 +222,6 @@

       [C:/Program 
Files/$VS_INSTALL_DIR], [well-known 
name])

   
TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([${VS_VERSION}],

       [C:/Program Files 
(x86)/$VS_INSTALL_DIR], [well-known 
name])

-

   if test "x$SDK_INSTALL_DIR" != x; 
then

     if test "x$ProgramW6432" != x; 
then

       
TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT([${VS_VERSION}],

@@ -372,8 +371,13 @@

       # Instead create a shell script 
which will set the relevant variables 
when run.

       WINPATH_VS_ENV_CMD="$VS_ENV_CMD"

       
BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH([WINPATH_VS_ENV_CMD])

-      WINPATH_BASH="$BASH"

-      
BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH([WINPATH_BASH])

+       

+      if test "x$OPENJDK_BUILD_OS_ENV" 
= "xwindows.wsl"; then

+        WINPATH_BASH="bash"

+      else

+        WINPATH_BASH="$BASH"

+        
BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH([WINPATH_BASH])

+      fi

 

       # Generate a DOS batch file 
which runs $VS_ENV_CMD, and then 
creates a shell

       # script (executable by bash) 
that will setup the important 
variables.

@@ -381,7 +385,7 @@

       $ECHO "@echo off" >  
$EXTRACT_VC_ENV_BAT_FILE

       # This will end up something 
like:

       # call 
C:/progra~2/micros~2.0/vc/bin/amd64/vcvars64.bat

-      $ECHO "call $WINPATH_VS_ENV_CMD 
$VS_ENV_ARGS" >> 
$EXTRACT_VC_ENV_BAT_FILE

+      $ECHO "call 
\"$WINPATH_VS_ENV_CMD\" $VS_ENV_ARGS" 
>> $EXTRACT_VC_ENV_BAT_FILE

       # 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

@@ -389,28 +393,28 @@

       # 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' \

+      $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' \

+      $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' \

+      $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' \

+      $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' \

+      $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' \

+      $ECHO "$WINPATH_BASH"' -c "echo 
WINDOWSSDKDIR=\\\"\"$WINDOWSSDKDIR 
\"\\\" >> set-vs-env.sh"' \

           >> $EXTRACT_VC_ENV_BAT_FILE

 

       # Now execute the newly created 
bat file.

       # The | cat is to stop 
SetEnv.Cmd to mess with system colors 
on msys.

       # Change directory so we don't 
need to mess with Windows paths in 
redirects.

       cd $VS_ENV_TMP_DIR

-      cmd /c extract-vs-env.bat | $CAT

+      cmd$EXECUTABLE_SUFFIX /c 
extract-vs-env.bat | $CAT

       cd $CURDIR

 

       if test ! -s 
$VS_ENV_TMP_DIR/set-vs-env.sh; then

-        AC_MSG_NOTICE([Could not 
succesfully extract the envionment 
variables needed for the VS setup.])

+        AC_MSG_NOTICE([Could not 
succesfully extract the environment 
variables needed for the VS setup.])

         AC_MSG_NOTICE([Try setting 
--with-tools-dir to the VC/bin 
directory within the VS installation])

         AC_MSG_NOTICE([or run 
"bash.exe -l" from a VS command prompt 
and then run configure from there.])

         AC_MSG_ERROR([Cannot 
continue])

@@ -693,7 +697,7 @@

   if test "x$USE_UCRT" = "xtrue"; then

     AC_MSG_CHECKING([for UCRT DLL 
dir])

     if test "x$with_ucrt_dll_dir" != 
x; then

-      if test -z "$(ls -d 
"$with_ucrt_dll_dir/*.dll" 2> 
/dev/null)"; then

+      if test -z "$(ls -d 
$with_ucrt_dll_dir/*.dll 2> 
/dev/null)"; then

         AC_MSG_RESULT([no])

         AC_MSG_ERROR([Could not find 
any dlls in $with_ucrt_dll_dir])

       else

diff -r 4bef1957a1d8 
make/gendata/Gendata-java.base.gmk

--- 
a/make/gendata/Gendata-java.base.gmk       
Thu Nov 22 10:15:32 2018 -0800

+++ 
b/make/gendata/Gendata-java.base.gmk       
Mon Dec 10 21:17:00 2018 -0800

@@ -55,7 +55,7 @@

 $(GENDATA_CURDATA): 
$(TOPDIR)/make/data/currency/CurrencyData.properties
 $(BUILD_TOOLS_JDK)

      $(call MakeDir, $(@D))

      $(RM) $@

-     $(TOOL_GENERATECURRENCYDATA) -o 
$@.tmp < $<

+     $(TOOL_GENERATECURRENCYDATA) -o 
$@.tmp -i $<

      $(MV) $@.tmp $@

      $(CHMOD) 444 $@

 

diff -r 4bef1957a1d8 
make/gensrc/GensrcBuffer.gmk

--- a/make/gensrc/GensrcBuffer.gmk   Thu 
Nov 22 10:15:32 2018 -0800

+++ b/make/gensrc/GensrcBuffer.gmk   Mon 
Dec 10 21:17:00 2018 -0800

@@ -230,7 +230,8 @@

   endif

 

   $$($1_DST): $$($1_DEP) 
$(GENSRC_BUFFER_DST)/_the.buffer.dir

-     $(TOOL_SPP) < $$($1_SRC) > 
$$($1_OUT).tmp \

+     $(RM) $$($1_OUT).tmp

+     $(TOOL_SPP) -i$$($1_SRC) 
-o$$($1_OUT).tmp \

          -K$$($1_type) \

          -K$$($1_category) \

          -K$$($1_streams) \

@@ -260,12 +261,12 @@

         ifeq ($$($1_BIN), 1)

        $(SED) -e '/#BIN/,$$$$d' < 
$$($1_OUT) > $$($1_DST).tmp

        $(RM) $$($1_OUT)

-       $$($1_char_CMD) < $$($1_SRC_BIN) 
>> $$($1_DST).tmp

-       $$($1_short_CMD) < $$($1_SRC_BIN) 
>> $$($1_DST).tmp

-       $$($1_int_CMD) < $$($1_SRC_BIN) 
>> $$($1_DST).tmp

-       $$($1_long_CMD) < $$($1_SRC_BIN) 
>> $$($1_DST).tmp

-       $$($1_float_CMD) < $$($1_SRC_BIN) 
>> $$($1_DST).tmp

-       $$($1_double_CMD) < 
$$($1_SRC_BIN) >> $$($1_DST).tmp

+       $$($1_char_CMD) -i$$($1_SRC_BIN) 
-o$$($1_DST).tmp

+       $$($1_short_CMD) -i$$($1_SRC_BIN) 
-o$$($1_DST).tmp

+       $$($1_int_CMD) -i$$($1_SRC_BIN) 
-o$$($1_DST).tmp

+       $$($1_long_CMD) -i$$($1_SRC_BIN) 
-o$$($1_DST).tmp

+       $$($1_float_CMD) -i$$($1_SRC_BIN) 
-o$$($1_DST).tmp

+       $$($1_double_CMD) 
-i$$($1_SRC_BIN) -o$$($1_DST).tmp

        $(PRINTF) "}\n" >> $$($1_DST).tmp

        mv $$($1_DST).tmp $$($1_DST)

         endif

diff -r 4bef1957a1d8 
make/gensrc/GensrcCharsetCoder.gmk

--- 
a/make/gensrc/GensrcCharsetCoder.gmk       
Thu Nov 22 10:15:32 2018 -0800

+++ 
b/make/gensrc/GensrcCharsetCoder.gmk       
Mon Dec 10 21:17:00 2018 -0800

@@ -36,7 +36,7 @@

 
$(GENSRC_CHARSETCODER_DST)/CharsetDecoder.java:
 $(GENSRC_CHARSETCODER_TEMPLATE)

      $(call MakeTargetDir)

      $(RM) $@.tmp

-     $(TOOL_SPP) < $< >$@.tmp \

+     $(TOOL_SPP) -i$< -o$@.tmp \

          -Kdecoder \

          -DA='A' \

          -Da='a' \

@@ -71,7 +71,7 @@

 
$(GENSRC_CHARSETCODER_DST)/CharsetEncoder.java:
 $(GENSRC_CHARSETCODER_TEMPLATE)

      $(call MakeTargetDir)

      $(RM) $@.tmp

-     $(TOOL_SPP) < $< >$@.tmp \

+     $(TOOL_SPP) -i$< -o$@.tmp \

          -Kencoder \

          -DA='An' \

          -Da='an' \

diff -r 4bef1957a1d8 
make/gensrc/GensrcVarHandles.gmk

--- a/make/gensrc/GensrcVarHandles.gmk   
Thu Nov 22 10:15:32 2018 -0800

+++ b/make/gensrc/GensrcVarHandles.gmk   
Mon Dec 10 21:17:00 2018 -0800

@@ -59,8 +59,9 @@

        $$(eval $1_type := $$$$(shell 
$(TR) '[:upper:]' '[:lower:]' <<< 
$$$$($1_Type)))

         endif

      $$(call MakeDir, $$(@D))

+     $(RM) $$@

      $(TOOL_SPP) -nel -K$$($1_type) 
-Dtype=$$($1_type) -DType=$$($1_Type) \

-         $$($1_ARGS) < $$< > $$@

+         $$($1_ARGS) -i$$< -o$$@

 

   GENSRC_VARHANDLES += $$($1_FILENAME)

 endef

@@ -147,10 +148,11 @@

 

   $$($1_FILENAME): 
$(VARHANDLES_SRC_DIR)/X-VarHandleByteArrayView.java.template
 $(BUILD_TOOLS_JDK)

      $$(call MakeDir, $$(@D))

+     $(RM) $$@

      $(TOOL_SPP) -nel -K$$($1_type) \

          -Dtype=$$($1_type) 
-DType=$$($1_Type) 
-DBoxType=$$($1_BoxType) \

          -DrawType=$$($1_rawType) 
-DRawType=$$($1_RawType) 
-DRawBoxType=$$($1_RawBoxType) \

-         $$($1_ARGS) < $$< > $$@

+         $$($1_ARGS) -i$$< -o$$@

 

   GENSRC_VARHANDLES += $$($1_FILENAME)

 endef

diff -r 4bef1957a1d8 
make/jdk/src/classes/build/tools/generatecurrencydata/GenerateCurrencyData.java

--- 
a/make/jdk/src/classes/build/tools/generatecurrencydata/GenerateCurrencyData.java
     Thu Nov 22 10:15:32 2018 -0800

+++ 
b/make/jdk/src/classes/build/tools/generatecurrencydata/GenerateCurrencyData.java
     Mon Dec 10 21:17:00 2018 -0800

@@ -28,7 +28,9 @@

 import java.io.IOException;

 import java.io.FileNotFoundException;

 import java.io.DataOutputStream;

+import java.io.FileInputStream;

 import java.io.FileOutputStream;

+import java.io.InputStream;

 import java.text.SimpleDateFormat;

 import java.util.Date;

 import java.util.HashMap;

@@ -134,19 +136,44 @@

     private static String 
currenciesWithMinorUnitsUndefined;

 

     public static void main(String[] 
args) {

-

+         InputStream in = System.in;

         // Look for "-o 
outputfilename" option

-        if ( args.length == 2 && 
args[0].equals("-o") ) {

-            try {

-                out = new 
DataOutputStream(new 
FileOutputStream(args[1]));

-            } catch ( 
FileNotFoundException e ) {

-                
System.err.println("Error: " + 
e.getMessage());

-                
e.printStackTrace(System.err);

-                System.exit(1);

-            }

-        } else {

-            System.err.println("Error: 
Illegal arg count");

-            System.exit(1);

+        for (int n = 0; n < 
args.length; ++n) {

+            if (args[n].equals("-o")) 
{

+                          ++n;

+                          if (n >= args.length) {

+                                 
System.err.println("Error: Invalid 
argument format");

+                                 System.exit(1);

+                          }

+                          try {

+                                 out = new 
DataOutputStream(new 
FileOutputStream(args[n]));

+                          } catch ( 
FileNotFoundException e ) {

+                                 
System.err.println("Error: " + 
e.getMessage());

+                                 
e.printStackTrace(System.err);

+                                 System.exit(1);

+                          }

+                   } else if 
(args[n].equals("-i")) {

+                          ++n;

+                          if (n >= args.length) {

+                                 
System.err.println("Error: Invalid 
argument format");

+                                 System.exit(1);

+                          }

+                          try {

+                                 in = new 
FileInputStream(args[n]);

+                          } catch ( 
FileNotFoundException e ) {

+                                 
System.err.println("Error: " + 
e.getMessage());

+                                 
e.printStackTrace(System.err);

+                                 System.exit(1);

+                          }

+                   } else {

+                          
System.err.println("Error: Invalid 
argument " + args[n]);

+                          System.exit(1);

+                   }

+        }

+

+        if (out == null) {

+                   System.err.println("Error: 
Invalid argument format");

+                   System.exit(1);

         }

 

         format = new 
SimpleDateFormat("yyyy-MM-dd-HH-mm-ss", 
Locale.US);

@@ -154,7 +181,7 @@

         format.setLenient(false);

 

         try {

-            readInput();

+            readInput(in);

             
buildMainAndSpecialCaseTables();

             buildOtherTables();

             writeOutput();

@@ -167,9 +194,9 @@

         }

     }

 

-    private static void readInput() 
throws IOException {

+    private static void 
readInput(InputStream in) throws 
IOException {

         currencyData = new 
Properties();

-        currencyData.load(System.in);

+        currencyData.load(in);

 

         // initialize other lookup 
strings

         formatVersion = (String) 
currencyData.get("formatVersion");

diff -r 4bef1957a1d8 
make/jdk/src/classes/build/tools/spp/Spp.java

--- 
a/make/jdk/src/classes/build/tools/spp/Spp.java
 Thu Nov 22 10:15:32 2018 -0800

+++ 
b/make/jdk/src/classes/build/tools/spp/Spp.java
 Mon Dec 10 21:17:00 2018 -0800

@@ -25,6 +25,8 @@

 

 package build.tools.spp;

 

+import java.io.FileInputStream;

+import java.io.FileOutputStream;

 import java.util.*;

 import java.util.regex.*;

 

@@ -69,6 +71,8 @@

         Set<String> keys = new 
HashSet<>();

         boolean be = false;

         boolean el = true;

+            String inputFile = null;

+            String outputFile = null;

 

         for (String arg:args) {

             if (arg.startsWith("-D")) 
{

@@ -76,6 +80,10 @@

                 
vars.put(arg.substring(2, 
i),arg.substring(i+1));

             } else if 
(arg.startsWith("-K")) {

                 
keys.add(arg.substring(2));

+            } else if 
(arg.startsWith("-i")) {

+                inputFile = 
arg.substring(2);

+            } else if 
(arg.startsWith("-o")) {

+                outputFile = 
arg.substring(2);

             } else if 
("-be".equals(arg)) {

                 be = true;

             } else if 
("-nel".equals(arg)) {

@@ -87,11 +95,11 @@

         }

 

         StringBuffer out = new 
StringBuffer();

-        new Spp().spp(new 
Scanner(System.in),

+        new Spp().spp(new Scanner(new 
FileInputStream(inputFile)),

                       out, "",

                       keys, vars, be, 
el,

                       false);

-        
System.out.print(out.toString());

+        new 
FileOutputStream(outputFile, 
true).write(out.toString().getBytes());

     }

 

     static final String LNSEP = 
System.getProperty("line.separator");

diff -r 4bef1957a1d8 
make/src/native/fixpath.c

--- a/make/src/native/fixpath.c Thu Nov 
22 10:15:32 2018 -0800

+++ b/make/src/native/fixpath.c Mon Dec 
10 21:17:00 2018 -0800

@@ -24,6 +24,7 @@

  */

 

 #include <Windows.h>

+#include <stdbool.h>

 #include <io.h>

 #include <stdio.h>

 #include <string.h>

@@ -53,25 +54,16 @@

 }

 

 /*

- * Test if pos points to /cygdrive/_/ 
where _ can

+ * Test if pos points to /prefix/_/ 
where _ can

  * be any character.

  */

-int is_cygdrive_here(int pos, char 
const *in, int len)

+int is_prefix_here(int pos, char const 
*in, int len, const char* prefix)

 {

-  // Length of /cygdrive/c/ is 12

-  if (pos+12 > len) return 0;

-  if (in[pos+11]=='/' &&

-      in[pos+9]=='/' &&

-      in[pos+8]=='e' &&

-      in[pos+7]=='v' &&

-      in[pos+6]=='i' &&

-      in[pos+5]=='r' &&

-      in[pos+4]=='d' &&

-      in[pos+3]=='g' &&

-      in[pos+2]=='y' &&

-      in[pos+1]=='c' &&

-      in[pos+0]=='/') {

-    return 1;

+  // Length of c/ is 2

+  int prefix_size = strlen(prefix);

+  if (pos+prefix_size+2 > len) return 
0;

+  if (in[pos+prefix_size+1]=='/') {

+    return strncmp(in + pos, prefix, 
prefix_size) == 0;

   }

   return 0;

 }

@@ -93,7 +85,7 @@

   }

 

   for (i = 0, j = 0; i<len;) {

-    if (is_cygdrive_here(i, in, len)) 
{

+    if (is_prefix_here(i, in, len, 
"/cygdrive/")) {

       out[j++] = in[i+10];

       out[j++] = ':';

       i+=11;

@@ -196,7 +188,39 @@

   return str;

 }

 

+/*

+ * Replace /mnt/_/ with _:/

+ * Works in place since drive letter 
is always

+ * shorter than /mnt/

+ */

+char *replace_cygdrive_wsl(char const 
*in)

+{

+  size_t len = strlen(in);

+  char *out = (char*) malloc(len+1);

+  int i,j;

+

+  if (len < 7) {

+    memmove(out, in, len + 1);

+    return out;

+  }

+

+  for (i = 0, j = 0; i<len;) {

+    if (is_prefix_here(i, in, len, 
"/mnt/")) {

+      out[j++] = in[i+5];

+      out[j++] = ':';

+      i+=6;

+    } else {

+      out[j] = in[i];

+      i++;

+      j++;

+    }

+  }

+  out[j] = '\0';

+  return out;

+}

+

 char*(*replace_cygdrive)(char const 
*in) = NULL;

+bool debug_fixpath = false;

 

 char *files_to_delete[1024];

 int num_files_to_delete = 0;

@@ -250,11 +274,11 @@

     append(&buffer, &buflen, &used, 
block, blocklen);

   }

   buffer[used] = 0;

-  if (getenv("DEBUG_FIXPATH") != NULL) 
{

+  if (debug_fixpath) {

     fprintf(stderr, "fixpath input 
from @-file %s: %s\n", &in[1], buffer);

   }

   fixed = replace_cygdrive(buffer);

-  if (getenv("DEBUG_FIXPATH") != NULL) 
{

+  if (debug_fixpath) {

     fprintf(stderr, "fixpath converted 
to @-file %s is: %s\n", name, fixed);

   }

   fwrite(fixed, strlen(fixed), 1, 
atout);

@@ -363,27 +387,34 @@

     BOOL processInheritHandles = TRUE;

     BOOL waitForChild = TRUE;

 

-    if (argc<2 || argv[1][0] != '-' || 
(argv[1][1] != 'c' && argv[1][1] != 
'm')) {

-        fprintf(stderr, "Usage: 
fixpath -c|m<path@path@...> [--detach] 
/cygdrive/c/WINDOWS/notepad.exe 
[/cygdrive/c/x/test.txt|@/cygdrive/c/x/atfile]\n");

+     debug_fixpath = 
(getenv("DEBUG_FIXPATH") != NULL);

+

+    if (argc<2 || argv[1][0] != '-' || 
(argv[1][1] != 'c' && argv[1][1] != 'm' 
&& argv[1][1] != 'w')) {

+        fprintf(stderr, "Usage: 
fixpath -c|m|w<path@path@...> 
[--detach] 
/cygdrive/c/WINDOWS/notepad.exe 
[/cygdrive/c/x/test.txt|@/cygdrive/c/x/atfile]\n");

         exit(0);

     }

 

-    if (getenv("DEBUG_FIXPATH") != 
NULL) {

+    if (debug_fixpath) {

       char const * cmdline = 
GetCommandLine();

       fprintf(stderr, "fixpath input 
line >%s<\n", strstr(cmdline, 
argv[1]));

     }

 

     if (argv[1][1] == 'c' && 
argv[1][2] == '\0') {

-      if (getenv("DEBUG_FIXPATH") != 
NULL) {

+      if (debug_fixpath) {

         fprintf(stderr, "fixpath using 
cygwin mode\n");

       }

       replace_cygdrive = 
replace_cygdrive_cygwin;

     } else if (argv[1][1] == 'm') {

-      if (getenv("DEBUG_FIXPATH") != 
NULL) {

+      if (debug_fixpath) {

         fprintf(stderr, "fixpath using 
msys mode, with path list: %s\n", 
&argv[1][2]);

       }

       setup_msys_path_list(argv[1]);

       replace_cygdrive = 
replace_cygdrive_msys;

+     } else if (argv[1][1] == 'w') {

+      if (debug_fixpath) {

+        fprintf(stderr, "fixpath using 
wsl mode, with path list: %s\n", 
&argv[1][2]);

+      }

+      replace_cygdrive = 
replace_cygdrive_wsl;

     } else {

       fprintf(stderr, "fixpath Unknown 
mode: %s\n", argv[1]);

       exit(-1);

@@ -391,7 +422,7 @@

 

     if (argv[2][0] == '-') {

       if (strcmp(argv[2], "--detach") 
== 0) {

-        if (getenv("DEBUG_FIXPATH") != 
NULL) {

+        if (debug_fixpath) {

           fprintf(stderr, "fixpath in 
detached mode\n");

         }

         processFlags |= 
DETACHED_PROCESS;

@@ -417,7 +448,7 @@

         var[var_len - 1] = '\0';

         strupr(var);

 

-        if (getenv("DEBUG_FIXPATH") != 
NULL) {

+        if (debug_fixpath) {

           fprintf(stderr, "fixpath 
setting var >%s< to >%s<\n", var, val);

         }

 

@@ -480,12 +511,12 @@

     }

     *current = '\0';

 

-    if (getenv("DEBUG_FIXPATH") != 
NULL) {

+    if (debug_fixpath) {

       fprintf(stderr, "fixpath 
converted line >%s<\n", line);

     }

 

     if (cmd == argc) {

-       if (getenv("DEBUG_FIXPATH") != 
NULL) {

+       if (debug_fixpath) {

          fprintf(stderr, "fixpath no 
command provided!\n");

        }

        exit(0);

@@ -518,7 +549,7 @@

       WaitForSingleObject(pi.hProcess, 
INFINITE);

       GetExitCodeProcess(pi.hProcess, 
&exitCode);

 

-      if (getenv("DEBUG_FIXPATH") != 
NULL) {

+      if (debug_fixpath) {

         for (i=0; 
i<num_files_to_delete; ++i) {

           fprintf(stderr, "fixpath Not 
deleting temporary file %s\n",

                   files_to_delete[i]);

@@ -530,13 +561,13 @@

       }

 

       if (exitCode != 0) {

-        if (getenv("DEBUG_FIXPATH") != 
NULL) {

+        if (debug_fixpath) {

           fprintf(stderr, "fixpath 
exit code %d\n",

                   exitCode);

         }

       }

     } else {

-      if (getenv("DEBUG_FIXPATH") != 
NULL) {

+      if (debug_fixpath) {

         fprintf(stderr, "fixpath Not 
waiting for child process");

       }

     }

Reply via email to