-
Notifications
You must be signed in to change notification settings - Fork 4
/
configure.in
452 lines (399 loc) · 13.4 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
# Process this file with autoconf to produce a configure script.
AC_INIT(spocd, 2.1.10, [email protected])
AM_INIT_AUTOMAKE([foreign no-dependencies 1.7])
AC_CONFIG_SRCDIR(include/wrappers.h)
AM_CONFIG_HEADER(include/config.h)
AM_MAINTAINER_MODE
dnl AC_CONFIG_HEADER([include/config.h])
AC_PREFIX_DEFAULT(/usr/local/spocp)
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_AWK
AC_PROG_LIBTOOL
dnl *************************************************
spocp_cv_warnings=yes
AC_ARG_ENABLE(warnings, [ --disable-warnings Turn off compiler warnings
(not recommended)],
[if test $enableval = no; then
spocp_cv_warnings=no
fi])
if test x$GCC = xyes -a $spocp_cv_warnings = yes; then
CFLAGS="-Wall -pedantic -Wmissing-prototypes -Wpointer-arith -Wbad-function-cast -Wmissing-declarations -Wnested-externs $CFLAGS"
fi
dnl *************************************************
AC_ARG_ENABLE(cert, --enable-cert Enable cert backend, [cert=yes])
AC_ARG_ENABLE(difftime, --enable-difftime Enable difftime backend, [difftime=yes])
AC_ARG_ENABLE(flatfile, --enable-flatfile Enable flatfile backend, [flatfile=yes])
AC_ARG_ENABLE(gdbm, --enable-gdbm Enable gdbm backend, [gdbm=yes])
AC_ARG_ENABLE(ipnum, --enable-ipnum Enable ipnum backend, [ipnum=yes] )
AC_ARG_ENABLE(lastlogin, --enable-lastlogin Enable lastlogin backend, [lastlogin=yes])
AC_ARG_ENABLE(ldapset, --enable-ldapset Enable ldapset backend, [ldapset=yes])
AC_ARG_ENABLE(localgroup, --enable-localgroup Enable localgroup backend, [localgroup=yes])
AC_ARG_ENABLE(mailmatch, --enable-mailmatch Enable mailmatch backend, [mailmatch=yes])
AC_ARG_ENABLE(motd, --enable-motd Enable motd backend,[motd=yes] )
AC_ARG_ENABLE(rbl, --enable-rbl Enable rbl backend, [rbl=yes] )
AC_ARG_ENABLE(regexp, --enable-regexp Enable regexp backend, [regexp=yes])
AC_ARG_ENABLE(sql, --enable-sql Enable sql backend, [sql=yes])
AC_ARG_ENABLE(strmatch, --enable-strmatch Enable strmatch backend, [strmatch=yes])
AC_ARG_ENABLE(system, --enable-system Enable system backend, [system=yes])
AC_ARG_ENABLE(time, --enable-time Enable time backend, [time=yes])
AC_ARG_ENABLE(ldapproxy, --enable-ldapproxy Enable ldapproxy backend, [ldapproxy=yes])
AC_ARG_ENABLE(all, --enable-all Enable all backends )
AC_ARG_ENABLE(spocp, --disable-spocp Build without spocp backend,, [enable_spocp=yes])
AC_ARG_ENABLE(ipv6, --disable-ipv6 Build WITHOUT ipv6 support,,enable_ipv6=yes)
if test "$enable_ipv6" = yes; then
AC_DEFINE(USE_IPV6, 1, [If you want support for IPv6])
fi
AM_CONDITIONAL(USE_IPV6, test "$enable_ipv6" = yes)
dnl *************************************************
# Checks for libraries.
AC_CHECK_LIB([resolv], [res_query])
# not on mac os x Tiger
AC_CHECK_LIB([pthread], [pthread_mutex_lock])
AC_CHECK_LIB([idn], [stringprep])
AC_CHECK_LIB([crypto],[SHA1])
dnl * dynamic modules?
have_modules=no
MODULE_LIBS=""
AC_CHECK_FUNC([dlopen],
[have_modules=yes MODULE_LIBS="-export-dynamic"],
[AC_CHECK_LIB([dl], [dlopen],
[have_modules=yes MODULE_LIBS="-export-dynamic -ldl"])])
if test $have_modules = yes ; then
AC_DEFINE(HAVE_LIBDL,1,[Defined if libidl exists])
if test -n "$enable-all" ; then
cert=yes
difftime=yes
flatfile=yes
gdbm=yes
ipnum=yes
lastlogin=yes
ldapset=yes
localgroup=yes
mailmatch=yes
motd=yes
rbl=yes
regexp=yes
sql=yes
strmatch=yes
system=yes
time=yes
ldapproxy=yes
fi
else
if test "$cert" = "yes" ; then
AC_MSG_WARN([cert backend disabled, ignoring --enable-cert])
fi
if test "$difftime" = "yes" ; then
AC_MSG_WARN([difftime backend disabled, ignoring --enable-difftime])
fi
if test "$flatfile" = "yes" ; then
AC_MSG_WARN([flatfile backend disabled, ignoring --enable-flatfile])
fi
if test "$gdbm" = "yes" ; then
AC_MSG_WARN([gdbm backend disabled, ignoring --enable-gdbm])
fi
if test "$ipnum" = "yes" ; then
AC_MSG_WARN([ipnum backend disabled, ignoring --enable-ipnum])
fi
if test "$lastlogin" = "yes" ; then
AC_MSG_WARN([lastlogin backend disabled, ignoring --enable-lastlogin])
fi
if test "$ldapset" = "yes" ; then
AC_MSG_WARN([ldapset backend disabled, ignoring --enable-ldapset])
fi
if test "$localgroup" = "yes" ; then
AC_MSG_WARN([localgroup backend disabled, ignoring --enable-localgroup])
fi
if test "$mailmatch" = "yes" ; then
AC_MSG_WARN([mailmatch backend disabled, ignoring --enable-mailmatch])
fi
if test "$motd" = "yes" ; then
AC_MSG_WARN([motd backend disabled, ignoring --enable-motd])
fi
if test "$rbl" = "yes" ; then
AC_MSG_WARN([rbl backend disabled, ignoring --enable-rbl])
fi
if test "$regexp" = "yes" ; then
AC_MSG_WARN([regexp backend disabled, ignoring --enable-regexp])
fi
if test "$sql" = "yes" ; then
AC_MSG_WARN([sql backend disabled, ignoring --enable-sql])
fi
if test "$strmatch" = "yes" ; then
AC_MSG_WARN([strmatch backend disabled, ignoring --enable-strmatch])
fi
if test "$system" = "yes" ; then
AC_MSG_WARN([system backend disabled, ignoring --enable-system])
fi
if test "$time" = "yes" ; then
AC_MSG_WARN([time backend disabled, ignoring --enable-time])
fi
if test "$ldapproxy" = "yes" ; then
AC_MSG_WARN([ldapproxy backend disabled, ignoring --enable-ldapproxy])
fi
cert=no
difftime=no
flatfile=no
gdbm=no
ipnum=no
lastlogin=no
ldapset=no
localgroup=no
mailmatch=no
motd=no
rbl=no
regexp=no
sql=no
strmatch=no
system=no
time=no
ldapproxy=no
fi
have_lber=no
have_ldap=no
AH_TEMPLATE( [HAVE_LIBDL], [Define to 1 if you have the 'dl' library] )
AH_TEMPLATE( [HAVE_LIBLBER], [Define to 1 if you have the 'lber' library] )
AH_TEMPLATE( [HAVE_LIBLDAP], [Define to 1 if you have the 'ldap' library] )
AH_TEMPLATE( [HAVE_LIBGDBM], [Define to 1 if you have the 'gdbm' library] )
AH_TEMPLATE( [HAVE_LIBODBC], [Define to 1 if you have the 'odbc' library] )
if test "$ldapset" = "yes" ; then
AC_CHECK_LIB([lber], [ber_read], AC_DEFINE(HAVE_LIBLBER), [ldapset=no])
AC_CHECK_LIB([ldap], [ldap_init], AC_DEFINE(HAVE_LIBLDAP), [ldapset=no] )
fi
if test "$gdbm" = "yes" ; then
AC_CHECK_LIB([gdbm], [gdbm_open], [AC_DEFINE(HAVE_LIBGDBM)], [gdbm=no] )
fi
if test "$sql" = "yes" ; then
AC_CHECK_LIB([odbc], [SQLConnect], [AC_DEFINE(HAVE_LIBODBC)], [sql=no] )
AC_CHECK_HEADERS([sqlext.h])
fi
AM_CONDITIONAL( BUILD_CERT, test x$cert = xyes )
AM_CONDITIONAL( BUILD_DTIME, test x$difftime = xyes )
AM_CONDITIONAL( BUILD_FFILE, test x$flatfile = xyes )
AM_CONDITIONAL( BUILD_GDBM, test x$gdbm = xyes )
AM_CONDITIONAL( BUILD_IPNUM, test x$ipnum = xyes )
AM_CONDITIONAL( BUILD_LASTLOGIN, test x$lastlogin = xyes )
AM_CONDITIONAL( BUILD_LDAPSET, test x$ldapset = xyes )
AM_CONDITIONAL( BUILD_LOCALGROUP, test x$localgroup = xyes )
AM_CONDITIONAL( BUILD_MAILMATCH, test x$mailmatch = xyes )
AM_CONDITIONAL( BUILD_MOTD, test x$motd = xyes )
AM_CONDITIONAL( BUILD_RBL, test x$rbl = xyes )
AM_CONDITIONAL( BUILD_REGEXP, test x$regexp = xyes )
AM_CONDITIONAL( BUILD_SPOCP, test x$enable_spocp = xyes )
AM_CONDITIONAL( BUILD_SQL, test x$sql = xyes )
AM_CONDITIONAL( BUILD_STRMATCH, test x$strmatch = xyes )
AM_CONDITIONAL( BUILD_SYSTEM, test x$system = xyes )
AM_CONDITIONAL( BUILD_TIME, test x$time = xyes )
AM_CONDITIONAL( BUILD_LDAPPROXY, test x$ldapproxy = xyes )
dnl *************************************************
AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
AC_TRY_COMPILE(
[ #include <sys/types.h> ],
[ u_int a; a = 1;],
[ ac_cv_have_u_int="yes" ],
[ ac_cv_have_u_int="no" ]
)
])
if test "x$ac_cv_have_u_int" = "xyes" ; then
AC_DEFINE([HAVE_U_INT],1,[Define if u_int is present])
have_u_int=1
fi
AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
AC_TRY_COMPILE(
[ #include <sys/types.h> ],
[ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
[ ac_cv_have_intxx_t="yes" ],
[ ac_cv_have_intxx_t="no" ]
)
])
if test "x$ac_cv_have_intxx_t" = "xyes" ; then
AC_DEFINE([HAVE_INTXX_T],1,[Define if u_intXX is present])
have_intxx_t=1
fi
if (test -z "$have_intxx_t" && \
test "x$ac_cv_header_stdint_h" = "xyes")
then
AC_MSG_CHECKING([for intXX_t types in stdint.h])
AC_TRY_COMPILE(
[ #include <stdint.h> ],
[ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
[
AC_DEFINE([HAVE_INTXX_T],1,[Define if u_intXX is present])
AC_MSG_RESULT(yes)
],
[ AC_MSG_RESULT(no) ]
)
fi
dnl *************************************************
AC_MSG_CHECKING(version of libc)
AC_EGREP_CPP(version of glibc is 2,
[
#include <stdio.h>
version of glibc is __GLIBC__
],
ac_glibc2=yes)
if test "$ac_glibc2" = "yes"; then
AC_MSG_RESULT(glibc2)
AC_DEFINE([GLIBC2], 1, [Define if glibc2 is used])
else
AC_MSG_RESULT(not glibc2)
fi
dnl *************************************************
dnl * taken from sleepycat DB configure *************
case "$host_os" in
aix4.3.*|aix5*)
optimize_def="-O2"
CC=${CC-"xlc_r"}
CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
LDFLAGS="$LDFLAGS -Wl,-brtl";;
bsdi3*) optimize_def="-O2"
CC=${CC-"shlicc2"}
LIBS="$LIBS -lipc";;
bsdi*) optimize_def="-O2";;
cygwin*)
optimize_def="-O2"
CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE -D_REENTRANT";;
freebsd*)
optimize_def="-O2"
CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
LDFLAGS="$LDFLAGS -pthread";;
gnu*|k*bsd*-gnu|linux*)
optimize_def="-O2"
CPPFLAGS="$CPPFLAGS -D_REENTRANT";;
hpux*) CPPFLAGS="$CPPFLAGS -D_REENTRANT";;
irix*) optimize_def="-O2"
CPPFLAGS="$CPPFLAGS -D_SGI_MP_SOURCE";;
mpeix*) CPPFLAGS="$CPPFLAGS -D_POSIX_SOURCE -D_SOCKET_SOURCE"
LIBS="$LIBS -lsocket -lsvipc";;
osf*) CPPFLAGS="$CPPFLAGS -pthread";;
*qnx*) AC_DEFINE(HAVE_QNX)
AH_TEMPLATE(HAVE_QNX, [Define to 1 if building on QNX.]);;
solaris*)
CPPFLAGS="$CPPFLAGS -D_REENTRANT";;
esac
dnl *************************************************
AC_CHECK_HEADERS(tcpd.h,[
AC_MSG_CHECKING([for TCP wrappers library])
save_LIBS="$LIBS"
LIBS="$LIBS -lwrap"
AC_TRY_LINK([
#include <tcpd.h>
int allow_severity = 0;
int deny_severity = 0;
struct request_info *req;
],[
hosts_access(req)
],[AC_MSG_RESULT([-lwrap])
have_wrappers=yes
LIBS="$save_LIBS"],[
dnl try with -lnsl
LIBS="$LIBS -lnsl"
AC_TRY_LINK([
#include <tcpd.h>
int allow_severity = 0;
int deny_severity = 0;
struct request_info *req;
],[
hosts_access(req)
],[AC_MSG_RESULT([-lwrap -lnsl])
have_wrappers=yes
LIBS="$save_LIBS -lnsl"],[
AC_MSG_RESULT(no)
have_wrappers=no
LIBS=$save_LIBS])],[
have_wrappers=no])],[have_wrappers=no])
if test $have_wrappers = yes ; then
AC_DEFINE(HAVE_LIBWRAP,1, [define if you have -lwrap])
WRAP_LIBS="-lwrap"
elif test $ol_enable_wrappers = yes ; then
AC_MSG_ERROR([could not find TCP wrappers, select apppropriate options ore disable])
else
AC_MSG_WARN([could not find TCP wrappers, support disabled])
WRAP_LIBS=""
fi
dnl *************************************************
# Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
CHECK_SSL
CHECK_SASL2
AC_CHECK_HEADERS([arpa/inet.h errno.h fcntl.h limits.h \
netdb.h netinet/in.h stdlib.h string.h strings.h \
sys/socket.h sys/time.h syslog.h unistd.h pthread.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_SIGNAL
AC_TYPE_MODE_T
AC_HEADER_TIME
AC_HEADER_SYS_WAIT
AC_STRUCT_TM
# Checks for library functions.
AC_FUNC_FORK
AC_FUNC_MALLOC
AC_FUNC_MKTIME
AC_FUNC_STAT
AC_FUNC_STRFTIME
AC_FUNC_MEMCMP
AC_FUNC_STRNLEN
dnl *************************************************
AC_CHECK_FUNCS([bzero fdatasync getcwd gethostbyaddr gethostbyname \
gethostname gettimeofday inet_ntoa localtime_r memmove memset \
select socket strcasecmp strdup strerror strncasecmp strndup \
strnlen strstr strtol uname getnameinfo inet_ntop fdatasync fsync])
AC_CHECK_FUNCS([memchr])
AC_CHECK_FUNCS([regcomp])
AC_CHECK_FUNCS([strchr])
AC_CHECK_FUNCS([strcspn])
AC_CHECK_FUNCS([strpbrk])
AC_CHECK_FUNCS([pipe])
AC_CHECK_FUNCS([getdomainname])
AC_CHECK_FUNCS([strptime])
AC_CHECK_FUNCS([strlcpy])
AC_CHECK_FUNCS([strlcat])
dnl *************************************************
AC_SUBST(WRAP_LIBS)
AC_SUBST(MODULE_LIBS)
AH_TOP([#ifndef RCSID
#define RCSID(msg) \
static /**/const char *const rcsid[] = { (const char *)rcsid, "@(#)" msg }
#endif])
dnl clients/openldap/Makefile
dnl clients/exim/Makefile
AC_OUTPUT([./Makefile \
backends/cert/Makefile \
backends/dback_gdbm/Makefile \
backends/difftime/Makefile \
backends/flatfile/Makefile \
backends/gdbm/Makefile \
backends/ipnum/Makefile \
backends/lastlogin/Makefile \
backends/ldapproxy/Makefile \
backends/ldapset/Makefile \
backends/localgroup/Makefile \
backends/mailmatch/Makefile \
backends/Makefile \
backends/motd/Makefile \
backends/rbl/Makefile \
backends/regexp/Makefile \
backends/spocp/Makefile \
backends/sql/Makefile \
backends/strmatch/Makefile \
backends/system/Makefile \
backends/time/Makefile \
client/Makefile \
client/src/Makefile \
client/tools/Makefile \
doc/Makefile \
cf/Makefile \
include/Makefile \
lib/Makefile \
util/Makefile \
server/Makefile])