summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
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"
])