Fix the debugger tests with MSYS2/MinGW64.

These were failing because debugger expects Windows-style paths in the
test_mdbrc file, but it was being generated with Unix-style paths. A
similar problem was recently fixed for MSVC, this change extends that
fix to also work for MSYS2/MinGW64.

configure.ac:
    Define a new configuration variable, FIX_PATH_FOR_WINDOWS, that expands
    to the command used to do path conversion in Unix-like environments on
    Windows. (The previous fix for MSVC used FIX_PATH_FOR_CC to do this,
    but the MinGW64 port of GCC does use Unix-style paths so that cannot
    be used here.)

scripts/Mmake.vars.in:
    Add a new mmake variable, FIX_PATH_FOR_WINDOWS.

scripts/Mmakefile:
    Use FIX_PATH_FOR_WINDOWS when creating the test_mdbrc file.
This commit is contained in:
Julien Fischer
2023-07-26 21:24:28 +10:00
parent c2624c6951
commit 460a11ec3d
3 changed files with 23 additions and 1 deletions

View File

@@ -1160,6 +1160,7 @@ if test "$ac_microsoft" = "yes" ; then
USING_MICROSOFT_CL_COMPILER="yes"
FIX_PATH_FOR_CC="$CYGPATH"
FIX_PATH_FOR_WINDOWS="$CYGPATH"
# MS doesn't use a ranlib.
RANLIB="echo"
@@ -1216,6 +1217,12 @@ else
USING_MICROSOFT_CL_COMPILER="no"
FIX_PATH_FOR_CC=echo
FIX_PATH_FOR_WINDOWS=echo
case "$host" in
*mingw*)
FIX_PATH_FOR_WINDOWS="$CYGPATH"
;;
esac
AC_PROG_RANLIB
RANLIBFLAGS=""
@@ -1258,6 +1265,7 @@ AC_SUBST(LINK_LIB)
AC_SUBST(LINK_LIB_SUFFIX)
AC_SUBST(LINK_OPT_SEP)
AC_SUBST(FIX_PATH_FOR_CC)
AC_SUBST(FIX_PATH_FOR_WINDOWS)
AC_SUBST(CYGPATH)
#-----------------------------------------------------------------------------#

View File

@@ -253,6 +253,19 @@ JAVA_INTERPRETER = @JAVA_INTERPRETER@
JAR = @JAR@
JAR_CREATE_FLAGS = cf
#-----------------------------------------------------------------------------#
#
# Stuff which is specific to Windows.
#
# On Unix-like environments on Windows (e.g. MSYS2, Cygwin) this is a command
# that converts Unix-style paths to (mixed) Windows-style paths.
# This is separate from the other FIX_PATH_FOR_* variables since there are
# places (e.g. scripts/test_mdbrc with MSYS2/MinGW64 or MSVC) where we *must*
# do path conversion regardless of what kind of paths the C compiler accepts.
#
FIX_PATH_FOR_WINDOWS = @FIX_PATH_FOR_WINDOWS@
#-----------------------------------------------------------------------------#
#
# Stuff related to linking (for the C back-end).

View File

@@ -2,6 +2,7 @@
# vim: ts=8 sw=8 noexpandtab ft=make
#-----------------------------------------------------------------------------#
# Copyright (C) 1996-2009, 2011 The University of Melbourne.
# Copyright (C) 2013, 2015, 2017-2018, 2020, 2022-2023 The Mercury team.
# This file may only be copied under the terms of the GNU General
# Public License - see the file COPYING in the Mercury distribution.
#-----------------------------------------------------------------------------#
@@ -113,7 +114,7 @@ CSHARP_WRAPPER_SCRIPTS = \
test_mdbrc: mdbrc.in mdbrc
@echo making test_mdbrc
@ABS_MERCURY_DIR=`(cd $(MERCURY_DIR); /bin/pwd)` ; \
ABS_MERCURY_DIR=`$(FIX_PATH_FOR_CC) $${ABS_MERCURY_DIR}` ; \
ABS_MERCURY_DIR=`$(FIX_PATH_FOR_WINDOWS) $${ABS_MERCURY_DIR}` ; \
sed \
-e "s,@DEFAULT_MERCURY_DEBUGGER_DOC@,$${ABS_MERCURY_DIR}/doc/mdb_doc," \
-e "s,@DEFAULT_MERCURY_DEBUGGER_INIT_DIR@,$${ABS_MERCURY_DIR}/scripts," \