Test for Apache executable in sbin dirs
authorDan Scott <dscott@laurentian.ca>
Sun, 27 Jan 2013 16:08:12 +0000 (11:08 -0500)
committerBen Shum <bshum@biblio.org>
Mon, 28 Jan 2013 22:33:54 +0000 (17:33 -0500)
Debian apparently doesn't include /usr/sbin in the default user PATH, so
add an APXS2-like lookup with likely locations if we don't find the
apache executable in our standard path.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Signed-off-by: Ben Shum <bshum@biblio.org>

configure.ac

index d23354d..8896f2b 100644 (file)
@@ -213,9 +213,18 @@ AC_SUBST([APR_HEADERS])
 # Collect apache version number. If for nothing else, this
 # guarantees that httpd is a working apache executable.
 #
-changequote(<<, >>)dnl
 APACHE=`$APXS2 -q progname`
-APACHE_READABLE_VERSION=`$APACHE -v | grep 'Server version' | sed -e 's;.*Apache/\([0-9\.][0-9\.]*\).*;\1;'`
+AC_PATH_PROG(APACHE_PATH, [$APACHE], [])
+if test -z "$APACHE_PATH" ; then
+       for i in /usr/bin /usr/sbin /usr/local/apache/bin /usr/local/apache2/bin ; do
+        if test -x "$i/$APACHE"; then
+            APACHE_PATH="$i/$APACHE"
+            break
+        fi
+       done
+fi
+changequote(<<, >>)dnl
+APACHE_READABLE_VERSION=`$APACHE_PATH -v | grep 'Server version' | sed -e 's;.*Apache/\([0-9\.][0-9\.]*\).*;\1;'`
 changequote([, ])dnl
 APACHE_VERSION=`echo $APACHE_READABLE_VERSION | sed -e 's/\.//g'`
 if test -z "$APACHE_VERSION" ; then