summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2022-10-22 20:28:35 -0400
committerPaul Smith <psmith@gnu.org>2022-10-22 22:40:26 -0400
commitb4157d2ff4f7e278e3cc507b82569d37b3a1b586 (patch)
treec8751790b61a89d85f17c429d9c2168ef824aa65 /configure.ac
parentf364e0d8d6e03f1e8bc995641530e4df6598704c (diff)
downloadmake-git-b4157d2ff4f7e278e3cc507b82569d37b3a1b586.tar.gz
* configure.ac: Check that we can link with Guile
On multi-arch systems we may be able to find the header file but not successfully link the library.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac26
1 files changed, 23 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 005aba35..b28c84d3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -175,15 +175,35 @@ AS_IF([test "x$with_guile" != xno],
AC_MSG_RESULT([$guile_version])
AS_IF([test "$have_guile" = yes],
[ PKG_CHECK_MODULES(GUILE, [guile-$guile_version])
- # Unfortunately Guile requires a C99 compiler but GNU make doesn't, so
- # verify we can actually compile the header.
+ # Unfortunately pkg doesn't help in multi-arch environments where the
+ # package is installed for some architectures but not others; we need
+ # to try to link.
keep_CPPFLAGS="$CPPFLAGS"
- CPPFLAGS="$CPPFLAGS $pkg_cv_GUILE_CFLAGS"
+ keep_LIBS="$LIBS"
+ CPPFLAGS="$CPPFLAGS $GUILE_CFLAGS"
+ LIBS="$LIBS $GUILE_LIBS"
AC_CHECK_HEADER([libguile.h],
[AC_DEFINE([HAVE_GUILE], [1], [Embed GNU Guile support])],
[have_guile=no],
[/* Avoid configuration error warnings. */])
+ AS_IF([test "$have_guile" = yes],
+ [ AC_MSG_CHECKING([whether we can link GNU Guile])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+#include <libguile.h>
+static void *
+guile_init (void *arg)
+{
+ (void) arg;
+ return 0;
+}
+]], [[
+ scm_with_guile (guile_init, 0);
+]])],
+ [have_guile=yes],
+ [have_guile=no])
+ AC_MSG_RESULT([$have_guile])])
CPPFLAGS="$keep_CPPFLAGS"
+ LIBS="$keep_LIBS"
])
])