summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorGabriella Gonzalez <gabriella@mercury.com>2023-02-01 13:44:44 -0800
committerMarge Bot <ben+marge-bot@smart-cactus.org>2023-03-06 17:06:50 -0500
commit5ed77deb1b49bff7bae9660487ee4a40a496476d (patch)
treeff53bb9ff50c50657fc9513a0bb7184f0f3a1403 /m4
parent232cfc241c14ba6a49d9552a90a94857255e455d (diff)
downloadhaskell-5ed77deb1b49bff7bae9660487ee4a40a496476d.tar.gz
Enable response files for linker if supported
Diffstat (limited to 'm4')
-rw-r--r--m4/fp_ld_supports_response_files.m419
1 files changed, 19 insertions, 0 deletions
diff --git a/m4/fp_ld_supports_response_files.m4 b/m4/fp_ld_supports_response_files.m4
new file mode 100644
index 0000000000..5596169dcb
--- /dev/null
+++ b/m4/fp_ld_supports_response_files.m4
@@ -0,0 +1,19 @@
+# FP_LD_SUPPORTS_RESPONSE_FILES
+# --------------------
+# See if whether we are using a version of ld64 on darwin platforms which
+# supports response files.
+AC_DEFUN([FP_LD_SUPPORTS_RESPONSE_FILES], [
+ AC_MSG_CHECKING([whether $LD supports response files])
+ echo 'int main(void) {return 0;}' > conftest.c
+ $CC -c -o conftest.o conftest.c > /dev/null 2>&1
+ if $LD @<(printf '%q\n' -o conftest conftest.o) > /dev/null 2>&1
+ then
+ LdSupportsResponseFiles=YES
+ AC_MSG_RESULT([yes])
+ else
+ LdSupportsResponseFiles=NO
+ AC_MSG_RESULT([no])
+ fi
+ rm -f conftest.c conftest
+ AC_SUBST(LdSupportsResponseFiles)
+])