[commit: ghc] ghc-8.2: Revert "Remove special casing of Windows in generic files" (8ef9716)

git at git.haskell.org git at git.haskell.org
Thu Apr 27 20:10:36 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : ghc-8.2
Link       : http://ghc.haskell.org/trac/ghc/changeset/8ef9716f8f085a4276e95d099e0ffb7343388639/ghc

>---------------------------------------------------------------

commit 8ef9716f8f085a4276e95d099e0ffb7343388639
Author: Ben Gamari <ben at smart-cactus.org>
Date:   Tue Apr 25 09:28:40 2017 -0400

    Revert "Remove special casing of Windows in generic files"
    
    This commit didn't consider the fact that binary distributions on Windows must
    have relative toolchain paths. This caused #13560.
    
    This reverts commit 48385cb2fc295eb8af9188cbe140142c1807d5a7 (except for a
    helpful comment).
    
    (cherry picked from commit 66108864540601837ad77847f4062a670362361f)


>---------------------------------------------------------------

8ef9716f8f085a4276e95d099e0ffb7343388639
 aclocal.m4   | 49 ++++++++++++++++++-------------------------------
 configure.ac | 13 ++++++++-----
 2 files changed, 26 insertions(+), 36 deletions(-)

diff --git a/aclocal.m4 b/aclocal.m4
index fa32b6d..2b12c0f 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -459,55 +459,42 @@ AC_DEFUN([GET_ARM_ISA],
 # Set the variables used in the settings file
 AC_DEFUN([FP_SETTINGS],
 [
-    SettingsCCompilerCommand="$CC"
-    SettingsHaskellCPPCommand="$HaskellCPPCmd"
-    SettingsHaskellCPPFlags="$HaskellCPPArgs"
-    SettingsLdCommand="$LdCmd"
-    SettingsArCommand="$ArCmd"
-    SettingsPerlCommand="$PerlCmd"
-
-    if test -z "$DllWrap"
+    if test "$windows" = YES
     then
-        SettingsDllWrapCommand="/bin/false"
+        mingw_bin_prefix=mingw/bin/
+        SettingsCCompilerCommand="\$topdir/../${mingw_bin_prefix}gcc.exe"
+        SettingsHaskellCPPCommand="\$topdir/../${mingw_bin_prefix}gcc.exe"
+        SettingsHaskellCPPFlags="$HaskellCPPArgs"
+        SettingsLdCommand="\$topdir/../${mingw_bin_prefix}ld.exe"
+        SettingsArCommand="\$topdir/../${mingw_bin_prefix}ar.exe"
+        SettingsPerlCommand='$topdir/../perl/perl.exe'
+        SettingsDllWrapCommand="\$topdir/../${mingw_bin_prefix}dllwrap.exe"
+        SettingsWindresCommand="\$topdir/../${mingw_bin_prefix}windres.exe"
+        SettingsTouchCommand='$topdir/bin/touchy.exe'
     else
-        SettingsDllWrapCommand="$DllWrap"
-    fi
-
-    if test -z "$Windres"
-    then
+        SettingsCCompilerCommand="$CC"
+        SettingsHaskellCPPCommand="$HaskellCPPCmd"
+        SettingsHaskellCPPFlags="$HaskellCPPArgs"
+        SettingsLdCommand="$LdCmd"
+        SettingsArCommand="$ArCmd"
+        SettingsPerlCommand="$PerlCmd"
+        SettingsDllWrapCommand="/bin/false"
         SettingsWindresCommand="/bin/false"
-    else
-        SettingsWindresCommand="$Windres"
-    fi
-
-    if test -z "$Libtool"
-    then
         SettingsLibtoolCommand="libtool"
-    else
-        SettingsLibtoolCommand="$Libtool"
-    fi
-
-    if test -z "$Touch"
-    then
         SettingsTouchCommand='touch'
-    else
-        SettingsTouchCommand='$Touch'
     fi
-
     if test -z "$LlcCmd"
     then
       SettingsLlcCommand="llc"
     else
       SettingsLlcCommand="$LlcCmd"
     fi
-
     if test -z "$OptCmd"
     then
       SettingsOptCommand="opt"
     else
       SettingsOptCommand="$OptCmd"
     fi
-
     SettingsCCompilerFlags="$CONF_CC_OPTS_STAGE2"
     SettingsCCompilerLinkFlags="$CONF_GCC_LINKER_OPTS_STAGE2"
     SettingsCCompilerSupportsNoPie="$CONF_GCC_SUPPORTS_NO_PIE"
diff --git a/configure.ac b/configure.ac
index 5ff54d8..9a47524 100644
--- a/configure.ac
+++ b/configure.ac
@@ -177,9 +177,13 @@ then
 
     if test "$ghc_host_os" = "mingw32"
     then
-        # Canonicalise to <drive>:/path/to/ghc
-        WithGhc=`cygpath -m "${WithGhc}"`
-
+        if test "${OSTYPE}" = "msys"
+        then
+            WithGhc=`echo "${WithGhc}" | sed "s#^/\([a-zA-Z]\)/#\1:/#"`
+        else
+            # Canonicalise to <drive>:/path/to/ghc
+            WithGhc=`cygpath -m "${WithGhc}"`
+        fi
         echo "GHC path canonicalised to: ${WithGhc}"
     fi
 fi
@@ -374,8 +378,6 @@ then
     NM="${mingwbin}nm.exe"
     RANLIB="${mingwbin}ranlib.exe"
     OBJDUMP="${mingwbin}objdump.exe"
-    Windres="${mingwbin}windres.exe"
-    DllWrap="${mingwbin}dllwrap.exe"
     fp_prog_ar="${mingwbin}ar.exe"
 
     # NB. Download the perl binaries if required
@@ -727,6 +729,7 @@ AC_SUBST(HaveDtrace)
 AC_PATH_PROG(HSCOLOUR,HsColour)
 # HsColour is passed to Cabal, so we need a native path
 if test "$HostOS"      = "mingw32" && \
+   test "${OSTYPE}"   != "msys"    && \
    test "${HSCOLOUR}" != ""
 then
     # Canonicalise to <drive>:/path/to/gcc



More information about the ghc-commits mailing list