forked from mono/mod_mono
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in
497 lines (441 loc) · 12.5 KB
/
configure.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
AC_INIT(src/mod_mono.c)
AM_INIT_AUTOMAKE(mod_mono, 2.11)
AM_CONFIG_HEADER(include/mod_mono_config.h:config.in)
AC_PROG_CC
AM_PROG_LIBTOOL
AC_C_BIGENDIAN
if test "x$ac_cv_c_bigendian" = "xyes" ; then
AC_DEFINE([MODMONO_BIGENDIAN],,[Compiling on a big-endian machine.])
fi
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
if test "x$PKG_CONFIG" = "xno"; then
AC_MSG_ERROR([You need to install pkg-config])
fi
PKG_PATH=""
AC_ARG_WITH(crosspkgdir, [ --with-crosspkgdir=/path/to/pkg-config/dir],
if test x$with_crosspkgdir = "x"; then
if test -s $PKG_CONFIG_PATH; then
PKG_PATH=$PKG_CONFIG_PATH
fi
else
PKG_PATH=$with_crosspkgdir
PKG_CONFIG_PATH=$PKG_PATH
export PKG_CONFIG_PATH
fi
)
AC_ARG_ENABLE(quiet-build, [ --enable-quiet-build Enable quiet build (on by default)], enable_quiet_build=$enableval, enable_quiet_build=yes)
# Checks for header files.
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS([netdb.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_HEADER_TIME
# Checks for library functions.
AC_FUNC_FORK
AC_HEADER_STDC
AC_FUNC_SELECT_ARGTYPES
AC_CHECK_FUNCS([memset mkdir unsetenv putenv setenv setrlimit select strcasecmp strerror strrchr dup2 strndup])
#
# --enable-debug
#
AC_MSG_CHECKING(if debug mode is requested)
AC_ARG_ENABLE(debug,
[ --enable-debug build mod_mono in debug mode],
enable_debug=$enableval, enable_debug=no)
AC_MSG_RESULT($enable_debug)
if test "x$enable_debug" = "xyes" ; then
CFLAGS="$CFLAGS -DDEBUG"
fi
#
# --with-debug-level
#
AC_MSG_CHECKING([What level debug messages should be printed at])
AC_ARG_WITH(debug-level,
[ --with-debug-level set the debug messages level to the specified value (0-9, 0 is the most verbose)],
debug_level=$withval, debug_level=0)
if test "x$enable_debug" = "xyes" ; then
CFLAGS="$CFLAGS -DDEBUG_LEVEL=$debug_level"
AC_MSG_RESULT($debug_level)
else
AC_MSG_RESULT([debug output disabled])
fi
#
# --with-remove-display
#
AC_MSG_CHECKING([whether mod_mono should remove the DISPLAY variable from environment])
AC_ARG_WITH(remove-display,
[ --with-remove-display remove the DISPLAY variable from environment before starting backends],
no_display=$withval, no_display=no)
AC_MSG_RESULT($no_display)
if test "x$no_display" = "xyes" ; then
CFLAGS="$CFLAGS -DREMOVE_DISPLAY"
fi
#
# --enable-gcov
#
AC_MSG_CHECKING(if gcov compilation was requested)
AC_ARG_ENABLE(gcov,
[ --enable-gcov build mod_mono for gcov testing],
enable_gcov=$enableval, enable_gcov=no)
AC_MSG_RESULT($enable_gcov)
AC_MSG_CHECKING(if gprof support was requested)
AC_ARG_ENABLE(gprof,
[ --enable-gprof build mono for gprof profiling],
enable_gprof=$enableval, enable_gprof=no)
AC_MSG_RESULT($enable_gprof)
dnl AC_MSG_CHECKING([if building mod_mono_old is requested])
dnl AC_ARG_ENABLE(old-module,
dnl [ --enable-old-module enables compilation of the mod_mono_old module],
dnl enable_old_module=$enableval, enable_old_module=no)
dnl AC_MSG_RESULT($enable_old_module)
# check for --with-apxs
AC_ARG_WITH(apxs, [ --with-apxs=PATH Path to apxs],
[
if test -x "$withval"
then
APXS=$withval
else
echo
AC_MSG_ERROR([$withval not found or not executable])
fi
],)
# check for --with-apr-config
# apr-config - at least in debian apr include directory is different
APR_INCLUDES=""
AC_ARG_WITH(apr-config,
[ --with-apr-config=PATH Path to apr-config (apache 2.0). You may use
this option when apr-config is not in the same
directory as apxs and the output of
'apr-config --includes' is different from
'apxs -q INCLUDEDIR'.
],
[
if test -x "$withval"
then
AC_MSG_RESULT([$withval executable, good])
APRCONFIG=$withval
else
if test "xno" = "x$withval" ; then
AC_MSG_RESULT([no])
else
AC_MSG_ERROR([$withval not found or not executable])
fi
fi
],)
if test -z "$APXS"; then
for mydir in /usr/local/apache2/sbin \
/usr/local/apache2/bin \
/usr/local/apache/sbin \
/usr/local/apache/bin \
/usr/sbin \
/usr/bin
do
AC_MSG_CHECKING(for apxs2 in $mydir)
A1="$mydir/apxs2"
if test -x "$A1" ; then
APXS="$A1"
AC_MSG_RESULT($APXS)
break
else
AC_MSG_RESULT(no)
fi
AC_MSG_CHECKING(for apxs in $mydir)
A2="$mydir/apxs"
if test -x "$A2" ; then
APXS="$A2"
AC_MSG_RESULT($APXS)
break
else
AC_MSG_RESULT(no)
fi
done
fi
# last resort 1
if test -z "$APXS"; then
AC_PATH_PROG(APXS, apxs2)
fi
# last resort 2
if test -z "$APXS"; then
AC_PATH_PROG(APXS, apxs)
fi
if test -z "$APXS"; then
AC_MSG_ERROR([**** apxs was not found, DSO compilation will not be available.])
fi
if test -z "$APRCONFIG"; then
for mydir in `dirname ${APXS}` \
/usr/local/apache2/sbin \
/usr/local/apache2/bin \
/usr/local/apache/sbin \
/usr/local/apache/bin \
/usr/sbin \
/usr/bin
do
AC_MSG_CHECKING(for apr-1-config in $mydir)
A1="$mydir/apr-1-config"
if test -x "$A1" ; then
APRCONFIG="$A1"
AC_MSG_RESULT(found.)
break
else
AC_MSG_RESULT(no)
fi
AC_MSG_CHECKING(for apr-config in $mydir)
A2="$mydir/apr-config"
if test -x "$A2" ; then
APRCONFIG="$A2"
AC_MSG_RESULT(found.)
break
else
AC_MSG_RESULT(no)
fi
done
fi
# last resort 1
if test -z "$APRCONFIG"; then
AC_PATH_PROG(APRCONFIG, apr-1-config)
fi
# last resort 2
if test -z "$APRCONFIG"; then
AC_PATH_PROG(APRCONFIG, apr-config)
fi
# apu-config - libapr-util can have different prefixes than libapr, check from apu-1-config to make sure
# (suse 10.1 is an example of this)
AC_ARG_WITH(apu-config,
[ --with-apu-config=PATH Path to apu-config (apache 2.0). You may use
this option when apu-config is not in the same
directory as apxs and the output of
'apu-config --includes' is different from
'apxs -q INCLUDEDIR'.
],
[
if test -x "$withval"
then
AC_MSG_RESULT([$withval executable, good])
APUCONFIG=$withval
else
if test "xno" = "x$withval" ; then
AC_MSG_RESULT([no])
else
AC_MSG_ERROR([$withval not found or not executable])
fi
fi
],)
if test -z "$APUCONFIG"; then
for mydir in `dirname ${APXS}` \
/usr/local/apache2/sbin \
/usr/local/apache2/bin \
/usr/local/apache/sbin \
/usr/local/apache/bin \
/usr/sbin \
/usr/bin
do
AC_MSG_CHECKING(for apu-1-config in $mydir)
A1="$mydir/apu-1-config"
if test -x "$A1" ; then
APUCONFIG="$A1"
AC_MSG_RESULT(found.)
break
else
AC_MSG_RESULT(no)
fi
AC_MSG_CHECKING(for apu-config in $mydir)
A2="$mydir/apu-config"
if test -x "$A2" ; then
APUCONFIG="$A2"
AC_MSG_RESULT(found.)
break
else
AC_MSG_RESULT(no)
fi
done
fi
# last resort 1
if test -z "$APUCONFIG"; then
AC_PATH_PROG(APUCONFIG, apu-1-config)
fi
# last resort 2
if test -z "$APUCONFIG"; then
AC_PATH_PROG(APUCONFIG, apu-config)
fi
APXS_LIBEXECDIR=`${APXS} -q LIBEXECDIR`
APXS_SYSCONFDIR=`${APXS} -q SYSCONFDIR`
AP_INCLUDES="-I`${APXS} -q INCLUDEDIR`"
CFLAGS="$CFLAGS $AP_INCLUDES"
CFLAGS="$CFLAGS `$APXS -q CFLAGS`"
CFLAGS="$CFLAGS `$APXS -q EXTRA_CFLAGS`"
CPPFLAGS="$CPPFLAGS $AP_INCLUDES"
CPPFLAGS="$CPPFLAGS $CFLAGS `$APXS -q EXTRA_CPPFLAGS`"
CPPFLAGS="$CPPFLAGS $CFLAGS `$APXS -q CPPFLAGS`"
if test -x "$APRCONFIG" ; then
CFLAGS="$CFLAGS `$APRCONFIG --includes --cflags`"
CPPFLAGS="$CFLAGS $CPPFLAGS `$APRCONFIG --includes --cflags --cppflags`"
fi
if test -x "$APUCONFIG" ; then
CFLAGS="$CFLAGS `$APUCONFIG --includes`"
CPPFLAGS="$CFLAGS $CPPFLAGS `$APUCONFIG --includes`"
fi
AC_MSG_CHECKING([Apache version])
AC_TRY_COMPILE([
#include <ap_release.h>
], [
char *version = AP_SERVER_BASEREVISION;
], [
APACHE_VER=2.0
], [
APACHE_VER=1.3
])
# We no longer support Apache < 2.0
if test "$APACHE_VER" = "1.3" ; then
AC_MSG_ERROR([Apache 1.3 is no longer supported. mod_mono now requires at least Apache 2.0])
else
AC_TRY_RUN([
#include <ap_release.h>
int main ()
{
return (AP_SERVER_MAJORVERSION_NUMBER == 2 && AP_SERVER_MINORVERSION_NUMBER == 2) ? 0 : 1;
}
], [
APACHE_VER=2.2
], [
])
AC_TRY_RUN([
#include <ap_release.h>
int main ()
{
return (AP_SERVER_MAJORVERSION_NUMBER == 2 && AP_SERVER_MINORVERSION_NUMBER == 4) ? 0 : 1;
}
], [
APACHE_VER=2.4
], [
])
fi
if test ! "$APACHE_VER" = "1.3" -a ! "$APACHE_VER" = "retry" ; then
AC_MSG_RESULT(${APACHE_VER})
fi
# Try apr-config, probably 1.3
if test "$APACHE_VER" = "retry" -a -x "$APRCONFIG"; then
AC_TRY_COMPILE([
#include <apr.h>
], [
apr_byte_t b;
], [
APACHE_VER=2.0
], [
APACHE_VER=1.3
])
fi
if test "$APACHE_VER" = "retry"; then
AC_MSG_ERROR([Confused on apache version. Please report this and send config.log])
fi
if test "$APACHE_VER" = "1.3"; then
AC_MSG_ERROR([Apache 1.3 is no longer supported. mod_mono now requires at least Apache 2.0])
fi
#
# gprof stuff must go at the every end, since we must be sure we turn off the optimizations
#
if test "x$enable_gprof" = "xyes" ; then
CFLAGS="$CFLAGS -DGPROF -O0 -pg"
fi
#
# GCOV stuff must go at the every end, since we must be sure we turn off the optimizations
#
if test "x$enable_gcov" = "xyes" ; then
CFLAGS="$CFLAGS -DGCOV -O0 -fprofile-arcs -ftest-coverage"
fi
AM_CONDITIONAL(APACHE2, true)
dnl Sources are recompiled if we change the target version
AC_DEFINE([APACHE2],,[Compiling for Apache >= 2.0 ])
if test "$APACHE_VER" = "2.2" ; then
AC_DEFINE([APACHE22],,[Compiling for Apache >= 2.2 ])
fi
if test "$APACHE_VER" = "2.4" ; then
AC_DEFINE([APACHE24],,[Compiling for Apache >= 2.4 ])
fi
# check for --with-mono-default-config-dir
DFLT_MONO_CONFIG_DIR=`$APXS -q SYSCONFDIR`/mod-mono-applications
AC_ARG_WITH(mono-default-config-dir,
[ --with-mono-default-config-dir=PATH Default value for MonoApplicationsConfigDir],
[
if test -x "$withval"
then
AC_MSG_RESULT([$withval])
DFLT_MONO_CONFIG_DIR="$withval"
else
AC_MSG_RESULT([$DFLT_MONO_CONFIG_DIR])
fi
],)
found_apr_socket_connect=yes
AC_DEFINE([HAVE_APR_SOCKET_CONNECT],,[apr_socket_connect is present])
MONO_PREFIX=`$PKG_CONFIG --silence-errors --variable=prefix mono`
if test x$MONO_PREFIX = "x" ; then
MONO_PREFIX=$prefix
fi
AC_ARG_WITH(mono-prefix,
[ --with-mono-prefix=PATH The prefix where mono is installed. It's used
to set the default paths for mod-mono-server.exe
and mono when the modules is installed in a
different prefix. Configuration directives can
override this.
],
if test ! x$with_mono_prefix = "x" ; then
if test ! -d "$with_mono_prefix" ; then
AC_MSG_ERROR([Directory '$with_mono_prefix' not found])
fi
MONO_PREFIX=$with_mono_prefix
fi
)
if test "$MONO_PREFIX" = NONE ; then
MONO_PREFIX=$ac_default_prefix
fi
AC_DEFINE_UNQUOTED([MONO_PREFIX],"$MONO_PREFIX",[Mono installation prefix])
AC_CHECK_HEADER(http_protocol.h,
AC_DEFINE([HAVE_HTTP_PROTOCOL_H],,
[Define to 1 if you have the <http_protocol.h> header file.]),,
[#include <httpd.h>])
AC_SUBST(APXS_LIBEXECDIR)
AC_SUBST(APXS_SYSCONFDIR)
AC_SUBST(APXS)
AC_SUBST(AP_INCLUDES)
AC_SUBST(CFLAGS)
AC_SUBST(CPPFLAGS)
AC_SUBST(DFLT_MONO_CONFIG_DIR)
if test x$enable_quiet_build = xyes; then
AC_CONFIG_COMMANDS([quiet], [for i in `find src -name Makefile.in | sed -e 's/Makefile.in/Makefile/g'`; do if test -f $i; then $srcdir/scripts/patch-quiet.sh $i; fi; done], [shell=$SHELL])
AC_CONFIG_COMMANDS([quiet-libtool], [sed -e 's/$echo "copying selected/$show "copying selected/g' < libtool > libtool.tmp && mv libtool.tmp libtool && chmod a+x libtool; sed -e 's/$ECHO "copying selected/# "copying selected/g' < libtool > libtool.tmp && mv libtool.tmp libtool && chmod a+x libtool])
fi
AC_OUTPUT(
apache2-mod_mono.spec
Makefile
mod_mono.conf
src/Makefile
man/mod_mono.8
man/Makefile
)
echo "---"
echo "Configuration summary for mod_mono"
echo ""
echo " * Installation prefix = $prefix"
echo " * Apache version = $APACHE_VER"
echo " * Apache modules directory = $APXS_LIBEXECDIR"
test -x "$APXS" && \
echo " * apxs = $APXS"
test -x "$APRCONFIG" && \
echo " * apr-config = $APRCONFIG"
test "$APUCONFIG" && \
echo " * apu-config = $APUCONFIG"
echo " * CFLAGS = $CFLAGS"
echo " * Verbose logging (debug) = $enable_debug"
if test "x$enable_debug" = "xyes" ; then
echo " * Debug output level = $debug_level"
fi
echo " * GCOV options used = $enable_gcov"
echo " * Profiling enabled = $enable_gprof"
echo " * mono prefix = $MONO_PREFIX"
echo " * Default MonoApplicationsConfigDir = $DFLT_MONO_CONFIG_DIR"
test "x$no_display" = "xyes" && \
echo " * DISPLAY variable will be removed before forking the mod-mono-server backend"
dnl echo " * Build old module: $enable_old_module"
echo ""
echo "---"