8287724: Fix various issues with msys2

Reviewed-by: erikj
This commit is contained in:
Magnus Ihse Bursie 2022-06-02 12:49:35 +00:00
Родитель 6ff2d89ea1
Коммит bddef71518
3 изменённых файлов: 31 добавлений и 15 удалений

Просмотреть файл

@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@ -126,16 +126,18 @@ AC_DEFUN([BOOTJDK_DO_CHECK],
AC_DEFUN([BOOTJDK_CHECK_ARGUMENTS],
[
if test "x$with_boot_jdk" != x; then
if test -d "$with_boot_jdk"; then
BOOT_JDK=$with_boot_jdk
BOOT_JDK_ARG="$with_boot_jdk"
UTIL_FIXUP_PATH(BOOT_JDK_ARG)
if test -d "$BOOT_JDK_ARG"; then
BOOT_JDK=$BOOT_JDK_ARG
BOOT_JDK_FOUND=maybe
elif test -f "$with_boot_jdk"; then
case "$with_boot_jdk" in
elif test -f "$BOOT_JDK_ARG"; then
case "$BOOT_JDK_ARG" in
*.tar.gz )
BOOT_JDK_SUPPORT_DIR=$CONFIGURESUPPORT_OUTPUTDIR/boot-jdk
$RM -rf $BOOT_JDK_SUPPORT_DIR
$MKDIR -p $BOOT_JDK_SUPPORT_DIR
$GUNZIP -c $with_boot_jdk | $TAR xf - -C $BOOT_JDK_SUPPORT_DIR
$GUNZIP -c $BOOT_JDK_ARG | $TAR xf - -C $BOOT_JDK_SUPPORT_DIR
# Try to find javac to determine BOOT_JDK path
BOOT_JDK_JAVAC_PATH=`$FIND $BOOT_JDK_SUPPORT_DIR | $GREP "/bin/javac"`

Просмотреть файл

@ -218,7 +218,7 @@ AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_OS],
VAR_OS=windows
VAR_OS_ENV=windows.wsl
;;
*msys*)
*msys* | *mingw*)
VAR_OS=windows
VAR_OS_ENV=windows.msys2
;;

Просмотреть файл

@ -1,6 +1,6 @@
#!/bin/bash
#
# Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@ -28,6 +28,14 @@
# available, or extract values automatically from the environment if missing.
# This is robust, but slower.
function setup() {
# Make regexp tests case insensitive
shopt -s nocasematch
# Prohibit msys2 from meddling with paths
export MSYS2_ARG_CONV_EXCL="*"
# Make sure WSL gets a copy of the path
export WSLENV=PATH/l
while getopts "e:p:r:t:c:qmi" opt; do
case "$opt" in
e) PATHTOOL="$OPTARG" ;;
@ -87,13 +95,6 @@ function setup() {
wintemp_win="$($CMD /q /c echo %TEMP% 2>/dev/null | tr -d \\n\\r)"
WINTEMP="$($PATHTOOL -u "$wintemp_win")"
fi
# Make regexp tests case insensitive
shopt -s nocasematch
# Prohibit msys2 from meddling with paths
export MSYS2_ARG_CONV_EXCL="*"
# Make sure WSL gets a copy of the path
export WSLENV=PATH/l
}
# Cleanup handling
@ -299,6 +300,19 @@ function convert_path() {
if [[ $arg =~ ^([^/]*|-[^:=]*[:=]|.*file://|/[a-zA-Z:]{1,3}:?)($DRIVEPREFIX/)([a-z])(/[^/]+.*$) ]] ; then
prefix="${BASH_REMATCH[1]}"
winpath="${BASH_REMATCH[3]}:${BASH_REMATCH[4]}"
# If the thing in its entirety points to an existing path, use that instead of thinking
# we have a prefix. This can only happen if the top-level directory has a single-letter name.
if [[ ${#prefix} -eq 2 && "${prefix:0:1}" == "/" ]]; then
possiblepath="${BASH_REMATCH[1]}/${BASH_REMATCH[3]}${BASH_REMATCH[4]}"
if [[ -e "$possiblepath" || -e "$(dirname $possiblepath)" || -e "$(echo $possiblepath | cut -d / -f 1-5)" ]] ; then
prefix=
drivepart="${possiblepath:1:1}"
pathpart="${possiblepath:2}"
winpath="$drivepart:$pathpart"
fi
fi
# Change slash to backslash (or vice versa if mixed mode)
if [[ $MIXEDMODE != true ]]; then
winpath="${winpath//'/'/'\'}"