diff --git a/configure.ac b/configure.ac index c4590a71b..8323940f1 100644 --- a/configure.ac +++ b/configure.ac @@ -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) #-----------------------------------------------------------------------------# diff --git a/scripts/Mmake.vars.in b/scripts/Mmake.vars.in index b2536f47f..f06d3f56c 100644 --- a/scripts/Mmake.vars.in +++ b/scripts/Mmake.vars.in @@ -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). diff --git a/scripts/Mmakefile b/scripts/Mmakefile index 3fd7ecc5b..049fff4c4 100644 --- a/scripts/Mmakefile +++ b/scripts/Mmakefile @@ -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," \