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

Commit

Permalink
check for pkg-config's m4 macros at bootstrap
Browse files Browse the repository at this point in the history
  • Loading branch information
dimpase committed Feb 7, 2019
1 parent 453033d commit 87621c7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
4 changes: 3 additions & 1 deletion bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 2 additions & 6 deletions build/pkgs/libffi/spkg-configure.m4
Original file line number Diff line number Diff line change
@@ -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])
])

9 changes: 9 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 87621c7

Please sign in to comment.