From 0d2a6466549f34c74835943c979ee315feb3eda8 Mon Sep 17 00:00:00 2001 From: Geert Janssens Date: Wed, 18 Apr 2018 11:10:11 +0200 Subject: [PATCH] guile - use more reliable method of finding guile executable based on guile-config This allows to only specify --with-guile-config=xyz to configure and it will pick up the correct guile executable in case more versions of guile are installed on the same system. For example on Fedora 27, I have /usr/bin/guile1.8 /usr/bin/guile (which is guile 2.0) /usr/bin/guile2.2 Without this patch the configure script would always pick /usr/bin/guile regardless of which guile-config I would specify (guile1.8-config, guile-config or guile-config2.2). With the patch guile2.2 is now correctly picked for guile-config2.2. Unfortunately it still won't work with guile 1.8 because that version can't provide the executable name via guile-config yet. In that case configure will fall back to the old behaviour. On my Fedora 27 system that would mean it would still pick the wrong executable. However this is not critical because that as well can be overridden by setting --with-guile=abc. I don't see an easy way to improve on this. --- configure.ac | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/configure.ac b/configure.ac index 833cb37bf..664c0fa1a 100644 --- a/configure.ac +++ b/configure.ac @@ -1704,13 +1704,20 @@ else fi if test -n "$GUILE_CONFIG" ; then if test x"$GUILE" = xyes; then - AC_MSG_CHECKING([for guile bindir]) - guile_bindir="`$GUILE_CONFIG info bindir`" - AC_MSG_RESULT([$guile_bindir]) - GUILE=$guile_bindir/guile - if ! test -f "$GUILE" ; then - GUILE= - AC_PATH_PROG(GUILE, guile) + AC_MSG_CHECKING([for guile executable]) + if $GUILE_CONFIG info guile > /dev/null 2>&1; then + GUILE="`$GUILE_CONFIG info guile`" + AC_MSG_RESULT([$GUILE]) + else + AC_MSG_RESULT([not in guile-config, constructing path]) + AC_MSG_CHECKING([for guile bindir]) + guile_bindir="`$GUILE_CONFIG info bindir`" + AC_MSG_RESULT([$guile_bindir]) + GUILE=$guile_bindir/guile + if ! test -f "$GUILE" ; then + GUILE= + AC_PATH_PROG(GUILE, guile) + fi fi fi