From a68887e1f1d72f1feedaaf3ae6ee536c27bfe751 Mon Sep 17 00:00:00 2001 From: Frank Wagner Date: Fri, 28 Feb 2025 19:37:33 +0000 Subject: [PATCH] windows: Fixed MSYS detection in CCCL. Fixed a path mapping problem (slash replaced by path) with current msys versions. cccl assumes that MACHTYPE contains "-msys" on msys and then configures slashes to '-' to avoid path mapping problems with slashes. However, at least in the current MSYS version, MACHTYPE reports as cygwin. A better way to detect MSYS is to use the MSYSTEM variable. I'm assuming that this check has been failing for a while, but not causing cccl to fail, but in current MSYS versions the path mapping logic has changed. See also https://github.com/swig/cccl/issues/20 Signed-off-by: Frank Wagner Acked-by: Mike Pattrick Signed-off-by: Alin Gabriel Serdean --- build-aux/cccl | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/build-aux/cccl b/build-aux/cccl index e2426fb3e..855d24c6c 100644 --- a/build-aux/cccl +++ b/build-aux/cccl @@ -33,14 +33,22 @@ EOF exit $1 } -case $MACHTYPE in - *-msys) - slash="-" - ;; - *) - slash="/" - ;; -esac + + +# Check for MSYS which now reports itself as cygwin in MACHTYPE +if [[ -n "$MSYSTEM" ]]; then + slash="-" +else + # fallback to old behavior + case $MACHTYPE in + *-msys) + slash="-" + ;; + *) + slash="/" + ;; + esac +fi # prog specifies the program that should be run (cl.exe or link.exe) # We'll assume cl to start out prog=cl