summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorGeert Janssens <geert@kobaltwit.be>2018-04-19 16:22:56 +0200
committerGeert Janssens <geert@kobaltwit.be>2018-04-20 08:41:15 +0200
commit7e798c18621d1b1b8291a6c8080692e1a3852e4b (patch)
tree748857daf5c98dedf0958b381e878a810c9757b8 /configure.ac
parentb02cb7e0bcf0ae747355b988b45900ed81538823 (diff)
downloadswig-7e798c18621d1b1b8291a6c8080692e1a3852e4b.tar.gz
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
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac35
1 files changed, 25 insertions, 10 deletions
diff --git a/configure.ac b/configure.ac
index 0720ad66f..789311d53 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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