summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2022-05-03 13:48:56 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-05-10 20:46:52 -0400
commit35da81f8fb04d905ed7fc2f2a435530b142c983d (patch)
treee9b33ab593912b08a1b9572d9f4ab4eefc47133d /m4
parentdcac383312cb4f2425eb412e72f632d6b484077b (diff)
downloadhaskell-35da81f8fb04d905ed7fc2f2a435530b142c983d.tar.gz
configure: Check for ffi.h
As noted in #21485, we checked for ffi.h yet then failed to throw an error if it is missing. Fixes #21485.
Diffstat (limited to 'm4')
-rw-r--r--m4/fp_find_libffi.m413
1 files changed, 10 insertions, 3 deletions
diff --git a/m4/fp_find_libffi.m4 b/m4/fp_find_libffi.m4
index ddc511553c..bf52afefbb 100644
--- a/m4/fp_find_libffi.m4
+++ b/m4/fp_find_libffi.m4
@@ -49,6 +49,7 @@ AC_DEFUN([FP_FIND_LIBFFI],
CFLAGS="$LIBFFI_CFLAGS $CFLAGS"
LDFLAGS2="$LDFLAGS"
LDFLAGS="$LIBFFI_LDFLAGS $LDFLAGS"
+
if test "$HostOS" = "openbsd";
then
# OpenBSD's libffi is not directly linked to the libpthread but
@@ -58,10 +59,16 @@ AC_DEFUN([FP_FIND_LIBFFI],
# symbols.
LDFLAGS="$LDFLAGS -lpthread"
fi
+
AC_CHECK_LIB(ffi, ffi_call,
- [AC_CHECK_HEADERS([ffi.h], [break], [])
- AC_DEFINE([HAVE_SYSTEM_LIBFFI], [1], [Define to 1 if you have libffi.])],
- [AC_MSG_ERROR([Cannot find system libffi])])
+ [AC_CHECK_HEADERS(
+ [ffi.h],
+ [AC_DEFINE([HAVE_SYSTEM_LIBFFI], [1], [Define to 1 if you have libffi.])],
+ [AC_MSG_ERROR([Cannot find ffi.h for system libffi])]
+ )],
+ [AC_MSG_ERROR([Cannot find system libffi])]
+ )
+
CFLAGS="$CFLAGS2"
LDFLAGS="$LDFLAGS2"
])