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(poll.h sys/devpoll.h sys/event.h)
113 dnl Checks for typedefs, structures, and compiler characteristics
120 unet_CHECK_TYPE_SIZES
122 dnl Checks for library functions.
123 AC_CHECK_FUNCS([kqueue setrlimit getrusage times])
125 dnl Do we have restarting syscalls ?
126 AC_SYS_RESTARTABLE_SYSCALLS
128 dnl Check for required features for admins?
129 AC_MSG_CHECKING([for donuts])
132 dnl Test for programs
137 AC_PATH_PROGS(RMPROG, rm, /bin/rm)
138 AC_PATH_PROGS(SHPROG, sh, /bin/sh)
143 dnl Add -pipe when possible
146 dnl Check OS for os_dep files.
147 AC_MSG_CHECKING(for OS-dependent information)
150 AC_MSG_RESULT([Linux ($host) found.])
151 unet_poll_syscall=yes
156 AC_MSG_RESULT([Solaris ($host) found.])
157 if test x"$ac_cv_header_poll_h" = xyes; then
158 unet_poll_syscall=yes
166 AC_MSG_RESULT([Solaris ($host) found.])
172 AC_MSG_RESULT([OpenBSD ($host) found.])
173 if test x"$ac_cv_header_poll_h" = xyes; then
174 unet_poll_syscall=yes
182 AC_MSG_RESULT([Generic BSD ($host) found.])
183 if test x"$ac_cv_header_poll_h" = xyes; then
184 unet_poll_syscall=yes
192 AC_MSG_RESULT([Darwin (Mac OS X) ($host) found.])
198 AC_MSG_RESULT([Unknown system type $host found.])
199 AC_MSG_WARN([Unknown OS type; using generic routines.])
206 dnl Check user configuration options
207 dnl Start with --enable-poll
208 AC_MSG_CHECKING([whether to enable use of poll()])
209 AC_ARG_ENABLE([poll],
210 [ --enable-poll Force poll to be used regardless of whether or not
211 it is a system call],
212 [unet_cv_enable_poll=$enable_poll],
213 [AC_CACHE_VAL(unet_cv_enable_poll,
214 [unet_cv_enable_poll=$unet_poll_syscall])])
216 # Force poll to be disabled if there is no poll.h
217 if test x"$ac_cv_header_poll_h" != xyes; then
218 unet_cv_enable_poll=no
221 AC_MSG_RESULT([$unet_cv_enable_poll])
223 if test x"$unet_cv_enable_poll" = xyes; then
224 AC_DEFINE([USE_POLL], , [Specify whether or not to use poll()])
225 ENGINE_C=engine_poll.c
227 ENGINE_C=engine_select.c
231 dnl Now look for --enable-debug
232 AC_MSG_CHECKING([whether to enable debug mode])
233 AC_ARG_ENABLE([debug],
234 [ --enable-debug Turn on debugging mode],
235 [unet_cv_enable_debug=$enable_debug],
236 [AC_CACHE_VAL(unet_cv_enable_debug,
237 [unet_cv_enable_debug=no])])
238 AC_MSG_RESULT([$unet_cv_enable_debug])
240 if test x"$unet_cv_enable_debug" = xyes; then
241 AC_DEFINE([DEBUGMODE], , [Enable debugging code])
244 dnl And now for --disable-asserts
245 AC_MSG_CHECKING([whether to enable asserts])
246 AC_ARG_ENABLE([asserts],
247 [ --disable-asserts Disable assertion checking],
248 [unet_cv_enable_asserts=$enable_asserts],
249 [AC_CACHE_VAL(unet_cv_enable_asserts,
250 [unet_cv_enable_asserts=yes])])
251 AC_MSG_RESULT([$unet_cv_enable_asserts])
253 if test x"$unet_cv_enable_asserts" = xno; then
254 AC_DEFINE([NDEBUG], , [Disable assertions])
257 dnl Check for --enable-symbols
258 AC_MSG_CHECKING([whether to enable debugging symbols])
259 AC_ARG_ENABLE([symbols],
260 [ --disable-symbols Disable debugging symbols (remove -g from CFLAGS)],
261 [unet_cv_enable_symbols=$enable_symbols],
262 [AC_CACHE_VAL(unet_cv_enable_symbols,
263 [unet_cv_enable_symbols=yes])])
264 AC_MSG_RESULT([$unet_cv_enable_symbols])
266 if test x"$unet_cv_enable_symbols" = xyes; then
270 dnl Check for --disable-headinsand
271 AC_MSG_CHECKING([whether to enable head in sand 'features'])
272 AC_ARG_ENABLE([headinsand],
273 [ --disable-headinsand Disable head in sand (-DNO_HEAD_IN_SAND)],
274 [unet_cv_enable_headinsand=$enable_headinsand],
275 [AC_CACHE_VAL(unet_cv_enable_headinsand,
276 [unet_cv_enable_headinsand=yes])])
277 AC_MSG_RESULT([$unet_cv_enable_headinsand])
279 if test x"$unet_cv_enable_headinsand" = xno; then
280 CFLAGS="-DNO_HEAD_IN_SAND $CFLAGS"
283 dnl Now check for --enable-profile
284 AC_MSG_CHECKING([whether to enable profiling support (gprof)])
285 AC_ARG_ENABLE([profile],
286 [ --enable-profile Enable profiling support (add -pg to CFLAGS)],
287 [unet_cv_enable_profile=$enable_profile],
288 [AC_CACHE_VAL(unet_cv_enable_profile,
289 [unet_cv_enable_profile=no])])
290 AC_MSG_RESULT([$unet_cv_enable_profile])
292 if test x"$unet_cv_enable_profile" = xyes; then
296 dnl Now check for --enable-pedantic
297 AC_MSG_CHECKING([whether to enable pedantic compiler warnings])
298 AC_ARG_ENABLE([pedantic],
299 [ --enable-pedantic Enable pedantic warnings (add -pedantic to CFLAGS)],
300 [unet_cv_enable_pedantic=$enable_pedantic],
301 [AC_CACHE_VAL(unet_cv_enable_pedantic,
302 [unet_cv_enable_pedantic=no])])
303 AC_MSG_RESULT([$unet_cv_enable_pedantic])
305 if test x"$unet_cv_enable_pedantic" = xyes; then
306 CFLAGS="-pedantic $CFLAGS"
309 dnl Now check for --enable-warnings
310 AC_MSG_CHECKING([whether to enable compiler warnings])
311 AC_ARG_ENABLE([warnings],
312 [ --enable-warnings Enable warnings (add -Wall to CFLAGS)],
313 [unet_cv_enable_warnings=$enable_warnings],
314 [AC_CACHE_VAL(unet_cv_enable_warnings,
315 [unet_cv_enable_warnings=no])])
316 AC_MSG_RESULT([$unet_cv_enable_warnings])
318 if test x"$unet_cv_enable_warnings" = xyes; then
319 CFLAGS="-Wall $CFLAGS"
322 dnl --disable-inlines check...
323 AC_MSG_CHECKING([whether to enable inlining for a few critical functions])
324 AC_ARG_ENABLE([inlines],
325 [ --disable-inlines Disable inlining for a few critical functions],
326 [unet_cv_enable_inlines=$enable_inlines],
327 [AC_CACHE_VAL(unet_cv_enable_inlines,
328 [unet_cv_enable_inlines=yes])])
329 AC_MSG_RESULT([$unet_cv_enable_inlines])
331 if test x"$unet_cv_enable_inlines" = xyes; then
332 AC_DEFINE([FORCEINLINE], , [Force inlining for a few critical functions])
335 dnl --disable-devpoll check...
336 AC_MSG_CHECKING([whether to enable the /dev/poll event engine])
337 AC_ARG_ENABLE([devpoll],
338 [ --disable-devpoll Enable the /dev/poll-based engine],
339 [unet_cv_enable_devpoll=$enable_devpoll],
340 [AC_CACHE_VAL(unet_cv_enable_devpoll,
341 [unet_cv_enable_devpoll=yes])])
343 if test x"$ac_cv_header_sys_devpoll_h" = xno; then
344 unet_cv_enable_devpoll=no
347 AC_MSG_RESULT([$unet_cv_enable_devpoll])
349 if test x"$unet_cv_enable_devpoll" != xno; then
350 AC_DEFINE([USE_DEVPOLL], , [Define to enable the /dev/poll engine])
351 ENGINE_C="engine_devpoll.c $ENGINE_C"
354 dnl --disable-kqueue check...
355 AC_MSG_CHECKING([whether to enable the kqueue event engine])
356 AC_ARG_ENABLE([kqueue],
357 [ --disable-kqueue Enable the kqueue-based engine],
358 [unet_cv_enable_kqueue=$enable_kqueue],
359 [AC_CACHE_VAL(unet_cv_enable_kqueue,
360 [unet_cv_enable_kqueue=yes])])
362 if test x"$ac_cv_header_sys_event_h" = xno -o x"$ac_cv_func_kqueue" = xno; then
363 unet_cv_enable_kqueue=no
366 AC_MSG_RESULT([$unet_cv_enable_kqueue])
368 if test x"$unet_cv_enable_kqueue" != xno; then
369 AC_DEFINE([USE_KQUEUE], , [Define to enable the kqueue engine])
370 ENGINE_C="engine_kqueue.c $ENGINE_C"
373 dnl --disable-adns check...
374 AC_MSG_CHECKING([whether to enable the adns resolver engine])
375 AC_ARG_ENABLE([adns],
376 [ --disable-adns Disable adns resolver],
377 [unet_cv_enable_adns=$enable_adns],
378 [AC_CACHE_VAL(unet_cv_enable_adns,
379 [unet_cv_enable_adns=yes])])
381 AC_MSG_RESULT([$unet_cv_enable_adns])
383 if test x"$unet_cv_enable_adns" != xno; then
384 AC_DEFINE([USE_ADNS], , [Define to enable the adns resolver])
385 AC_CONFIG_SUBDIRS([adns])
387 LIBS="../adns/src/libadns.a $LIBS"
390 RES_C="res_libresolv.c"
393 dnl Look for res_mkquery. Done after AC_LIBRARY_NET in case res_mkquery
394 dnl is in one of those libraries somewhere.
395 AC_SEARCH_LIBS(res_mkquery, resolv, ,
396 [AC_MSG_ERROR([Unable to find library containing res_mkquery()])])
399 AC_SUBST(ADNS_SUBDIR)
401 dnl --with-symlink lets us set the name of the symlink; defaults to "ircd"
402 AC_MSG_CHECKING([what name to give the symlink])
403 AC_ARG_WITH([symlink],
404 [ --with-symlink=name Name to give the symlink; if name is "no," no
405 symlink will be created.],
406 [unet_cv_with_symlink=$with_symlink],
407 [AC_CACHE_VAL(unet_cv_with_symlink,
408 [unet_cv_with_symlink="ircd"])])
410 if test x"$unet_cv_with_symlink" = xyes; then
411 unet_cv_with_symlink="ircd"
414 AC_MSG_RESULT([$unet_cv_with_symlink])
416 if test x"$unet_cv_with_symlink" = xno; then
417 INSTALL_RULE=install-no-symlink
420 INSTALL_RULE=install-with-symlink
421 SYMLINK=$unet_cv_with_symlink
423 AC_SUBST(INSTALL_RULE)
426 dnl --with-mode lets us set the permissions on the binary
427 AC_MSG_CHECKING([what permissions to set on the installed binary])
429 [ --with-mode=mode Permissions (in octal) to give the binary],
430 [unet_cv_with_mode=$with_mode],
431 [AC_CACHE_VAL(unet_cv_with_mode,
432 [unet_cv_with_mode=711])])
434 if test x"$unet_cv_with_mode" = xyes -o x"$unet_cv_with_mode" = xno; then
435 unet_cv_with_mode=711
438 AC_MSG_RESULT([$unet_cv_with_mode])
440 IRCDMODE=$unet_cv_with_mode
443 dnl --with-owner lets us set the owner of the binary
445 unet_uid=`id | sed -e 's/.*uid=[0-9]*(//' -e 's/).*//' 2> /dev/null`
447 AC_MSG_CHECKING([which user should own the installed binary])
449 [ --with-owner=owner Specify owner of the installed binary],
450 [unet_cv_with_owner=$with_owner],
451 [AC_CACHE_VAL(unet_cv_with_owner,
452 [unet_cv_with_owner=$unet_uid])])
454 if test x"$unet_cv_with_owner" = xyes -o x"$unet_cv_with_owner" = xno; then
455 unet_cv_with_owner=$unet_uid
458 AC_MSG_RESULT([$unet_cv_with_owner])
460 IRCDOWN=$unet_cv_with_owner
463 dnl --with-group lets us set the group owner of the binary
465 unet_gid=`id | sed -e 's/.*gid=[0-9]*(//' -e 's/).*//' 2> /dev/null`
467 AC_MSG_CHECKING([which group should own the installed binary])
469 [ --with-group=group Specify group owner of the installed binary],
470 [unet_cv_with_group=$with_group],
471 [AC_CACHE_VAL(unet_cv_with_group,
472 [unet_cv_with_group=$unet_gid])])
474 if test x"$unet_cv_with_group" = xyes -o x"$unet_cv_with_group" = xno; then
475 unet_cv_with_group=$unet_gid
478 AC_MSG_RESULT([$unet_cv_with_group])
480 IRCDGRP=$unet_cv_with_group
483 dnl --with-domain lets us set the domain name for some statistics-gathering
485 if test -f /etc/resolv.conf; then
486 unet_domain=`awk '/^domain/ { print $2; exit }' /etc/resolv.conf`
487 if test x"$unet_domain" = x; then
488 unet_domain=`awk '/^search/ { print $2; exit }' /etc/resolv.conf`
491 AC_MSG_CHECKING([for site domain name])
492 AC_ARG_WITH([domain],
493 [ --with-domain=domain Domain name to use in local statistics gathering],
494 [unet_cv_with_domain=$with_domain],
495 [AC_CACHE_VAL(unet_cv_with_domain,
496 [unet_cv_with_domain=$unet_domain])])
498 if test x"$unet_cv_with_domain" = xyes -o x"$unet_cv_with_domain" = xno; then
499 unet_cv_with_domain=$unet_domain
501 if test x"$unet_cv_with_domain" = xno; then
502 AC_MSG_ERROR([Unable to determine server DNS domain; use --with-domain to set it])
505 AC_MSG_RESULT([$unet_cv_with_domain])
507 AC_DEFINE_UNQUOTED(DOMAINNAME, "*$unet_cv_with_domain",
508 [Domain name to be used for some statistics gathering])
510 dnl --with-chroot lets us define a directory that we are going to be using
511 dnl as the root of our filesystem
512 AC_MSG_CHECKING([if chroot operation is desired])
513 AC_ARG_WITH([chroot],
514 [ --with-chroot=dir Specify that the server will be operated under
515 a different root directory given by dir. See
516 doc/readme.chroot for more information.],
517 [unet_cv_with_chroot=$with_chroot],
518 [AC_CACHE_VAL(unet_cv_with_chroot,
519 [unet_cv_with_chroot=no])])
521 if test x"$unet_cv_with_chroot" = xyes; then
522 AC_MSG_ERROR([--with-chroot given with no directory. See doc/readme.chroot.])
525 # Ensure there are no trailing /'s to mess us up
526 unet_cv_with_chroot=`echo "$unet_cv_with_chroot" | sed 's%/*$%%'`
528 AC_MSG_RESULT([$unet_cv_with_chroot])
530 dnl Determine some default directory names
532 dnl HACK WARNING: We are referencing an autoconf internal variable. This is
533 dnl the only way to figure out what value $prefix will have when we go to do
534 dnl the install--and the only way we can stick that value in our definitions
536 # Deal with the annoying value "NONE" here
537 unet_save_prefix=$prefix
538 if test x"$prefix" = xNONE; then
539 prefix=$ac_default_prefix
544 unet_save_exec_prefix=$exec_prefix
545 if test x"$exec_prefix" = xNONE; then
548 exec_prefix=$exec_prefix
551 # Obtain the actual interesting directories
552 unet_bindir=`eval echo "$bindir"`
553 unet_libdir=`eval echo "$libdir"`
555 # Restore the original settings of $prefix and $exec_prefix
556 prefix=$unet_save_prefix
557 exec_prefix=$unet_save_exec_prefix
559 dnl Now compute the name of the binary and verify that it will work under
561 AC_MSG_CHECKING([where the binary will be for /restart])
562 if test x"$unet_cv_with_symlink" = xno; then
563 unet_spath="$unet_bindir/ircd"
565 unet_spath="$unet_bindir/$unet_cv_with_symlink"
567 AC_MSG_RESULT([$unet_spath])
569 if test x"$unet_cv_with_chroot" != xno; then
570 if echo "$unet_spath" | grep "^$unet_cv_with_chroot" > /dev/null 2>&1; then
571 unet_spath=`echo "$unet_spath" | sed "s%^$unet_cv_with_chroot%%"`
573 AC_MSG_WARN([Binary $unet_spath not relative to root directory $unet_cv_with_chroot; restarts will probably fail])
577 AC_DEFINE_UNQUOTED(SPATH, "$unet_spath", [Path to executable for restarts])
579 dnl --with-dpath sets the all-important DPATH
580 AC_MSG_CHECKING([what the data directory should be])
582 [ --with-dpath=dir Directory for all server data files],
583 [unet_cv_with_dpath=$with_dpath],
584 [AC_CACHE_VAL(unet_cv_with_dpath,
585 [unet_cv_with_dpath=$unet_libdir])])
587 if test x"$unet_cv_with_dpath" = xyes -o x"$unet_cv_with_dpath" = xno; then
588 unet_cv_with_dpath=$unet_libdir
591 # Ensure there are no trailing /'s to mess us up
592 unet_cv_with_dpath=`echo "$unet_cv_with_dpath" | sed 's%/*$%%'`
594 AC_MSG_RESULT([$unet_cv_with_dpath])
596 if test x"$unet_cv_with_chroot" != xno; then
597 if echo "$unet_cv_with_dpath" | grep "^$unet_cv_with_chroot" > /dev/null 2>&1; then
598 unet_dpath=`echo "$unet_cv_with_dpath" | sed "s%^$unet_cv_with_chroot%%"`
600 AC_MSG_ERROR([Data directory $unet_cv_with_dpath not relative to root directory $unet_cv_with_chroot])
603 unet_dpath=$unet_cv_with_dpath
606 AC_DEFINE_UNQUOTED(DPATH, "$unet_dpath", [Path to data directory])
608 DPATH=$unet_cv_with_dpath
611 dnl --with-cpath allows us to specify the configuration file
612 AC_MSG_CHECKING([where the default configuration file resides])
614 [ --with-cpath=file Set server configuration file],
615 [unet_cv_with_cpath=$with_cpath],
616 [AC_CACHE_VAL(unet_cv_with_cpath,
617 [unet_cv_with_cpath="ircd.conf"])])
619 if test x"$unet_cv_with_cpath" = xyes -o x"$unet_cv_with_cpath" = xno; then
620 unet_cv_with_cpath="ircd.conf"
623 AC_MSG_RESULT([$unet_cv_with_cpath])
625 if echo "$unet_cv_with_cpath" | grep '^/' > /dev/null 2>&1; then
626 # Absolute path; check against chroot stuff
627 if test x"$unet_cv_with_chroot" != xno; then
628 if echo "$unet_cv_with_cpath" | grep "^$unet_cv_with_chroot" > /dev/null 2>&1; then
629 unet_cpath=`echo "$unet_cv_with_cpath" | sed "s%^$unet_cv_with_chroot%%"`
631 AC_MSG_ERROR([Configuration file $unet_cv_with_cpath not relative to root directory $unet_cv_with_chroot])
634 unet_cpath=$unet_cv_with_cpath
637 unet_cpath=$unet_cv_with_cpath
640 AC_DEFINE_UNQUOTED(CPATH, "$unet_cpath", [Configuration file name])
642 dnl --with-lpath allows us to specify the default debugging log file
643 AC_MSG_CHECKING([where to put the debugging log if debugging enabled])
645 [ --with-lpath=file Set the debugging log file],
646 [unet_cv_with_lpath=$with_lpath],
647 [AC_CACHE_VAL(unet_cv_with_lpath,
648 [unet_cv_with_lpath="ircd.log"])])
650 if test x"$unet_cv_with_lpath" = xyes -o x"$unet_cv_with_lpath" = xno; then
651 unet_cv_with_lpath="ircd.log"
654 AC_MSG_RESULT([$unet_cv_with_lpath])
656 if echo "$unet_cv_with_lpath" | grep '^/' > /dev/null 2>&1; then
657 # Absolute path; check against chroot stuff
658 if test x"$unet_cv_with_chroot" != xno; then
659 if echo "$unet_cv_with_lpath" | grep "^$unet_cv_with_chroot" > /dev/null 2>&1; then
660 unet_lpath=`echo "$unet_cv_with_lpath" | sed "s%^$unet_cv_with_chroot%%"`
662 AC_MSG_WARN([Log file $unet_cv_with_lpath not relative to root directory $unet_cv_with_chroot; using default ircd.log instead])
663 unet_cv_with_lpath="ircd.log"
664 unet_lpath="ircd.log"
667 unet_lpath=$unet_cv_with_lpath
670 unet_lpath=$unet_cv_with_lpath
673 AC_DEFINE_UNQUOTED(LPATH, "$unet_lpath", [Path to debugging log file])
675 dnl --with-maxcon allows us to set the maximum connections
676 unet_maxcon=`ulimit -Hn`
677 unet_maxcon=`expr $unet_maxcon - 4`
678 AC_MSG_CHECKING([max connections])
679 AC_ARG_WITH([maxcon],
680 [ --with-maxcon=maxcon Maximum number of connections server will accept],
681 [unet_cv_with_maxcon=$with_maxcon],
682 [AC_CACHE_VAL(unet_cv_with_maxcon,
683 [unet_cv_with_maxcon=$unet_maxcon])])
685 if test x"$unet_cv_with_maxcon" = xyes -o x"$unet_cv_with_maxcon" = xno; then
686 unet_cv_with_maxcon=$unet_maxcon
689 AC_MSG_RESULT([$unet_cv_with_maxcon])
691 AC_DEFINE_UNQUOTED(MAXCONNECTIONS, $unet_cv_with_maxcon,
692 [Maximum number of network connections])
694 dnl Finally really generate all output files:
695 AC_OUTPUT(Makefile ircd/Makefile doc/Makefile, [echo timestamp > stamp-h])
697 dnl Report configuration
698 AC_OUTPUT_COMMANDS([echo "
699 ircu is now hopefully configured for your system.
701 Host system: $host_os
703 Asserts: $unet_cv_enable_asserts
704 Warnings: $unet_cv_enable_warnings
705 Debug: $unet_cv_enable_debug
706 Profile: $unet_cv_enable_profile
707 Head-in-sand: $unet_cv_enable_headinsand
708 ADNS: $unet_cv_enable_adns
709 Owner/mode: $unet_cv_with_owner.$unet_cv_with_group ($unet_cv_with_mode)
710 Chroot: $unet_cv_with_chroot
712 Domain: $unet_cv_with_domain
713 DPath: $unet_cv_with_dpath
714 CPath: $unet_cv_with_cpath
715 LPath: $unet_cv_with_lpath
716 Maximum connections: $unet_cv_with_maxcon
718 poll() engine: $unet_cv_enable_poll
719 kqueue() engine: $unet_cv_enable_kqueue
720 /dev/poll engine: $unet_cv_enable_devpoll