This repository has been archived by the owner on Nov 19, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathconfigure.in
328 lines (288 loc) · 8.29 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
AC_INIT(src/mod_mono.c)
AM_INIT_AUTOMAKE(mod_mono, 1.0.2)
AM_CONFIG_HEADER(include/mod_mono_config.h:config.in)
AC_PROG_CC
AM_PROG_LIBTOOL
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_MSG_CHECKING(for --with-apxs)
AC_ARG_WITH(apxs, [ --with-apxs=PATH Path to apxs],
[
if test -x "$withval"
then
AC_MSG_RESULT([$withval executable, good])
APXS=$withval
else
echo
AC_MSG_ERROR([$withval not found or not executable])
fi
],
AC_MSG_RESULT(no))
# check for --with-apr-config
# apr-config - at least in debian apr include directory is different
APR_INCLUDES=""
AC_MSG_CHECKING(for --with-apr-config)
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
],
AC_MSG_RESULT(not specified))
# if no apxs found yet, check /usr/local/apache/sbin
# since it's the default Apache location
if test -z "$APXS"; then
AC_MSG_CHECKING(for apxs2 in /usr/local/apache/sbin)
if test -x /usr/local/apache/sbin/apxs2; then
APXS=/usr/local/apache/sbin/apxs2
AC_MSG_RESULT([found, we'll use this. Use --with-apxs to specify another.])
else
AC_MSG_RESULT(no)
fi
fi
if test -z "$APXS"; then
AC_MSG_CHECKING(for apxs in /usr/local/apache/sbin)
if test -x /usr/local/apache/sbin/apxs; then
APXS=/usr/local/apache/sbin/apxs
AC_MSG_RESULT([found, we'll use this. Use --with-apxs to specify another.])
else
AC_MSG_RESULT(no)
fi
else
if test -z "$APRCONFIG" ; then
APRCONFIG=`dirname ${APXS}`/apr-config
fi
fi
if test -z "$APRCONFIG"; then
AC_MSG_CHECKING(for apr-config in /usr/local/apache/sbin)
if test -x /usr/local/apache/sbin/apr-config; then
APRCONFIG=/usr/local/apache/sbin/apr-config
AC_MSG_RESULT([found, we'll use this. Use --with-apr-config to specify another.])
else
AC_MSG_RESULT(no)
APRCONFIG=""
fi
fi
if test -z "$APXS"; then
AC_MSG_CHECKING(for apxs2 in /usr/local/apache2/bin)
if test -x /usr/local/apache/bin/apxs2; then
APXS=/usr/local/apache/bin/apxs2
AC_MSG_RESULT([found, we'll use this. Use --with-apxs to specify another.])
else
AC_MSG_RESULT(no)
fi
fi
if test -z "$APXS"; then
AC_MSG_CHECKING(for apxs in /usr/local/apache2/bin)
if test -x /usr/local/apache2/bin/apxs; then
APXS=/usr/local/apache2/bin/apxs
AC_MSG_RESULT([found, we'll use this. Use --with-apxs to specify another.])
else
AC_MSG_RESULT(no)
fi
fi
if test -z "$APRCONFIG"; then
AC_MSG_CHECKING(for apr-config in /usr/local/apache2/bin)
if test -x /usr/local/apache2/bin/apr-config; then
APRCONFIG=/usr/local/apache2/bin/apr-config
AC_MSG_RESULT([found, we'll use this. Use --with-apr-config to specify another.])
else
AC_MSG_RESULT(no)
APRCONFIG=""
fi
fi
if test -z "$APXS"; then
AC_MSG_CHECKING(for apxs2 in /usr/sbin)
if test -x /usr/sbin/apxs2; then
APXS=/usr/sbin/apxs2
AC_MSG_RESULT([found, we'll use this. Use --with-apxs to specify another.])
else
AC_MSG_RESULT(no)
fi
fi
if test -z "$APXS"; then
AC_MSG_CHECKING(for apxs in /usr/sbin)
if test -x /usr/sbin/apxs; then
APXS=/usr/sbin/apxs
AC_MSG_RESULT([found, we'll use this. Use --with-apxs to specify another.])
else
AC_MSG_RESULT(no)
fi
fi
if test -z "$APRCONFIG"; then
AC_MSG_CHECKING(for apr-config in /usr/sbin)
if test -x /usr/sbin/apr-config; then
APRCONFIG=/usr/sbin/apr-config
AC_MSG_RESULT([found, we'll use this. Use --with-apr-config to specify another.])
else
AC_MSG_RESULT(no)
APRCONFIG=""
fi
fi
# last resort
if test -z "$APXS"; then
AC_PATH_PROG(APXS, apxs2)
fi
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
AC_PATH_PROG(APRCONFIG, apr-config)
fi
# determine LIBEXEC
AC_MSG_CHECKING(for Apache libexec directory)
APXS_LIBEXECDIR=`${APXS} -q LIBEXECDIR`
AC_MSG_RESULT($APXS_LIBEXECDIR)
AC_MSG_CHECKING(for Apache sysconf directory)
APXS_SYSCONFDIR=`${APXS} -q SYSCONFDIR`
AC_MSG_RESULT($APXS_SYSCONFDIR)
# determine INCLUDES
AC_MSG_CHECKING([for Apache include directory])
AP_INCLUDES="-I`${APXS} -q INCLUDEDIR`"
AC_MSG_RESULT($AP_INCLUDES)
CFLAGS="$CFLAGS $AP_INCLUDES"
AC_MSG_CHECKING([Apache version])
AC_TRY_COMPILE([
#include <httpd.h>
], [
char *version = AP_SERVER_BASEREVISION;
], [
APACHE_VER=2.0
], [
APACHE_VER=1.3
])
# ensure we have apache 1.3
if test "$APACHE_VER" = "1.3" ; then
AC_TRY_COMPILE([
#include <httpd.h>
], [
char *version = SERVER_BASEREVISION;
], [
APACHE_VER=1.3
], [
APACHE_VER=retry
])
fi
# Try apr-config
if test "$APACHE_VER" = "retry" -a -x "$APRCONFIG"; then
CFLAGS="$CFLAGS `$APRCONFIG --includes`"
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
CFLAGS="$CFLAGS -DAPACHE13 -DEAPI"
fi
AC_MSG_RESULT($APACHE_VER)
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
)
AM_CONDITIONAL(APACHE2, test "$APACHE_VER" = "2.0")
if test "$APACHE_VER" = "2.0" ; then
dnl Sources are recompiled if we change the target version
AC_DEFINE([APACHE2],,[Compiling for Apache 2.0])
fi
AC_C_BIGENDIAN
AC_CHECK_FUNCS([setenv putenv setrlimit])
found_apr_socket_connect=no
AC_CHECK_LIB(apr-0, apr_socket_connect, found_apr_socket_connect=yes)
if test x$found_apr_socket_connect = xyes ; then
AC_DEFINE([HAVE_APR_SOCKET_CONNECT],,[apr_socket_connect is present])
fi
MONO_PREFIX=`$PKG_CONFIG --silence-errors --variable=prefix mono`
if test x$MONO_PREFIX = "x" ; then
MONO_PREFIX=$prefix
fi
AC_MSG_CHECKING([for mono installation prefix])
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_MSG_RESULT($MONO_PREFIX)
AC_DEFINE_UNQUOTED([MONO_PREFIX],"$MONO_PREFIX",[Mono installation prefix])
dnl Prevent the 'not found by the preprocessor' message.
CPPFLAGS="$CPPFLAGS $CFLAGS `$APXS -q EXTRA_CPPFLAGS`"
CFLAGS="$CFLAGS `$APXS -q EXTRA_CFLAGS`"
AC_CHECK_HEADERS([http_protocol.h])
AC_SUBST(APXS_LIBEXECDIR)
AC_SUBST(APXS_SYSCONFDIR)
AC_SUBST(APXS)
AC_SUBST(AP_INCLUDES)
AC_SUBST(CFLAGS)
AC_OUTPUT(
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 "$APACHE_VER" = "2.0" -a -x "$APRCONFIG" && \
echo " * apr-config = $APRCONFIG"
echo " * mono prefix = $MONO_PREFIX"
dnl echo " * Build old module: $enable_old_module"
echo ""
echo "---"