[Git][ghc/ghc][wip/fix-mingw-distro-toolchain] autoconf: normalize paths of some build-time dependencies on Windows

Cheng Shao (@TerrorJack) gitlab at gitlab.haskell.org
Mon Jun 3 08:58:34 UTC 2024



Cheng Shao pushed to branch wip/fix-mingw-distro-toolchain at Glasgow Haskell Compiler / GHC


Commits:
5926c86d by Cheng Shao at 2024-06-03T10:55:41+02:00
autoconf: normalize paths of some build-time dependencies on Windows

This commit applies path normalization via cygpath -m to some
build-time dependencies on Windows. Without this logic, the
/clang64/bin prefixed msys2-style paths cause the build to fail with
--enable-distro-toolchain.

- - - - -


3 changed files:

- configure.ac
- m4/fp_find_nm.m4
- m4/fp_prog_ar_args.m4


Changes:

=====================================
configure.ac
=====================================
@@ -314,6 +314,8 @@ else
         AC_CHECK_TARGET_TOOL([WindresCmd],[windres])
         AC_CHECK_TARGET_TOOL([OBJDUMP],[objdump])
 
+        WindresCmd="$(cygpath -m $WindresCmd)"
+
         if test "$Genlib" != ""; then
             GenlibCmd="$(cygpath -m $Genlib)"
         fi
@@ -464,7 +466,12 @@ case $HostOS_CPP in
     ;;
 esac
 
-ObjdumpCmd="$OBJDUMP"
+if test "$HostOS" = "mingw32"
+then
+  ObjdumpCmd=$(cygpath -m "$OBJDUMP")
+else
+  ObjdumpCmd="$OBJDUMP"
+fi
 AC_SUBST([ObjdumpCmd])
 
 dnl ** Which ranlib to use?
@@ -473,7 +480,12 @@ AC_PROG_RANLIB
 if test "$RANLIB" = ":"; then
     AC_MSG_ERROR([cannot find ranlib in your PATH])
 fi
-RanlibCmd="$RANLIB"
+if test "$HostOS" = "mingw32"
+then
+  RanlibCmd=$(cygpath -m "$RANLIB")
+else
+  RanlibCmd="$RANLIB"
+fi
 AC_SUBST([RanlibCmd])
 
 dnl ** which strip to use?


=====================================
m4/fp_find_nm.m4
=====================================
@@ -9,7 +9,12 @@ AC_DEFUN([FP_FIND_NM],
             AC_MSG_ERROR([cannot find nm in your PATH])
         fi
     fi
-    NmCmd="$NM"
+    if test "$HostOS" = "mingw32"
+    then
+      NmCmd=$(cygpath -m "$NM")
+    else
+      NmCmd="$NM"
+    fi
     AC_SUBST([NmCmd])
 
     if test "$TargetOS_CPP" = "darwin"
@@ -37,4 +42,3 @@ AC_DEFUN([FP_FIND_NM],
             esac
     fi
 ])
-


=====================================
m4/fp_prog_ar_args.m4
=====================================
@@ -30,7 +30,13 @@ else
   fi
 fi])
 fp_prog_ar_args=$fp_cv_prog_ar_args
-AC_SUBST([ArCmd], ["$fp_prog_ar"])
+if test "$HostOS" = "mingw32"
+then
+  ArCmd=$(cygpath -m "$fp_prog_ar")
+else
+  ArCmd="$fp_prog_ar"
+fi
+AC_SUBST([ArCmd])
 AC_SUBST([ArArgs], ["$fp_prog_ar_args"])
 
 ])# FP_PROG_AR_ARGS



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/5926c86d221a7f749525de1a9e0e6e941aff4f57

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/5926c86d221a7f749525de1a9e0e6e941aff4f57
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20240603/b50811b4/attachment-0001.html>


More information about the ghc-commits mailing list