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

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