summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2010-03-29 12:33:25 +0000
committerIan Lynagh <igloo@earth.li>2010-03-29 12:33:25 +0000
commitf74a195e8eaad2670cf10be30484fda842e3c01e (patch)
tree756263365285f2645a1e26ae03757e96c596ba8c
parent57fad22f920f13527a0e6f1ee26eb326580fcb1a (diff)
downloadhaskell-f74a195e8eaad2670cf10be30484fda842e3c01e.tar.gz
Explicitly check whether ar supports the @file syntax
rather than assuming that all GNU ar's do. Apparently OpenBSD's older version doesn't.
-rw-r--r--aclocal.m426
-rw-r--r--configure.ac2
-rw-r--r--mk/config.mk.in2
-rw-r--r--rules/build-package-way.mk2
4 files changed, 29 insertions, 3 deletions
diff --git a/aclocal.m4 b/aclocal.m4
index a9bdcea2b0..031145d411 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -399,6 +399,32 @@ AC_SUBST([ArIsGNUAr], [`echo $fp_prog_ar_is_gnu | tr 'a-z' 'A-Z'`])
])# FP_PROG_AR_IS_GNU
+# FP_PROG_AR_SUPPORTS_ATFILE
+# -----------------
+# Sets fp_prog_ar_supports_atfile to yes or no, depending on whether
+# or not it supports the @file syntax
+AC_DEFUN([FP_PROG_AR_SUPPORTS_ATFILE],
+[AC_REQUIRE([FP_PROG_AR])
+ AC_REQUIRE([FP_PROG_AR_ARGS])
+AC_CACHE_CHECK([whether $fp_prog_ar_raw supports @file], [fp_cv_prog_ar_supports_atfile],
+[
+rm -f conftest*
+touch conftest.file
+echo conftest.file > conftest.atfile
+echo conftest.file >> conftest.atfile
+"$fp_prog_ar_raw" $fp_prog_ar_args conftest.a @conftest.atfile > /dev/null 2>&1
+fp_prog_ar_supports_atfile_tmp=`"$fp_prog_ar_raw" t conftest.a 2> /dev/null | grep -c conftest.file`
+rm -f conftest*
+if test "$fp_prog_ar_supports_atfile_tmp" -eq 2
+then
+ fp_cv_prog_ar_supports_atfile=yes
+else
+ fp_cv_prog_ar_supports_atfile=no
+fi])
+fp_prog_ar_supports_atfile=$fp_cv_prog_ar_supports_atfile
+AC_SUBST([ArSupportsAtFile], [`echo $fp_prog_ar_supports_atfile | tr 'a-z' 'A-Z'`])
+])# FP_PROG_AR_SUPPORTS_ATFILE
+
# FP_PROG_AR_ARGS
# ---------------
# Sets fp_prog_ar_args to the arguments for ar and the output variable ArCmd
diff --git a/configure.ac b/configure.ac
index d603fd4a0d..3c4e59446a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -578,7 +578,7 @@ dnl If you can run configure, you certainly have /bin/sh
AC_DEFINE([HAVE_BIN_SH], [1], [Define to 1 if you have /bin/sh.])
dnl ** how to invoke `ar' and `ranlib'
-FP_PROG_AR_IS_GNU
+FP_PROG_AR_SUPPORTS_ATFILE
FP_PROG_AR_NEEDS_RANLIB
FP_PROG_AR_SUPPORTS_INPUT
diff --git a/mk/config.mk.in b/mk/config.mk.in
index db21b1482f..9da19468c2 100644
--- a/mk/config.mk.in
+++ b/mk/config.mk.in
@@ -563,7 +563,7 @@ DLLTOOL = inplace/mingw/bin/dlltool.exe
AR = @ArCmd@
AR_OPTS = @ArArgs@
ArSupportsInput = @ArSupportsInput@
-ArIsGNUAr = @ArIsGNUAr@
+ArSupportsAtFile = @ArSupportsAtFile@
# Yuckage: for ghc/utils/parallel -- todo: nuke this dependency!!
BASH = /usr/local/bin/bash
diff --git a/rules/build-package-way.mk b/rules/build-package-way.mk
index d66ed7c520..a128c4fd43 100644
--- a/rules/build-package-way.mk
+++ b/rules/build-package-way.mk
@@ -81,7 +81,7 @@ ifeq "$$($1_$2_SplitObjs)" "YES"
else
echo $$($1_$2_$3_ALL_OBJS) `$$($1_$2_$3_MKSTUBOBJS)` >> $$@.contents
endif
-ifeq "$$(ArIsGNUAr)" "YES"
+ifeq "$$(ArSupportsAtFile)" "YES"
"$$(AR)" $$(AR_OPTS) $$(EXTRA_AR_ARGS) $$@ @$$@.contents
else
"$$(XARGS)" $$(XARGS_OPTS) "$$(AR)" $$(AR_OPTS) $$(EXTRA_AR_ARGS) $$@ < $$@.contents