Check for an existing MIT Scheme in top-level Setup.sh and configure.
authorTaylor R Campbell <campbell@mumble.net>
Mon, 2 Nov 2009 16:16:02 +0000 (11:16 -0500)
committerTaylor R Campbell <campbell@mumble.net>
Mon, 2 Nov 2009 16:16:02 +0000 (11:16 -0500)
src/Setup.sh
src/configure.ac

index 459c63dc97e92a43c6a520305a85edbebe58b943..3d59e71a57fae1d3a80fe507d8092d69df6fce2b 100755 (executable)
 
 set -e
 
+: ${MIT_SCHEME_EXE:=mit-scheme}
+
+if ! ${MIT_SCHEME_EXE} --batch-mode --eval '(%exit)' > /dev/null 2> /dev/null
+then
+    cat <<EOF >&2
+This script needs an existing MIT/GNU Scheme installation to function.
+
+If you have installed MIT/GNU Scheme in an unusual location, or with
+an unusual name, set the environment variable MIT_SCHEME_EXE to the
+name or pathname of the MIT/GNU Scheme executable, which is usually
+\`mit-scheme' or \`/usr/local/bin/mit-scheme', and set the environment
+variable MITSCHEME_LIBRARY_PATH to the pathname of the MIT/GNU Scheme
+library directory, which is usually \`/usr/local/lib/mit-scheme'.
+EOF
+    exit 1
+fi
+
 if [ ! -x configure ]; then
     echo "autoconf"
     autoconf
index f6f1960340ae811fe43b88f758a0cf65c6b0cbac..d437bf6647dce0d9303c93151dd9eea61ff34846 100644 (file)
@@ -44,6 +44,25 @@ c)
     INSTALL_COM='$(INSTALL_DATA)'
     INSTALL_LIARC_BUNDLES=
     AUXDIR_NAME=mit-scheme
+
+    AC_MSG_CHECKING([for an existing MIT/GNU Scheme installation])
+    : ${MIT_SCHEME_EXE:=mit-scheme}
+    if ! ${MIT_SCHEME_EXE} --batch-mode --eval '(%exit)'       \
+       > /dev/null 2> /dev/null
+    then
+       AC_MSG_ERROR([
+This script needs an existing MIT/GNU Scheme installation to function.
+
+If you have installed MIT/GNU Scheme in an unusual location, or with
+an unusual name, set the environment variable MIT_SCHEME_EXE to the
+name or pathname of the MIT/GNU Scheme executable, which is usually
+\`mit-scheme' or \`/usr/local/bin/mit-scheme', and set the environment
+variable MITSCHEME_LIBRARY_PATH to the pathname of the MIT/GNU Scheme
+library directory, which is usually \`/usr/local/lib/mit-scheme'.
+])
+    else
+       AC_MSG_RESULT([yes])
+    fi
     ;;
 esac
 AUXDIR='$(libdir)'/${AUXDIR_NAME}