Blame SOURCES/0001-configure.ac-SV-50648-Detect-Guile-2.2-packages.patch

cfe910
From fbf71ec25a5986d9003ac16ee9e23675feac9053 Mon Sep 17 00:00:00 2001
cfe910
From: Paul Smith <psmith@gnu.org>
cfe910
Date: Sun, 16 Apr 2017 15:03:48 -0400
cfe910
Subject: [PATCH] * configure.ac: [SV 50648] Detect Guile 2.2 packages.
cfe910
cfe910
---
cfe910
 configure.ac | 26 ++++++++++++++++----------
cfe910
 1 file changed, 16 insertions(+), 10 deletions(-)
cfe910
cfe910
diff --git a/configure.ac b/configure.ac
cfe910
index 1187ad4..a78fb93 100644
cfe910
--- a/configure.ac
cfe910
+++ b/configure.ac
cfe910
@@ -160,22 +160,28 @@ AC_FUNC_ALLOCA
cfe910
 AC_FUNC_CLOSEDIR_VOID
cfe910
 
cfe910
 # See if the user wants to add (or not) GNU Guile support
cfe910
-PKG_PROG_PKG_CONFIG
cfe910
 AC_ARG_WITH([guile], [AS_HELP_STRING([--with-guile],
cfe910
             [Support GNU Guile for embedded scripting])])
cfe910
 
cfe910
-# For some strange reason, at least on Ubuntu, each version of Guile
cfe910
-# comes with it's own PC file so we have to specify them as individual
cfe910
-# packages.  Ugh.
cfe910
+# Annoyingly, each version of Guile comes with it's own PC file so we have to
cfe910
+# specify them as individual packages.  Ugh.
cfe910
+PKG_PROG_PKG_CONFIG
cfe910
+
cfe910
 AS_IF([test "x$with_guile" != xno],
cfe910
-[ PKG_CHECK_MODULES([GUILE], [guile-2.0], [have_guile=yes],
cfe910
-  [PKG_CHECK_MODULES([GUILE], [guile-1.8], [have_guile=yes],
cfe910
-    [have_guile=no])])
cfe910
+[ guile_versions="2.2 2.0 1.8"
cfe910
+  guile_version=no
cfe910
+  have_guile=no
cfe910
+  AC_MSG_CHECKING([for GNU Guile])
cfe910
+  for v in $guile_versions; do
cfe910
+    PKG_CHECK_EXISTS([guile-$v], [guile_version=$v; have_guile=yes; break], [])
cfe910
+  done
cfe910
+  AC_MSG_RESULT([$guile_version])
cfe910
+  if test "$have_guile" = yes; then
cfe910
+    PKG_CHECK_MODULES(GUILE, [guile-$guile_version])
cfe910
+    AC_DEFINE([HAVE_GUILE], [1], [Embed GNU Guile support])
cfe910
+  fi
cfe910
 ])
cfe910
 
cfe910
-AS_IF([test "$have_guile" = yes],
cfe910
-      [AC_DEFINE([HAVE_GUILE], [1], [Embed GNU Guile support])])
cfe910
-
cfe910
 AM_CONDITIONAL([HAVE_GUILE], [test "$have_guile" = yes])
cfe910
 
cfe910
 AC_FUNC_GETLOADAVG
cfe910
-- 
cfe910
2.21.0.rc1
cfe910