# Get full path of executable ($1)
AC_DEFUN(STEPMAKE_GET_EXECUTABLE, [
- type -p "$1" 2>&1 | awk '{print $NF}'
+ ## which doesn't work in ash, if /usr/bin/which isn't installed
+ ## type -p doesn't work in ash
+ ## command -v doesn't work in zsh
+ ## command -v "$1" 2>&1
+ ## this test should work in ash, bash, pdksh (ksh), zsh
+ type -p "$1" 2>/dev/null | tail -1 | awk '{print $NF}'
])
# Return if tested proram ($1) was found (true) or not (false).
AC_DEFUN(STEPMAKE_CHECK_SEARCH_RESULT, [
r="`eval echo '$'"$1"`"
- if test -n "$r" -a "$r" != "error" -a "$r" != "no" && ! expr '`eval echo '$'"$1"`' : '.*\(echo\)' > /dev/null; then
+ if test -n "$r" -a "$r" != "error" -a "$r" != "no" && expr '`eval echo '$'"$1"`' : '.*\(echo\)' > /dev/null; then
+ true
+ else
##STEPMAKE_WARN(cannot find $2. $3)
false
- else
- true
fi
])
AC_DEFUN(STEPMAKE_CHECK_VERSION, [
r="`eval echo '$'"$1"`"
AC_MSG_CHECKING("$r version")
+ #exe=`STEPMAKE_GET_EXECUTABLE($r)`
exe=`STEPMAKE_GET_EXECUTABLE($r)`
ver=`STEPMAKE_GET_VERSION($exe)`
num=`STEPMAKE_NUMERIC_VERSION($ver)`
])
AC_DEFUN(STEPMAKE_CXX, [
- AC_LANG_CPLUSPLUS
+ AC_LANG([C++])
AC_PROG_CXX
STEPMAKE_OPTIONAL_REQUIRED(CXX, c++, $1)
AC_DEFUN(STEPMAKE_DATADIR, [
if test "$datadir" = "\${prefix}/share"; then
- datadir='${prefix}/share/'$package
+ datadir='${prefix}/share/'$package/$FULL_VERSION
fi
DIR_DATADIR=${datadir}
presome=${prefix}
AC_SUBST(datadir)
AC_SUBST(DIR_DATADIR)
-
- dnl yeah, so fuck me gently with a cactus: this doesnt belong here
- dnl Please take the person responsible for inventing shell-scripts out
- dnl and shoot him. On behalf of the sane world, thank you.
- dnl DIR_SHAREDSTATEDIR="foobar"
- dnl AC_SUBST(DIR_SHAREDSTATEDIR)
+
+ # we used to set DIR_SHAREDSTATEDIR here,
+ # but apparently that broke something
AC_DEFINE_UNQUOTED(DIR_DATADIR, "${DIR_DATADIR}")
])
AC_SUBST(OPTIONAL)
AC_SUBST(REQUIRED)
- AC_OUTPUT($CONFIGFILE.make:config.make.in)
+ AC_CONFIG_FILES([$CONFIGFILE.make:config.make.in])
+AC_OUTPUT
if test -n "$OPTIONAL"; then
# AC_PROG_LEX
# urg: automake 1.3: hope this doesn't break 1.2 ac_cv_pro_lex_root hack...
- # AC_DECL_YYTEXT
+ # AC_PROG_LEX()
# ugh, ugh
ac_cv_prog_lex_root=lex.yy
STEPMAKE_PROGS(FLEX, flex, $1)
AC_DEFUN(STEPMAKE_FLEXLEXER, [
- AC_HAVE_HEADERS(FlexLexer.h, true, false)
+ AC_CHECK_HEADERS([FlexLexer.h],[true],[false])
if test $? -ne 0; then
warn='FlexLexer.h (flex package)'
STEPMAKE_ADD_ENTRY($1, $warn)
AC_SUBST(INSTALL)
AC_DEFINE_UNQUOTED(DIRSEP, '${DIRSEP}')
AC_DEFINE_UNQUOTED(PATHSEP, '${PATHSEP}')
- AC_SUBST(PATHSEP)
AC_SUBST(DIRSEP)
+ AC_SUBST(PATHSEP)
+ AC_SUBST(ROOTSEP)
STEPMAKE_DATADIR
])
[kpathsea_b=$with_kpathsea])
if test "$kpathsea_b" != "no"; then
- AC_HAVE_HEADERS(kpathsea/kpathsea.h)
+ AC_CHECK_HEADERS([kpathsea/kpathsea.h])
AC_CHECK_LIB(kpathsea, kpse_find_file)
- AC_CHECK_FUNCS(kpse_find_file,, AC_ERROR(Cannot find kpathsea functions. You should install kpathsea; see INSTALL.txt. Rerun ./configure --without-kpathsea only if kpathsea is not available for your platform.))
+ AC_CHECK_FUNCS(kpse_find_file,, AC_MSG_ERROR([Cannot find kpathsea functions. You should install kpathsea; see INSTALL.txt. Rerun ./configure --without-kpathsea only if kpathsea is not available for your platform.]))
fi
AC_MSG_CHECKING(whether to use kpathsea)
if test "$kpathsea_b" != no; then
AC_DEFUN(STEPMAKE_PYTHON_DEVEL, [
- AC_HAVE_HEADERS(python2.2/Python.h python2.1/Python.h python2.0/Python.h python2/Python.h python/Python.h python1.5/Python.h Python.h, PYTHON_HEADER=yes)
+ AC_CHECK_HEADERS([python2.2/Python.h python2.1/Python.h python2.0/Python.h python2/Python.h python/Python.h python1.5/Python.h Python.h],[PYTHON_HEADER=yes])
if test -z "$PYTHON_HEADER"; then
warn='python.h (python-devel, python-dev or libpython-dev package)'
STEPMAKE_ADD_ENTRY($1, $warn)