summaryrefslogtreecommitdiffstats
path: root/m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4')
-rw-r--r--m4/apache.m433
1 files changed, 22 insertions, 11 deletions
diff --git a/m4/apache.m4 b/m4/apache.m4
index 3d76b72..ef9ce90 100644
--- a/m4/apache.m4
+++ b/m4/apache.m4
@@ -1,14 +1,17 @@
1dnl TEST_APACHE_VERSION([MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) 1dnl TEST_APACHE_VERSION(RELEASE, [MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
2dnl Test for Apache 2dnl Test for Apache
3dnl 3dnl
4AC_DEFUN(TEST_APACHE_VERSION, 4AC_DEFUN(TEST_APACHE_VERSION,
5[dnl 5[dnl
6 AC_REQUIRE([AC_CANONICAL_TARGET]) 6 AC_REQUIRE([AC_CANONICAL_TARGET])
7 7 releasetest=$1
8 min_apache_version="$1" 8 min_apache_version="$2"
9 no_apache="" 9 no_apache=""
10 ac_save_CFLAGS="$CFLAGS" 10 ac_save_CFLAGS="$CFLAGS"
11 CFLAGS="$CFLAGS $APACHE_CFLAGS" 11 CFLAGS="$CFLAGS $APACHE_CFLAGS"
12 if test $releasetest -eq 20; then
13 CFLAGS="$CFLAGS -I$APU_INCDIR -I$APR_INCDIR"
14 fi
12 15
13 AC_TRY_RUN([ 16 AC_TRY_RUN([
14#include <stdio.h> 17#include <stdio.h>
@@ -70,7 +73,7 @@ int main (int argc, char *argv[])
70 CFLAGS="$ac_save_CFLAGS" 73 CFLAGS="$ac_save_CFLAGS"
71 74
72 if test "x$no_apache" = x ; then 75 if test "x$no_apache" = x ; then
73 ifelse([$2], , :, [$2]) 76 ifelse([$3], , :, [$3])
74 else 77 else
75 if test -f conf.apachetest ; then 78 if test -f conf.apachetest ; then
76 : 79 :
@@ -90,7 +93,7 @@ int main(int argc, char *argv[])
90 [ echo "*** The test program failed to compile or link. Check config.log" ]) 93 [ echo "*** The test program failed to compile or link. Check config.log" ])
91 CFLAGS="$ac_save_CFLAGS" 94 CFLAGS="$ac_save_CFLAGS"
92 fi 95 fi
93 ifelse([$3], , :, [$3]) 96 ifelse([$4], , :, [$4])
94 fi 97 fi
95 rm -f conf.apachetest 98 rm -f conf.apachetest
96]) 99])
@@ -129,18 +132,24 @@ AC_ARG_ENABLE(
129 AC_MSG_ERROR([*** your path, or use the --with-apxs configure option]) 132 AC_MSG_ERROR([*** your path, or use the --with-apxs configure option])
130 else 133 else
131 APACHE_INCDIR=`$APXS_BIN -q INCLUDEDIR` 134 APACHE_INCDIR=`$APXS_BIN -q INCLUDEDIR`
132 APACHE_CPPFLAGS=`$APXS_BIN -q CFLAGS` 135 APR_INCDIR=`$APXS_BIN -q APR_INCLUDEDIR`
133 APACHE_CFLAGS="-I$APACHE_INCDIR" 136 APU_INCDIR=`$APXS_BIN -q APU_INCLUDEDIR`
137 APACHE_CPPFLAGS=`$APXS_BIN -q CPPFLAGS`
138 APACHE_CPPFLAGS="$APACHE_CPPFLAGS -I$APACHE_INCDIR"
139 APACHE_CFLAGS=`$APXS_BIN -q CFLAGS`
140 APACHE_CFLAGS="$APACHE_CFLAGS -I$APACHE_INCDIR"
134 APACHE_MODDIR=`$APXS_BIN -q LIBEXECDIR` 141 APACHE_MODDIR=`$APXS_BIN -q LIBEXECDIR`
135 142
136 if test "x$enable_apachetest" = "xyes" ; then 143 if test "x$enable_apachetest" = "xyes" ; then
137 if test "$min_apache20_version" != "no"; then 144 if test "$min_apache20_version" != "no"; then
138 AC_MSG_CHECKING(for Apache 2.0 version >= $min_apache20_version) 145 AC_MSG_CHECKING(for Apache 2.0 version >= $min_apache20_version)
139 TEST_APACHE_VERSION($min_apache20_version, 146 TEST_APACHE_VERSION(20,$min_apache20_version,
140 AC_MSG_RESULT(yes) 147 AC_MSG_RESULT(yes)
141 AC_DEFINE(WITH_APACHE20,1,[Define to 1 if we are compiling with Apache 2.0.x]) 148 AC_DEFINE(WITH_APACHE20,1,[Define to 1 if we are compiling with Apache 2.0.x])
142 APACHE_VERSION="20" 149 APACHE_VERSION="2.0"
143 APXS_EXTENSION=.la 150 APXS_EXTENSION=.la
151 APACHE_CFLAGS="$APACHE_CFLAGS -I$APU_INCDIR -I$APR_INCDIR"
152 APACHE_CPPFLAGS="$APACHE_CPPFLAGS -I$APU_INCDIR -I$APR_INCDIR"
144 APACHE_DEFS="-DWITH_APACHE20" 153 APACHE_DEFS="-DWITH_APACHE20"
145 ifelse([$4], , , $4), 154 ifelse([$4], , , $4),
146 AC_MSG_RESULT(no) 155 AC_MSG_RESULT(no)
@@ -151,10 +160,10 @@ AC_ARG_ENABLE(
151 fi 160 fi
152 if test "$min_apache13_version" != "no" -a "x$APACHE_VERSION" = "x"; then 161 if test "$min_apache13_version" != "no" -a "x$APACHE_VERSION" = "x"; then
153 AC_MSG_CHECKING(for Apache 1.3 version >= $min_apache13_version) 162 AC_MSG_CHECKING(for Apache 1.3 version >= $min_apache13_version)
154 TEST_APACHE_VERSION($min_apache13_version, 163 TEST_APACHE_VERSION(13,$min_apache13_version,
155 AC_MSG_RESULT(yes) 164 AC_MSG_RESULT(yes)
156 AC_DEFINE(WITH_APACHE13,1,[Define to 1 if we are compiling with Apache 1.3.x]) 165 AC_DEFINE(WITH_APACHE13,1,[Define to 1 if we are compiling with Apache 1.3.x])
157 APACHE_VERSION="13" 166 APACHE_VERSION="1.3"
158 APXS_EXTENSION=.so 167 APXS_EXTENSION=.so
159 APACHE_CFLAGS="-g $APACHE_CFLAGS" 168 APACHE_CFLAGS="-g $APACHE_CFLAGS"
160 APACHE_DEFS="-DWITH_APACHE13" 169 APACHE_DEFS="-DWITH_APACHE13"
@@ -168,6 +177,8 @@ AC_ARG_ENABLE(
168 AC_SUBST(APACHE_CFLAGS) 177 AC_SUBST(APACHE_CFLAGS)
169 AC_SUBST(APACHE_CPPFLAGS) 178 AC_SUBST(APACHE_CPPFLAGS)
170 AC_SUBST(APACHE_INCDIR) 179 AC_SUBST(APACHE_INCDIR)
180 AC_SUBST(APR_INCDIR)
181 AC_SUBST(APU_INCDIR)
171 AC_SUBST(APACHE_MODDIR) 182 AC_SUBST(APACHE_MODDIR)
172 AC_SUBST(APACHE_VERSION) 183 AC_SUBST(APACHE_VERSION)
173 AC_SUBST(APXS_EXTENSION) 184 AC_SUBST(APXS_EXTENSION)