1 | dnl |
---|
2 | dnl Macros to find an Apache installation |
---|
3 | dnl |
---|
4 | dnl This will find an installed Apache. |
---|
5 | dnl |
---|
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. |
---|
8 | dnl |
---|
9 | |
---|
10 | AC_DEFUN(SVN_FIND_APACHE,[ |
---|
11 | AC_REQUIRE([AC_CANONICAL_HOST]) |
---|
12 | |
---|
13 | HTTPD_WANTED_MMN="$1" |
---|
14 | |
---|
15 | AC_MSG_CHECKING(for Apache module support via DSO through APXS) |
---|
16 | AC_ARG_WITH(apxs, |
---|
17 | [AS_HELP_STRING([[--with-apxs[=FILE]]], |
---|
18 | [Build shared Apache modules. FILE is the optional |
---|
19 | pathname to the Apache apxs tool; defaults to |
---|
20 | "apxs".])], |
---|
21 | [ |
---|
22 | if test "$withval" = "yes"; then |
---|
23 | APXS=apxs |
---|
24 | else |
---|
25 | APXS="$withval" |
---|
26 | fi |
---|
27 | APXS_EXPLICIT=1 |
---|
28 | ]) |
---|
29 | |
---|
30 | if test -z "$APXS"; then |
---|
31 | for i in /usr/sbin /usr/local/apache/bin /usr/local/apache2/bin /usr/bin ; do |
---|
32 | if test -f "$i/apxs2"; then |
---|
33 | APXS="$i/apxs2" |
---|
34 | break |
---|
35 | fi |
---|
36 | if test -f "$i/apxs"; then |
---|
37 | APXS="$i/apxs" |
---|
38 | break |
---|
39 | fi |
---|
40 | done |
---|
41 | fi |
---|
42 | |
---|
43 | if test -n "$APXS" && test "$APXS" != "no"; then |
---|
44 | APXS_INCLUDE="`$APXS -q INCLUDEDIR`" |
---|
45 | if test -r $APXS_INCLUDE/mod_dav.h; then |
---|
46 | AC_MSG_RESULT(found at $APXS) |
---|
47 | |
---|
48 | AC_MSG_CHECKING([httpd version]) |
---|
49 | AC_EGREP_CPP(VERSION_OKAY, |
---|
50 | [ |
---|
51 | #include "$APXS_INCLUDE/ap_mmn.h" |
---|
52 | #if AP_MODULE_MAGIC_AT_LEAST($HTTPD_WANTED_MMN,0) |
---|
53 | VERSION_OKAY |
---|
54 | #endif], |
---|
55 | [AC_MSG_RESULT([recent enough])], |
---|
56 | [AC_MSG_RESULT([apache too old: mmn must be at least $HTTPD_WANTED_MMN]) |
---|
57 | if test "$APXS_EXPLICIT" != ""; then |
---|
58 | AC_MSG_ERROR([Apache APXS build explicitly requested, but apache version is too old]) |
---|
59 | fi |
---|
60 | APXS="" |
---|
61 | ]) |
---|
62 | |
---|
63 | elif test "$APXS_EXPLICIT" != ""; then |
---|
64 | AC_MSG_ERROR(no - APXS refers to an old version of Apache |
---|
65 | Unable to locate $APXS_INCLUDE/mod_dav.h) |
---|
66 | else |
---|
67 | AC_MSG_RESULT(no - Unable to locate $APXS_INCLUDE/mod_dav.h) |
---|
68 | APXS="" |
---|
69 | fi |
---|
70 | else |
---|
71 | AC_MSG_RESULT(no) |
---|
72 | fi |
---|
73 | |
---|
74 | if test -n "$APXS" && test "$APXS" != "no"; then |
---|
75 | AC_MSG_CHECKING([whether Apache version is compatible with APR version]) |
---|
76 | apr_major_version="${apr_version%%.*}" |
---|
77 | case "$apr_major_version" in |
---|
78 | 0) |
---|
79 | apache_minor_version_wanted_regex="0" |
---|
80 | ;; |
---|
81 | 1) |
---|
82 | apache_minor_version_wanted_regex=["[1-4]"] |
---|
83 | ;; |
---|
84 | *) |
---|
85 | AC_MSG_ERROR([unknown APR version]) |
---|
86 | ;; |
---|
87 | esac |
---|
88 | AC_EGREP_CPP([apache_minor_version= *$apache_minor_version_wanted_regex], |
---|
89 | [ |
---|
90 | #include "$APXS_INCLUDE/ap_release.h" |
---|
91 | apache_minor_version=AP_SERVER_MINORVERSION_NUMBER], |
---|
92 | [AC_MSG_RESULT([yes])], |
---|
93 | [AC_MSG_RESULT([no]) |
---|
94 | AC_MSG_ERROR([Apache version incompatible with APR version])]) |
---|
95 | fi |
---|
96 | |
---|
97 | AC_ARG_WITH(apache-libexecdir, |
---|
98 | [AS_HELP_STRING([[--with-apache-libexecdir[=PATH]]], |
---|
99 | [Install Apache modules to PATH instead of Apache's |
---|
100 | configured modules directory; PATH "no" |
---|
101 | or --without-apache-libexecdir means install |
---|
102 | to LIBEXECDIR.])], |
---|
103 | [ |
---|
104 | APACHE_LIBEXECDIR="$withval" |
---|
105 | ]) |
---|
106 | |
---|
107 | if test -n "$APXS" && test "$APXS" != "no"; then |
---|
108 | APXS_CC="`$APXS -q CC`" |
---|
109 | APACHE_INCLUDES="$APACHE_INCLUDES -I$APXS_INCLUDE" |
---|
110 | |
---|
111 | if test -z "$APACHE_LIBEXECDIR"; then |
---|
112 | APACHE_LIBEXECDIR="`$APXS -q libexecdir`" |
---|
113 | elif test "$APACHE_LIBEXECDIR" = 'no'; then |
---|
114 | APACHE_LIBEXECDIR="$libexecdir" |
---|
115 | fi |
---|
116 | |
---|
117 | BUILD_APACHE_RULE=apache-mod |
---|
118 | INSTALL_APACHE_RULE=install-mods-shared |
---|
119 | |
---|
120 | case $host in |
---|
121 | *-*-cygwin*) |
---|
122 | APACHE_LDFLAGS="-shrext .so" |
---|
123 | ;; |
---|
124 | esac |
---|
125 | else |
---|
126 | echo "==================================================================" |
---|
127 | echo "WARNING: skipping the build of mod_dav_svn" |
---|
128 | echo " try using --with-apxs" |
---|
129 | echo "==================================================================" |
---|
130 | fi |
---|
131 | |
---|
132 | AC_SUBST(APXS) |
---|
133 | AC_SUBST(APACHE_LDFLAGS) |
---|
134 | AC_SUBST(APACHE_INCLUDES) |
---|
135 | AC_SUBST(APACHE_LIBEXECDIR) |
---|
136 | |
---|
137 | # there aren't any flags that interest us ... |
---|
138 | #if test -n "$APXS" && test "$APXS" != "no"; then |
---|
139 | # CFLAGS="$CFLAGS `$APXS -q CFLAGS CFLAGS_SHLIB`" |
---|
140 | #fi |
---|
141 | |
---|
142 | if test -n "$APXS_CC" && test "$APXS_CC" != "$CC" ; then |
---|
143 | echo "==================================================================" |
---|
144 | echo "WARNING: You have chosen to compile Subversion with a different" |
---|
145 | echo " compiler than the one used to compile Apache." |
---|
146 | echo "" |
---|
147 | echo " Current compiler: $CC" |
---|
148 | echo " Apache's compiler: $APXS_CC" |
---|
149 | echo "" |
---|
150 | echo "This could cause some problems." |
---|
151 | echo "==================================================================" |
---|
152 | fi |
---|
153 | |
---|
154 | ]) |
---|