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 Look for res_mkquery. Done after AC_LIBRARY_NET in case res_mkquery
110 dnl is in one of those libraries somewhere.
111 AC_SEARCH_LIBS(res_mkquery, resolv, ,
112 [AC_MSG_ERROR([Unable to find library containing res_mkquery()])])
114 dnl Checks for header files.
116 AC_CHECK_HEADERS(crypt.h inttypes.h poll.h sys/devpoll.h sys/epoll.h sys/event.h)
118 dnl Checks for typedefs, structures, and compiler characteristics
125 unet_CHECK_TYPE_SIZES
127 dnl Checks for library functions.
128 AC_CHECK_FUNCS([kqueue setrlimit getrusage times])
130 dnl Do we have restarting syscalls ?
131 AC_SYS_RESTARTABLE_SYSCALLS
133 dnl Check for required features for admins?
134 AC_MSG_CHECKING([for donuts])
137 dnl Test for programs
142 AC_PATH_PROGS(RMPROG, rm, /bin/rm)
143 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
161 AC_MSG_RESULT([Solaris ($host) found.])
162 if test x"$ac_cv_header_poll_h" = xyes; then
163 unet_poll_syscall=yes
171 AC_MSG_RESULT([Solaris ($host) found.])
177 AC_MSG_RESULT([OpenBSD ($host) found.])
178 if test x"$ac_cv_header_poll_h" = xyes; then
179 unet_poll_syscall=yes
187 AC_MSG_RESULT([Generic BSD ($host) found.])
188 if test x"$ac_cv_header_poll_h" = xyes; then
189 unet_poll_syscall=yes
197 AC_MSG_RESULT([Darwin (Mac OS X) ($host) found.])
203 AC_MSG_RESULT([Unknown system type $host found.])
204 AC_MSG_WARN([Unknown OS type; using generic routines.])
211 dnl Check user configuration options
212 dnl Start with --enable-poll
213 AC_MSG_CHECKING([whether to enable use of poll()])
214 AC_ARG_ENABLE([poll],
215 [ --enable-poll Force poll to be used regardless of whether or not
216 it is a system call],
217 [unet_cv_enable_poll=$enable_poll],
218 [AC_CACHE_VAL(unet_cv_enable_poll,
219 [unet_cv_enable_poll=$unet_poll_syscall])])
221 # Force poll to be disabled if there is no poll.h
222 if test x"$ac_cv_header_poll_h" != xyes; then
223 unet_cv_enable_poll=no
226 AC_MSG_RESULT([$unet_cv_enable_poll])
228 if test x"$unet_cv_enable_poll" = xyes; then
229 AC_DEFINE([USE_POLL], , [Specify whether or not to use poll()])
230 ENGINE_C=engine_poll.c
232 ENGINE_C=engine_select.c
236 dnl Now look for --enable-debug
237 AC_MSG_CHECKING([whether to enable debug mode])
238 AC_ARG_ENABLE([debug],
239 [ --enable-debug Turn on debugging mode],
240 [unet_cv_enable_debug=$enable_debug],
241 [AC_CACHE_VAL(unet_cv_enable_debug,
242 [unet_cv_enable_debug=no])])
243 AC_MSG_RESULT([$unet_cv_enable_debug])
245 if test x"$unet_cv_enable_debug" = xyes; then
246 AC_DEFINE([DEBUGMODE], , [Enable debugging code])
249 dnl Now look for --enable-leak-detect
250 AC_MSG_CHECKING([whether to enable leak detection])
251 AC_ARG_WITH([leak-detect],
252 [ --with-leak-detect Turn on the leak detector(requires patched boehm)],
253 [unet_cv_with_leak_detect=$with_leak_detect],
254 [AC_CACHE_VAL(unet_cv_with_leak_detect,
255 [unet_cv_with_leak_detect=no])])
256 AC_MSG_RESULT([$unet_cv_enable_leak_detect])
258 if test x"$unet_cv_with_leak_detect" != xno; then
260 CFLAGS="-DMDEBUG $CFLAGS"
261 if test x"$unet_cv_with_leak_detect" != xyes; then
262 LIBS="-L$unet_cv_with_leak_detect $LIBS"
266 dnl And now for --disable-asserts
267 AC_MSG_CHECKING([whether to enable asserts])
268 AC_ARG_ENABLE([asserts],
269 [ --disable-asserts Disable assertion checking],
270 [unet_cv_enable_asserts=$enable_asserts],
271 [AC_CACHE_VAL(unet_cv_enable_asserts,
272 [unet_cv_enable_asserts=yes])])
273 AC_MSG_RESULT([$unet_cv_enable_asserts])
275 if test x"$unet_cv_enable_asserts" = xno; then
276 AC_DEFINE([NDEBUG], , [Disable assertions])
279 dnl Check for --enable-symbols
280 AC_MSG_CHECKING([whether to enable debugging symbols])
281 AC_ARG_ENABLE([symbols],
282 [ --disable-symbols Disable debugging symbols (remove -g from CFLAGS)],
283 [unet_cv_enable_symbols=$enable_symbols],
284 [AC_CACHE_VAL(unet_cv_enable_symbols,
285 [unet_cv_enable_symbols=yes])])
286 AC_MSG_RESULT([$unet_cv_enable_symbols])
288 if test x"$unet_cv_enable_symbols" = xyes; then
292 dnl Now check for --enable-profile
293 AC_MSG_CHECKING([whether to enable profiling support (gprof)])
294 AC_ARG_ENABLE([profile],
295 [ --enable-profile Enable profiling support (add -pg to CFLAGS)],
296 [unet_cv_enable_profile=$enable_profile],
297 [AC_CACHE_VAL(unet_cv_enable_profile,
298 [unet_cv_enable_profile=no])])
299 AC_MSG_RESULT([$unet_cv_enable_profile])
301 if test x"$unet_cv_enable_profile" = xyes; then
305 dnl Now check for --enable-pedantic
306 AC_MSG_CHECKING([whether to enable pedantic compiler warnings])
307 AC_ARG_ENABLE([pedantic],
308 [ --enable-pedantic Enable pedantic warnings (add -pedantic to CFLAGS)],
309 [unet_cv_enable_pedantic=$enable_pedantic],
310 [AC_CACHE_VAL(unet_cv_enable_pedantic,
311 [unet_cv_enable_pedantic=no])])
312 AC_MSG_RESULT([$unet_cv_enable_pedantic])
314 if test x"$unet_cv_enable_pedantic" = xyes; then
315 CFLAGS="-pedantic $CFLAGS"
318 dnl Now check for --enable-warnings
319 AC_MSG_CHECKING([whether to enable compiler warnings])
320 AC_ARG_ENABLE([warnings],
321 [ --enable-warnings Enable warnings (add -Wall to CFLAGS)],
322 [unet_cv_enable_warnings=$enable_warnings],
323 [AC_CACHE_VAL(unet_cv_enable_warnings,
324 [unet_cv_enable_warnings=no])])
325 AC_MSG_RESULT([$unet_cv_enable_warnings])
327 if test x"$unet_cv_enable_warnings" = xyes; then
328 CFLAGS="-Wall $CFLAGS"
331 dnl --disable-inlines check...
332 AC_MSG_CHECKING([whether to enable inlining for a few critical functions])
333 AC_ARG_ENABLE([inlines],
334 [ --disable-inlines Disable inlining for a few critical functions],
335 [unet_cv_enable_inlines=$enable_inlines],
336 [AC_CACHE_VAL(unet_cv_enable_inlines,
337 [unet_cv_enable_inlines=yes])])
338 AC_MSG_RESULT([$unet_cv_enable_inlines])
340 if test x"$unet_cv_enable_inlines" = xyes; then
341 AC_DEFINE([FORCEINLINE], , [Force inlining for a few critical functions])
344 dnl --disable-devpoll check...
345 AC_MSG_CHECKING([whether to enable the /dev/poll event engine])
346 AC_ARG_ENABLE([devpoll],
347 [ --disable-devpoll Disable the /dev/poll-based engine],
348 [unet_cv_enable_devpoll=$enable_devpoll],
349 [AC_CACHE_VAL(unet_cv_enable_devpoll,
350 [unet_cv_enable_devpoll=yes])])
352 if test x"$ac_cv_header_sys_devpoll_h" = xno; then
353 unet_cv_enable_devpoll=no
356 AC_MSG_RESULT([$unet_cv_enable_devpoll])
358 if test x"$unet_cv_enable_devpoll" != xno; then
359 AC_DEFINE([USE_DEVPOLL], , [Define to enable the /dev/poll engine])
360 ENGINE_C="engine_devpoll.c $ENGINE_C"
363 dnl --disable-kqueue check...
364 AC_MSG_CHECKING([whether to enable the kqueue event engine])
365 AC_ARG_ENABLE([kqueue],
366 [ --disable-kqueue Disable the kqueue-based engine],
367 [unet_cv_enable_kqueue=$enable_kqueue],
368 [AC_CACHE_VAL(unet_cv_enable_kqueue,
369 [unet_cv_enable_kqueue=yes])])
371 if test x"$ac_cv_header_sys_event_h" = xno -o x"$ac_cv_func_kqueue" = xno; then
372 unet_cv_enable_kqueue=no
375 AC_MSG_RESULT([$unet_cv_enable_kqueue])
377 if test x"$unet_cv_enable_kqueue" != xno; then
378 AC_DEFINE([USE_KQUEUE], , [Define to enable the kqueue engine])
379 ENGINE_C="engine_kqueue.c $ENGINE_C"
382 dnl --disable-epoll check
383 AC_MSG_CHECKING([whether to enable the epoll event engine])
384 AC_ARG_ENABLE([epoll],
385 [ --disable-epoll Disable the epoll-based engine],
386 [unet_cv_enable_epoll=$enable_epoll],
387 [AC_CACHE_VAL(unet_cv_enable_epoll,
388 [unet_cv_enable_epoll=yes])])
390 if test x"$ac_cv_header_sys_epoll_h" = xno -o x"$ac_cv_func_epoll" = xno; then
391 unet_cv_enable_epoll=no
394 AC_MSG_RESULT([$unet_cv_enable_epoll])
396 dnl If we have the header and user has not refused epoll, we still need
397 dnl to check whether the functions are properly defined.
398 if test x"$unet_cv_enable_epoll" != xno; then
399 AC_MSG_CHECKING([whether epoll functions are properly defined])
400 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <sys/epoll.h>], [epoll_create(10);])],
401 [AC_MSG_RESULT([yes])],
403 AC_DEFINE([EPOLL_NEED_BODY],,[Define to implement epoll system calls])])
404 AC_DEFINE([USE_EPOLL], , [Define to enable the epoll engine])
405 ENGINE_C="engine_epoll.c $ENGINE_C"
408 dnl How to copy one va_list to another?
409 AC_CACHE_CHECK([for va_copy], unet_cv_c_va_copy, [AC_LINK_IFELSE(
410 [AC_LANG_PROGRAM([#include <stdarg.h>], [va_list ap1, ap2; va_copy(ap1, ap2);])],
411 [unet_cv_c_va_copy="yes"],
412 [unet_cv_c_va_copy="no"]
414 if test "$unet_cv_c_va_copy" = "yes" ; then
415 AC_DEFINE(HAVE_VA_COPY, 1, [Define if we have va_copy])
418 AC_CACHE_CHECK([for __va_copy], unet_cv_c___va_copy, [AC_LINK_IFELSE(
419 [AC_LANG_PROGRAM([#include <stdarg.h>], [va_list ap1, ap2; __va_copy(ap1, ap2);])],
420 [unet_cv_c___va_copy="yes"],
421 [unet_cv_c___va_copy="no"]
423 if test "$unet_cv_c___va_copy" = "yes" ; then
424 AC_DEFINE(HAVE___VA_COPY, 1, [Define if we have __va_copy])
427 dnl --disable-adns check...
428 AC_MSG_CHECKING([whether to enable the adns resolver engine])
429 AC_ARG_ENABLE([adns],
430 [ --disable-adns Disable adns resolver],
431 [unet_cv_enable_adns=$enable_adns],
432 [AC_CACHE_VAL(unet_cv_enable_adns,
433 [unet_cv_enable_adns=yes])])
435 AC_MSG_RESULT([$unet_cv_enable_adns])
437 if test x"$unet_cv_enable_adns" != xno; then
438 AC_DEFINE([USE_ADNS], , [Define to enable the adns resolver])
439 AC_CONFIG_SUBDIRS([adns])
441 LIBS="../adns/src/libadns.a $LIBS"
444 RES_C="res_libresolv.c"
447 dnl Look for res_mkquery. Done after AC_LIBRARY_NET in case res_mkquery
448 dnl is in one of those libraries somewhere.
449 AC_SEARCH_LIBS(res_mkquery, resolv, ,
450 [AC_MSG_ERROR([Unable to find library containing res_mkquery()])])
453 AC_SUBST(ADNS_SUBDIR)
455 dnl --with-symlink lets us set the name of the symlink; defaults to "ircd"
456 AC_MSG_CHECKING([what name to give the symlink])
457 AC_ARG_WITH([symlink],
458 [ --with-symlink=name Name to give the symlink; if name is "no," no
459 symlink will be created.],
460 [unet_cv_with_symlink=$with_symlink],
461 [AC_CACHE_VAL(unet_cv_with_symlink,
462 [unet_cv_with_symlink="ircd"])])
464 if test x"$unet_cv_with_symlink" = xyes; then
465 unet_cv_with_symlink="ircd"
468 AC_MSG_RESULT([$unet_cv_with_symlink])
470 if test x"$unet_cv_with_symlink" = xno; then
471 INSTALL_RULE=install-no-symlink
474 INSTALL_RULE=install-with-symlink
475 SYMLINK=$unet_cv_with_symlink
477 AC_SUBST(INSTALL_RULE)
480 dnl --with-mode lets us set the permissions on the binary
481 AC_MSG_CHECKING([what permissions to set on the installed binary])
483 [ --with-mode=mode Permissions (in octal) to give the binary],
484 [unet_cv_with_mode=$with_mode],
485 [AC_CACHE_VAL(unet_cv_with_mode,
486 [unet_cv_with_mode=711])])
488 if test x"$unet_cv_with_mode" = xyes -o x"$unet_cv_with_mode" = xno; then
489 unet_cv_with_mode=711
492 AC_MSG_RESULT([$unet_cv_with_mode])
494 IRCDMODE=$unet_cv_with_mode
497 dnl --with-owner lets us set the owner of the binary
499 unet_uid=`id | sed -e 's/.*uid=[0-9]*(//' -e 's/).*//' 2> /dev/null`
501 AC_MSG_CHECKING([which user should own the installed binary])
503 [ --with-owner=owner Specify owner of the installed binary],
504 [unet_cv_with_owner=$with_owner],
505 [AC_CACHE_VAL(unet_cv_with_owner,
506 [unet_cv_with_owner=$unet_uid])])
508 if test x"$unet_cv_with_owner" = xyes -o x"$unet_cv_with_owner" = xno; then
509 unet_cv_with_owner=$unet_uid
512 AC_MSG_RESULT([$unet_cv_with_owner])
514 IRCDOWN=$unet_cv_with_owner
517 dnl --with-group lets us set the group owner of the binary
519 unet_gid=`id | sed -e 's/.*gid=[0-9]*(//' -e 's/).*//' 2> /dev/null`
521 AC_MSG_CHECKING([which group should own the installed binary])
523 [ --with-group=group Specify group owner of the installed binary],
524 [unet_cv_with_group=$with_group],
525 [AC_CACHE_VAL(unet_cv_with_group,
526 [unet_cv_with_group=$unet_gid])])
528 if test x"$unet_cv_with_group" = xyes -o x"$unet_cv_with_group" = xno; then
529 unet_cv_with_group=$unet_gid
532 AC_MSG_RESULT([$unet_cv_with_group])
534 IRCDGRP=$unet_cv_with_group
537 dnl --with-domain lets us set the domain name for some statistics-gathering
539 if test -f /etc/resolv.conf; then
540 unet_domain=`awk '/^domain/ { print $2; exit }' /etc/resolv.conf`
541 if test x"$unet_domain" = x; then
542 unet_domain=`awk '/^search/ { print $2; exit }' /etc/resolv.conf`
545 AC_MSG_CHECKING([for site domain name])
546 AC_ARG_WITH([domain],
547 [ --with-domain=domain Domain name to use in local statistics gathering],
548 [unet_cv_with_domain=$with_domain],
549 [AC_CACHE_VAL(unet_cv_with_domain,
550 [unet_cv_with_domain=$unet_domain])])
552 if test x"$unet_cv_with_domain" = xyes -o x"$unet_cv_with_domain" = xno; then
553 unet_cv_with_domain=$unet_domain
555 if test x"$unet_cv_with_domain" = xno; then
556 AC_MSG_ERROR([Unable to determine server DNS domain; use --with-domain to set it])
559 AC_MSG_RESULT([$unet_cv_with_domain])
561 AC_DEFINE_UNQUOTED(DOMAINNAME, "*$unet_cv_with_domain",
562 [Domain name to be used for some statistics gathering])
564 dnl --with-chroot lets us define a directory that we are going to be using
565 dnl as the root of our filesystem
566 AC_MSG_CHECKING([if chroot operation is desired])
567 AC_ARG_WITH([chroot],
568 [ --with-chroot=dir Specify that the server will be operated under
569 a different root directory given by dir. See
570 doc/readme.chroot for more information.],
571 [unet_cv_with_chroot=$with_chroot],
572 [AC_CACHE_VAL(unet_cv_with_chroot,
573 [unet_cv_with_chroot=no])])
575 if test x"$unet_cv_with_chroot" = xyes; then
576 AC_MSG_ERROR([--with-chroot given with no directory. See doc/readme.chroot.])
579 # Ensure there are no trailing /'s to mess us up
580 unet_cv_with_chroot=`echo "$unet_cv_with_chroot" | sed 's%/*$%%'`
582 AC_MSG_RESULT([$unet_cv_with_chroot])
584 dnl Determine some default directory names
586 dnl HACK WARNING: We are referencing an autoconf internal variable. This is
587 dnl the only way to figure out what value $prefix will have when we go to do
588 dnl the install--and the only way we can stick that value in our definitions
590 # Deal with the annoying value "NONE" here
591 unet_save_prefix=$prefix
592 if test x"$prefix" = xNONE; then
593 prefix=$ac_default_prefix
598 unet_save_exec_prefix=$exec_prefix
599 if test x"$exec_prefix" = xNONE; then
602 exec_prefix=$exec_prefix
605 # Obtain the actual interesting directories
606 unet_bindir=`eval echo "$bindir"`
607 unet_libdir=`eval echo "$libdir"`
609 # Restore the original settings of $prefix and $exec_prefix
610 prefix=$unet_save_prefix
611 exec_prefix=$unet_save_exec_prefix
613 dnl Now compute the name of the binary and verify that it will work under
615 AC_MSG_CHECKING([where the binary will be for /restart])
616 if test x"$unet_cv_with_symlink" = xno; then
617 unet_spath="$unet_bindir/ircd"
619 unet_spath="$unet_bindir/$unet_cv_with_symlink"
621 AC_MSG_RESULT([$unet_spath])
623 if test x"$unet_cv_with_chroot" != xno; then
624 if echo "$unet_spath" | grep "^$unet_cv_with_chroot" > /dev/null 2>&1; then
625 unet_spath=`echo "$unet_spath" | sed "s%^$unet_cv_with_chroot%%"`
627 AC_MSG_WARN([Binary $unet_spath not relative to root directory $unet_cv_with_chroot; restarts will probably fail])
631 AC_DEFINE_UNQUOTED(SPATH, "$unet_spath", [Path to executable for restarts])
633 dnl --with-dpath sets the all-important DPATH
634 AC_MSG_CHECKING([what the data directory should be])
636 [ --with-dpath=dir Directory for all server data files],
637 [unet_cv_with_dpath=$with_dpath],
638 [AC_CACHE_VAL(unet_cv_with_dpath,
639 [unet_cv_with_dpath=$unet_libdir])])
641 if test x"$unet_cv_with_dpath" = xyes -o x"$unet_cv_with_dpath" = xno; then
642 unet_cv_with_dpath=$unet_libdir
645 # Ensure there are no trailing /'s to mess us up
646 unet_cv_with_dpath=`echo "$unet_cv_with_dpath" | sed 's%/*$%%'`
648 AC_MSG_RESULT([$unet_cv_with_dpath])
650 if test x"$unet_cv_with_chroot" != xno; then
651 if echo "$unet_cv_with_dpath" | grep "^$unet_cv_with_chroot" > /dev/null 2>&1; then
652 unet_dpath=`echo "$unet_cv_with_dpath" | sed "s%^$unet_cv_with_chroot%%"`
654 AC_MSG_ERROR([Data directory $unet_cv_with_dpath not relative to root directory $unet_cv_with_chroot])
657 unet_dpath=$unet_cv_with_dpath
660 AC_DEFINE_UNQUOTED(DPATH, "$unet_dpath", [Path to data directory])
662 DPATH=$unet_cv_with_dpath
665 dnl --with-cpath allows us to specify the configuration file
666 AC_MSG_CHECKING([where the default configuration file resides])
668 [ --with-cpath=file Set server configuration file],
669 [unet_cv_with_cpath=$with_cpath],
670 [AC_CACHE_VAL(unet_cv_with_cpath,
671 [unet_cv_with_cpath="ircd.conf"])])
673 if test x"$unet_cv_with_cpath" = xyes -o x"$unet_cv_with_cpath" = xno; then
674 unet_cv_with_cpath="ircd.conf"
677 AC_MSG_RESULT([$unet_cv_with_cpath])
679 if echo "$unet_cv_with_cpath" | grep '^/' > /dev/null 2>&1; then
680 # Absolute path; check against chroot stuff
681 if test x"$unet_cv_with_chroot" != xno; then
682 if echo "$unet_cv_with_cpath" | grep "^$unet_cv_with_chroot" > /dev/null 2>&1; then
683 unet_cpath=`echo "$unet_cv_with_cpath" | sed "s%^$unet_cv_with_chroot%%"`
685 AC_MSG_ERROR([Configuration file $unet_cv_with_cpath not relative to root directory $unet_cv_with_chroot])
688 unet_cpath=$unet_cv_with_cpath
691 unet_cpath=$unet_cv_with_cpath
694 AC_DEFINE_UNQUOTED(CPATH, "$unet_cpath", [Configuration file name])
696 dnl --with-lpath allows us to specify the default debugging log file
697 AC_MSG_CHECKING([where to put the debugging log if debugging enabled])
699 [ --with-lpath=file Set the debugging log file],
700 [unet_cv_with_lpath=$with_lpath],
701 [AC_CACHE_VAL(unet_cv_with_lpath,
702 [unet_cv_with_lpath="ircd.log"])])
704 if test x"$unet_cv_with_lpath" = xyes -o x"$unet_cv_with_lpath" = xno; then
705 unet_cv_with_lpath="ircd.log"
708 AC_MSG_RESULT([$unet_cv_with_lpath])
710 if echo "$unet_cv_with_lpath" | grep '^/' > /dev/null 2>&1; then
711 # Absolute path; check against chroot stuff
712 if test x"$unet_cv_with_chroot" != xno; then
713 if echo "$unet_cv_with_lpath" | grep "^$unet_cv_with_chroot" > /dev/null 2>&1; then
714 unet_lpath=`echo "$unet_cv_with_lpath" | sed "s%^$unet_cv_with_chroot%%"`
716 AC_MSG_WARN([Log file $unet_cv_with_lpath not relative to root directory $unet_cv_with_chroot; using default ircd.log instead])
717 unet_cv_with_lpath="ircd.log"
718 unet_lpath="ircd.log"
721 unet_lpath=$unet_cv_with_lpath
724 unet_lpath=$unet_cv_with_lpath
727 AC_DEFINE_UNQUOTED(LPATH, "$unet_lpath", [Path to debugging log file])
729 dnl --with-maxcon allows us to set the maximum connections
730 unet_maxcon=`ulimit -Hn`
731 if test x"$unet_maxcon" = xunlimited; then
732 unet_maxcon=`ulimit -Sn`
734 unet_maxcon=`expr $unet_maxcon - 4`
735 AC_MSG_CHECKING([max connections])
736 AC_ARG_WITH([maxcon],
737 [ --with-maxcon=maxcon Maximum number of connections server will accept],
738 [unet_cv_with_maxcon=$with_maxcon],
739 [AC_CACHE_VAL(unet_cv_with_maxcon,
740 [unet_cv_with_maxcon=$unet_maxcon])])
742 if test x"$unet_cv_with_maxcon" = xyes -o x"$unet_cv_with_maxcon" = xno; then
743 unet_cv_with_maxcon=$unet_maxcon
746 AC_MSG_RESULT([$unet_cv_with_maxcon])
748 AC_DEFINE_UNQUOTED(MAXCONNECTIONS, $unet_cv_with_maxcon,
749 [Maximum number of network connections])
751 dnl Finally really generate all output files:
752 AC_OUTPUT(Makefile ircd/Makefile doc/Makefile, [echo timestamp > stamp-h])
754 dnl Report configuration
755 AC_OUTPUT_COMMANDS([echo "
756 ircu is now hopefully configured for your system.
758 Host system: $host_os
760 Asserts: $unet_cv_enable_asserts
761 Warnings: $unet_cv_enable_warnings
762 Debug: $unet_cv_enable_debug
763 Profile: $unet_cv_enable_profile
764 ADNS: $unet_cv_enable_adns
765 Owner/mode: $unet_cv_with_owner.$unet_cv_with_group ($unet_cv_with_mode)
766 Chroot: $unet_cv_with_chroot
768 Domain: $unet_cv_with_domain
769 DPath: $unet_cv_with_dpath
770 CPath: $unet_cv_with_cpath
771 LPath: $unet_cv_with_lpath
772 Maximum connections: $unet_cv_with_maxcon
774 poll() engine: $unet_cv_enable_poll
775 kqueue() engine: $unet_cv_enable_kqueue
776 /dev/poll engine: $unet_cv_enable_devpoll
777 epoll() engine: $unet_cv_enable_epoll