I'm also using apxs, and for Apache module builders it would be handy to
be able to find this program easily. Here's the macro to do just that.
--snip--
dnl @synopsis AX_PROG_APXS
dnl
dnl Locates an installed apxs binary. Accepts --with-apxs, and failing
dnl that searches for apxs in the path (using AC_PATH_PROG). If apxs is found,
dnl $APXS is set to the full path of the binary; otherwise, nothing is changed.
dnl
dnl Example:
dnl
dnl AX_PROG_APXS
dnl if test -z "$APXS"
dnl then
dnl AC_MSG_ERROR("apxs not found")
dnl fi
dnl
dnl @author Dustin Mitchell <address@hidden>
AC_DEFUN([AX_PROG_APXS],
[
AC_MSG_CHECKING(for --with-apxs)
AC_ARG_WITH(apxs,
AC_HELP_STRING([--with-apxs=APXS],
[absolute path name of apxs executable]),
[
if test -f $withval -a -x $withval;
then
AC_MSG_RESULT($withval)
APXS="$withval"
AC_SUBST(APXS)
else
AC_MSG_RESULT($withval is not executable)
fi
], [
AC_MSG_RESULT(no)
])
# if it's not found, check the paths.
if test -z "$APXS"
then
AC_PATH_PROG(APXS, apxs, ,
/usr/local/apxs/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin)
AC_SUBST(APXS)
fi
])
--snip--