diff --git a/make/autoconf/basic_tools.m4 b/make/autoconf/basic_tools.m4 index 8e42f9205a454..beb58bd4c736d 100644 --- a/make/autoconf/basic_tools.m4 +++ b/make/autoconf/basic_tools.m4 @@ -56,8 +56,10 @@ AC_DEFUN_ONCE([BASIC_SETUP_FUNDAMENTAL_TOOLS], # Tools only needed on some platforms UTIL_LOOKUP_PROGS(LOCALE, locale) UTIL_LOOKUP_PROGS(PATHTOOL, cygpath wslpath) - UTIL_LOOKUP_PROGS(CMD, cmd.exe, $PATH:/cygdrive/c/windows/system32:/mnt/c/windows/system32:/c/windows/system32) UTIL_LOOKUP_PROGS(LSB_RELEASE, lsb_release) + + SYSTEM32_PATH=$($PATHTOOL -u "$SYSTEMROOT/system32" 2>/dev/null) + UTIL_LOOKUP_PROGS(CMD, cmd.exe, $PATH:$SYSTEM32_PATH) ]) ################################################################################ diff --git a/make/autoconf/toolchain_microsoft.m4 b/make/autoconf/toolchain_microsoft.m4 index f577cf1a2a1d6..6af344a48f61a 100644 --- a/make/autoconf/toolchain_microsoft.m4 +++ b/make/autoconf/toolchain_microsoft.m4 @@ -338,7 +338,7 @@ AC_DEFUN([TOOLCHAIN_EXTRACT_VISUAL_STUDIO_ENV], OLDPATH="$PATH" # Make sure we only capture additions to PATH needed by VS. # Clear out path, but need system dir present for vsvars cmd file to be able to run - export PATH=$WINENV_PREFIX/c/windows/system32 + export PATH=$($PATHTOOL -u "$SYSTEMROOT")/system32 # The "| cat" is to stop SetEnv.Cmd to mess with system colors on some systems # We can't pass -vcvars_ver=$VCVARS_VER here because cmd.exe eats all '=' # in bat file arguments. :-( diff --git a/make/scripts/fixpath.sh b/make/scripts/fixpath.sh index 6a524df4c680b..dcf67ce7115d0 100644 --- a/make/scripts/fixpath.sh +++ b/make/scripts/fixpath.sh @@ -88,7 +88,9 @@ function setup() { fi if [[ -z ${CMD+x} ]]; then - CMD="$DRIVEPREFIX/c/windows/system32/cmd.exe" + # Use SYSTEMROOT to find Windows directory regardless of drive letter + systemroot_unix="$($PATHTOOL -u "$SYSTEMROOT")" + CMD="$systemroot_unix/system32/cmd.exe" fi if [[ -z ${WINTEMP+x} ]]; then diff --git a/test/jdk/com/sun/jdi/JdbReadTwiceTest.sh b/test/jdk/com/sun/jdi/JdbReadTwiceTest.sh index 5902abe50ad69..f6894da7bcbd1 100644 --- a/test/jdk/com/sun/jdi/JdbReadTwiceTest.sh +++ b/test/jdk/com/sun/jdi/JdbReadTwiceTest.sh @@ -43,6 +43,10 @@ if [ -z "$TESTCLASSES" ] ; then exit 1 fi +# Detect if running on Windows +IS_WINDOWS=false +case `uname -s` in CYGWIN*|MINGW*|MSYS*) IS_WINDOWS=true ;; esac + case `uname -s` in Linux) # Need this to convert to the /.automount/... form which @@ -84,7 +88,7 @@ failIfNot() # $1 is the expected number of occurances of $2 in the jdb output. count=$1 shift - if [ -r c:/ ] ; then + if [ "$IS_WINDOWS" = "true" ] ; then sed -e 's@\\@/@g' $tmpResult > $tmpResult.1 mv $tmpResult.1 $tmpResult fi @@ -177,7 +181,7 @@ mkFiles $HOME/.jdbrc $here/jdb.ini clean -if [ ! -r c:/ ] ; then +if [ "$IS_WINDOWS" != "true" ] ; then # No symlinks on windows. echo echo "+++++++++++++++++++++++++++++++++++" @@ -191,7 +195,7 @@ if [ ! -r c:/ ] ; then fi -if [ ! -r c:/ ] ; then +if [ "$IS_WINDOWS" != "true" ] ; then # No symlinks on windows. echo echo "+++++++++++++++++++++++++++++++++++" diff --git a/test/jdk/java/awt/Dialog/FileDialogUIUpdate.java b/test/jdk/java/awt/Dialog/FileDialogUIUpdate.java index f97d947991b43..b479b748d8502 100644 --- a/test/jdk/java/awt/Dialog/FileDialogUIUpdate.java +++ b/test/jdk/java/awt/Dialog/FileDialogUIUpdate.java @@ -70,7 +70,7 @@ public FileDialogUIUpdate() { Button showButton = new Button("Show FileDialog"); setLayout(new BorderLayout()); - fd.setDirectory("c:/"); + fd.setDirectory(System.getenv("SYSTEMROOT")); showButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { fd.setVisible(true);