File: configure.in

package info (click to toggle)
mod-mono 1.2.1-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,640 kB
  • ctags: 230
  • sloc: sh: 8,606; ansic: 1,750; makefile: 120
file content (363 lines) | stat: -rw-r--r-- 8,622 bytes parent folder | download
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
AC_INIT(src/mod_mono.c)
AM_INIT_AUTOMAKE(mod_mono, 1.2.1)
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
	

# 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 putenv setenv setrlimit select strcasecmp strerror strrchr dup2])

#
# --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


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

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
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
])

# 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
	])
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
], [
])

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
	CFLAGS="$CFLAGS -DAPACHE13 -DEAPI"
	AC_MSG_RESULT($APACHE_VER)
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
)

AM_CONDITIONAL(APACHE2, test ! "$APACHE_VER" = "1.3")
if test ! "$APACHE_VER" = "1.3" ; then
dnl Sources are recompiled if we change the target version
	AC_DEFINE([APACHE2],,[Compiling for Apache >= 2.0 ])
fi

if test "$APACHE_VER" = "2.2" ; then
	AC_DEFINE([APACHE22],,[Compiling for Apache >= 2.2 ])
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
],)

if test ! "$APACHE_VER" = "1.3" ; then
   found_apr_socket_connect=yes
   AC_DEFINE([HAVE_APR_SOCKET_CONNECT],,[apr_socket_connect is present])
else
   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

fi

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],1,\
	[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)

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" = "1.3" -a -x "$APRCONFIG" && \
echo "   * apr-config = $APRCONFIG"
echo "   * Verbose logging (debug) = $enable_debug"
echo "   * mono prefix = $MONO_PREFIX"
echo "   * Default MonoApplicationsConfigDir = $DFLT_MONO_CONFIG_DIR"
dnl echo "   * Build old module: $enable_old_module"
echo ""
echo "---"