+ AC_MSG_RESULT($lang)
+
+ if test "$lang" = "unknown" ; then
+ STEPMAKE_WARN($language not supported; available are: $ALL_LINGUAS)
+ fi
+
+])
+
+
+AC_DEFUN(STEPMAKE_MAKEINFO, [
+ STEPMAKE_PROGS(MAKEINFO, makeinfo, $1)
+])
+
+
+AC_DEFUN(STEPMAKE_MAN, [
+ STEPMAKE_PROGS(GROFF, groff ditroff, $1)
+ AC_SUBST(GROFF)
+ STEPMAKE_PROGS(TROFF, troff, $1)
+ AC_SUBST(TROFF)
+ STEPMAKE_PROGS(TBL, tbl, $1)
+ AC_SUBST(TBL)
+])
+
+
+AC_DEFUN(STEPMAKE_MSGFMT, [
+ STEPMAKE_PROGS(MSGFMT, msgfmt, $1)
+])
+
+
+# Check for program ($2), set full path result to ($1).
+# If missing, add entry to missing-list ($3, one of 'OPTIONAL', 'REQUIRED')
+AC_DEFUN(STEPMAKE_PATH_PROG, [
+ AC_CHECK_PROGS($1, $2, no)
+ STEPMAKE_OPTIONAL_REQUIRED($1, $2, $3)
+ if test $? -eq 0; then
+ AC_PATH_PROGS($1, $2)
+ if test -n "$4"; then
+ STEPMAKE_CHECK_VERSION($1, $3, $4)
+ fi
+ fi
+])
+
+
+# Check for program in set of names ($2), set result to ($1) .
+# If missing, add entry to missing-list ($3, one of 'OPTIONAL', 'REQUIRED')
+# If exists, and a minimal version ($4) is required
+AC_DEFUN(STEPMAKE_PROGS, [
+ AC_CHECK_PROGS($1, $2, no)
+ STEPMAKE_OPTIONAL_REQUIRED($1, $2, $3)
+ if test $? -eq 0 -a -n "$4"; then
+ STEPMAKE_CHECK_VERSION($1, $3, $4)
+ fi
+])
+
+
+AC_DEFUN(STEPMAKE_PERL, [
+ STEPMAKE_PATH_PROG(PERL, perl, $1)
+])
+
+
+# Check for python, between minimum ($2) and maximum version ($3).
+# If missing, add entry to missing-list ($1, one of 'OPTIONAL', 'REQUIRED')
+AC_DEFUN(STEPMAKE_PYTHON, [
+ AC_MSG_CHECKING([for python])
+ python="python"
+ found="no"
+ for r in $PYTHON python python3 python3.3 python3.2 python3.1 python3.0 python2 python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0; do
+ exe=`STEPMAKE_GET_EXECUTABLE($r)`
+ if ! $exe -V > /dev/null 2>&1 ; then
+ continue
+ fi
+ ver=`STEPMAKE_GET_VERSION($exe)`
+ num=`STEPMAKE_NUMERIC_VERSION($ver)`
+ req=`STEPMAKE_NUMERIC_VERSION($2)`
+ sup=`STEPMAKE_NUMERIC_VERSION($3)`
+ if test -n "$2" && test "$num" -lt "$req"; then
+ python=["$r >= $2 (installed: $ver)"]
+ continue
+ else
+ if test -n "$3" && test "$num" -ge "$sup"; then
+ python=["$r < $3 (installed: $ver)"]
+ continue
+ else
+ python=$r
+ found=$r
+ break
+ fi
+ fi
+ done
+ AC_MSG_RESULT([$found])
+ if test "$found" != "no"; then
+ AC_MSG_CHECKING([$python version])
+ AC_MSG_RESULT([$ver])
+ PYTHON=$found
+ else
+ STEPMAKE_ADD_ENTRY($1, $python)
+ fi
+ AC_PATH_PROG(PYTHON, $PYTHON)
+ AC_SUBST(PYTHON)
+])
+
+# Check for python-config, between minimum ($2) and maximum version ($3).
+# If missing, add entry to missing-list ($1, one of 'OPTIONAL', 'REQUIRED')
+AC_DEFUN(STEPMAKE_PYTHON_DEVEL, [
+ AC_ARG_WITH(python-include,
+ [AS_HELP_STRING([--with-python-include=DIR],
+ [location of the python include dir])],[
+ if test "$withval" = "yes" -o "$withval" = "no"; then
+ AC_MSG_WARN(Usage: --with-python-include=includedir)
+ else
+ PYTHON_CFLAGS="-I${withval}"
+ fi
+ ])
+
+ AC_ARG_WITH(python-lib,
+ [AS_HELP_STRING([--with-python-lib=NAME],
+ [name of the python lib])],[
+ if test "$withval" = "yes" -o "$withval" = "no"; then
+ AC_MSG_WARN(Usage: --with-python-lib=name)
+ else
+ LDFLAGS="$LDFLAGS -l${withval}"
+ fi
+ ])
+
+ STEPMAKE_PYTHON($1, $2, $3)
+ AC_CHECK_PROGS(PYTHON_CONFIG, `basename $PYTHON`-config, no)
+
+ if test -z "$PYTHON_CFLAGS" -a "$PYTHON_CONFIG" != "no"; then
+ # Clean out junk: http://bugs.python.org/issue3290
+ # Python headers may need some -f* flags, leave them in.
+ # We want the sed commands to look like 's/-[WDOm][[:alnum:][:punct:]][[:alnum:][:punct:]]*//g' and 's/-arch [^[:space:]]*//g', but automake eats brackets.
+ #PYTHON_CFLAGS=`$PYTHON_CONFIG --cflags | sed -e 's/-[[WDOm]][[[:alnum:][:punct:]]][[[:alnum:][:punct:]]]*//g' | sed -e 's/-arch @<:@^@<:@:space:@:>@@:>@*//g'`
+ # The above sed BRE matches parts of legal options, stipping down part of that option, resulting in invalid gcc arguments. Gentoo Bug #415793
+ # For instance, '-floop-stip-mime' becomes '-floop-strip', and '-fvect-cost-model' becomes '-fvect-cost'.
+ # Tentative fix to require a non alphanumeric character before the initial hyphen of the BRE or the hyphen being the first character in the string.
+ PYTHON_CFLAGS=`$PYTHON_CONFIG --cflags | sed -e 's/\(^\|[[^[:alnum:]]]\)-[[WDOm]][[[:alnum:][:punct:]]][[[:alnum:][:punct:]]]*//g' | sed -e 's/-arch @<:@^@<:@:space:@:>@@:>@*//g'`
+ PYTHON_LDFLAGS=`$PYTHON_CONFIG --ldflags`
+ fi
+
+ if test -z "$PYTHON_CFLAGS" -a "$cross_compiling" = "no"; then
+ changequote(<<, >>)#dnl
+ # alternatively, for python >= 2.0
+ # 'import sys, distutils.sysconfig; sys.stdout.write (distutils.sysconfig.get_python_inc ())'
+ PYTHON_INCLUDE=`$PYTHON -c 'import sys; sys.stdout.write ("%s/include/python%s" % (sys.prefix, sys.version[:3]))'`
+ PYTHON_CFLAGS="-I$PYTHON_INCLUDE"
+ changequote([, ])#dnl
+ fi
+
+ if test -z "$PYTHON_HEADER"; then
+ CPPFLAGS="$PYTHON_CFLAGS $CPPFLAGS"
+ AC_CHECK_HEADERS([Python.h],[PYTHON_HEADER=yes])
+ fi
+
+ if test -z "$PYTHON_HEADER"; then
+ warn="Python.h (python-devel, python-dev or libpython-dev package)"
+ STEPMAKE_ADD_ENTRY($1, $warn)
+ fi
+ AC_SUBST(PYTHON_CFLAGS)
+ AC_SUBST(PYTHON_LDFLAGS)
+])
+
+
+
+AC_DEFUN(STEPMAKE_STL_DATA_METHOD, [
+ AC_CACHE_CHECK([for stl.data () method],
+ [stepmake_cv_stl_data_method],
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <vector>
+using namespace std;
+vector <int> v;
+void *p = v.data ();
+]])],
+ [stepmake_cv_stl_data_method=yes],
+ [stepmake_cv_stl_data_method=no]))
+ if test $stepmake_cv_stl_data_method = yes; then
+ AC_DEFINE(HAVE_STL_DATA_METHOD, 1, [define if stl classes have data () method])
+ fi
+])
+
+
+AC_DEFUN(STEPMAKE_TEXMF_DIRS, [
+ STEPMAKE_PROGS(KPSEWHICH, kpsewhich, $1)
+
+ AC_MSG_CHECKING(for metapost required files)
+ if test "$MFPLAIN_MP" = ""; then
+ MFPLAIN_MP=`kpsewhich -format=mp mfplain`
+ fi
+ if test "$MFPLAIN_MP" = ""; then
+ AC_MSG_RESULT(no)
+ STEPMAKE_ADD_ENTRY($1,['metapost CTAN package (texlive-metapost)'])
+ else
+ AC_MSG_RESULT(yes)
+ fi
+])
+
+AC_DEFUN(STEPMAKE_TEXMF, [
+ STEPMAKE_PROGS(METAFONT, mf-nowin mf mfw mfont, $1)
+ STEPMAKE_PROGS(METAPOST, mpost, $1)
+ if test "$METAPOST" != ""; then
+ ver=`STEPMAKE_GET_VERSION($METAPOST)`
+ num=`STEPMAKE_NUMERIC_VERSION($ver)`
+ # Avoid buggy metapost versions: 1.600 <= x < 1.803
+ if test "$num" -ge "1600000" -a "$num" -lt "1803000"; then
+ STEPMAKE_ADD_ENTRY($1, ["mpost (due to a bug in metapost, versions 1.600 <= x < 1.803 are not supported; installed: $ver)"])
+ fi
+ fi
+
+ AC_MSG_CHECKING(for working metafont mode)
+ modelist='ljfour lj4 lj3 lj2 ljet laserjet'
+ for MFMODE in $modelist; do
+ $METAFONT -progname=mf "\mode:=$MFMODE; mode_setup; end." > /dev/null 2>&1
+ if test -f mfput.tfm; then
+ break;
+ fi
+ done
+ AC_MSG_RESULT($MFMODE)
+
+ rm -f mfput.*
+
+ AC_SUBST(MFMODE)
+])
+
+
+AC_DEFUN(STEPMAKE_WARN, [
+ AC_MSG_WARN($1)
+ warn_b=yes
+])
+
+
+dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
+dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
+dnl also defines GSTUFF_PKG_ERRORS on error
+AC_DEFUN(PKG_CHECK_MODULES, [
+ succeeded=no
+
+ if test -z "$PKG_CONFIG"; then
+ AC_PATH_PROG(PKG_CONFIG, pkg-config, no)