1 dnl Prefered emacs editing mode: -*- shell-script -*-
3 dnl Process this file with autoconf to produce a configure script.
5 dnl Copyright (c) 1997, by Carlo Wood <carlo@runaway.xs4all.nl>
6 dnl Copyright (C) 2001 Kevin L. Mitchell <klmitch@mit.edu>
8 dnl This program is free software; you can redistribute it and/or modify
9 dnl it under the terms of the GNU General Public License as published by
10 dnl the Free Software Foundation; either version 1, or (at your option)
11 dnl any later version.
13 dnl This program is distributed in the hope that it will be useful,
14 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
15 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 dnl GNU General Public License for more details.
18 dnl You should have received a copy of the GNU General Public License
19 dnl along with this program; if not, write to the Free Software
20 dnl Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 dnl Make sure we are in the correct directory (someone could have run
25 dnl 'configure' with a wrong '--srcdir').
28 dnl Set the default prefix
29 AC_PREFIX_DEFAULT([$HOME])
30 AC_MSG_CHECKING([for installation prefix])
31 AC_CACHE_VAL(unet_cv_prefix, [unet_cv_prefix=$HOME])
32 if test x"$prefix" != xNONE; then
33 unet_cv_prefix=$prefix
35 AC_MSG_RESULT([$unet_cv_prefix])
36 dnl HACK WARNING: We are referencing an autoconf internal variable. This is
37 dnl the only way to force the prefix to be retrieved from the config.cache
39 ac_default_prefix=$unet_cv_prefix
41 dnl Define the input and output configuration header file.
42 AC_CONFIG_HEADER([config.h])
44 dnl Demand at least version 2.59 of autoconf (for AS_HELP_STRING)
47 dnl Find out what type of system we are
50 dnl This should be done early.
53 dnl ANSIfy the C compiler whenever possible.
56 dnl Checks for libraries.
58 dnl Locate the library containing crypt
59 AC_SEARCH_LIBS(crypt, descrypt crypt, ,
60 [AC_MSG_ERROR([Unable to find library containing crypt()])])
62 dnl Do all the checks necessary to figure out -lnsl / -lsocket stuff
65 dnl Checks for header files.
67 AC_CHECK_HEADERS(crypt.h poll.h inttypes.h stdint.h sys/devpoll.h sys/epoll.h sys/event.h sys/param.h sys/resource.h sys/socket.h)
69 dnl Checks for typedefs, structures, and compiler characteristics
77 AC_CHECK_TYPE(socklen_t, unsigned int)
78 AC_CHECK_TYPE(struct sockaddr_in6, [unet_have_sockaddr_in6="yes"], [unet_have_sockaddr_in6="no"], [#include <sys/types.h>
79 #include <netinet/in.h>])
81 dnl Checks for library functions.
82 AC_CHECK_FUNCS([kqueue setrlimit getrusage times])
84 dnl Do we have restarting syscalls ?
85 AC_SYS_RESTARTABLE_SYSCALLS
87 dnl Check for required features for admins?
88 AC_MSG_CHECKING([for donuts])
96 AC_PATH_PROGS(RMPROG, rm, /bin/rm)
97 AC_PATH_PROGS(SHPROG, sh, /bin/sh)
99 dnl (F)LEX - needed for the new conf file parser
101 dnl The autoconf docs say $LEX defaults to 'lex'. They lie.
102 if test "$LEX" = ":" ; then
103 AC_MSG_ERROR([Cannot find flex.])
104 elif echo "" | $LEX -V -v --version > /dev/null 2>&1 ; then
107 AC_MSG_ERROR([Cannot use $LEX as flex.])
110 if test -z "$LEXLIB" ; then
111 AC_MSG_FAILURE([Cannot find a library with yywrap() in, but flex was found.
112 It's possible the compiler you're using ($CC) is incompatible with the
120 dnl The autoconf docs say $YACC defaults to 'yacc'. This seems to be true,
121 dnl but judging from AC_PROG_LEX, it may not stay true.
122 if test "$YACC" = ":" ; then
123 AC_MSG_ERROR([Cannot find yacc.])
124 elif echo "" | $YACC -V -v --version > /dev/null 2>&1 ; then
127 dnl byacc does not seem to have any way to test for workingness, so only warn.
128 AC_MSG_WARN([$YACC may not work as yacc.])
134 dnl Check OS for os_dep files.
135 AC_MSG_CHECKING(for OS-dependent information)
138 AC_MSG_RESULT([Linux ($host) found.])
139 unet_poll_syscall=yes
143 AC_MSG_RESULT([Solaris ($host) found.])
144 if test x"$ac_cv_header_poll_h" = xyes; then
145 unet_poll_syscall=yes
152 AC_MSG_RESULT([Solaris ($host) found.])
157 AC_MSG_RESULT([OpenBSD ($host) found.])
158 if test x"$ac_cv_header_poll_h" = xyes; then
159 unet_poll_syscall=yes
166 AC_MSG_RESULT([Generic BSD ($host) found.])
167 if test x"$ac_cv_header_poll_h" = xyes; then
168 unet_poll_syscall=yes
175 AC_MSG_RESULT([Darwin (Mac OS X) ($host) found.])
180 AC_MSG_RESULT([Unknown system type $host found.])
181 AC_MSG_WARN([Unknown OS type; using generic routines.])
186 dnl Check user configuration options
187 dnl Start with --enable-poll
188 AC_MSG_CHECKING([whether to enable use of poll()])
189 AC_ARG_ENABLE([poll],
190 [ --enable-poll Force poll to be used regardless of whether or not
191 it is a system call],
192 [unet_cv_enable_poll=$enable_poll],
193 [AC_CACHE_VAL(unet_cv_enable_poll,
194 [unet_cv_enable_poll=$unet_poll_syscall])])
196 # Force poll to be disabled if there is no poll.h
197 if test x"$ac_cv_header_poll_h" != xyes; then
198 unet_cv_enable_poll=no
201 AC_MSG_RESULT([$unet_cv_enable_poll])
203 if test x"$unet_cv_enable_poll" = xyes; then
204 AC_DEFINE([USE_POLL], 1, [Specify whether or not to use poll()])
205 ENGINE_C=engine_poll.c
207 ENGINE_C=engine_select.c
211 dnl Now look for --enable-debug
212 AC_MSG_CHECKING([whether to enable debug mode])
213 AC_ARG_ENABLE([debug],
214 [ --enable-debug Turn on debugging mode],
215 [unet_cv_enable_debug=$enable_debug],
216 [AC_CACHE_VAL(unet_cv_enable_debug,
217 [unet_cv_enable_debug=no])])
218 AC_MSG_RESULT([$unet_cv_enable_debug])
220 if test x"$unet_cv_enable_debug" = xyes; then
221 AC_DEFINE([DEBUGMODE], 1, [Enable debugging code])
224 dnl Now look for --enable-leak-detect
225 AC_MSG_CHECKING([whether to enable leak detection])
226 AC_ARG_WITH([leak-detect],
227 [ --with-leak-detect Turn on the leak detector(requires patched boehm)],
228 [unet_cv_with_leak_detect=$with_leak_detect],
229 [AC_CACHE_VAL(unet_cv_with_leak_detect,
230 [unet_cv_with_leak_detect=no])])
231 AC_MSG_RESULT([$unet_cv_enable_leak_detect])
233 if test x"$unet_cv_with_leak_detect" != xno; then
235 CFLAGS="-DMDEBUG $CFLAGS"
236 if test x"$unet_cv_with_leak_detect" != xyes; then
237 LIBS="-L$unet_cv_with_leak_detect $LIBS"
242 AS_HELP_STRING([--without-ipv6], [disable IPv6 support (default is autodetect)]),
243 [ac_cv_use_ipv6=$withval],
244 [ac_cv_use_ipv6=$unet_have_sockaddr_in6])
245 AC_CACHE_CHECK([whether to use IPv6], [ac_cv_use_ipv6], [ac_cv_use_ipv6=no])
246 if test x"$ac_cv_use_ipv6" != "xno" ; then
247 AC_DEFINE([IPV6], 1, [Enable IPv6 support])
250 dnl And now for --disable-asserts
251 AC_MSG_CHECKING([whether to enable asserts])
252 AC_ARG_ENABLE([asserts],
253 [ --disable-asserts Disable assertion checking],
254 [unet_cv_enable_asserts=$enable_asserts],
255 [AC_CACHE_VAL(unet_cv_enable_asserts,
256 [unet_cv_enable_asserts=yes])])
257 AC_MSG_RESULT([$unet_cv_enable_asserts])
259 if test x"$unet_cv_enable_asserts" = xno; then
260 AC_DEFINE([NDEBUG], 1, [Disable assertions])
263 dnl Now check for --enable-profile
264 AC_MSG_CHECKING([whether to enable profiling support (gprof)])
265 AC_ARG_ENABLE([profile],
266 [ --enable-profile Enable profiling support (add -pg to CFLAGS and LDFLAGS)],
267 [unet_cv_enable_profile=$enable_profile],
268 [AC_CACHE_VAL(unet_cv_enable_profile,
269 [unet_cv_enable_profile=no])])
270 AC_MSG_RESULT([$unet_cv_enable_profile])
272 if test x"$unet_cv_enable_profile" = xyes; then
274 LDFLAGS="-pg $LDFLAGS"
277 dnl Now check for --enable-pedantic
278 AC_MSG_CHECKING([whether to enable pedantic compiler warnings])
279 AC_ARG_ENABLE([pedantic],
280 [ --enable-pedantic Enable pedantic warnings (add -pedantic to CFLAGS)],
281 [unet_cv_enable_pedantic=$enable_pedantic],
282 [AC_CACHE_VAL(unet_cv_enable_pedantic,
283 [unet_cv_enable_pedantic=no])])
284 AC_MSG_RESULT([$unet_cv_enable_pedantic])
286 if test x"$unet_cv_enable_pedantic" = xyes; then
287 CFLAGS="-pedantic $CFLAGS"
290 dnl Now check for --enable-warnings
291 AC_MSG_CHECKING([whether to enable compiler warnings])
292 AC_ARG_ENABLE([warnings],
293 [ --enable-warnings Enable warnings (add -Wall to CFLAGS)],
294 [unet_cv_enable_warnings=$enable_warnings],
295 [AC_CACHE_VAL(unet_cv_enable_warnings,
296 [unet_cv_enable_warnings=no])])
297 AC_MSG_RESULT([$unet_cv_enable_warnings])
299 if test x"$unet_cv_enable_warnings" = xyes; then
300 CFLAGS="-Wall $CFLAGS"
303 dnl --disable-inlines check...
304 AC_MSG_CHECKING([whether to enable inlining for a few critical functions])
305 AC_ARG_ENABLE([inlines],
306 [ --disable-inlines Disable inlining for a few critical functions],
307 [unet_cv_enable_inlines=$enable_inlines],
308 [AC_CACHE_VAL(unet_cv_enable_inlines,
309 [unet_cv_enable_inlines=yes])])
310 AC_MSG_RESULT([$unet_cv_enable_inlines])
312 if test x"$unet_cv_enable_inlines" = xyes; then
313 AC_DEFINE([FORCEINLINE], 1, [Force inlining for a few critical functions])
316 dnl --disable-devpoll check...
317 AC_MSG_CHECKING([whether to enable the /dev/poll event engine])
318 AC_ARG_ENABLE([devpoll],
319 [ --disable-devpoll Disable the /dev/poll-based engine],
320 [unet_cv_enable_devpoll=$enable_devpoll],
321 [AC_CACHE_VAL(unet_cv_enable_devpoll,
322 [unet_cv_enable_devpoll=yes])])
324 if test x"$ac_cv_header_sys_devpoll_h" = xno; then
325 unet_cv_enable_devpoll=no
328 AC_MSG_RESULT([$unet_cv_enable_devpoll])
330 if test x"$unet_cv_enable_devpoll" != xno; then
331 AC_DEFINE([USE_DEVPOLL], 1, [Define to enable the /dev/poll engine])
332 ENGINE_C="engine_devpoll.c $ENGINE_C"
335 dnl --disable-kqueue check...
336 AC_MSG_CHECKING([whether to enable the kqueue event engine])
337 AC_ARG_ENABLE([kqueue],
338 [ --disable-kqueue Disable the kqueue-based engine],
339 [unet_cv_enable_kqueue=$enable_kqueue],
340 [AC_CACHE_VAL(unet_cv_enable_kqueue,
341 [unet_cv_enable_kqueue=yes])])
343 if test x"$ac_cv_header_sys_event_h" = xno -o x"$ac_cv_func_kqueue" = xno; then
344 unet_cv_enable_kqueue=no
347 AC_MSG_RESULT([$unet_cv_enable_kqueue])
349 if test x"$unet_cv_enable_kqueue" != xno; then
350 AC_DEFINE([USE_KQUEUE], 1, [Define to enable the kqueue engine])
351 ENGINE_C="engine_kqueue.c $ENGINE_C"
354 dnl --disable-epoll check
355 AC_MSG_CHECKING([whether to enable the epoll event engine])
356 AC_ARG_ENABLE([epoll],
357 [ --disable-epoll Disable the epoll-based engine],
358 [unet_cv_enable_epoll=$enable_epoll],
359 [AC_CACHE_VAL(unet_cv_enable_epoll,
360 [unet_cv_enable_epoll=yes])])
362 if test x"$ac_cv_header_sys_epoll_h" = xno -o x"$ac_cv_func_epoll" = xno; then
363 unet_cv_enable_epoll=no
366 AC_MSG_RESULT([$unet_cv_enable_epoll])
368 dnl If we have the header and user has not refused epoll, we still need
369 dnl to check whether the functions are properly defined.
370 if test x"$unet_cv_enable_epoll" != xno; then
371 AC_MSG_CHECKING([whether epoll functions are properly defined])
372 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <sys/epoll.h>], [epoll_create(10);])],
373 [AC_MSG_RESULT([yes])],
375 AC_DEFINE([EPOLL_NEED_BODY], 1, [Define to implement epoll system calls])])
376 AC_DEFINE([USE_EPOLL], 1, [Define to enable the epoll engine])
377 ENGINE_C="engine_epoll.c $ENGINE_C"
380 dnl How to copy one va_list to another?
381 AC_CACHE_CHECK([for va_copy], unet_cv_c_va_copy, [AC_LINK_IFELSE(
382 [AC_LANG_PROGRAM([#include <stdarg.h>], [va_list ap1, ap2; va_copy(ap1, ap2);])],
383 [unet_cv_c_va_copy="yes"],
384 [unet_cv_c_va_copy="no"]
386 if test "$unet_cv_c_va_copy" = "yes" ; then
387 AC_DEFINE(HAVE_VA_COPY, 1, [Define if we have va_copy])
390 AC_CACHE_CHECK([for __va_copy], unet_cv_c___va_copy, [AC_LINK_IFELSE(
391 [AC_LANG_PROGRAM([#include <stdarg.h>], [va_list ap1, ap2; __va_copy(ap1, ap2);])],
392 [unet_cv_c___va_copy="yes"],
393 [unet_cv_c___va_copy="no"]
395 if test "$unet_cv_c___va_copy" = "yes" ; then
396 AC_DEFINE(HAVE___VA_COPY, 1, [Define if we have __va_copy])
399 dnl --with-symlink lets us set the name of the symlink; defaults to "ircd"
400 AC_MSG_CHECKING([what name to give the symlink])
401 AC_ARG_WITH([symlink],
402 [ --with-symlink=name Name to give the symlink; if name is "no," no
403 symlink will be created.],
404 [unet_cv_with_symlink=$with_symlink],
405 [AC_CACHE_VAL(unet_cv_with_symlink,
406 [unet_cv_with_symlink="ircd"])])
408 if test x"$unet_cv_with_symlink" = xyes; then
409 unet_cv_with_symlink="ircd"
412 AC_MSG_RESULT([$unet_cv_with_symlink])
414 if test x"$unet_cv_with_symlink" = xno; then
415 INSTALL_RULE=install-no-symlink
418 INSTALL_RULE=install-with-symlink
419 SYMLINK=$unet_cv_with_symlink
421 AC_SUBST(INSTALL_RULE)
424 dnl --with-mode lets us set the permissions on the binary
425 AC_MSG_CHECKING([what permissions to set on the installed binary])
427 [ --with-mode=mode Permissions (in octal) to give the binary],
428 [unet_cv_with_mode=$with_mode],
429 [AC_CACHE_VAL(unet_cv_with_mode,
430 [unet_cv_with_mode=711])])
432 if test x"$unet_cv_with_mode" = xyes -o x"$unet_cv_with_mode" = xno; then
433 unet_cv_with_mode=711
436 AC_MSG_RESULT([$unet_cv_with_mode])
438 IRCDMODE=$unet_cv_with_mode
441 dnl --with-owner lets us set the owner of the binary
443 unet_uid=`id | sed -e 's/.*uid=[0-9]*(//' -e 's/).*//' 2> /dev/null`
445 AC_MSG_CHECKING([which user should own the installed binary])
447 [ --with-owner=owner Specify owner of the installed binary],
448 [unet_cv_with_owner=$with_owner],
449 [AC_CACHE_VAL(unet_cv_with_owner,
450 [unet_cv_with_owner=$unet_uid])])
452 if test x"$unet_cv_with_owner" = xyes -o x"$unet_cv_with_owner" = xno; then
453 unet_cv_with_owner=$unet_uid
456 AC_MSG_RESULT([$unet_cv_with_owner])
458 IRCDOWN=$unet_cv_with_owner
461 dnl --with-group lets us set the group owner of the binary
463 unet_gid=`id | sed -e 's/.*gid=[0-9]*(//' -e 's/).*//' 2> /dev/null`
465 AC_MSG_CHECKING([which group should own the installed binary])
467 [ --with-group=group Specify group owner of the installed binary],
468 [unet_cv_with_group=$with_group],
469 [AC_CACHE_VAL(unet_cv_with_group,
470 [unet_cv_with_group=$unet_gid])])
472 if test x"$unet_cv_with_group" = xyes -o x"$unet_cv_with_group" = xno; then
473 unet_cv_with_group=$unet_gid
476 AC_MSG_RESULT([$unet_cv_with_group])
478 IRCDGRP=$unet_cv_with_group
481 dnl --with-domain lets us set the domain name for some statistics-gathering
483 if test -f /etc/resolv.conf; then
484 unet_domain=`awk '/^domain/ { print $2; exit }' /etc/resolv.conf`
485 if test x"$unet_domain" = x; then
486 unet_domain=`awk '/^search/ { print $2; exit }' /etc/resolv.conf`
489 AC_MSG_CHECKING([for site domain name])
490 AC_ARG_WITH([domain],
491 [ --with-domain=domain Domain name to use in local statistics gathering],
492 [unet_cv_with_domain=$with_domain],
493 [AC_CACHE_VAL(unet_cv_with_domain,
494 [unet_cv_with_domain=$unet_domain])])
496 if test x"$unet_cv_with_domain" = xyes -o x"$unet_cv_with_domain" = xno; then
497 unet_cv_with_domain=$unet_domain
499 if test x"$unet_cv_with_domain" = xno; then
500 AC_MSG_ERROR([Unable to determine server DNS domain; use --with-domain to set it])
503 AC_MSG_RESULT([$unet_cv_with_domain])
505 AC_DEFINE_UNQUOTED(DOMAINNAME, "*$unet_cv_with_domain",
506 [Domain name to be used for some statistics gathering])
508 dnl --with-chroot lets us define a directory that we are going to be using
509 dnl as the root of our filesystem
510 AC_MSG_CHECKING([if chroot operation is desired])
511 AC_ARG_WITH([chroot],
512 [ --with-chroot=dir Specify that the server will be operated under
513 a different root directory given by dir. See
514 doc/readme.chroot for more information.],
515 [unet_cv_with_chroot=$with_chroot],
516 [AC_CACHE_VAL(unet_cv_with_chroot,
517 [unet_cv_with_chroot=no])])
519 if test x"$unet_cv_with_chroot" = xyes; then
520 AC_MSG_ERROR([--with-chroot given with no directory. See doc/readme.chroot.])
523 # Ensure there are no trailing /'s to mess us up
524 unet_cv_with_chroot=`echo "$unet_cv_with_chroot" | sed 's%/*$%%'`
526 AC_MSG_RESULT([$unet_cv_with_chroot])
528 dnl Determine some default directory names
530 dnl HACK WARNING: We are referencing an autoconf internal variable. This is
531 dnl the only way to figure out what value $prefix will have when we go to do
532 dnl the install--and the only way we can stick that value in our definitions
534 # Deal with the annoying value "NONE" here
535 unet_save_prefix=$prefix
536 if test x"$prefix" = xNONE; then
537 prefix=$ac_default_prefix
542 unet_save_exec_prefix=$exec_prefix
543 if test x"$exec_prefix" = xNONE; then
546 exec_prefix=$exec_prefix
549 # Obtain the actual interesting directories
550 unet_bindir=`eval echo "$bindir"`
551 unet_libdir=`eval echo "$libdir"`
553 # Restore the original settings of $prefix and $exec_prefix
554 prefix=$unet_save_prefix
555 exec_prefix=$unet_save_exec_prefix
557 dnl Now compute the name of the binary and verify that it will work under
559 AC_MSG_CHECKING([where the binary will be for /restart])
560 if test x"$unet_cv_with_symlink" = xno; then
561 unet_spath="$unet_bindir/ircd"
563 unet_spath="$unet_bindir/$unet_cv_with_symlink"
565 AC_MSG_RESULT([$unet_spath])
567 if test x"$unet_cv_with_chroot" != xno; then
568 if echo "$unet_spath" | grep "^$unet_cv_with_chroot" > /dev/null 2>&1; then
569 unet_spath=`echo "$unet_spath" | sed "s%^$unet_cv_with_chroot%%"`
571 AC_MSG_WARN([Binary $unet_spath not relative to root directory $unet_cv_with_chroot; restarts will probably fail])
575 AC_DEFINE_UNQUOTED(SPATH, "$unet_spath", [Path to executable for restarts])
577 dnl --with-dpath sets the all-important DPATH
578 AC_MSG_CHECKING([what the data directory should be])
580 [ --with-dpath=dir Directory for all server data files],
581 [unet_cv_with_dpath=$with_dpath],
582 [AC_CACHE_VAL(unet_cv_with_dpath,
583 [unet_cv_with_dpath=$unet_libdir])])
585 if test x"$unet_cv_with_dpath" = xyes -o x"$unet_cv_with_dpath" = xno; then
586 unet_cv_with_dpath=$unet_libdir
589 # Ensure there are no trailing /'s to mess us up
590 unet_cv_with_dpath=`echo "$unet_cv_with_dpath" | sed 's%/*$%%'`
592 AC_MSG_RESULT([$unet_cv_with_dpath])
594 if test x"$unet_cv_with_chroot" != xno; then
595 if echo "$unet_cv_with_dpath" | grep "^$unet_cv_with_chroot" > /dev/null 2>&1; then
596 unet_dpath=`echo "$unet_cv_with_dpath" | sed "s%^$unet_cv_with_chroot%%"`
598 AC_MSG_ERROR([Data directory $unet_cv_with_dpath not relative to root directory $unet_cv_with_chroot])
601 unet_dpath=$unet_cv_with_dpath
604 AC_DEFINE_UNQUOTED(DPATH, "$unet_dpath", [Path to data directory])
606 DPATH=$unet_cv_with_dpath
609 dnl --with-cpath allows us to specify the configuration file
610 AC_MSG_CHECKING([where the default configuration file resides])
612 [ --with-cpath=file Set server configuration file],
613 [unet_cv_with_cpath=$with_cpath],
614 [AC_CACHE_VAL(unet_cv_with_cpath,
615 [unet_cv_with_cpath="ircd.conf"])])
617 if test x"$unet_cv_with_cpath" = xyes -o x"$unet_cv_with_cpath" = xno; then
618 unet_cv_with_cpath="ircd.conf"
621 AC_MSG_RESULT([$unet_cv_with_cpath])
623 if echo "$unet_cv_with_cpath" | grep '^/' > /dev/null 2>&1; then
624 # Absolute path; check against chroot stuff
625 if test x"$unet_cv_with_chroot" != xno; then
626 if echo "$unet_cv_with_cpath" | grep "^$unet_cv_with_chroot" > /dev/null 2>&1; then
627 unet_cpath=`echo "$unet_cv_with_cpath" | sed "s%^$unet_cv_with_chroot%%"`
629 AC_MSG_ERROR([Configuration file $unet_cv_with_cpath not relative to root directory $unet_cv_with_chroot])
632 unet_cpath=$unet_cv_with_cpath
635 unet_cpath=$unet_cv_with_cpath
638 AC_DEFINE_UNQUOTED(CPATH, "$unet_cpath", [Configuration file name])
640 dnl --with-lpath allows us to specify the default debugging log file
641 AC_MSG_CHECKING([where to put the debugging log if debugging enabled])
643 [ --with-lpath=file Set the debugging log file],
644 [unet_cv_with_lpath=$with_lpath],
645 [AC_CACHE_VAL(unet_cv_with_lpath,
646 [unet_cv_with_lpath="ircd.log"])])
648 if test x"$unet_cv_with_lpath" = xyes -o x"$unet_cv_with_lpath" = xno; then
649 unet_cv_with_lpath="ircd.log"
652 AC_MSG_RESULT([$unet_cv_with_lpath])
654 if echo "$unet_cv_with_lpath" | grep '^/' > /dev/null 2>&1; then
655 # Absolute path; check against chroot stuff
656 if test x"$unet_cv_with_chroot" != xno; then
657 if echo "$unet_cv_with_lpath" | grep "^$unet_cv_with_chroot" > /dev/null 2>&1; then
658 unet_lpath=`echo "$unet_cv_with_lpath" | sed "s%^$unet_cv_with_chroot%%"`
660 AC_MSG_WARN([Log file $unet_cv_with_lpath not relative to root directory $unet_cv_with_chroot; using default ircd.log instead])
661 unet_cv_with_lpath="ircd.log"
662 unet_lpath="ircd.log"
665 unet_lpath=$unet_cv_with_lpath
668 unet_lpath=$unet_cv_with_lpath
671 AC_DEFINE_UNQUOTED(LPATH, "$unet_lpath", [Path to debugging log file])
673 dnl --with-maxcon allows us to set the maximum connections
674 unet_maxcon=`ulimit -Hn`
675 if test x"$unet_maxcon" = xunlimited; then
676 unet_maxcon=`ulimit -Sn`
678 unet_maxcon=`expr $unet_maxcon - 4`
679 AC_MSG_CHECKING([max connections])
680 AC_ARG_WITH([maxcon],
681 [ --with-maxcon=maxcon Maximum number of connections server will accept],
682 [unet_cv_with_maxcon=$with_maxcon],
683 [AC_CACHE_VAL(unet_cv_with_maxcon,
684 [unet_cv_with_maxcon=$unet_maxcon])])
686 if test x"$unet_cv_with_maxcon" = xyes -o x"$unet_cv_with_maxcon" = xno; then
687 unet_cv_with_maxcon=$unet_maxcon
690 AC_MSG_RESULT([$unet_cv_with_maxcon])
692 AC_DEFINE_UNQUOTED(MAXCONNECTIONS, $unet_cv_with_maxcon,
693 [Maximum number of network connections])
695 dnl Finally really generate all output files:
696 AC_OUTPUT(Makefile ircd/Makefile ircd/test/Makefile doc/Makefile, [echo timestamp > stamp-h])
698 dnl Report configuration
699 AC_OUTPUT_COMMANDS([echo "
700 ircu is now hopefully configured for your system.
702 Host system: $host_os
704 Asserts: $unet_cv_enable_asserts
705 Warnings: $unet_cv_enable_warnings
706 Debug: $unet_cv_enable_debug
707 Profile: $unet_cv_enable_profile
708 Owner/mode: $unet_cv_with_owner.$unet_cv_with_group ($unet_cv_with_mode)
709 Chroot: $unet_cv_with_chroot
711 Domain: $unet_cv_with_domain
712 DPath: $unet_cv_with_dpath
713 CPath: $unet_cv_with_cpath
714 LPath: $unet_cv_with_lpath
715 Maximum connections: $unet_cv_with_maxcon
717 poll() engine: $unet_cv_enable_poll
718 kqueue() engine: $unet_cv_enable_kqueue
719 /dev/poll engine: $unet_cv_enable_devpoll
720 epoll() engine: $unet_cv_enable_epoll