~svn/ubuntu/raring/subversion/ppa

« back to all changes in this revision

Viewing changes to build/ac-macros/svn-apache.m4

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-12-05 01:26:14 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051205012614-qom4xfypgtsqc2xq
Tags: 1.2.3dfsg1-3ubuntu1
Merge with the final Debian release of 1.2.3dfsg1-3, bringing in
fixes to the clean target, better documentation of the libdb4.3
upgrade and build fixes to work with swig1.3_1.3.27.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
dnl
 
2
dnl Macros to find an Apache installation
 
3
dnl
 
4
dnl This will find either an installed Apache, or an Apache source directory.
 
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. Similarly, without an Apache
 
8
dnl       source dir, we cannot create static builds of the system.
 
9
dnl
 
10
 
 
11
AC_DEFUN(SVN_FIND_APACHE,[
 
12
 
 
13
HTTPD_WANTED_MMN="$1"
 
14
 
 
15
AC_MSG_CHECKING(for static Apache module support)
 
16
AC_ARG_WITH(apache,
 
17
AC_HELP_STRING([--with-apache=DIR],
 
18
               [Build static Apache module.  DIR is the path to the top-level
 
19
                Apache source directory.]),
 
20
[
 
21
        if test "$withval" = "yes"; then
 
22
                AC_MSG_ERROR(You need to specify a directory with --with-apache)
 
23
        fi
 
24
 
 
25
        if test "$withval" = "no"; then
 
26
                BINNAME=""
 
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
 
31
                BINNAME=mod_dav_svn.a
 
32
 
 
33
                AC_MSG_RESULT(yes - Apache 2.0.x)
 
34
 
 
35
                AC_MSG_CHECKING([httpd version])
 
36
                AC_EGREP_CPP(VERSION_OKAY,
 
37
                [
 
38
#include "$withval/include/ap_mmn.h"
 
39
#if AP_MODULE_MAGIC_AT_LEAST($HTTPD_WANTED_MMN,0)
 
40
VERSION_OKAY
 
41
#endif],
 
42
                [AC_MSG_RESULT([recent enough])],
 
43
                [AC_MSG_ERROR([apache too old:  mmn must be at least $HTTPD_WANTED_MMN])])
 
44
 
 
45
                if test ! -r $withval/srclib/apr/include/apr.h; then
 
46
                        AC_MSG_WARN(Apache 2.0.x is not configured)
 
47
                fi
 
48
        else
 
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)
 
51
        fi
 
52
],[
 
53
    AC_MSG_RESULT(no)
 
54
])
 
55
 
 
56
 
 
57
AC_MSG_CHECKING(for Apache module support via DSO through APXS)
 
58
AC_ARG_WITH(apxs,
 
59
[[  --with-apxs[=FILE]      Build shared Apache module.  FILE is the optional
 
60
                          pathname to the Apache apxs tool; defaults to "apxs".]],
 
61
[
 
62
    if test "$BINNAME" != ""; then
 
63
      AC_MSG_ERROR(--with-apache and --with-apxs are mutually exclusive)
 
64
    fi
 
65
 
 
66
    if test "$withval" = "yes"; then
 
67
      APXS=apxs
 
68
    else
 
69
      APXS="$withval"
 
70
    fi
 
71
    APXS_EXPLICIT=1
 
72
])
 
73
 
 
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
 
77
      APXS="$i/apxs"
 
78
    fi
 
79
  done
 
80
fi
 
81
 
 
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)
 
86
 
 
87
        AC_MSG_CHECKING([httpd version])
 
88
        AC_EGREP_CPP(VERSION_OKAY,
 
89
        [
 
90
#include "$APXS_INCLUDE/ap_mmn.h"
 
91
#if AP_MODULE_MAGIC_AT_LEAST($HTTPD_WANTED_MMN,0)
 
92
VERSION_OKAY
 
93
#endif],
 
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])
 
98
         fi
 
99
         APXS=""
 
100
        ])
 
101
 
 
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)
 
105
    else
 
106
        AC_MSG_RESULT(no - Unable to locate $APXS_INCLUDE/mod_dav.h)
 
107
        APXS=""
 
108
    fi
 
109
else
 
110
    AC_MSG_RESULT(no)
 
111
fi
 
112
 
 
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"
 
116
 
 
117
    APXS_CC="`$APXS -q CC`"
 
118
    APACHE_INCLUDES="$APACHE_INCLUDES -I$APXS_INCLUDE"
 
119
    APACHE_LIBEXECDIR="`$APXS -q libexecdir`"
 
120
 
 
121
    INSTALL_APACHE_RULE=install-mods-shared
 
122
 
 
123
    AC_SUBST(APXS)
 
124
    AC_SUBST(BINNAME)
 
125
    AC_SUBST(INSTALL_IT)
 
126
fi
 
127
 
 
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 "=================================================================="
 
134
else
 
135
    BUILD_APACHE_RULE=apache-mod
 
136
fi
 
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)
 
142
 
 
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`"
 
146
#fi
 
147
 
 
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."
 
152
  echo ""
 
153
  echo "    Current compiler:      $CC"
 
154
  echo "   Apache's compiler:      $APXS_CC"
 
155
  echo ""
 
156
  echo "This could cause some problems."
 
157
  echo "=================================================================="
 
158
fi
 
159
 
 
160
])