summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Trofimovich <slyfox@gentoo.org>2017-04-17 09:41:49 +0100
committerSergei Trofimovich <slyfox@gentoo.org>2017-04-17 12:57:25 +0100
commit79848f18805ad8eba48c9897c5d53afbd17ab44d (patch)
treeef508ad71a771d87f177fc131b47729b11de9935
parent1ca188c74e70661419499e78be5b0a4998c85dea (diff)
downloadhaskell-79848f18805ad8eba48c9897c5d53afbd17ab44d.tar.gz
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@gentoo.org>
-rw-r--r--aclocal.m44
1 files changed, 3 insertions, 1 deletions
diff --git a/aclocal.m4 b/aclocal.m4
index 2062b0d11d..ed26a899d0 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1130,7 +1130,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