]> granicus.if.org Git - graphviz/commitdiff
fix: lookup Guile version by guile-config, not guile
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 27 Dec 2020 22:50:32 +0000 (14:50 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 23 Jan 2021 22:43:47 +0000 (14:43 -0800)
The Autotools build system was using the binary "guile" to detect what version
of Guile to build and link against. However, this is the Guile runtime system,
not the Guile developer dependencies. The effect of this was that the build
system could detect e.g. Guile 2.0 when guile20-devel was not installed. Related
to #1885.

configure.ac

index 2ab4e4b8f799f6067a62df56ada4fb1aaac6e2ac..80d6ce1f67a822dfd04155fc57041c1e9673c5a3 100644 (file)
@@ -701,27 +701,28 @@ else
     if test `$SWIG -help 2>&1 | $EGREP -c '\-guile *- Generate'` = 0; then
       use_guile="No (swig does not support -guile option)"
     else
-      AC_CHECK_PROGS(GUILE,guile2 guile1.8 guile)
-      if test "x$GUILE" = "x"; then
+      AC_CHECK_PROGS(GUILE_CONFIG,guile-config)
+      if test "x$GUILE_CONFIG" = "x"; then
         use_guile="No (guile not available)"
       else
-        [GUILE_VERSION=`$GUILE --version | sed -n '1 s/^.* \+\([0-9\.]\+\)$/\1/ p'`]
+        [GUILE_VERSION=`$GUILE_CONFIG --version 2>&1 | sed -n '1 s/^.* \+\([0-9\.]\+\)$/\1/ p'`]
         GUILE_VERSION_MAJOR=`echo $GUILE_VERSION | cut -d '.' -f 1`
         GUILE_VERSION_MINOR=`echo $GUILE_VERSION | cut -d '.' -f 2`
+        AC_CHECK_PROGS(GUILE,guile$GUILE_VERSION_MAJOR.$GUILE_VERSION_MINOR guile$GUILE_VERSION_MAJOR guile)
         if test 0$GUILE_VERSION_MAJOR -lt 2; then
           if test 0$GUILE_VERSION_MAJOR -lt 1; then
-            GUILE=
+            GUILE_CONFIG=
           else
             if test 0$GUILE_VERSION_MINOR -lt 4; then
-             GUILE=
+             GUILE_CONFIG=
             fi
           fi
         fi
-        if test "x$GUILE" = "x"; then
+        if test "x$GUILE_CONFIG" = "x"; then
          use_guile="No (guile is too old)"
         else
-         GUILE_INCLUDES=$(guile-config compile)
-         GUILE_LIBS=$(guile-config link)
+         GUILE_INCLUDES=$($GUILE_CONFIG compile)
+         GUILE_LIBS=$($GUILE_CONFIG link)
          # don't die if PKG_CHECK_MODULES not available - el4, el5
           PKG_CHECK_MODULES([GUILE],
                [guile-2.0 >= "$GUILE_VERSION_MAJOR.$GUILE_VERSION_MINOR"],
@@ -738,7 +739,7 @@ else
           CPPFLAGS="$CPPFLAGS $GUILE_INCLUDES"
           AC_CHECK_HEADER(libguile.h,,[
             use_guile="No (guile header missing)"
-            GUILE=
+            GUILE_CONFIG=
           ])
           CFLAGS="$ac_save_CFLAGS"
           CPPFLAGS="$ac_save_CPPFLAGS"