~ubuntu-branches/ubuntu/natty/libapache-mod-security/natty-updates

« back to all changes in this revision

Viewing changes to apache2/configure.in

  • Committer: Bazaar Package Importer
  • Author(s): Alberto Gonzalez Iniesta
  • Date: 2008-08-08 13:31:56 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20080808133156-6jqb24apsw787v33
Tags: 2.5.6-1
* The 'Back to the archive!' Release (Closes: #487431)
* Drop '2' from package name, now libapache-mod-security
* New upstream release
  - Includes a new licensing exception that allows binary 
    distribution with licenses not compatible with GPLv2,
    such as Apache's. See MODSECURITY_LICENSING_EXCEPTION
* Removed debian/bug and debian/rules entry to install bug
  handling when out of the archive.
* Bumped Standards-Version to 3.8.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
dnl
 
2
dnl Autoconf configuration for ModSecurity
 
3
dnl
 
4
dnl     Use ./buildconf to produce a configure script
 
5
dnl
 
6
 
 
7
AC_PREREQ(2.50)
 
8
 
 
9
AC_INIT()
 
10
dnl AC_INIT(ModSecurity, 2.5, mod-security-users@lists.sourceforge.net, modsecurity-apache)
 
11
AC_CONFIG_SRCDIR([mod_security2.c])
 
12
AC_CONFIG_HEADER([mod_security2_config.h])
 
13
AC_CONFIG_AUX_DIR([build])
 
14
 
 
15
# Checks for programs.
 
16
AC_PROG_CXX
 
17
AC_PROG_CC
 
18
AC_PROG_CPP
 
19
AC_PROG_INSTALL
 
20
AC_PROG_LN_S
 
21
AC_PROG_MAKE_SET
 
22
AC_PROG_RANLIB
 
23
AC_PATH_PROGS(PERL, [perl perl5], )
 
24
 
 
25
# Checks for header files.
 
26
AC_HEADER_STDC
 
27
AC_CHECK_HEADERS([fcntl.h limits.h stdlib.h string.h unistd.h])
 
28
 
 
29
# Checks for typedefs, structures, and compiler characteristics.
 
30
AC_C_CONST
 
31
AC_C_INLINE
 
32
AC_C_RESTRICT
 
33
AC_TYPE_SIZE_T
 
34
AC_STRUCT_TM
 
35
AC_TYPE_UINT8_T
 
36
 
 
37
# Checks for library functions.
 
38
AC_FUNC_MALLOC
 
39
AC_FUNC_MEMCMP
 
40
AC_CHECK_FUNCS([atexit fchmod getcwd memset strcasecmp strchr strdup strerror strncasecmp strrchr strstr strtol])
 
41
 
 
42
# Some directories
 
43
MSC_BASE_DIR=`pwd`
 
44
MSC_PKGBASE_DIR="$MSC_BASE_DIR/.."
 
45
MSC_TEST_DIR="$MSC_BASE_DIR/t"
 
46
MSC_REGRESSION_DIR="$MSC_TEST_DIR/regression"
 
47
MSC_REGRESSION_SERVERROOT_DIR="$MSC_REGRESSION_DIR/server_root"
 
48
MSC_REGRESSION_CONF_DIR="$MSC_REGRESSION_SERVERROOT_DIR/conf"
 
49
MSC_REGRESSION_LOGS_DIR="$MSC_REGRESSION_SERVERROOT_DIR/logs"
 
50
MSC_REGRESSION_DOCROOT_DIR="$MSC_REGRESSION_SERVERROOT_DIR/htdocs"
 
51
 
 
52
AC_SUBST(MSC_BASE_DIR)
 
53
AC_SUBST(MSC_PKGBASE_DIR)
 
54
AC_SUBST(MSC_TEST_DIR)
 
55
AC_SUBST(MSC_REGRESSION_DIR)
 
56
AC_SUBST(MSC_REGRESSION_SERVERROOT_DIR)
 
57
AC_SUBST(MSC_REGRESSION_CONF_DIR)
 
58
AC_SUBST(MSC_REGRESSION_LOGS_DIR)
 
59
AC_SUBST(MSC_REGRESSION_DOCROOT_DIR)
 
60
 
 
61
# Find apxs
 
62
AC_MSG_NOTICE(looking for Apache module support via DSO through APXS)
 
63
AC_ARG_WITH(apxs,
 
64
            [AS_HELP_STRING([[--with-apxs=FILE]],
 
65
                            [FILE is the path to apxs; defaults to "apxs".])],
 
66
[
 
67
  if test "$withval" = "yes"; then
 
68
    APXS=apxs
 
69
  else
 
70
    APXS="$withval"
 
71
  fi
 
72
])
 
73
 
 
74
if test -z "$APXS"; then
 
75
  for i in /usr/local/apache22/bin \
 
76
           /usr/local/apache2/bin \
 
77
           /usr/local/apache/bin \
 
78
           /usr/local/sbin \
 
79
           /usr/local/bin \
 
80
           /usr/sbin \
 
81
           /usr/bin;
 
82
  do
 
83
    if test -f "$i/apxs2"; then
 
84
      APXS="$i/apxs2"
 
85
      break
 
86
    elif test -f "$i/apxs"; then
 
87
      APXS="$i/apxs"
 
88
      break
 
89
    fi
 
90
  done
 
91
fi
 
92
 
 
93
# arbitrarily picking the same version subversion looks for, don't know how
 
94
# accurate this really is, but at least it'll force us to have apache2...
 
95
HTTPD_WANTED_MMN=20020903
 
96
 
 
97
if test -n "$APXS" -a "$APXS" != "no" -a -x "$APXS" ; then
 
98
  APXS_INCLUDE="`$APXS -q INCLUDEDIR`"
 
99
  if test -r $APXS_INCLUDE/httpd.h; then
 
100
    AC_MSG_NOTICE(found apxs at $APXS)
 
101
    AC_MSG_NOTICE(checking httpd version)
 
102
    AC_EGREP_CPP(VERSION_OK,
 
103
    [
 
104
#include "$APXS_INCLUDE/ap_mmn.h"
 
105
#if AP_MODULE_MAGIC_AT_LEAST($HTTPD_WANTED_MMN,0)
 
106
VERSION_OK
 
107
#endif],
 
108
    [AC_MSG_NOTICE(httpd is recent enough)],
 
109
    [AC_MSG_ERROR(apache is too old, mmn must be at least $HTTPD_WANTED_MMN)])
 
110
  fi
 
111
  APXS_INCLUDEDIR="`$APXS -q INCLUDEDIR`"
 
112
  # Make sure the include dir is used
 
113
  if test -n "$APXS_INCLUDEDIR"; then
 
114
    APXS_INCLUDES="-I${APXS_INCLUDEDIR} `$APXS -q INCLUDES` `$APXS -q EXTRA_INCLUDES`"
 
115
  else
 
116
    APXS_INCLUDES="`$APXS -q INCLUDES` `$APXS -q EXTRA_INCLUDES`"
 
117
  fi
 
118
  APXS_CFLAGS="`$APXS -q CFLAGS` `$APXS -q EXTRA_CFLAGS`"
 
119
  APXS_LDFLAGS="`$APXS -q LDFLAGS` `$APXS -q EXTRA_LDFLAGS`"
 
120
  APXS_LIBDIR="`$APXS -q LIBDIR`"
 
121
  # Make sure the lib dir is used
 
122
  if test -n "$APXS_LIBDIR"; then
 
123
    APXS_LIBS="-L{$APXS_LIBDIR} `$APXS -q LIBS` `$APXS -q EXTRA_LIBS`"
 
124
  else
 
125
    APXS_LIBS="`$APXS -q LIBS` `$APXS -q EXTRA_LIBS`"
 
126
  fi
 
127
  APXS_LIBTOOL="`$APXS -q LIBTOOL`"
 
128
  APXS_CC="`$APXS -q CC`"
 
129
  APXS_BINDIR="`$APXS -q BINDIR`"
 
130
  APXS_SBINDIR="`$APXS -q SBINDIR`"
 
131
  APXS_PROGNAME="`$APXS -q PROGNAME`"
 
132
  if test "$APXS_SBINDIR" = "/"; then
 
133
    APXS_HTTPD="$APXS_SBINDIR/$APXS_PROGNAME"
 
134
  else
 
135
    APXS_HTTPD="$APXS_SBINDIR/$APXS_PROGNAME"
 
136
  fi
 
137
else
 
138
  AC_MSG_ERROR(couldn't find APXS)
 
139
fi
 
140
 
 
141
# Use Apache httpd source srclib as base for pcre, apr and apu config scripts
 
142
AC_ARG_WITH(httpd-src,
 
143
            [AS_HELP_STRING([[--with-httpd-src=PATH]],
 
144
                            [PATH is to the Apache httpd source tree where srclib will be used as a base for pcre, apr and apu config scripts.])],
 
145
[
 
146
  if test -n "$withval"; then
 
147
    CPPFLAGS="$CPPFLAGS -I$withval/srclib/pcre"
 
148
    LDFLAGS="$LDFLAGS -L$withval/srclib/pcre"
 
149
    pcre_path="$withval/srclib/pcre"
 
150
    apr_path="$withval/srclib/apr"
 
151
    apu_path="$withval/srclib/apr-util"
 
152
  else
 
153
    AC_MSG_ERROR(--with-httpd-src requires a path)
 
154
  fi
 
155
])
 
156
 
 
157
# Include M4 macros
 
158
sinclude(build/find_pcre.m4)
 
159
sinclude(build/find_apr.m4)
 
160
sinclude(build/find_apu.m4)
 
161
sinclude(build/find_xml.m4)
 
162
sinclude(build/find_lua.m4)
 
163
sinclude(build/find_curl.m4)
 
164
 
 
165
 
 
166
### Configure Options
 
167
 
 
168
# Strict Compile
 
169
AC_ARG_ENABLE(strict-compile,
 
170
              AS_HELP_STRING([--enable-strict-compile],
 
171
                             [Enable strict compilation (warnings are errors).]),
 
172
[
 
173
  if test "$enableval" != "no"; then
 
174
    strict_compile="-Werror"
 
175
  else
 
176
    strict_compile=
 
177
  fi
 
178
],
 
179
[
 
180
  strict_compile=
 
181
])
 
182
 
 
183
# DEBUG_CONF
 
184
AC_ARG_ENABLE(debug-conf,
 
185
              AS_HELP_STRING([--enable-debug-conf],
 
186
                             [Enable debug during configuration.]),
 
187
[
 
188
  if test "$enableval" != "no"; then
 
189
    debug_conf="-DDEBUG_CONF"
 
190
  else
 
191
    debug_conf=
 
192
  fi
 
193
],
 
194
[
 
195
  debug_conf=
 
196
])
 
197
 
 
198
# CACHE_DEBUG
 
199
AC_ARG_ENABLE(debug-cache,
 
200
              AS_HELP_STRING([--enable-debug-cache],
 
201
                             [Enable debug for transformation caching.]),
 
202
[
 
203
  if test "$enableval" != "no"; then
 
204
    debug_cache="-DCACHE_DEBUG"
 
205
  else
 
206
    debug_cache=
 
207
  fi
 
208
],
 
209
[
 
210
  debug_cache=
 
211
])
 
212
 
 
213
# DEBUG_ACMP
 
214
AC_ARG_ENABLE(debug-acmp,
 
215
              AS_HELP_STRING([--enable-debug-acmp],
 
216
                             [Enable debugging acmp code.]),
 
217
[
 
218
  if test "$enableval" != "no"; then
 
219
    debug_acmp="-DDEBUG_ACMP"
 
220
  else
 
221
    debug_acmp=
 
222
  fi
 
223
],
 
224
[
 
225
  debug_acmp=
 
226
])
 
227
 
 
228
# DEBUG_MEM
 
229
AC_ARG_ENABLE(debug-mem,
 
230
              AS_HELP_STRING([--enable-debug-mem],
 
231
                             [Enable debug during configuration.]),
 
232
[
 
233
  if test "$enableval" != "no"; then
 
234
    debug_mem="-DDEBUG_MEM"
 
235
  else
 
236
    debug_mem=
 
237
  fi
 
238
],
 
239
[
 
240
  debug_mem=
 
241
])
 
242
 
 
243
# PERFORMANCE_MEASUREMENT
 
244
AC_ARG_ENABLE(performance-measurement,
 
245
              AS_HELP_STRING([--enable-performance-measurement],
 
246
                             [Enable performance-measurement stats.]),
 
247
[
 
248
  if test "$enableval" != "no"; then
 
249
    perf_meas="-DPERFORMANCE_MEASUREMENT"
 
250
  else
 
251
    perf_meas=
 
252
  fi
 
253
],
 
254
[
 
255
  perf_meas=
 
256
])
 
257
 
 
258
# NO_MODSEC_API
 
259
AC_ARG_ENABLE(modsec-api,
 
260
              AS_HELP_STRING([--disable-modsec-api],
 
261
                             [Disable the API; compiling against some older Apache versions require this.]),
 
262
[
 
263
  if test "$enableval" != "yes"; then
 
264
    modsec_api="-DNO_MODSEC_API"
 
265
  else
 
266
    modsec_api=
 
267
  fi
 
268
],
 
269
[
 
270
  modsec_api=
 
271
])
 
272
 
 
273
### Build *EXTRA_CFLAGS vars
 
274
 
 
275
if test -n "$debug_mem"; then
 
276
  EXTRA_CFLAGS="-O0 -g -Wall"
 
277
else
 
278
  EXTRA_CFLAGS="-O2 -g -Wall $strict_compile"
 
279
fi
 
280
MODSEC_EXTRA_CFLAGS="$debug_conf $debug_cache $debug_acmp $debug_mem $perf_meas $modsec_api"
 
281
 
 
282
APXS_WRAPPER=build/apxs-wrapper
 
283
APXS_EXTRA_CFLAGS=""
 
284
for f in $EXTRA_CFLAGS; do
 
285
    APXS_EXTRA_CFLAGS="$APXS_EXTRA_CFLAGS -Wc,$f"
 
286
done;
 
287
MODSEC_APXS_EXTRA_CFLAGS=""
 
288
for f in $MODSEC_EXTRA_CFLAGS; do
 
289
    MODSEC_APXS_EXTRA_CFLAGS="$MODSEC_APXS_EXTRA_CFLAGS -Wc,$f"
 
290
done;
 
291
 
 
292
### Substitute the vars
 
293
 
 
294
save_CPPFLAGS=$CPPFLAGS
 
295
CPPFLAGS="$APXS_INCLUDES $CPPFLAGS"
 
296
save_LDFLAGS=$LDFLAGS
 
297
LDFLAGS="$APXS_LDFLAGS $LDFLAGS"
 
298
 
 
299
AC_SUBST(EXTRA_CFLAGS)
 
300
AC_SUBST(MODSEC_EXTRA_CFLAGS)
 
301
AC_SUBST(APXS)
 
302
AC_SUBST(APXS_WRAPPER)
 
303
AC_SUBST(APXS_INCLUDEDIR)
 
304
AC_SUBST(APXS_INCLUDES)
 
305
AC_SUBST(APXS_EXTRA_CFLAGS)
 
306
AC_SUBST(MODSEC_APXS_EXTRA_CFLAGS)
 
307
AC_SUBST(APXS_LDFLAGS)
 
308
AC_SUBST(APXS_LIBS)
 
309
AC_SUBST(APXS_CFLAGS)
 
310
AC_SUBST(APXS_LIBTOOL)
 
311
AC_SUBST(APXS_CC)
 
312
AC_SUBST(APXS_LIBDIR)
 
313
AC_SUBST(APXS_BINDIR)
 
314
AC_SUBST(APXS_SBINDIR)
 
315
AC_SUBST(APXS_PROGNAME)
 
316
AC_SUBST(APXS_HTTPD)
 
317
 
 
318
CHECK_PCRE()
 
319
CHECK_APR()
 
320
CHECK_APU()
 
321
CHECK_LIBXML()
 
322
CHECK_LUA()
 
323
CHECK_CURL()
 
324
 
 
325
AC_CONFIG_FILES([Makefile])
 
326
AC_CONFIG_FILES([build/apxs-wrapper], [chmod +x build/apxs-wrapper])
 
327
if test -e "$PERL"; then
 
328
    AC_CONFIG_FILES([t/run-unit-tests.pl], [chmod +x t/run-unit-tests.pl])
 
329
    AC_CONFIG_FILES([t/run-regression-tests.pl], [chmod +x t/run-regression-tests.pl])
 
330
    AC_CONFIG_FILES([t/gen_rx-pm.pl], [chmod +x t/gen_rx-pm.pl])
 
331
    AC_CONFIG_FILES([t/csv_rx-pm.pl], [chmod +x t/csv_rx-pm.pl])
 
332
    AC_CONFIG_FILES([t/regression/server_root/conf/httpd.conf])
 
333
 
 
334
    # Perl based tools
 
335
    AC_CONFIG_FILES([../tools/rules-updater.pl], [chmod +x ../tools/rules-updater.pl])
 
336
fi
 
337
if test -e "mlogc-src/Makefile.in"; then
 
338
    AC_CONFIG_FILES([mlogc-src/Makefile])
 
339
fi
 
340
 
 
341
AC_OUTPUT