Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit 07e5561

Browse files
committed
Use pkg-config if possible to detect libffi
also, AC_CHECK_HEADERS should come before AC_SEARCH_LIBS, and move ffi/ffi.h first since it seems to be more common too
1 parent 187de34 commit 07e5561

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
SAGE_SPKG_CONFIGURE([libffi], [
2-
AC_SEARCH_LIBS([ffi_call], [ffi], [], [sage_spkg_install_libffi=yes])
3-
AC_CHECK_HEADERS([ffi.h ffi/ffi.h], [break], [sage_spkg_install_libffi=yes])
2+
dnl First try checking for libffi with pkg-config
3+
PKG_CHECK_MODULES([LIBFFI], [libffi], [], [
4+
dnl Fallback to manually grubbing around for headers and libs
5+
AC_CHECK_HEADERS([ffi/ffi.h ffi.h], [sage_spkg_install_libffi=no; break], [sage_spkg_install_libffi=yes])
6+
AC_SEARCH_LIBS([ffi_call], [ffi], [], [sage_spkg_install_libffi=yes])
7+
])
48
])
59

0 commit comments

Comments
 (0)