-
Notifications
You must be signed in to change notification settings - Fork 0
/
aclocal.m4
executable file
·327 lines (286 loc) · 9.27 KB
/
aclocal.m4
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_DEFUN([CHECK_SSL],
[
AC_MSG_CHECKING(for ssl)
ssldirs="/usr/local/openssl /usr/lib/openssl /usr/openssl \
/usr/local/ssl /usr/lib/ssl /usr/ssl \
/usr/pkg /usr/local /usr"
AC_ARG_WITH(ssl,
AC_HELP_STRING([--with-ssl=DIR], [path to ssl]),
ssldirs="$withval")
AC_CACHE_VAL(ac_cv_path_ssl,[
for ssldir in $ssldirs; do
if test -f "$ssldir/include/openssl/ssl.h"; then
ac_cv_path_ssl=$ssldir;
break;
fi
if test -f "$ssldir/include/ssl.h"; then
ac_cv_path_ssl=$ssldir;
break
fi
done
])
if test ! -e "$ac_cv_path_ssl" ; then
AC_MSG_ERROR(cannot find ssl libraries)
fi
case "X$host_os" in
Xaix*)
ADDLIBS="-lssl -lcrypto";
AC_SUBST(ADDLIBS)
ADDLDFLAGS="-L$ac_cv_path_ssl/lib";
AC_SUBST(ADDLDFLAGS)
;;
esac
CPPFLAGS="$CPPFLAGS -I$ac_cv_path_ssl/include";
AC_DEFINE([HAVE_LIBSSL], [1], [Define to 1 if you have the `ssl' library (-lssl).])
LIBS="$LIBS -lssl -lcrypto";
LDFLAGS="$LDFLAGS -L$ac_cv_path_ssl/lib";
AC_MSG_RESULT($ac_cv_path_ssl)
])
AC_DEFUN([CHECK_LIBKRB],
[
AC_MSG_CHECKING(for krb)
if test -d $enableval; then
echo "using krb as '$enableval'";
if test -f "$enableval/include/krb5.h"; then
ac_cv_path_krb=$enableval
krb_include="$enableval/include"
elif test -f "$enableval/include/kerberosV/krb5.h"; then
# handle NetBSD's krb5 pathing
ac_cv_path_krb=$enableval
krb_include="$enableval/include/kerberosV"
fi
else
krbdirs="/usr/local/kerberos /usr/lib/kerberos /usr/kerberos \
/usr/local/krb5 /usr/lib/krb /usr/krb \
/usr/pkg /usr/local /usr"
AC_CACHE_VAL(ac_cv_path_krb,[
for krbdir in $krbdirs; do
if test -f "$krbdir/include/krb5.h"; then
ac_cv_path_krb=$krbdir
krb_include="$krbdir/include"
break;
elif test -f "$krbd/include/kerberosV/krb5.h"; then
ac_cv_path_krb=$krbdir
krb_include="$krbdir/include/kerberosV"
break;
fi
done
])
fi
if test -n "$KRB_CFLAGS"; then
KINC="$KRB_CFLAGS";
elif test -n "$krb_include"; then
KINC="-I$krb_include";
else
AC_MSG_ERROR(cannot find krb libraries)
fi
if test -n "$KRB_LDFLAGS"; then
KLDFLAGS="$KRB_LDFLAGS";
elif test -n "$ac_cv_path_krb"; then
KLDFLAGS="-L$ac_cv_path_krb/lib";
else
AC_MSG_ERROR(cannot find krb libraries)
fi
if test -n "$KRB_LIBS"; then
KLIBS="$KRB_LIBS";
else
KLIBS="-lkrb5 -lk5crypto -lcom_err";
fi
KRBCGI="cosign.cgi"
AC_SUBST(KRBCGI)
AC_SUBST(KINC)
AC_SUBST(KLIBS)
AC_SUBST(KLDFLAGS)
AC_DEFINE([KRB], [1], [Define to 1 to enable kerberos for the cgi and apache filter.])
AC_MSG_RESULT(Kerberos found at $ac_cv_path_krb)
])
AC_DEFUN([CHECK_APACHE2],
[
AC_MSG_CHECKING(for apache 2)
if test -f "$enableval"; then
echo "using apxs2 as '$enableval'"
ac_cv_path_apxs2="$enableval"
fi
APXS2="$ac_cv_path_apxs2"
if test ! -e "$ac_cv_path_apxs2" ; then
AC_MSG_ERROR(cannot find apache 2)
fi
FILTERS="$FILTERS filters/apache2"
APXS2_TARGET="`$APXS2 -q TARGET`"
APXS2_SBINDIR="`$APXS2 -q SBINDIR`"
if test x_$APXS2_TARGET = x_httpd ; then
APACHECTL2="${APXS2_SBINDIR}/apachectl"
else
APACHECTL2="${APXS2_SBINDIR}/${APXS2_TARGET}ctl"
fi
APXS2_INCLUDEDIR="`${APXS2} -q INCLUDEDIR`"
if test -f "$APXS2_INCLUDEDIR/ap_regex.h"; then
AC_DEFINE([HAVE_AP_REGEX_H], [1], [Define to 1 if you have the apache 2 ap_regex.h header file.])
fi
APACHE2_MINOR_VERSION="`${APXS2_SBINDIR}/${APXS2_TARGET} -v | \
sed -e '/^Server version:/!d' \
-e 's/.*Apache\/2\.\(@<:@0-9@:>@\)\..*/\1/g'`"
if test -n "${APACHE2_MINOR_VERSION}"; then
if test "${APACHE2_MINOR_VERSION}" -gt 0; then
AC_DEFINE([HAVE_MOD_AUTHZ_HOST], [1], [Define to 1 if the apache mod_authz_host module is present.])
if test "${APACHE2_MINOR_VERSION}" -gt 2; then
AC_DEFINE([HAVE_APACHE_USERAGENT_IP], [1], [Define to 1 to use request_rec->useragent_ip instead of conn_rec->remote_ip.])
fi
fi
fi
AC_SUBST(APXS2)
AC_SUBST(APACHECTL2)
AC_DEFINE([APACHE2], [1], [Define to 1 to enable the apache 2 filter.])
AC_MSG_RESULT(apache 2 filter will be built)
])
AC_DEFUN([CHECK_GSS],
[
AC_MSG_CHECKING(for gss)
if test -n "$GSSAPI_CFLAGS"; then
GSSINC="$GSSAPI_CFLAGS";
elif test -n "$ac_cv_path_krb"; then
GSSINC="-I$ac_cv_path_krb/include";
else
AC_MSG_ERROR(gss require krb5 libraries)
fi
if test -n "$GSSAPI_LDFLAGS"; then
GSSLDFLAGS="$GSSAPI_LDFLAGS";
elif test -n "$ac_cv_path_krb"; then
GSSLDFLAGS="-L$ac_cv_path_krb/lib";
else
AC_MSG_ERROR(cannot find krb libraries)
fi
if test -n "$GSSAPI_LIBS"; then
GSSLIBS="$GSSAPI_LIBS";
else
GSSLIBS="-lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err";
fi
AC_SUBST(GSSINC)
AC_SUBST(GSSLIBS)
AC_SUBST(GSSLDFLAGS)
AC_DEFINE([GSS], [1], [Define to 1 to enable the apache filter to set up GSSAPI.])
AC_MSG_RESULT($ac_cv_path_krb)
])
AC_DEFUN([CHECK_APACHE_1],
[
AC_MSG_CHECKING([for apache 1.3])
if test -f "$enableval"; then
echo "using apxs as '$enableval'"
ac_cv_path_apxs="$enableval"
fi
APXS="$ac_cv_path_apxs"
if test ! -e "$ac_cv_path_apxs" ; then
AC_MSG_ERROR(cannot find apache 1.3)
fi
FILTERS="$FILTERS filters/apache"
APXS_TARGET="`$APXS -q TARGET`"
if test x_$APXS_TARGET = x_httpd ; then
APACHECTL="${APXS_SBINDIR}/apachectl"
else
APACHECTL="${APXS_SBINDIR}/${APXS_TARGET}ctl"
fi
AC_SUBST(APXS)
AC_SUBST(APACHECTL)
AC_DEFINE([APACHE1], [1], [Define to 1 to enable the apache 1.3 filter.])
AC_MSG_RESULT(apache 1.3 filter will be built)
])
AC_DEFUN([CHECK_LIBMYSQL],
[
AC_MSG_CHECKING(for mysql)
if test -d "$enableval"; then
if test -f "$enableval/include/mysql/mysql.h"; then
ac_cv_path_mysql=$enableval
fi
else
mysqldirs="/usr /usr/local/mysql /usr/lib/mysql /usr/mysql \
/usr/pkg /usr/local /usr"
AC_CACHE_VAL(ac_cv_path_mysql,[
for mysqldir in $mysqldirs; do
if test -f "$mysqldir/include/mysql/mysql.h"; then
ac_cv_path_mysql=$mysqldir
break;
fi
done
])
if test ! -e "$ac_cv_path_mysql" ; then
AC_MSG_ERROR(cannot find mysql libraries)
fi
fi
MYSQLINC="-I$ac_cv_path_mysql/include/mysql";
AC_SUBST(MYSQLINC)
MYSQLLIBS="-lmysqlclient";
AC_SUBST(MYSQLLIBS)
MYSQLLDFLAGS="-L$ac_cv_path_mysql/lib/mysql -R$ac_cv_path_mysql/lib/mysql";
AC_SUBST(MYSQLLDFLAGS)
AC_DEFINE([HAVE_MYSQL], [1], [Define to 1 if you have the `mysqlclient' library (-lmysqlclient).])
AC_DEFINE([SQL_FRIEND], [1], [Define to 1 to enable mysql for guest login support in the cgi.])
AC_MSG_RESULT($ac_cv_path_mysql)
])
AC_DEFUN([SET_NO_SASL],
[
ac_configure_args="$ac_configure_args --with-sasl=no";
AC_MSG_RESULT(Disabled SASL)
])
AC_DEFUN([SET_NO_ZLIB],
[
ac_configure_args="$ac_configure_args --with-zlib=no";
AC_MSG_RESULT(Disabled ZLIB)
])
AC_DEFUN([SET_ENABLE_SHARED],
[
ac_configure_args="$ac_configure_args --enable-shared";
AC_MSG_RESULT(Enabled Shared)
])
AC_DEFUN([CHECK_UNIVERSAL_BINARIES],
[
AC_ARG_ENABLE(universal_binaries,
AC_HELP_STRING([--enable-universal-binaries], [build universal binaries (default=no)]),
,[enable_universal_binaries=no])
if test "${enable_universal_binaries}" = "yes"; then
case "${host_os}" in
darwin8*)
macosx_sdk="MacOSX10.4u.sdk"
;;
darwin9*)
dep_target="-mmacosx-version-min=10.4"
macosx_sdk="MacOSX10.5.sdk"
;;
*)
AC_MSG_ERROR([Building universal binaries on ${host_os} is not suppo
rted])
;;
esac
echo ===========================================================
echo Setting up universal binaries for ${host_os}
echo ===========================================================
FILTER_LINKER_OPTS="-Wl,\"-isysroot /Developer/SDKs/$macosx_sdk\" -Wl,\"-arch i386\" -Wl,\"-arch x86_64\" -Wl,\"-arch ppc\" -Wl,\"-arch ppc64\" -Wl,\"$dep_target\""
FILTER_COMPILER_OPTS="-Wc,\"-isysroot /Developer/SDKs/$macosx_sdk\" -Wc,\"-arch i386\" -Wc,\"-arch x86_64\" -Wc,\"-arch ppc\" -Wc,\"-arch ppc64\" -Wc,\"$dep_target\""
UNIVERSAL_OPTOPTS="-isysroot /Developer/SDKs/$macosx_sdk -arch i386 -arch x86_64 -arch ppc -arch ppc64 $dep_target"
fi
])
AC_DEFUN([CHECK_LIGHTTPD],
[
AC_MSG_CHECKING(for lighttpd)
if test -d "$enableval"; then
echo "$enableval"
ac_cv_path_lighttpd="$enableval"
fi
if test ! -e "$ac_cv_path_lighttpd"; then
AC_MSG_ERROR(cannot find lighttpd)
fi
lighttpdincdirs="include src"
for incdir in $lighttpdincdirs; do
if test -e "$ac_cv_path_lighttpd/$incdir/base.h"; then
LIGHTTPDINC="-I$ac_cv_path_lighttpd/$incdir"
break
fi
done
if test -z "$LIGHTTPDINC"; then
AC_MSG_ERROR(cannot find lighttpd)
fi
LIGHTTPD_COSIGN_SRCDIR=`pwd`
AC_SUBST(LIGHTTPD_COSIGN_SRCDIR)
AC_DEFINE([HAVE_LIGHTTPD], [1], [Define to 1 to enable the lighttpd filter.])
FILTERS="$FILTERS filters/lighttpd"
AC_MSG_RESULT(lighttpd filter will be built)
])