From 761c97892a3c4ff3cd99224312094d41394e410c Mon Sep 17 00:00:00 2001 From: "Erik M. Bray" Date: Tue, 29 Jan 2019 17:52:11 +0000 Subject: [PATCH] AC_CHECK_HEADERS should come before AC_SEARCH_LIBS the latter can make use of the result of the former Also, annoyingly, AC_CHECK_HEADERS will call the action-if-not-found for *every* header it its list that is not found (as opposed to just if no header in the list is found. So we should set sage_spkg_install_libffi=no again in case the second header is found but not the first. --- build/pkgs/libffi/spkg-configure.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/pkgs/libffi/spkg-configure.m4 b/build/pkgs/libffi/spkg-configure.m4 index c7b08fb32dc..e0773871b41 100644 --- a/build/pkgs/libffi/spkg-configure.m4 +++ b/build/pkgs/libffi/spkg-configure.m4 @@ -2,8 +2,8 @@ SAGE_SPKG_CONFIGURE([libffi], [ dnl First try checking for libffi with pkg-config PKG_CHECK_MODULES([LIBFFI], [libffi], [], [ dnl Fallback to manually grubbing around for headers and libs + AC_CHECK_HEADERS([ffi.h ffi/ffi.h], [sage_spkg_install_libffi=no; break], [sage_spkg_install_libffi=yes]) AC_SEARCH_LIBS([ffi_call], [ffi], [], [sage_spkg_install_libffi=yes]) - AC_CHECK_HEADERS([ffi.h ffi/ffi.h], [break], [sage_spkg_install_libffi=yes]) ]) ])