Disable guile configuration if guile-config and guile report a different version

In addition
- inform the user when guile gets disabled while it was requested
- skip unecessary configuration work if guile gets disabled
This commit is contained in:
Geert Janssens 2018-04-19 16:22:56 +02:00
commit 7e798c1862

View file

@ -1710,7 +1710,7 @@ else
if test -n "$GUILE"; then
AC_MSG_RESULT([$GUILE])
else
AC_MSG_RESULT([not in guile-config, constructing path])
AC_MSG_RESULT([not found via guile-config - constructing path])
AC_MSG_CHECKING([for guile bindir])
guile_bindir="`$GUILE_CONFIG info bindir`"
AC_MSG_RESULT([$guile_bindir])
@ -1722,7 +1722,9 @@ else
fi
fi
if test -f "$GUILE" ; then
if ! test -f "$GUILE" ; then
AC_MSG_WARN([no suitable guile executable found. Disabling Guile])
else
AC_MSG_CHECKING([for guile version])
guile_version=`$GUILE -c '(display (effective-version))'`
AC_MSG_RESULT([$guile_version])
@ -1730,20 +1732,33 @@ else
guile_good_version=`$GUILE -c '(if (>= (string->number (effective-version)) 1.8) (display "yes") (display "no"))'`
AC_MSG_RESULT([$guile_good_version])
if test x"$guile_good_version" != xyes ; then
AC_MSG_WARN([at least guile version 1.8 is required. Disabling Guile])
GUILE=
fi
fi
if test -z "$GUILE_CFLAGS" ; then
AC_MSG_CHECKING([for guile compile flags])
GUILE_CFLAGS="`$GUILE_CONFIG compile`" # Note that this can sometimes be empty
AC_MSG_RESULT([$GUILE_CFLAGS])
if test -f "$GUILE" ; then
# Test if guile-config and guile versions match. They should.
gc_version="`$GUILE_CONFIG --version 2>&1 | sed '1 s/.* //;q'`"
g_version="`$GUILE --version | sed '1 s/.* //;q'`"
if test "$gc_version" != "$g_version"; then
AC_MSG_WARN([different versions reported by $GUILE_CONFIG ($gc_version) and $GUILE ($g_version). Disabling Guile])
GUILE=
fi
fi
if test -z "$GUILE_LIBS" ; then
AC_MSG_CHECKING([for guile link flags])
GUILE_LIBS="`$GUILE_CONFIG link`"
AC_MSG_RESULT([$GUILE_LIBS])
if test -f "$GUILE" ; then
if test -z "$GUILE_CFLAGS" ; then
AC_MSG_CHECKING([for guile compile flags])
GUILE_CFLAGS="`$GUILE_CONFIG compile`" # Note that this can sometimes be empty
AC_MSG_RESULT([$GUILE_CFLAGS])
fi
if test -z "$GUILE_LIBS" ; then
AC_MSG_CHECKING([for guile link flags])
GUILE_LIBS="`$GUILE_CONFIG link`"
AC_MSG_RESULT([$GUILE_LIBS])
fi
fi
fi
fi