[commit: ghc] master: Build system: fix `pwd` issues on Windows (f7b45c3)

git at git.haskell.org git at git.haskell.org
Fri Jan 8 22:46:14 UTC 2016


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/f7b45c31f07daa4c3dca39f6ccc1a52c86900b7c/ghc

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

commit f7b45c31f07daa4c3dca39f6ccc1a52c86900b7c
Author: Thomas Miedema <thomasmiedema at gmail.com>
Date:   Fri Jan 8 20:59:28 2016 +0100

    Build system: fix `pwd` issues on Windows
    
    Some parts of the build system require that paths are what msys2 calls
    "mixed style":
      * forwards slashes
      * absolute paths starting with a drive letter followed by a colon
        (e.g. "C:")
    
    The removal of ghc-pwd in 4c56ad3 changed $(TOP) from mixed style to
    unix style, resulting in a broken Windows build for some.
    
    Differential Revision: https://phabricator.haskell.org/D1752


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

f7b45c31f07daa4c3dca39f6ccc1a52c86900b7c
 aclocal.m4              | 10 +++++++++-
 configure.ac            |  5 +++--
 distrib/configure.ac.in |  5 +++--
 3 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/aclocal.m4 b/aclocal.m4
index 0c93de4..933aee9 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1739,7 +1739,15 @@ AC_DEFUN([FP_CURSES],
 
 AC_DEFUN([FP_FIND_ROOT],[
 AC_MSG_CHECKING(for path to top of build tree)
-    hardtop=`pwd`
+    if test "$windows" = YES
+    then
+      dnl Make sure this is a c:/foo/bar (mixed) style path. Some parts of
+      dnl the build system might depend on it (such as the sed expression
+      dnl `"s|$(TOP)/||i"` in addCFileDeps in rules/build-dependencies.mk).
+      hardtop=$(cygpath -m "$(pwd)")
+    else
+      hardtop=$(pwd)
+    fi
 
     dnl Remove common automounter nonsense
     hardtop=`echo $hardtop | sed 's|^/tmp_mnt.*\(/local/.*\)$|\1|' | sed 's|^/tmp_mnt/|/|'`
diff --git a/configure.ac b/configure.ac
index ab82bb0..e9bdeec 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,8 +26,6 @@ AC_INIT([The Glorious Glasgow Haskell Compilation System], [8.1], [glasgow-haske
 # checkout), then we ship a file 'VERSION' containing the full version
 # when the source distribution was created.
 
-FP_FIND_ROOT
-
 if test ! -f mk/config.h.in; then
    echo "mk/config.h.in doesn't exist: perhaps you haven't run 'perl boot'?"
    exit 1
@@ -260,6 +258,9 @@ AC_ARG_WITH(hc,
 )
 AC_SUBST(WithHc)
 
+# Requires FPTOOLS_SET_PLATFORM_VARS to be run first.
+FP_FIND_ROOT
+
 fail() {
     echo >&2
     echo "$1" >&2
diff --git a/distrib/configure.ac.in b/distrib/configure.ac.in
index 4d57cd8..99b51f5 100644
--- a/distrib/configure.ac.in
+++ b/distrib/configure.ac.in
@@ -6,8 +6,6 @@ dnl
 
 AC_INIT([The Glorious Glasgow Haskell Compilation System], [@ProjectVersion@], [glasgow-haskell-bugs at haskell.org], [ghc])
 
-FP_FIND_ROOT
-
 dnl--------------------------------------------------------------------
 dnl * Deal with arguments telling us gmp is somewhere odd
 dnl--------------------------------------------------------------------
@@ -17,6 +15,9 @@ FP_GMP
 bootstrap_target=@TargetPlatform@
 FPTOOLS_SET_PLATFORM_VARS
 
+# Requires FPTOOLS_SET_PLATFORM_VARS to be run first.
+FP_FIND_ROOT
+
 # ToDo: if Stage1Only=YES, should be YES
 CrossCompiling=NO
 CrossCompilePrefix=""



More information about the ghc-commits mailing list