source: valtobtest/subversion-1.6.2/build/ac-macros/apache.m4 @ 3

Last change on this file since 3 was 3, checked in by valtob, 15 years ago

subversion source 1.6.2 as test

File size: 4.5 KB
Line 
1dnl
2dnl Macros to find an Apache installation
3dnl
4dnl This will find an installed Apache.
5dnl
6dnl Note: If we don't have an installed Apache, then we can't install the
7dnl       (dynamic) mod_dav_svn.so module.
8dnl
9
10AC_DEFUN(SVN_FIND_APACHE,[
11AC_REQUIRE([AC_CANONICAL_HOST])
12
13HTTPD_WANTED_MMN="$1"
14
15AC_MSG_CHECKING(for Apache module support via DSO through APXS)
16AC_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
30if 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
41fi
42
43if 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)
53VERSION_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
70else
71    AC_MSG_RESULT(no)
72fi
73
74if 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"
91apache_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])])
95fi
96
97AC_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
107if 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
125else
126    echo "=================================================================="
127    echo "WARNING: skipping the build of mod_dav_svn"
128    echo "         try using --with-apxs"
129    echo "=================================================================="
130fi
131
132AC_SUBST(APXS)
133AC_SUBST(APACHE_LDFLAGS)
134AC_SUBST(APACHE_INCLUDES)
135AC_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
142if 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 "=================================================================="
152fi
153
154])
Note: See TracBrowser for help on using the repository browser.