summaryrefslogtreecommitdiff
path: root/aclocal.m4
diff options
context:
space:
mode:
authorIan Lynagh <ian@well-typed.com>2013-03-18 22:48:43 +0000
committerIan Lynagh <ian@well-typed.com>2013-03-18 23:42:53 +0000
commitc53ea7c7467a149ff753b907535025634c62dda4 (patch)
treeb0b6779a9c477322310d68dc327095c47921f0aa /aclocal.m4
parent01efdd6c4b066fbfdf17c6d2b1cad0fd651d334a (diff)
downloadhaskell-c53ea7c7467a149ff753b907535025634c62dda4.tar.gz
Add support for OSX ld's -filelist flag
Without it, when linking the split objects for Language.Haskell.TH.Syntax, the commandline was too long when listing all the files directly.
Diffstat (limited to 'aclocal.m4')
-rw-r--r--aclocal.m432
1 files changed, 32 insertions, 0 deletions
diff --git a/aclocal.m4 b/aclocal.m4
index e225030ddd..2cfa2f1518 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1003,6 +1003,38 @@ AC_SUBST([LdHasNoCompactUnwind])
])# FP_PROG_LD_NO_COMPACT_UNWIND
+# FP_PROG_LD_FILELIST
+# -------------------
+
+# Sets the output variable LdHasFilelist to YES if ld supports
+# -filelist, or NO otherwise.
+AC_DEFUN([FP_PROG_LD_FILELIST],
+[
+AC_CACHE_CHECK([whether ld understands -filelist], [fp_cv_ld_has_filelist],
+[
+ echo 'int foo() { return 0; }' > conftest1.c
+ echo 'int bar() { return 0; }' > conftest2.c
+ ${CC-cc} -c conftest1.c
+ ${CC-cc} -c conftest2.c
+ echo conftest1.o > conftest.o-files
+ echo conftest2.o >> conftest.o-files
+ if ${LdCmd} -r -filelist conftest.o-files -o conftest.o > /dev/null 2>&1
+ then
+ fp_cv_ld_has_filelist=yes
+ else
+ fp_cv_ld_has_filelist=no
+ fi
+ rm -rf conftest*
+])
+if test "$fp_cv_ld_has_filelist" = yes; then
+ LdHasFilelist=YES
+else
+ LdHasFilelist=NO
+fi
+AC_SUBST([LdHasFilelist])
+])# FP_PROG_LD_FILELIST
+
+
# FP_PROG_AR
# ----------
# Sets fp_prog_ar to a (non-Cygwin) path to ar. Exits if no ar can be found