8248526: configure script failed on WSL in May 2020 update

Reviewed-by: ihse
This commit is contained in:
Yasumasa Suenaga 2020-07-01 07:23:48 +09:00
parent 545d56dd42
commit f5673586b7
3 changed files with 14 additions and 6 deletions

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2020, 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
@ -150,10 +150,10 @@ AC_DEFUN_ONCE([BASIC_COMPILE_FIXPATH],
fi
FIXPATH_SRC_W="$FIXPATH_SRC"
FIXPATH_BIN_W="$FIXPATH_BIN"
UTIL_REWRITE_AS_WINDOWS_MIXED_PATH([FIXPATH_SRC_W])
UTIL_REWRITE_AS_WINDOWS_MIXED_PATH([FIXPATH_BIN_W])
$RM -rf $FIXPATH_BIN $FIXPATH_DIR
$MKDIR -p $FIXPATH_DIR $CONFIGURESUPPORT_OUTPUTDIR/bin
UTIL_REWRITE_AS_WINDOWS_MIXED_PATH([FIXPATH_SRC_W])
UTIL_REWRITE_AS_WINDOWS_MIXED_PATH([FIXPATH_BIN_W])
cd $FIXPATH_DIR
$CC $FIXPATH_SRC_W -Fe$FIXPATH_BIN_W > $FIXPATH_DIR/fixpath1.log 2>&1
cd $CONFIGURE_START_DIR

View File

@ -52,7 +52,15 @@ AC_DEFUN([UTIL_REWRITE_AS_WINDOWS_MIXED_PATH],
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"`
windows_path=`$WSLPATH -m "$unix_path" 2>/dev/null`
if test $? -ne 0; then
dir=`dirname "$unix_path"`
base=`basename "$unix_path"`
windows_path=`$WSLPATH -m "$dir"`/"$base"
if test $? -ne 0; then
AC_MSG_ERROR([Cannot convert \"$unix_path\" to Windows path])
fi
fi
$1="$windows_path"
fi
])

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2020, 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
@ -32,7 +32,7 @@
void report_error(char const * msg)
{
LPVOID lpMsgBuf;
LPTSTR lpMsgBuf;
DWORD dw = GetLastError();
FormatMessage(