diff --git a/bootstrap b/bootstrap index 526848f2bfa..e5c9e49672c 100755 --- a/bootstrap +++ b/bootstrap @@ -47,13 +47,15 @@ SAGE_SPKG_CONFIGURE_$(echo ${pkgname} | tr '[a-z]' '[A-Z]')" case $st in 0) true;; # Success - 63|127) # Autotools not installed or version too old + 1|63|127) # no m4 for pkg-config, or autotools not installed, or version too old if [ $DOWNLOAD = yes ]; then echo >&2 "Bootstrap failed, downloading required files instead." bootstrap-download || exit $? else if [ $st -eq 127 ]; then verb="install" + elif [ $st -eq 1 ]; then + verb="install pkg-config m4 macros for" else verb="upgrade" fi diff --git a/build/pkgs/libffi/spkg-configure.m4 b/build/pkgs/libffi/spkg-configure.m4 index ed6f031cf75..fb37b984b88 100644 --- a/build/pkgs/libffi/spkg-configure.m4 +++ b/build/pkgs/libffi/spkg-configure.m4 @@ -1,9 +1,5 @@ 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/ffi.h 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_SEARCH_LIBS([ffi_call], [ffi], [], [sage_spkg_install_libffi=yes]) + AC_CHECK_HEADERS([ffi.h ffi/ffi.h], [break], [sage_spkg_install_libffi=yes]) ]) diff --git a/configure.ac b/configure.ac index f727a46d082..93ce09ca77c 100644 --- a/configure.ac +++ b/configure.ac @@ -216,6 +216,15 @@ then AC_MSG_ERROR([Exiting, as the macro processor 'm4' can not be found.]) fi +m4_ifndef([PKG_PROG_PKG_CONFIG], + [m4_fatal([Could not locate the pkg-config autoconf macros. + These are usually located in /usr/share/aclocal/pkg.m4. If your + macros are in a different location, try setting the environment + variable ACLOCAL="aclocal -I/other/macro/dir" before running + ./bootstrap])]) + +PKG_PROG_PKG_CONFIG + AC_CHECK_PROG(found_ranlib, ranlib, yes, no) if test x$found_ranlib != xyes then