-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.in
587 lines (525 loc) · 18.2 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
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
dnl Process this file with autoconf to produce a configure script.
dnl rewritten for my own personal sanity, and for more extensive
dnl checks - feb04 -epi
AC_INIT
AC_CONFIG_HEADER(include/setup.h)
PACKAGE=solid-ircd
VERSION=3.4.7
AC_SUBST(PACKAGE)
AC_SUBST(VERSION)
# autoheader templates
AH_TEMPLATE([BROKEN_FD_SETSIZE],[If on a system with a broken FD_SETSIZE])
AH_TEMPLATE([HAVE_ENCRYPTION_ON],[If we support encryption])
AH_TEMPLATE([HAVE_MINMAX],[If we have the MIN and MAX macros])
AH_TEMPLATE([OS_SOLARIS2],[If we're running on Solaris])
AH_TEMPLATE([OS_SOLARIS],[Not quite sure why we have two of these])
AH_TEMPLATE([SYS_ERRLIST_DECLARED],[If the sys_errlist array is defined])
AH_TEMPLATE([USE_HOOKMODULES],[Do we support loadable modules])
AH_TEMPLATE([MAXCONNECTIONS],[Maximum Connections we allow])
AH_TEMPLATE([NEED_EPOLL_DEFS],[epoll behavior])
AH_TEMPLATE([AIX],[AIX support])
AH_TEMPLATE([WRITEV_IOV],[Maxmimum number of iovecs supported by writev()])
AH_TEMPLATE([HAVE_SSL],[SSL support])
dnl Put our options of here for ease of reading.
AC_ARG_ENABLE(hookmodules,
[ --disable-hookmodules disable support for loadable hook modules],,
[ check_hmodules="yes" ])
AC_ARG_ENABLE(openssl,
[ --enable-openssl[=DIR] Enable OpenSSL support (DIR optional).
--disable-openssl Disable OpenSSL support. ],
[ cf_enable_openssl=$enableval ],
[ cf_enable_openssl="auto" ])
AC_ARG_WITH(socketengine,
[ --with-socketengine=TYPE Set the socketengine type. Choices are:
kqueue poll select ],
[ check_sengine=$withval ],
[ check_sengine="yes" ])
AC_ARG_WITH(maxconnections,
[ --with-maxconnections=NUMBER Set the maximum number of sockets.],
[ check_maxconnections=$withval ],
[ check_maxconnections="auto" ])
dnl -----------------------------------------------------------------
dnl this adds our check for proper warnings checks
dnl http://ac-archive.sourceforge.net/guidod/ax_cflags_warn_all.html
dnl handy.
AC_DEFUN([AX_CFLAGS_WARN_ALL],[dnl
AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl
AS_VAR_PUSHDEF([VAR],[ac_cv_cflags_warn_all])dnl
AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for maximum warnings],
VAR,[VAR="no, unknown"
AC_LANG_SAVE
AC_LANG_C
ac_save_[]FLAGS="$[]FLAGS"
for ac_arg dnl
in "-pedantic % -Wall" dnl GCC
"-xstrconst % -v" dnl Solaris C
"-std1 % -verbose -w0 -warnprotos" dnl Digital Unix
"-qlanglvl=ansi % -qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd" dnl AIX
"-ansi -ansiE % -fullwarn" dnl IRIX
"+ESlit % +w1" dnl HP-UX C
"-Xc % -pvctl[,]fullmsg" dnl NEC SX-5 (Super-UX 10)
"-h conform % -h msglevel 2" dnl Cray C (Unicos)
#
do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
AC_TRY_COMPILE([],[return 0;],
[VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
done
FLAGS="$ac_save_[]FLAGS"
AC_LANG_RESTORE
])
case ".$VAR" in
.ok|.ok,*) m4_ifvaln($3,$3) ;;
.|.no|.no,*) m4_ifvaln($4,$4,[m4_ifval($2,[
AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])
m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])]) ;;
*) m4_ifvaln($3,$3,[
if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
fi ]) ;;
esac
AS_VAR_POPDEF([VAR])dnl
AS_VAR_POPDEF([FLAGS])dnl
])
dnl the only difference - the LANG selection... and the default FLAGS
AC_DEFUN([AX_CXXFLAGS_WARN_ALL],[dnl
AS_VAR_PUSHDEF([FLAGS],[CXXFLAGS])dnl
AS_VAR_PUSHDEF([VAR],[ac_cv_cxxflags_warn_all])dnl
AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for maximum warnings],
VAR,[VAR="no, unknown"
AC_LANG_SAVE
AC_LANG_CXX
ac_save_[]FLAGS="$[]FLAGS"
for ac_arg dnl
in "-pedantic % -Wall" dnl GCC
"-xstrconst % -v" dnl Solaris C
"-std1 % -verbose -w0 -warnprotos" dnl Digital Unix
"-qlanglvl=ansi % -qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd" dnl AIX
"-ansi -ansiE % -fullwarn" dnl IRIX
"+ESlit % +w1" dnl HP-UX C
"-Xc % -pvctl[,]fullmsg" dnl NEC SX-5 (Super-UX 10)
"-h conform % -h msglevel 2" dnl Cray C (Unicos)
#
do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
AC_TRY_COMPILE([],[return 0;],
[VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
done
FLAGS="$ac_save_[]FLAGS"
AC_LANG_RESTORE
])
case ".$VAR" in
.ok|.ok,*) m4_ifvaln($3,$3) ;;
.|.no|.no,*) m4_ifvaln($4,$4,[m4_ifval($2,[
AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])
m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])]) ;;
*) m4_ifvaln($3,$3,[
if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
fi ]) ;;
esac
AS_VAR_POPDEF([VAR])dnl
AS_VAR_POPDEF([FLAGS])dnl
])
dnl implementation tactics:
dnl the for-argument contains a list of options. The first part of
dnl these does only exist to detect the compiler - usually it is
dnl a global option to enable -ansi or -extrawarnings. All other
dnl compilers will fail about it. That was needed since a lot of
dnl compilers will give false positives for some option-syntax
dnl like -Woption or -Xoption as they think of it is a pass-through
dnl to later compile stages or something. The "%" is used as a
dnl delimimiter. A non-option comment can be given after "%%" marks.
dnl -------------------------------------------------------------------
dnl Checks for programs.
AC_PROG_CC
AX_CFLAGS_WARN_ALL
AC_CANONICAL_SYSTEM
AC_ISC_POSIX
AC_PROG_MAKE_SET
AC_PATH_PROG(RM, rm)
AC_PATH_PROG(CP, cp)
AC_PATH_PROG(MV, mv)
AC_PROG_INSTALL
AC_C_INLINE
dnl Checks for libraries.
dnl Replace `main' with a function in -lnsl:
AC_CHECK_LIB(nsl, gethostbyname)
AC_CHECK_FUNC(res_mkquery,, AC_CHECK_LIB(resolv, res_mkquery))
AC_CHECK_FUNC(__res_mkquery,, AC_CHECK_LIB(resolv, __res_mkquery))
AC_CHECK_LIB(socket, socket)
AC_CHECK_FUNC(crypt,, AC_CHECK_LIB(descrypt, crypt,,AC_CHECK_LIB(crypt, crypt,,)))
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([fcntl.h limits.h malloc.h netdb.h netinet/in.h stddef.h])
AC_CHECK_HEADERS([stdlib.h string.h strings.h sys/file.h sys/ioctl.h])
AC_CHECK_HEADERS([sys/param.h sys/socket.h sys/time.h syslog.h unistd.h])
AC_CHECK_HEADERS([utmp.h])
AC_CHECK_HEADERS(inttypes.h sys/resource.h errno.h stdlib.h stddef.h getopt.h)
AC_MSG_CHECKING(MIN and MAX definition)
AC_EGREP_CPP(yes,
[
#if defined( HAVE_SYS_PARAM_H )
#include <sys/param.h>
#ifdef MIN
yes
#endif
#endif
], AC_DEFINE(HAVE_MINMAX) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
dnl Checks for library functions.
AC_PROG_GCC_TRADITIONAL
AC_CHECK_FUNCS([alarm dup2 gethostbyname gethostname getpass gettimeofday])
AC_CHECK_FUNCS([inet_ntoa isascii memmove memset munmap setenv socket])
AC_CHECK_FUNCS([strcasecmp strchr strdup strerror strncasecmp strrchr strtol])
AC_CHECK_FUNCS([strtoul index strerror strtoken strtok inet_addr inet_netof])
AC_CHECK_FUNCS([inet_aton gettimeofday lrand48 sigaction bzero bcmp bcopy])
AC_CHECK_FUNCS([dn_skipname __dn_skipname getrusage times break])
dnl check for various OSes
case "$target" in
*-solaris2*)
solaris2="yes"
AC_DEFINE(OS_SOLARIS2)
AC_DEFINE(OS_SOLARIS)
dnl AC_DEFINE_UNQUOTED(WRITEV_IOV, 16)
;;
*-freebsd*)
freebsd="yes"
dnl AC_DEFINE_UNQUOTED(WRITEV_IOV, 32)
;;
*-netbsd*)
dnl AC_DEFINE_UNQUOTED(WRITEV_IOV, 32)
;;
*-openbsd*)
dnl AC_DEFINE_UNQUOTED(WRITEV_IOV, 32)
;;
*-linux*)
linux="yes"
dnl AC_DEFINE_UNQUOTED(WRITEV_IOV, 32)
;;
*aix*)
aix="yes"
AC_DEFINE(AIX)
;;
*-darwin*)
check_hmodules="no"
dnl AC_DEFINE_UNQUOTED(WRITEV_IOV, 32)
;;
esac
dnl Checks for loadable hook module support
set_hmodules="disabled"
if test "$check_hmodules" = "yes"; then
AC_CHECK_LIB(dl, dlopen)
AC_CHECK_HEADER(dlfcn.h)
AC_CHECK_FUNCS(dlopen dlsym, [set_hmodules="enabled"])
if test "$set_hmodules" = "enabled"; then
AC_DEFINE(USE_HOOKMODULES)
MOD_LIBS="-Wl,-export-dynamic"
fi
fi
dnl Check for sys_errlist
dnl Stolen from BitchX
AC_MSG_CHECKING(for sys_errlist declaration)
AC_TRY_RUN([
#include <sys/types.h>
#include <stdio.h>
#include <errno.h>
main()
{
char *s = sys_errlist[0];
exit(0);
}
],
AC_MSG_RESULT(yes)
AC_DEFINE(SYS_ERRLIST_DECLARED),
AC_MSG_RESULT(no), AC_MSG_RESULT(cross compiling))
dnl Openssl checks - combination of our old way and the hybrid7 method
save_LIBS="$LIBS"
AC_MSG_CHECKING(for OpenSSL)
if test "X$cf_enable_openssl" != "Xno" ; then
cf_openssl_basedir=""
if test "X$cf_enable_openssl" != "Xauto" &&
test "X$cf_enable_openssl" != "Xyes"; then
dnl Support for --enable-openssl=/some/place
cf_openssl_basedir="${cf_enable_openssl}"
else
dnl Do the auto-probe here. Check some common directory paths.
for dirs in /usr/local/ssl /usr/pkg /usr/local /usr/lib /usr/lib/ssl\
/opt /opt/openssl /usr/local/openssl ; do
if test -f "${dirs}/include/openssl/opensslv.h" ; then
cf_openssl_basedir="${dirs}"
break
fi
done
unset dirs
fi
dnl Now check cf_openssl_found to see if we found anything.
if test "X$cf_openssl_basedir" != "X" ; then
if test -f "${cf_openssl_basedir}/include/openssl/opensslv.h" ; then
SSL_INCLUDES="-I${cf_openssl_basedir}/include"
SSL_LIBS="-L${cf_openssl_basedir}/lib"
else
dnl OpenSSL wasn't found in the directory specified. Naughty
dnl administrator...
cf_openssl_basedir=""
fi
else
dnl Check for stock FreeBSD 4.x and 5.x systems, since their files
dnl are in /usr/include and /usr/lib. In this case, we don't want to
dnl change INCLUDES or LIBS, but still want to enable OpenSSL.
dnl We can't do this check above, because some people want two versions
dnl of OpenSSL installed (stock FreeBSD 4.x/5.x and /usr/local/ssl)
dnl and they want /usr/local/ssl to have preference.
if test -f "/usr/include/openssl/opensslv.h" ; then
cf_openssl_basedir="/usr"
fi
fi
dnl If we have a basedir defined, then everything is okay. Otherwise,
dnl we have a problem.
if test "X$cf_openssl_basedir" != "X" ; then
LIBS="$save_LIBS $SSL_LIBS -lssl -lcrypto"
AC_MSG_RESULT($cf_openssl_basedir)
cf_enable_openssl="yes"
encryption="enabled"
AC_DEFINE(HAVE_ENCRYPTION_ON)
ENCRYPT_SRC="rc4.c dh.c"
AC_SUBST(ENCRYPT_SRC)
AC_DEFINE(HAVE_SSL)
ssl_connections="enabled"
else
AC_MSG_RESULT(not found. Please check your path.)
cf_enable_openssl="no"
encryption="disabled"
fi
unset cf_openssl_basedir
else
dnl If --disable-openssl was specified
encryption="disabled"
AC_MSG_RESULT(disabled)
fi
unset save_LIBS
dnl end of openssl library test
dnl once we add epoll and /dev/poll support, these will be
dnl updated with the appropriate checks
if test "$check_sengine" = "yes"; then
engine="select"
if test "$freebsd" = "yes"; then
AC_CHECK_FUNC(kevent, [ engine="kqueue" ], )
elif test "$solaris2" = "yes"; then
engine="poll"
AC_CHECK_HEADER(sys/devpoll.h, engine="devpoll", )
elif test "$linux" = "yes"; then
AC_CHECK_FUNC(poll, [ engine="poll" ], )
AC_CHECK_HEADER(sys/epoll.h, HAVE_EPOLL_H=yes, HAVE_EPOLL_H=no)
AC_CHECK_LIB(epoll, epoll_create,
[LIBS="$LIBS -lepoll"; have_epoll_lib="yes"; engine="epoll"],
have_epoll_lib="no")
if test "$HAVE_EPOLL_H $have_epoll_lib" = "yes no"; then
AC_MSG_CHECKING(for epoll_create [without -lepoll])
AC_TRY_RUN([
#include <stdint.h>
#include <sys/epoll.h>
#include <errno.h>
#include <asm/unistd.h>
_syscall1(int, epoll_create, int, size)
int main(int argc, char **argv) { return epoll_create(5) < 1; }
],
have_epoll_lib="yes", have_epoll_lib="no")
AC_MSG_RESULT($have_epoll_lib)
if test "$have_epoll_lib" = "yes"; then
AC_DEFINE(NEED_EPOLL_DEFS)
fi
fi
if test "$HAVE_EPOLL_H $have_epoll_lib" = "yes yes"; then
engine="epoll";
fi
else
AC_CHECK_FUNC(poll, [ engine="poll"], )
fi
elif test "$check_sengine" = "kqueue"; then
AC_CHECK_FUNC(kevent, [ engine="kqueue" ], )
if test "X$engine" = "X"; then
AC_MSG_NOTICE()
AC_MSG_NOTICE(kqueue not supported on this platform!)
AC_MSG_ERROR()
fi
AC_MSG_NOTICE(setting socketengine type to kqueue)
elif test "$check_sengine" = "poll"; then
AC_CHECK_FUNC(poll, [ engine="poll" ], )
if test "X$engine" = "X"; then
AC_MSG_NOTICE()
AC_MSG_NOTICE(poll not supported on this platform!)
AC_MSG_ERROR()
fi
AC_MSG_NOTICE(setting socketengine type to poll)
elif test "$check_sengine" = "devpoll"; then
AC_CHECK_HEADER(sys/devpoll.h, engine="devpoll", )
if test "X$engine" = "X"; then
AC_MSG_NOTICE()
AC_MSG_NOTICE(/dev/poll not supported on this system)
AC_MSG_ERROR()
fi
AC_MSG_NOTICE(setting socketengine to devpoll)
elif test "$check_sengine" = "epoll"; then
AC_CHECK_HEADER(sys/epoll.h, HAVE_EPOLL_H=yes, HAVE_EPOLL_H=no)
AC_CHECK_LIB(epoll, epoll_create,
[LIBS="$LIBS -lepoll"; have_epoll_lib="yes"; engine="epoll"],
have_epoll_lib="no")
if test "$HAVE_EPOLL_H $have_epoll_lib" = "yes no"; then
AC_MSG_CHECKING(for epoll_create [without -lepoll])
AC_TRY_RUN([
#include <stdint.h>
#include <sys/epoll.h>
#include <errno.h>
#include <asm/unistd.h>
_syscall1(int, epoll_create, int, size)
int main(int argc, char **argv) { return epoll_create(5) < 1; }
],
have_epoll_lib="yes", have_epoll_lib="no")
AC_MSG_RESULT($have_epoll_lib)
if test "$have_epoll_lib" = "yes"; then
AC_DEFINE(NEED_EPOLL_DEFS)
fi
fi
if test "$HAVE_EPOLL_H $have_epoll_lib" != "yes yes"; then
AC_MSG_NOTICE()
AC_MSG_ERROR(epoll is not supported on this machine)
AC_MSG_ERROR()
fi
AC_MSG_NOTICE(setting socketengine type to epoll)
engine="epoll";
elif test "$check_sengine" = "select"; then
AC_MSG_NOTICE(setting socketengine type to select.. for some stupid reason)
engine="select"
else
AC_MSG_NOTICE()
AC_MSG_NOTICE(socket engine type incorrect!)
AC_MSG_ERROR()
fi
SENGINE="socketengine_$engine.c"
dnl Check to see if we have a broken FD_SETSIZE
if test $engine = "select"; then
AC_MSG_CHECKING(to see if FD_SETSIZE is broken)
AC_TRY_RUN([
#define FD_SETSIZE 666
#include <sys/types.h>
#include <sys/time.h>
int main()
{
if(FD_SETSIZE != 666)
exit(1);
exit(0);
}
],
AC_MSG_RESULT(no),
[
AC_MSG_RESULT(YES)
AC_MSG_WARN(FD_SETSIZE is hard set by your operating system)
AC_MSG_WARN(MAXCONNECTIONS must be no higher than the hardwired FD_SETSIZE)
AC_DEFINE(BROKEN_FD_SETSIZE)
broken_fd_setsize="yes"
],
AC_MSG_RESULT(can't tell))
fi
if test "$solaris2" != "yes" && test "$aix" != "yes" &&
test "$set_hmodules" = "enabled"; then
LIBS="$LIBS $MOD_LIBS"
fi
if test "$check_maxconnections" = "auto"; then
AC_MSG_CHECKING(Maximum file descriptors);
AC_CACHE_VAL(maxconnections,
[
AC_LANG_CONFTEST(
[AC_LANG_SOURCE([[
#include <sys/types.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <stdio.h>
#ifdef RLIMIT_FDMAX
#define RLIMIT_FD_MAX RLIMIT_FDMAX
#else
#ifdef RLIMIT_NOFILE
#define RLIMIT_FD_MAX RLIMIT_NOFILE
#else
#ifdef RLIMIT_OPEN_MAX
#define RLIMIT_FD_MAX RLIMIT_OPEN_MAX
#else
#undef RLIMIT_FD_MAX
#endif
#endif
#endif
int main()
{
#ifndef BROKEN_FD_SETSIZE
#ifdef RLIMIT_FD_MAX
struct rlimit limit;
if(!getrlimit(RLIMIT_FD_MAX, &limit))
{
if(limit.rlim_max > 32768)
printf("32768");
else
printf("%ld", (long) limit.rlim_max);
}
else
#endif
printf("256");
#else
printf("%d", FD_SETSIZE);
#endif
return 0;
}
]])
])
$CC -o conftest conftest.c >/dev/null 2>&1
maxconnections=`./conftest`
AC_MSG_RESULT($maxconnections)
$RM -f conftest conftest.c
])
AC_DEFINE_UNQUOTED(MAXCONNECTIONS, ${maxconnections})
else
maxconnections=$check_maxconnections
AC_DEFINE_UNQUOTED(MAXCONNECTIONS, ${maxconnections})
fi
if test "$engine" = "select" && test "$broken_fd_setsize" != "yes"; then
CFLAGS="$CFLAGS -DFD_SETSIZE=$maxconnections"
fi
AC_DEFUN([TYPE_SOCKLEN_T],
[AC_CACHE_CHECK([for socklen_t], ac_cv_type_socklen_t,
[
AC_TRY_COMPILE(
[#include <sys/types.h>
#include <sys/socket.h>],
[socklen_t len = 42; return 0;],
ac_cv_type_socklen_t=yes,
ac_cv_type_socklen_t=no)
])
if test $ac_cv_type_socklen_t != yes; then
AC_DEFINE(socklen_t, int, [Substitute for socklen_t])
fi
])
TYPE_SOCKLEN_T
AC_SUBST(SSL_INCLUDES)
AC_SUBST(SSL_LIBS)
AC_SUBST(LIBS)
AC_SUBST(SENGINE)
AC_OUTPUT(Makefile src/Makefile tools/Makefile doc/Makefile)
echo configuring zlib...
(
cd zlib
./configure
cd ..
)
echo ""
echo " ******* solid-ircd Configuration Settings *******"
echo " System Build Type: $target"
echo " Socket Engine Type: $engine"
echo " Encryption: $encryption"
echo " SSL Connections: $ssl_connections"
echo " Loadable Modules: $set_hmodules"
echo " Maximum Connections: $maxconnections"
echo " Install Directory: $prefix"
echo " System Config Directory: $sysconfdir"
echo " Binaries Directory: $sbindir"
echo " Documentation Directory: $docdir"
echo ""