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.13 of autoconf
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.
55 dnl Use -O3 instead of -O2.
56 if test x"$CFLAGS" != x; then
57 CFLAGS=`echo "$CFLAGS" | sed -e 's/-O2/-O3/'`
59 dnl Remove -pipe during configure
60 if test x"$CFLAGS" != x; then
61 CFLAGS=`echo "$CFLAGS" | sed -e 's/-pipe//g'`
63 dnl Notice the -g flag and deal accordingly
64 if test x"$CFLAGS" != x; then
65 unet_old_cflags=$CFLAGS
66 CFLAGS=`echo "$CFLAGS" | sed -e 's/-g//g'`
68 if test x"$CFLAGS" != x"$unet_old_cflags"; then
69 # If -g was already there, force symbols to be enabled
70 unet_cv_enable_symbols=yes
72 dnl Notice the -pg flag and deal accordingly
73 if test x"$CFLAGS" != x; then
74 unet_old_cflags=$CFLAGS
75 CFLAGS=`echo "$CFLAGS" | sed -e 's/-pg//g'`
77 if test x"$CFLAGS" != x"$unet_old_cflags"; then
78 # If -pg was already there, force profiling to be enabled
79 unet_cv_enable_profile=yes
81 dnl Notice the -Wall flag and deal accordingly
82 if test x"$CFLAGS" != x; then
83 unet_old_cflags=$CFLAGS
84 CFLAGS=`echo "$CFLAGS" | sed -e 's/-Wall//g'`
86 if test x"$CFLAGS" != x"$unet_old_cflags"; then
87 # If -Wall was already there, force warnings to be enabled
88 unet_cv_enable_warnings=yes
90 dnl Notice the -pedantic flag and deal accordingly
91 if test x"$CFLAGS" != x; then
92 unet_old_cflags=$CFLAGS
93 CFLAGS=`echo "$CFLAGS" | sed -e 's/-pedantic//g'`
95 if test x"$CFLAGS" != x"$unet_old_cflags"; then
96 # If -pedantic was already there, force pedatic to be enabled
97 unet_cv_enable_pedantic=yes
100 dnl Checks for libraries.
102 dnl Locate the library containing crypt
103 AC_SEARCH_LIBS(crypt, descrypt crypt, ,
104 [AC_MSG_ERROR([Unable to find library containing crypt()])])
106 dnl Do all the checks necessary to figure out -lnsl / -lsocket stuff
109 dnl Checks for header files.
111 AC_CHECK_HEADERS(crypt.h poll.h stdint.h sys/devpoll.h sys/epoll.h sys/event.h sys/param.h sys/socket.h)
113 dnl Checks for typedefs, structures, and compiler characteristics
120 unet_CHECK_TYPE_SIZES
121 AC_CHECK_TYPE(socklen_t, unsigned int)
123 dnl Checks for library functions.
124 AC_CHECK_FUNCS([kqueue setrlimit getrusage times])
126 dnl Do we have restarting syscalls ?
127 AC_SYS_RESTARTABLE_SYSCALLS
129 dnl Check for required features for admins?
130 AC_MSG_CHECKING([for donuts])
133 dnl Test for programs
140 AC_PATH_PROGS(RMPROG, rm, /bin/rm)
141 AC_PATH_PROGS(SHPROG, sh, /bin/sh)
148 dnl Add -pipe when possible
151 dnl Check OS for os_dep files.
152 AC_MSG_CHECKING(for OS-dependent information)
155 AC_MSG_RESULT([Linux ($host) found.])
156 unet_poll_syscall=yes
160 AC_MSG_RESULT([Solaris ($host) found.])
161 if test x"$ac_cv_header_poll_h" = xyes; then
162 unet_poll_syscall=yes
169 AC_MSG_RESULT([Solaris ($host) found.])
174 AC_MSG_RESULT([OpenBSD ($host) found.])
175 if test x"$ac_cv_header_poll_h" = xyes; then
176 unet_poll_syscall=yes
183 AC_MSG_RESULT([Generic BSD ($host) found.])
184 if test x"$ac_cv_header_poll_h" = xyes; then
185 unet_poll_syscall=yes
192 AC_MSG_RESULT([Darwin (Mac OS X) ($host) found.])
197 AC_MSG_RESULT([Unknown system type $host found.])
198 AC_MSG_WARN([Unknown OS type; using generic routines.])
203 dnl Check user configuration options
204 dnl Start with --enable-poll
205 AC_MSG_CHECKING([whether to enable use of poll()])
206 AC_ARG_ENABLE([poll],
207 [ --enable-poll Force poll to be used regardless of whether or not
208 it is a system call],
209 [unet_cv_enable_poll=$enable_poll],
210 [AC_CACHE_VAL(unet_cv_enable_poll,
211 [unet_cv_enable_poll=$unet_poll_syscall])])
213 # Force poll to be disabled if there is no poll.h
214 if test x"$ac_cv_header_poll_h" != xyes; then
215 unet_cv_enable_poll=no
218 AC_MSG_RESULT([$unet_cv_enable_poll])
220 if test x"$unet_cv_enable_poll" = xyes; then
221 AC_DEFINE([USE_POLL], , [Specify whether or not to use poll()])
222 ENGINE_C=engine_poll.c
224 ENGINE_C=engine_select.c
228 dnl Now look for --enable-debug
229 AC_MSG_CHECKING([whether to enable debug mode])
230 AC_ARG_ENABLE([debug],
231 [ --enable-debug Turn on debugging mode],
232 [unet_cv_enable_debug=$enable_debug],
233 [AC_CACHE_VAL(unet_cv_enable_debug,
234 [unet_cv_enable_debug=no])])
235 AC_MSG_RESULT([$unet_cv_enable_debug])
237 if test x"$unet_cv_enable_debug" = xyes; then
238 AC_DEFINE([DEBUGMODE], , [Enable debugging code])
241 dnl Now look for --enable-leak-detect
242 AC_MSG_CHECKING([whether to enable leak detection])
243 AC_ARG_WITH([leak-detect],
244 [ --with-leak-detect Turn on the leak detector(requires patched boehm)],
245 [unet_cv_with_leak_detect=$with_leak_detect],
246 [AC_CACHE_VAL(unet_cv_with_leak_detect,
247 [unet_cv_with_leak_detect=no])])
248 AC_MSG_RESULT([$unet_cv_enable_leak_detect])
250 if test x"$unet_cv_with_leak_detect" != xno; then
252 CFLAGS="-DMDEBUG $CFLAGS"
253 if test x"$unet_cv_with_leak_detect" != xyes; then
254 LIBS="-L$unet_cv_with_leak_detect $LIBS"
258 dnl And now for --disable-asserts
259 AC_MSG_CHECKING([whether to enable asserts])
260 AC_ARG_ENABLE([asserts],
261 [ --disable-asserts Disable assertion checking],
262 [unet_cv_enable_asserts=$enable_asserts],
263 [AC_CACHE_VAL(unet_cv_enable_asserts,
264 [unet_cv_enable_asserts=yes])])
265 AC_MSG_RESULT([$unet_cv_enable_asserts])
267 if test x"$unet_cv_enable_asserts" = xno; then
268 AC_DEFINE([NDEBUG], , [Disable assertions])
271 dnl Check for --enable-symbols
272 AC_MSG_CHECKING([whether to enable debugging symbols])
273 AC_ARG_ENABLE([symbols],
274 [ --disable-symbols Disable debugging symbols (remove -g from CFLAGS)],
275 [unet_cv_enable_symbols=$enable_symbols],
276 [AC_CACHE_VAL(unet_cv_enable_symbols,
277 [unet_cv_enable_symbols=yes])])
278 AC_MSG_RESULT([$unet_cv_enable_symbols])
280 if test x"$unet_cv_enable_symbols" = xyes; then
284 dnl Now check for --enable-profile
285 AC_MSG_CHECKING([whether to enable profiling support (gprof)])
286 AC_ARG_ENABLE([profile],
287 [ --enable-profile Enable profiling support (add -pg to CFLAGS)],
288 [unet_cv_enable_profile=$enable_profile],
289 [AC_CACHE_VAL(unet_cv_enable_profile,
290 [unet_cv_enable_profile=no])])
291 AC_MSG_RESULT([$unet_cv_enable_profile])
293 if test x"$unet_cv_enable_profile" = xyes; then
297 dnl Now check for --enable-pedantic
298 AC_MSG_CHECKING([whether to enable pedantic compiler warnings])
299 AC_ARG_ENABLE([pedantic],
300 [ --enable-pedantic Enable pedantic warnings (add -pedantic to CFLAGS)],
301 [unet_cv_enable_pedantic=$enable_pedantic],
302 [AC_CACHE_VAL(unet_cv_enable_pedantic,
303 [unet_cv_enable_pedantic=no])])
304 AC_MSG_RESULT([$unet_cv_enable_pedantic])
306 if test x"$unet_cv_enable_pedantic" = xyes; then
307 CFLAGS="-pedantic $CFLAGS"
310 dnl Now check for --enable-warnings
311 AC_MSG_CHECKING([whether to enable compiler warnings])
312 AC_ARG_ENABLE([warnings],
313 [ --enable-warnings Enable warnings (add -Wall to CFLAGS)],
314 [unet_cv_enable_warnings=$enable_warnings],
315 [AC_CACHE_VAL(unet_cv_enable_warnings,
316 [unet_cv_enable_warnings=no])])
317 AC_MSG_RESULT([$unet_cv_enable_warnings])
319 if test x"$unet_cv_enable_warnings" = xyes; then
320 CFLAGS="-Wall $CFLAGS"
323 dnl --disable-inlines check...
324 AC_MSG_CHECKING([whether to enable inlining for a few critical functions])
325 AC_ARG_ENABLE([inlines],
326 [ --disable-inlines Disable inlining for a few critical functions],
327 [unet_cv_enable_inlines=$enable_inlines],
328 [AC_CACHE_VAL(unet_cv_enable_inlines,
329 [unet_cv_enable_inlines=yes])])
330 AC_MSG_RESULT([$unet_cv_enable_inlines])
332 if test x"$unet_cv_enable_inlines" = xyes; then
333 AC_DEFINE([FORCEINLINE], , [Force inlining for a few critical functions])
336 dnl --disable-devpoll check...
337 AC_MSG_CHECKING([whether to enable the /dev/poll event engine])
338 AC_ARG_ENABLE([devpoll],
339 [ --disable-devpoll Disable the /dev/poll-based engine],
340 [unet_cv_enable_devpoll=$enable_devpoll],
341 [AC_CACHE_VAL(unet_cv_enable_devpoll,
342 [unet_cv_enable_devpoll=yes])])
344 if test x"$ac_cv_header_sys_devpoll_h" = xno; then
345 unet_cv_enable_devpoll=no
348 AC_MSG_RESULT([$unet_cv_enable_devpoll])
350 if test x"$unet_cv_enable_devpoll" != xno; then
351 AC_DEFINE([USE_DEVPOLL], , [Define to enable the /dev/poll engine])
352 ENGINE_C="engine_devpoll.c $ENGINE_C"
355 dnl --disable-kqueue check...
356 AC_MSG_CHECKING([whether to enable the kqueue event engine])
357 AC_ARG_ENABLE([kqueue],
358 [ --disable-kqueue Disable the kqueue-based engine],
359 [unet_cv_enable_kqueue=$enable_kqueue],
360 [AC_CACHE_VAL(unet_cv_enable_kqueue,
361 [unet_cv_enable_kqueue=yes])])
363 if test x"$ac_cv_header_sys_event_h" = xno -o x"$ac_cv_func_kqueue" = xno; then
364 unet_cv_enable_kqueue=no
367 AC_MSG_RESULT([$unet_cv_enable_kqueue])
369 if test x"$unet_cv_enable_kqueue" != xno; then
370 AC_DEFINE([USE_KQUEUE], , [Define to enable the kqueue engine])
371 ENGINE_C="engine_kqueue.c $ENGINE_C"
374 dnl --disable-epoll check
375 AC_MSG_CHECKING([whether to enable the epoll event engine])
376 AC_ARG_ENABLE([epoll],
377 [ --disable-epoll Disable the epoll-based engine],
378 [unet_cv_enable_epoll=$enable_epoll],
379 [AC_CACHE_VAL(unet_cv_enable_epoll,
380 [unet_cv_enable_epoll=yes])])
382 if test x"$ac_cv_header_sys_epoll_h" = xno -o x"$ac_cv_func_epoll" = xno; then
383 unet_cv_enable_epoll=no
386 AC_MSG_RESULT([$unet_cv_enable_epoll])
388 dnl If we have the header and user has not refused epoll, we still need
389 dnl to check whether the functions are properly defined.
390 if test x"$unet_cv_enable_epoll" != xno; then
391 AC_MSG_CHECKING([whether epoll functions are properly defined])
392 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <sys/epoll.h>], [epoll_create(10);])],
393 [AC_MSG_RESULT([yes])],
395 AC_DEFINE([EPOLL_NEED_BODY],,[Define to implement epoll system calls])])
396 AC_DEFINE([USE_EPOLL], , [Define to enable the epoll engine])
397 ENGINE_C="engine_epoll.c $ENGINE_C"
400 dnl How to copy one va_list to another?
401 AC_CACHE_CHECK([for va_copy], unet_cv_c_va_copy, [AC_LINK_IFELSE(
402 [AC_LANG_PROGRAM([#include <stdarg.h>], [va_list ap1, ap2; va_copy(ap1, ap2);])],
403 [unet_cv_c_va_copy="yes"],
404 [unet_cv_c_va_copy="no"]
406 if test "$unet_cv_c_va_copy" = "yes" ; then
407 AC_DEFINE(HAVE_VA_COPY, 1, [Define if we have va_copy])
410 AC_CACHE_CHECK([for __va_copy], unet_cv_c___va_copy, [AC_LINK_IFELSE(
411 [AC_LANG_PROGRAM([#include <stdarg.h>], [va_list ap1, ap2; __va_copy(ap1, ap2);])],
412 [unet_cv_c___va_copy="yes"],
413 [unet_cv_c___va_copy="no"]
415 if test "$unet_cv_c___va_copy" = "yes" ; then
416 AC_DEFINE(HAVE___VA_COPY, 1, [Define if we have __va_copy])
419 dnl --with-symlink lets us set the name of the symlink; defaults to "ircd"
420 AC_MSG_CHECKING([what name to give the symlink])
421 AC_ARG_WITH([symlink],
422 [ --with-symlink=name Name to give the symlink; if name is "no," no
423 symlink will be created.],
424 [unet_cv_with_symlink=$with_symlink],
425 [AC_CACHE_VAL(unet_cv_with_symlink,
426 [unet_cv_with_symlink="ircd"])])
428 if test x"$unet_cv_with_symlink" = xyes; then
429 unet_cv_with_symlink="ircd"
432 AC_MSG_RESULT([$unet_cv_with_symlink])
434 if test x"$unet_cv_with_symlink" = xno; then
435 INSTALL_RULE=install-no-symlink
438 INSTALL_RULE=install-with-symlink
439 SYMLINK=$unet_cv_with_symlink
441 AC_SUBST(INSTALL_RULE)
444 dnl --with-mode lets us set the permissions on the binary
445 AC_MSG_CHECKING([what permissions to set on the installed binary])
447 [ --with-mode=mode Permissions (in octal) to give the binary],
448 [unet_cv_with_mode=$with_mode],
449 [AC_CACHE_VAL(unet_cv_with_mode,
450 [unet_cv_with_mode=711])])
452 if test x"$unet_cv_with_mode" = xyes -o x"$unet_cv_with_mode" = xno; then
453 unet_cv_with_mode=711
456 AC_MSG_RESULT([$unet_cv_with_mode])
458 IRCDMODE=$unet_cv_with_mode
461 dnl --with-owner lets us set the owner of the binary
463 unet_uid=`id | sed -e 's/.*uid=[0-9]*(//' -e 's/).*//' 2> /dev/null`
465 AC_MSG_CHECKING([which user should own the installed binary])
467 [ --with-owner=owner Specify owner of the installed binary],
468 [unet_cv_with_owner=$with_owner],
469 [AC_CACHE_VAL(unet_cv_with_owner,
470 [unet_cv_with_owner=$unet_uid])])
472 if test x"$unet_cv_with_owner" = xyes -o x"$unet_cv_with_owner" = xno; then
473 unet_cv_with_owner=$unet_uid
476 AC_MSG_RESULT([$unet_cv_with_owner])
478 IRCDOWN=$unet_cv_with_owner
481 dnl --with-group lets us set the group owner of the binary
483 unet_gid=`id | sed -e 's/.*gid=[0-9]*(//' -e 's/).*//' 2> /dev/null`
485 AC_MSG_CHECKING([which group should own the installed binary])
487 [ --with-group=group Specify group owner of the installed binary],
488 [unet_cv_with_group=$with_group],
489 [AC_CACHE_VAL(unet_cv_with_group,
490 [unet_cv_with_group=$unet_gid])])
492 if test x"$unet_cv_with_group" = xyes -o x"$unet_cv_with_group" = xno; then
493 unet_cv_with_group=$unet_gid
496 AC_MSG_RESULT([$unet_cv_with_group])
498 IRCDGRP=$unet_cv_with_group
501 dnl --with-domain lets us set the domain name for some statistics-gathering
503 if test -f /etc/resolv.conf; then
504 unet_domain=`awk '/^domain/ { print $2; exit }' /etc/resolv.conf`
505 if test x"$unet_domain" = x; then
506 unet_domain=`awk '/^search/ { print $2; exit }' /etc/resolv.conf`
509 AC_MSG_CHECKING([for site domain name])
510 AC_ARG_WITH([domain],
511 [ --with-domain=domain Domain name to use in local statistics gathering],
512 [unet_cv_with_domain=$with_domain],
513 [AC_CACHE_VAL(unet_cv_with_domain,
514 [unet_cv_with_domain=$unet_domain])])
516 if test x"$unet_cv_with_domain" = xyes -o x"$unet_cv_with_domain" = xno; then
517 unet_cv_with_domain=$unet_domain
519 if test x"$unet_cv_with_domain" = xno; then
520 AC_MSG_ERROR([Unable to determine server DNS domain; use --with-domain to set it])
523 AC_MSG_RESULT([$unet_cv_with_domain])
525 AC_DEFINE_UNQUOTED(DOMAINNAME, "*$unet_cv_with_domain",
526 [Domain name to be used for some statistics gathering])
528 dnl --with-chroot lets us define a directory that we are going to be using
529 dnl as the root of our filesystem
530 AC_MSG_CHECKING([if chroot operation is desired])
531 AC_ARG_WITH([chroot],
532 [ --with-chroot=dir Specify that the server will be operated under
533 a different root directory given by dir. See
534 doc/readme.chroot for more information.],
535 [unet_cv_with_chroot=$with_chroot],
536 [AC_CACHE_VAL(unet_cv_with_chroot,
537 [unet_cv_with_chroot=no])])
539 if test x"$unet_cv_with_chroot" = xyes; then
540 AC_MSG_ERROR([--with-chroot given with no directory. See doc/readme.chroot.])
543 # Ensure there are no trailing /'s to mess us up
544 unet_cv_with_chroot=`echo "$unet_cv_with_chroot" | sed 's%/*$%%'`
546 AC_MSG_RESULT([$unet_cv_with_chroot])
548 dnl Determine some default directory names
550 dnl HACK WARNING: We are referencing an autoconf internal variable. This is
551 dnl the only way to figure out what value $prefix will have when we go to do
552 dnl the install--and the only way we can stick that value in our definitions
554 # Deal with the annoying value "NONE" here
555 unet_save_prefix=$prefix
556 if test x"$prefix" = xNONE; then
557 prefix=$ac_default_prefix
562 unet_save_exec_prefix=$exec_prefix
563 if test x"$exec_prefix" = xNONE; then
566 exec_prefix=$exec_prefix
569 # Obtain the actual interesting directories
570 unet_bindir=`eval echo "$bindir"`
571 unet_libdir=`eval echo "$libdir"`
573 # Restore the original settings of $prefix and $exec_prefix
574 prefix=$unet_save_prefix
575 exec_prefix=$unet_save_exec_prefix
577 dnl Now compute the name of the binary and verify that it will work under
579 AC_MSG_CHECKING([where the binary will be for /restart])
580 if test x"$unet_cv_with_symlink" = xno; then
581 unet_spath="$unet_bindir/ircd"
583 unet_spath="$unet_bindir/$unet_cv_with_symlink"
585 AC_MSG_RESULT([$unet_spath])
587 if test x"$unet_cv_with_chroot" != xno; then
588 if echo "$unet_spath" | grep "^$unet_cv_with_chroot" > /dev/null 2>&1; then
589 unet_spath=`echo "$unet_spath" | sed "s%^$unet_cv_with_chroot%%"`
591 AC_MSG_WARN([Binary $unet_spath not relative to root directory $unet_cv_with_chroot; restarts will probably fail])
595 AC_DEFINE_UNQUOTED(SPATH, "$unet_spath", [Path to executable for restarts])
597 dnl --with-dpath sets the all-important DPATH
598 AC_MSG_CHECKING([what the data directory should be])
600 [ --with-dpath=dir Directory for all server data files],
601 [unet_cv_with_dpath=$with_dpath],
602 [AC_CACHE_VAL(unet_cv_with_dpath,
603 [unet_cv_with_dpath=$unet_libdir])])
605 if test x"$unet_cv_with_dpath" = xyes -o x"$unet_cv_with_dpath" = xno; then
606 unet_cv_with_dpath=$unet_libdir
609 # Ensure there are no trailing /'s to mess us up
610 unet_cv_with_dpath=`echo "$unet_cv_with_dpath" | sed 's%/*$%%'`
612 AC_MSG_RESULT([$unet_cv_with_dpath])
614 if test x"$unet_cv_with_chroot" != xno; then
615 if echo "$unet_cv_with_dpath" | grep "^$unet_cv_with_chroot" > /dev/null 2>&1; then
616 unet_dpath=`echo "$unet_cv_with_dpath" | sed "s%^$unet_cv_with_chroot%%"`
618 AC_MSG_ERROR([Data directory $unet_cv_with_dpath not relative to root directory $unet_cv_with_chroot])
621 unet_dpath=$unet_cv_with_dpath
624 AC_DEFINE_UNQUOTED(DPATH, "$unet_dpath", [Path to data directory])
626 DPATH=$unet_cv_with_dpath
629 dnl --with-cpath allows us to specify the configuration file
630 AC_MSG_CHECKING([where the default configuration file resides])
632 [ --with-cpath=file Set server configuration file],
633 [unet_cv_with_cpath=$with_cpath],
634 [AC_CACHE_VAL(unet_cv_with_cpath,
635 [unet_cv_with_cpath="ircd.conf"])])
637 if test x"$unet_cv_with_cpath" = xyes -o x"$unet_cv_with_cpath" = xno; then
638 unet_cv_with_cpath="ircd.conf"
641 AC_MSG_RESULT([$unet_cv_with_cpath])
643 if echo "$unet_cv_with_cpath" | grep '^/' > /dev/null 2>&1; then
644 # Absolute path; check against chroot stuff
645 if test x"$unet_cv_with_chroot" != xno; then
646 if echo "$unet_cv_with_cpath" | grep "^$unet_cv_with_chroot" > /dev/null 2>&1; then
647 unet_cpath=`echo "$unet_cv_with_cpath" | sed "s%^$unet_cv_with_chroot%%"`
649 AC_MSG_ERROR([Configuration file $unet_cv_with_cpath not relative to root directory $unet_cv_with_chroot])
652 unet_cpath=$unet_cv_with_cpath
655 unet_cpath=$unet_cv_with_cpath
658 AC_DEFINE_UNQUOTED(CPATH, "$unet_cpath", [Configuration file name])
660 dnl --with-lpath allows us to specify the default debugging log file
661 AC_MSG_CHECKING([where to put the debugging log if debugging enabled])
663 [ --with-lpath=file Set the debugging log file],
664 [unet_cv_with_lpath=$with_lpath],
665 [AC_CACHE_VAL(unet_cv_with_lpath,
666 [unet_cv_with_lpath="ircd.log"])])
668 if test x"$unet_cv_with_lpath" = xyes -o x"$unet_cv_with_lpath" = xno; then
669 unet_cv_with_lpath="ircd.log"
672 AC_MSG_RESULT([$unet_cv_with_lpath])
674 if echo "$unet_cv_with_lpath" | grep '^/' > /dev/null 2>&1; then
675 # Absolute path; check against chroot stuff
676 if test x"$unet_cv_with_chroot" != xno; then
677 if echo "$unet_cv_with_lpath" | grep "^$unet_cv_with_chroot" > /dev/null 2>&1; then
678 unet_lpath=`echo "$unet_cv_with_lpath" | sed "s%^$unet_cv_with_chroot%%"`
680 AC_MSG_WARN([Log file $unet_cv_with_lpath not relative to root directory $unet_cv_with_chroot; using default ircd.log instead])
681 unet_cv_with_lpath="ircd.log"
682 unet_lpath="ircd.log"
685 unet_lpath=$unet_cv_with_lpath
688 unet_lpath=$unet_cv_with_lpath
691 AC_DEFINE_UNQUOTED(LPATH, "$unet_lpath", [Path to debugging log file])
693 dnl --with-maxcon allows us to set the maximum connections
694 unet_maxcon=`ulimit -Hn`
695 if test x"$unet_maxcon" = xunlimited; then
696 unet_maxcon=`ulimit -Sn`
698 unet_maxcon=`expr $unet_maxcon - 4`
699 AC_MSG_CHECKING([max connections])
700 AC_ARG_WITH([maxcon],
701 [ --with-maxcon=maxcon Maximum number of connections server will accept],
702 [unet_cv_with_maxcon=$with_maxcon],
703 [AC_CACHE_VAL(unet_cv_with_maxcon,
704 [unet_cv_with_maxcon=$unet_maxcon])])
706 if test x"$unet_cv_with_maxcon" = xyes -o x"$unet_cv_with_maxcon" = xno; then
707 unet_cv_with_maxcon=$unet_maxcon
710 AC_MSG_RESULT([$unet_cv_with_maxcon])
712 AC_DEFINE_UNQUOTED(MAXCONNECTIONS, $unet_cv_with_maxcon,
713 [Maximum number of network connections])
715 dnl Finally really generate all output files:
716 AC_OUTPUT(Makefile ircd/Makefile doc/Makefile, [echo timestamp > stamp-h])
718 dnl Report configuration
719 AC_OUTPUT_COMMANDS([echo "
720 ircu is now hopefully configured for your system.
722 Host system: $host_os
724 Asserts: $unet_cv_enable_asserts
725 Warnings: $unet_cv_enable_warnings
726 Debug: $unet_cv_enable_debug
727 Profile: $unet_cv_enable_profile
728 Owner/mode: $unet_cv_with_owner.$unet_cv_with_group ($unet_cv_with_mode)
729 Chroot: $unet_cv_with_chroot
731 Domain: $unet_cv_with_domain
732 DPath: $unet_cv_with_dpath
733 CPath: $unet_cv_with_cpath
734 LPath: $unet_cv_with_lpath
735 Maximum connections: $unet_cv_with_maxcon
737 poll() engine: $unet_cv_enable_poll
738 kqueue() engine: $unet_cv_enable_kqueue
739 /dev/poll engine: $unet_cv_enable_devpoll
740 epoll() engine: $unet_cv_enable_epoll