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

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