[commit: ghc] master: Fix the searching of target AR tool (c839c57)

git at git.haskell.org git at git.haskell.org
Mon Sep 25 23:19:14 UTC 2017


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

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

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

commit c839c57ed372203b05407b2042d00c188af75310
Author: Tamar Christina <tamar at zhox.com>
Date:   Mon Sep 25 19:12:35 2017 +0100

    Fix the searching of target AR tool
    
    Summary:
    Ar was being checked twice prior to D3883 where I removed one of the checks
    because the converted path was being overridden after the check because of
    the second check for Ar. However the one in configure.ac was a target check
    so I'm changing the path check to a target check now.
    
    Test Plan: ./configure
    
    Reviewers: angerman, austin, hvr, bgamari
    
    Reviewed By: bgamari
    
    Subscribers: rwbarton, thomie, erikd
    
    GHC Trac Issues: #14274
    
    Differential Revision: https://phabricator.haskell.org/D4020


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

c839c57ed372203b05407b2042d00c188af75310
 aclocal.m4   | 16 ++++++++++++----
 configure.ac |  4 +---
 2 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/aclocal.m4 b/aclocal.m4
index 30fd220..754a13a 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1071,9 +1071,20 @@ AC_SUBST([LdHasFilelist])
 # FP_PROG_AR
 # ----------
 # Sets fp_prog_ar to a path to ar. Exits if no ar can be found
+# The host normalization on Windows breaks autoconf, it no longer
+# thinks that target == host so it never checks the unqualified
+# tools for Windows. See #14274.
 AC_DEFUN([FP_PROG_AR],
 [if test -z "$fp_prog_ar"; then
-  AC_PATH_PROG([fp_prog_ar], [ar])
+  if test "$HostOS" = "mingw32"
+  then
+    AC_PATH_PROG([fp_prog_ar], [ar])
+    if test -n "$fp_prog_ar"; then
+      fp_prog_ar=$(cygpath -m $fp_prog_ar)
+    fi
+  else
+    AC_CHECK_TARGET_TOOL([fp_prog_ar], [ar])
+  fi
 fi
 if test -z "$fp_prog_ar"; then
   AC_MSG_ERROR([cannot find ar in your PATH, no idea how to make a library])
@@ -1151,9 +1162,6 @@ else
   fi
 fi])
 fp_prog_ar_args=$fp_cv_prog_ar_args
-if test "$HostOS" = "mingw32"; then
-    ArCmd=$(cygpath -m $ArCmd)
-fi
 AC_SUBST([ArCmd], ["$fp_prog_ar"])
 AC_SUBST([ArArgs], ["$fp_prog_ar_args"])
 
diff --git a/configure.ac b/configure.ac
index 98fffe1..5eae83d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -609,9 +609,7 @@ dnl ** which libtool to use?
 dnl --------------------------------------------------------------
 # The host normalization on Windows breaks autoconf, it no longer
 # thinks that target == host so it never checks the unqualified
-# tools for Windows. I don't know why we do this whole normalization thing
-# as it just breaks everything.. but for now, just check the unqualified one
-# if on Windows.
+# tools for Windows. See #14274.
 if test "$HostOS" = "mingw32"
 then
     AC_PATH_PROG([LIBTOOL],[libtool])



More information about the ghc-commits mailing list