On my Ubuntu linux box, the Apache2 apxs is installed as 'apxs2', and
the httpd binary is installed in the SBINDIR, not BINDIR, and is not
named httpd, so the current configure script can't find it. Here's an
updated version that makes two changes, first it lets you specify a full
path to the apxs binary, second it makes the search for the apache
binary check both the SBINDIR and BINDIR directories, and makes it query
apxs for the actual program name.
A log message and patch follows.
-garrett
* configure.ac
(CHECK_VERSION): try the SBINDIR directory in addition to the BINDIR,
and query apxs for the httpd program name instead of hardcoding
httpd.
(APACHE_DIR): interpret an argument that points to a file as the full
path to apxs.
Index: configure.ac
===================================================================
--- configure.ac (revision 232623)
+++ configure.ac (working copy)
@@ -4,7 +4,14 @@
AC_DEFUN([CHECK_VERSION],[dnl
min_apache_version=ifelse([$1], ,no,$1)
AP_BIN=`$APXS_BIN -q BINDIR`
- our_apache_version=`$AP_BIN/httpd -v | grep -i Apache |
+ AP_SBIN=`$APXS_BIN -q SBINDIR`
+ AP_PROG=`$APXS_BIN -q PROGNAME`
+ if test -e "$AP_BIN/$AP_PROG"; then
+ AP_PATH="$AP_BIN/$AP_PROG"
+ else
+ AP_PATH="$AP_SBIN/$AP_PROG"
+ fi
+ our_apache_version=`$AP_PATH -v | grep -i Apache |
sed -e 's/.*Apache\///' | tr -dc [^0-9.]`
AC_MSG_CHECKING(for Apache version >= $min_apache_version)
@@ -27,14 +34,16 @@
apxs_prefix="$withval",
)
- if test ! -d $apxs_prefix; then
- apxs_prefix=`dirname $apxs_prefix`
+ if test -d $apxs_prefix; then
+ apxs_prefix=`dirname $apxs_prefix`
+
+ test_paths="$apxs_prefix:$apxs_prefix/bin:$apxs_prefix/sbin"
+ test_paths="${test_paths}:${PATH}:/usr/bin:/usr/sbin"
+ test_paths="${test_paths}:/usr/local/bin:/usr/local/sbin:/usr/local/apache2/bin"
+ AC_PATH_PROG(APXS_BIN, apxs, no, [$test_paths])
+ else
+ APXS_BIN="$withval"
fi
-
- test_paths="$apxs_prefix:$apxs_prefix/bin:$apxs_prefix/sbin"
- test_paths="${test_paths}:${PATH}:/usr/bin:/usr/sbin"
- test_paths="${test_paths}:/usr/local/bin:/usr/local/sbin:/usr/local/apache2/bin"
- AC_PATH_PROG(APXS_BIN, apxs, no, [$test_paths])
if test "$APXS_BIN" = "no"; then
AC_MSG_ERROR([*** The apxs binary installed by apache could not be found!])