diff options
author | Geert Janssens <geert@kobaltwit.be> | 2018-04-18 11:10:11 +0200 |
---|---|---|
committer | Geert Janssens <geert@kobaltwit.be> | 2018-04-20 08:36:47 +0200 |
commit | 0d2a6466549f34c74835943c979ee315feb3eda8 (patch) | |
tree | 62372605efb3d8b748ce4e508d56fc57796935fc /configure.ac | |
parent | 2ab3f4d744682d6512e216f57e0fb7cecea04169 (diff) | |
download | swig-0d2a6466549f34c74835943c979ee315feb3eda8.tar.gz |
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.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 21 |
1 files 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 |