2
dnl Macros to find an Apache installation
4
dnl This will find either an installed Apache, or an Apache source directory.
6
dnl Note: If we don't have an installed Apache, then we can't install the
7
dnl (dynamic) mod_dav_svn.so module. Similarly, without an Apache
8
dnl source dir, we cannot create static builds of the system.
11
AC_DEFUN(SVN_FIND_APACHE,[
15
AC_MSG_CHECKING(for static Apache module support)
17
AC_HELP_STRING([--with-apache=DIR],
18
[Build static Apache module. DIR is the path to the top-level
19
Apache source directory.]),
21
if test "$withval" = "yes"; then
22
AC_MSG_ERROR(You need to specify a directory with --with-apache)
25
if test "$withval" = "no"; then
27
elif test -r $withval/modules/dav/main/mod_dav.h; then
28
APACHE_INCLUDES="$APACHE_INCLUDES -I$withval/include -I$withval/os/unix -I$withval/modules/dav/main -I$withval/srclib/apr/include -I$withval/srclib/apr-util/include"
29
APACHE_TARGET=$withval/modules/dav/svn
30
INSTALL_APACHE_RULE=install-mods-static
33
AC_MSG_RESULT(yes - Apache 2.0.x)
35
AC_MSG_CHECKING([httpd version])
36
AC_EGREP_CPP(VERSION_OKAY,
38
#include "$withval/include/ap_mmn.h"
39
#if AP_MODULE_MAGIC_AT_LEAST($HTTPD_WANTED_MMN,0)
42
[AC_MSG_RESULT([recent enough])],
43
[AC_MSG_ERROR([apache too old: mmn must be at least $HTTPD_WANTED_MMN])])
45
if test ! -r $withval/srclib/apr/include/apr.h; then
46
AC_MSG_WARN(Apache 2.0.x is not configured)
49
dnl if they pointed us at the wrong place, then just bail
50
AC_MSG_ERROR(no - Unable to locate $withval/modules/dav/main/mod_dav.h)
57
AC_MSG_CHECKING(for Apache module support via DSO through APXS)
59
[[ --with-apxs[=FILE] Build shared Apache module. FILE is the optional
60
pathname to the Apache apxs tool; defaults to "apxs".]],
62
if test "$BINNAME" != ""; then
63
AC_MSG_ERROR(--with-apache and --with-apxs are mutually exclusive)
66
if test "$withval" = "yes"; then
74
if test "$BINNAME" = "" -a "$APXS" = ""; then
75
for i in /usr/sbin /usr/local/apache/bin /usr/local/apache2/bin ; do
76
if test -f "$i/apxs"; then
82
if test -n "$APXS" -a "$APXS" != "no"; then
83
APXS_INCLUDE="`$APXS -q INCLUDEDIR`"
84
if test -r $APXS_INCLUDE/mod_dav.h; then
85
AC_MSG_RESULT(found at $APXS)
87
AC_MSG_CHECKING([httpd version])
88
AC_EGREP_CPP(VERSION_OKAY,
90
#include "$APXS_INCLUDE/ap_mmn.h"
91
#if AP_MODULE_MAGIC_AT_LEAST($HTTPD_WANTED_MMN,0)
94
[AC_MSG_RESULT([recent enough])],
95
[AC_MSG_RESULT([apache too old: mmn must be at least $HTTPD_WANTED_MMN])
96
if test "$APXS_EXPLICIT" != ""; then
97
AC_MSG_ERROR([Apache APXS build explicitly requested, but apache version is too old])
102
elif test "$APXS_EXPLICIT" != ""; then
103
AC_MSG_ERROR(no - APXS refers to an old version of Apache
104
Unable to locate $APXS_INCLUDE/mod_dav.h)
106
AC_MSG_RESULT(no - Unable to locate $APXS_INCLUDE/mod_dav.h)
113
if test -n "$APXS" -a "$APXS" != "no"; then
114
BINNAME=mod_dav_svn.so
115
INSTALL_IT="\$(APXS) -i -a -n dav_svn $BINNAME"
117
APXS_CC="`$APXS -q CC`"
118
APACHE_INCLUDES="$APACHE_INCLUDES -I$APXS_INCLUDE"
119
APACHE_LIBEXECDIR="`$APXS -q libexecdir`"
121
INSTALL_APACHE_RULE=install-mods-shared
128
# If we did not find a way to build/install mod_dav, then bail out.
129
if test "$BINNAME" = ""; then
130
echo "=================================================================="
131
echo "WARNING: skipping the build of mod_dav_svn"
132
echo " --with-apxs or --with-apache must be used"
133
echo "=================================================================="
135
BUILD_APACHE_RULE=apache-mod
137
AC_SUBST(APACHE_TARGET)
138
AC_SUBST(APACHE_INCLUDES)
139
AC_SUBST(APACHE_LIBEXECDIR)
140
AC_SUBST(BUILD_APACHE_RULE)
141
AC_SUBST(INSTALL_APACHE_RULE)
143
# there aren't any flags that interest us ...
144
#if test -n "$APXS" -a "$APXS" != "no"; then
145
# CFLAGS="$CFLAGS `$APXS -q CFLAGS CFLAGS_SHLIB`"
148
if test -n "$APXS_CC" && test "$APXS_CC" != "$CC" ; then
149
echo "=================================================================="
150
echo "WARNING: You have chosen to compile Subversion with a different"
151
echo " compiler than the one used to compile Apache."
153
echo " Current compiler: $CC"
154
echo " Apache's compiler: $APXS_CC"
156
echo "This could cause some problems."
157
echo "=================================================================="