# 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}'
])
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_SUBST(DIR_DATADIR)
# we used to set DIR_SHAREDSTATEDIR here,
- but apparently that broke something
+ # but apparently that broke something
AC_DEFINE_UNQUOTED(DIR_DATADIR, "${DIR_DATADIR}")
])