+AC_DEFUN(STEPMAKE_FLEXLEXER_LOCATION, [
+ AC_MSG_CHECKING([FlexLexer.h location])
+
+ # ugh.
+ cat <<EOF > conftest.cc
+using namespace std;
+#include <FlexLexer.h>
+EOF
+ FLEXLEXER_FILE=`eval $ac_cpp conftest.cc | \
+ sed 's!# 1 "\(.*FlexLexer.h\)"!@FLEXLEXER@\1@@!g' | grep '@@' | \
+ sed 's!.*@FLEXLEXER@\(.*\)@@.*$!\1!g' ` 1> /dev/null 2> /dev/null
+ rm conftest.cc
+ AC_SUBST(FLEXLEXER_FILE)
+ AC_MSG_RESULT($FLEXLEXER_FILE)
+])
+
+AC_DEFUN(STEPMAKE_GCC, [
+ if test "$GCC" = "yes"; then
+ STEPMAKE_CHECK_VERSION(CC, $1, $2)
+ else
+ warn="$CC (Please install *GNU* cc)"
+ STEPMAKE_ADD_ENTRY($1, $warn)
+ fi
+])
+
+AC_DEFUN(STEPMAKE_GETTEXT, [
+ presome=${prefix}
+ if test "$prefix" = "NONE"; then
+ presome=${ac_default_prefix}
+ fi
+ LOCALEDIR=`echo ${localedir} | sed "s!\\\${prefix}!$presome!"`
+
+ AC_SUBST(localedir)
+ AC_DEFINE_UNQUOTED(LOCALEDIR, ["${LOCALEDIR}"])
+ AC_CHECK_LIB(intl, gettext)
+ AC_CHECK_FUNCS(gettext)
+])
+
+
+AC_DEFUN(STEPMAKE_GUILE, [
+ STEPMAKE_PATH_PROG(GUILE, guile, $1)
+])
+
+
+# STEPMAKE_GUILE_FLAGS --- set flags for compiling and linking with Guile
+#
+# This macro runs the guile-config script, installed with Guile,
+# to find out where Guile's header files and libraries are
+# installed. It sets two variables, marked for substitution, as
+# by AC_SUBST.
+#
+# GUILE_CFLAGS --- flags to pass to a C or C++ compiler to build
+# code that uses Guile header files. This is almost
+# always just a -I flag.
+#
+# GUILE_LDFLAGS --- flags to pass to the linker to link a
+# program against Guile. This includes -lguile for
+# the Guile library itself, any libraries that Guile
+# itself requires (like -lqthreads), and so on. It may
+# also include a -L flag to tell the compiler where to
+# find the libraries.
+
+AC_DEFUN([STEPMAKE_GUILE_FLAGS], [
+ exe=`STEPMAKE_GET_EXECUTABLE($guile_config)`
+ if test -x $exe; then
+ AC_MSG_CHECKING([guile compile flags])
+ GUILE_CFLAGS="`$guile_config compile`"
+ AC_MSG_RESULT($GUILE_CFLAGS)
+ AC_MSG_CHECKING([guile link flags])
+ GUILE_LDFLAGS="`$guile_config link`"
+ AC_MSG_RESULT($GUILE_LDFLAGS)
+ fi
+ AC_SUBST(GUILE_CFLAGS)
+ AC_SUBST(GUILE_LDFLAGS)
+])
+
+
+AC_DEFUN(STEPMAKE_GUILE_DEVEL, [
+ ## First, let's just see if we can find Guile at all.
+ test -n "$target_alias" && target_guile_config=$target_alias-guile-config
+ test -n "$host_alias" && host_guile_config=$host_alias-guile-config
+ AC_MSG_CHECKING([for guile-config])
+ for guile_config in $GUILE_CONFIG $target_guile_config $host_guile_config $build_guile_config guile-config; do
+ AC_MSG_RESULT([$guile_config])
+ if ! $guile_config --version > /dev/null 2>&1 ; then
+ AC_MSG_WARN([cannot execute $guile_config])
+ AC_MSG_CHECKING([if we are cross compiling])
+ GUILE_CONFIG='echo no guile-config'
+ else
+ GUILE_CONFIG=$guile_config
+ break
+ fi
+ done
+ STEPMAKE_OPTIONAL_REQUIRED(GUILE_CONFIG, $guile_config, $1)
+ if test $? -ne 0; then
+ STEPMAKE_ADD_ENTRY($1, 'guile-config (guile-devel, guile-dev or libguile-dev package)')
+ fi
+
+ STEPMAKE_CHECK_SEARCH_RESULT(GUILE_CONFIG)
+ # urg. should test functionality rather than version.
+ if test $? -eq 0 -a -n "$2"; then
+ STEPMAKE_CHECK_VERSION(GUILE_CONFIG, $1, $2)
+ fi
+
+ AC_SUBST(GUILE_CONFIG)
+
+ guile_version="$ver"
+ changequote(<<, >>)#dnl
+ GUILE_MAJOR_VERSION=`expr $guile_version : '\([0-9]*\)'`
+ GUILE_MINOR_VERSION=`expr $guile_version : '[0-9]*\.\([0-9]*\)'`
+ GUILE_PATCH_LEVEL=`expr $guile_version : '[0-9]*\.[0-9]*\.\([0-9]*\)'`
+ changequote([, ])#dnl
+ STEPMAKE_GUILE_FLAGS
+ save_CPPFLAGS="$CPPFLAGS"
+ save_LIBS="$LIBS"
+ CPPFLAGS="$GUILE_CFLAGS $CPPFLAGS"
+ LIBS="$GUILE_LDFLAGS $LIBS"
+ AC_CHECK_HEADERS([libguile.h])
+ AC_CHECK_LIB(guile, scm_boot_guile)
+ AC_CHECK_FUNCS(scm_boot_guile,,libguile_b=no)
+ if test "$libguile_b" = "no"; then
+ warn='libguile (libguile-dev, guile-devel or guile-dev
+ package).'
+ STEPMAKE_ADD_ENTRY(REQUIRED, $warn)
+ fi
+ CPPFLAGS="$save_CPPFLAGS"
+ LIBS="$save_LIBS"
+ AC_DEFINE_UNQUOTED(GUILE_MAJOR_VERSION, $GUILE_MAJOR_VERSION)
+ AC_DEFINE_UNQUOTED(GUILE_MINOR_VERSION, $GUILE_MINOR_VERSION)
+ AC_DEFINE_UNQUOTED(GUILE_PATCH_LEVEL, $GUILE_PATCH_LEVEL)
+])
+
+
+AC_DEFUN(STEPMAKE_DLOPEN, [
+ AC_CHECK_LIB(dl, dlopen)
+ AC_CHECK_FUNCS(dlopen)
+])
+
+AC_DEFUN(STEPMAKE_GXX, [
+ if test "$GXX" = "yes"; then
+ STEPMAKE_CHECK_VERSION(CXX, $1, $2)
+ else
+ warn="$CXX (Please install *GNU* c++)"
+ STEPMAKE_ADD_ENTRY($1, $warn)
+ fi
+])
+
+
+AC_DEFUN(STEPMAKE_INIT, [