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.
This commit is contained in:
Geert Janssens 2018-04-18 11:10:11 +02:00
commit 0d2a646654

View file

@ -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