Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion make/autoconf/basic_tools.m4
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,21 @@ 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)

case "`uname -s 2>/dev/null || true`" in
*MINGW*|*MSYS*|*CYGWIN*|*NT*) HAVE_WINDOWS_ENV=yes ;;
*) HAVE_WINDOWS_ENV=no ;;
esac

if test "x${HAVE_WINDOWS_ENV}" = "xyes"; then
if test "x${SYSTEMROOT:-}" = "x"; then
AC_MSG_ERROR([Environment variable SYSTEMROOT is not set. Please set SYSTEMROOT (e.g. C:\Windows) before building on Windows.])
fi
fi

SYSTEM32_PATH=$($PATHTOOL -u "${SYSTEMROOT}/system32" 2>/dev/null)
UTIL_LOOKUP_PROGS(CMD, cmd.exe, $PATH:${SYSTEM32_PATH})
])

################################################################################
Expand Down
2 changes: 1 addition & 1 deletion make/autoconf/toolchain_microsoft.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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. :-(
Expand Down
10 changes: 7 additions & 3 deletions make/scripts/fixpath.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,10 @@ function setup() {
fi

if [[ -z ${DRIVEPREFIX+x} ]]; then
winroot="$($PATHTOOL -u c:/)"
DRIVEPREFIX="${winroot%/c/}"
drive_letter="${SYSTEMROOT%%:*}"
drive_letter_lower="$(echo "${drive_letter}" | tr 'A-Z' 'a-z')"
cyg_systemroot="$(${PATHTOOL} -u "${SYSTEMROOT}")"
DRIVEPREFIX="${cyg_systemroot%%/${drive_letter_lower}/*}"
else
if [[ $DRIVEPREFIX == "NONE" ]]; then
DRIVEPREFIX=""
Expand All @@ -88,7 +90,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
cyg_systemroot="$(${PATHTOOL} -u "${SYSTEMROOT}")"
CMD="${cyg_systemroot}/system32/cmd.exe"
fi

if [[ -z ${WINTEMP+x} ]]; then
Expand Down
13 changes: 10 additions & 3 deletions test/jdk/com/sun/jdi/JdbReadTwiceTest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,20 @@ if [ -z "$TESTCLASSES" ] ; then
fi

case `uname -s` in
*MINGW*|*MSYS*|*CYGWIN*|*NT*)
IS_WINDOWS=true
;;
Linux)
IS_WINDOWS=false

# Need this to convert to the /.automount/... form which
# is what jdb will report when it reads an init file.
echo TESTCLASSES=$TESTCLASSES
TESTCLASSES=`(cd $TESTCLASSES; /bin/pwd)`
echo TESTCLASSES=$TESTCLASSES
;;
*)
IS_WINDOWS=false
esac

# All output will go under this dir. We define HOME to
Expand Down Expand Up @@ -84,7 +91,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
Expand Down Expand Up @@ -177,7 +184,7 @@ mkFiles $HOME/.jdbrc $here/jdb.ini
clean


if [ ! -r c:/ ] ; then
if [ "${IS_WINDOWS}" != "true" ] ; then
# No symlinks on windows.
echo
echo "+++++++++++++++++++++++++++++++++++"
Expand All @@ -191,7 +198,7 @@ if [ ! -r c:/ ] ; then
fi


if [ ! -r c:/ ] ; then
if [ "${IS_WINDOWS}" != "true" ] ; then
# No symlinks on windows.
echo
echo "+++++++++++++++++++++++++++++++++++"
Expand Down
2 changes: 1 addition & 1 deletion test/jdk/java/awt/Dialog/FileDialogUIUpdate.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down