]> git.ipfire.org Git - thirdparty/make.git/commitdiff
* configure.ac: [SV 50648] Detect Guile 2.2 packages.
authorPaul Smith <psmith@gnu.org>
Sun, 16 Apr 2017 19:03:48 +0000 (15:03 -0400)
committerPaul Smith <psmith@gnu.org>
Sun, 4 Jun 2017 22:37:20 +0000 (18:37 -0400)
configure.ac

index 1187ad4f2b689e7751bc61956a6c58845f6284f3..a78fb932f1df36c3c43177a046891df4c05bcb0e 100644 (file)
@@ -160,22 +160,28 @@ AC_FUNC_ALLOCA
 AC_FUNC_CLOSEDIR_VOID
 
 # See if the user wants to add (or not) GNU Guile support
-PKG_PROG_PKG_CONFIG
 AC_ARG_WITH([guile], [AS_HELP_STRING([--with-guile],
             [Support GNU Guile for embedded scripting])])
 
-# For some strange reason, at least on Ubuntu, each version of Guile
-# comes with it's own PC file so we have to specify them as individual
-# packages.  Ugh.
+# Annoyingly, each version of Guile comes with it's own PC file so we have to
+# specify them as individual packages.  Ugh.
+PKG_PROG_PKG_CONFIG
+
 AS_IF([test "x$with_guile" != xno],
-[ PKG_CHECK_MODULES([GUILE], [guile-2.0], [have_guile=yes],
-  [PKG_CHECK_MODULES([GUILE], [guile-1.8], [have_guile=yes],
-    [have_guile=no])])
+[ guile_versions="2.2 2.0 1.8"
+  guile_version=no
+  have_guile=no
+  AC_MSG_CHECKING([for GNU Guile])
+  for v in $guile_versions; do
+    PKG_CHECK_EXISTS([guile-$v], [guile_version=$v; have_guile=yes; break], [])
+  done
+  AC_MSG_RESULT([$guile_version])
+  if test "$have_guile" = yes; then
+    PKG_CHECK_MODULES(GUILE, [guile-$guile_version])
+    AC_DEFINE([HAVE_GUILE], [1], [Embed GNU Guile support])
+  fi
 ])
 
-AS_IF([test "$have_guile" = yes],
-      [AC_DEFINE([HAVE_GUILE], [1], [Embed GNU Guile support])])
-
 AM_CONDITIONAL([HAVE_GUILE], [test "$have_guile" = yes])
 
 AC_FUNC_GETLOADAVG