Skip to content

Commit 382fe54

Browse files
sormurasjonathan-gibbons
authored andcommittedJun 10, 2022
7903206: Support MSYS2 for building jtreg on Windows
1 parent 4d06ab3 commit 382fe54

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed
 

‎make/Defs.gmk

+8-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ LD_LIBRARY_PATH=
3939

4040
#----------------------------------------------------------------------
4141
#
42-
# Support for Cygwin
42+
# Support for Cygwin and MSYS2 (which may identify as MSYS, MINGW32 or MINGW64 (the default))
4343

4444
SYSTEM_UNAME := $(shell uname)
4545

@@ -53,9 +53,15 @@ endif
5353

5454
ifneq (,$(findstring CYGWIN,$(SYSTEM_UNAME)))
5555
USING_CYGWIN = true
56+
USING_CYGWIN_OR_USING_MSYS = true
5657
endif
5758

58-
ifdef USING_CYGWIN
59+
ifneq (,$(findstring MSYS,$(SYSTEM_UNAME))$(findstring MINGW,$(SYSTEM_UNAME)))
60+
USING_MSYS = true
61+
USING_CYGWIN_OR_USING_MSYS = true
62+
endif
63+
64+
ifdef USING_CYGWIN_OR_USING_MSYS
5965
define FullPath
6066
$(shell cygpath -a -m $1 2> $(DEV_NULL))
6167
endef

‎make/build-support/build-common.sh

+7-3
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,13 @@ setup_shasum() {
8787
native_path() {
8888
check_arguments "${FUNCNAME}" 1 $#
8989

90-
if [ $CYGWIN -eq 1 ]; then echo $(cygpath -w $1); else echo "$1"; fi
90+
if [ $CYGWIN_OR_MSYS -eq 1 ]; then echo $(cygpath -w $1); else echo "$1"; fi
9191
}
9292

9393
mixed_path() {
9494
check_arguments "${FUNCNAME}" 1 $#
9595

96-
if [ $CYGWIN -eq 1 ]; then echo $(cygpath -m $1); else echo "$1"; fi
96+
if [ $CYGWIN_OR_MSYS -eq 1 ]; then echo $(cygpath -m $1); else echo "$1"; fi
9797
}
9898

9999
##
@@ -331,4 +331,8 @@ export ANT_ARCHIVE_URL_BASE="${ANT_ARCHIVE_URL_BASE:-https://archive.apache.org/
331331

332332
setup_shasum
333333

334-
case $(uname) in CYGWIN*) CYGWIN=1 ;; *) CYGWIN=0 ;; esac
334+
##
335+
# Support for Cygwin and MSYS2 (which may identify as MSYS, MINGW32 or MINGW64 (the default))
336+
#
337+
case $(uname) in CYGWIN*|MSYS*|MINGW*) CYGWIN_OR_MSYS=1 ;; *) CYGWIN_OR_MSYS=0 ;; esac
338+
info "CYGWIN_OR_MSYS=$CYGWIN_OR_MSYS"

‎make/build.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -926,7 +926,7 @@ make ANT="${ANT}" \
926926
JCOV_JAR="${JCOV_JAR}" \
927927
JCOV_LICENSE="${JCOV_LICENSE}" \
928928
JCOV_NETWORK_SAVER_JAR="${JCOV_NETWORK_SAVER_JAR}" \
929-
JDKHOME="${JAVA_HOME}" \
929+
JDKHOME="$(mixed_path ${JAVA_HOME})" \
930930
JTHARNESS_COPYRIGHT="${JTHARNESS_COPYRIGHT}" \
931931
JTHARNESS_LICENSE="${JTHARNESS_LICENSE}" \
932932
JUNIT_JAR="$(mixed_path "${JUNIT_JAR}")" \

0 commit comments

Comments
 (0)
Please sign in to comment.