[commit: ghc] ghc-8.2: aclocal.m4: respect user's --with-ar= choice (948d777)

git at git.haskell.org git at git.haskell.org
Wed Aug 2 21:40:42 UTC 2017


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

On branch  : ghc-8.2
Link       : http://ghc.haskell.org/trac/ghc/changeset/948d7774b3f41779998a5b71d646198c8dd76257/ghc

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

commit 948d7774b3f41779998a5b71d646198c8dd76257
Author: Sergei Trofimovich <slyfox at gentoo.org>
Date:   Mon Apr 17 09:41:49 2017 +0100

    aclocal.m4: respect user's --with-ar= choice
    
    'FP_PROG_AR' macro has a minor bug: it ignores
    already existing value stored in '$fp_prog_ar'.
    
    I've noticed it when tried to built UNREG ghc using thin LTO:
    
      $ ./configure --enable-unregisterised \
                    --with-nm=gcc-nm \
                    --with-ar=gcc-ar \
                    --with-ranlib=gcc-ranlib \
    
    ./configure refused to use 'gcc-ar' (LTO-aware variant of 'ar')
    and kept using 'ar'.
    
    '$fp_prog_ar' is initialized (in a complex manner) in 'configure.ac' as:
    
        FP_ARG_WITH_PATH_GNU_PROG([AR], [ar], [ar])
        ArCmd="$AR"
        fp_prog_ar="$AR"
        AC_SUBST([ArCmd])
    
    The change keeps that value.
    
    Signed-off-by: Sergei Trofimovich <slyfox at gentoo.org>
    (cherry picked from commit 79848f18805ad8eba48c9897c5d53afbd17ab44d)


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

948d7774b3f41779998a5b71d646198c8dd76257
 aclocal.m4 | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/aclocal.m4 b/aclocal.m4
index c48b42c..516584b 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1114,7 +1114,9 @@ AC_SUBST([LdHasFilelist])
 # ----------
 # Sets fp_prog_ar to a path to ar. Exits if no ar can be found
 AC_DEFUN([FP_PROG_AR],
-[AC_PATH_PROG([fp_prog_ar], [ar])
+[if test -z "$fp_prog_ar"; then
+  AC_PATH_PROG([fp_prog_ar], [ar])
+fi
 if test -z "$fp_prog_ar"; then
   AC_MSG_ERROR([cannot find ar in your PATH, no idea how to make a library])
 fi



More information about the ghc-commits mailing list