2 # ngIRCd -- The Next Generation IRC Daemon
3 # Copyright (c)2001-2003 by Alexander Barton (alex@barton.de)
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
9 # Please read the file COPYING, README and AUTHORS for more information.
11 # $Id: configure.in,v 1.87 2003/03/31 16:17:33 alex Exp $
14 # -- Initialisierung --
17 AC_INIT(ngircd, CVSHEAD)
18 AC_CONFIG_SRCDIR(src/ngircd/ngircd.c)
21 AM_CONFIG_HEADER(src/config.h)
23 # -- Templates fuer config.h --
25 AH_TEMPLATE([DEBUG], [Define if debug-mode should be enabled])
26 AH_TEMPLATE([HAVE_socklen_t], [Define if socklen_t exists])
27 AH_TEMPLATE([SNIFFER], [Define if IRC sniffer should be enabled])
28 AH_TEMPLATE([STRICT_RFC], [Define if ngIRCd should behave strict RFC compliant])
29 AH_TEMPLATE([USE_SYSLOG], [Define if syslog should be used for logging])
30 AH_TEMPLATE([USE_ZLIB], [Define if zlib compression should be enabled])
31 AH_TEMPLATE([USE_TCPWRAP], [Define if TCP wrappers should be used])
32 AH_TEMPLATE([IRCPLUS], [Define if IRC+ protocol should be used])
33 AH_TEMPLATE([RENDEZVOUS], [Define if Rendezvous support should be included])
35 AH_TEMPLATE([TARGET_OS], [Target operating system name])
36 AH_TEMPLATE([TARGET_VENDOR], [Target system vendor])
37 AH_TEMPLATE([TARGET_CPU], [Target CPU name])
43 # -- Hilfsprogramme --
51 # -- Compiler Features --
60 if test `uname` = "A/UX"; then
61 # unter A/UX sollte _POSIX_SOURCE definiert sein.
62 AC_MSG_RESULT([detected A/UX, defining _POSIX_SOURCE])
63 CFLAGS="$CFLAGS -D_POSIX_SOURCE"
66 if test `uname` = "HP-UX"; then
67 # unter HP-UX 11.11 muss _XOPEN_SOURCE_EXTENDED definiert sein.
68 AC_MSG_RESULT([detected HP-UX, defining _XOPEN_SOURCE_EXTENDED])
69 CFLAGS="$CFLAGS -D_XOPEN_SOURCE_EXTENDED"
81 ctype.h errno.h fcntl.h netdb.h netinet/in.h stdlib.h string.h \
82 strings.h sys/socket.h sys/time.h unistd.h \
83 ],,AC_MSG_ERROR([required C header missing!]))
85 AC_CHECK_HEADERS([arpa/inet.h ctype.h malloc.h stdint.h varargs.h])
89 AC_MSG_CHECKING(whether socklen_t exists)
91 #include <sys/socket.h>
92 #include <sys/types.h>
97 AC_DEFINE(HAVE_socklen_t) AC_MSG_RESULT(yes)
108 AC_CHECK_LIB(UTIL,memmove)
109 AC_CHECK_LIB(socket,bind)
110 AC_CHECK_LIB(nsl,gethostent)
121 bind gethostbyaddr gethostbyname gethostname inet_ntoa memmove \
122 memset setsockopt socket strcasecmp strchr strerror strstr waitpid \
123 ],,AC_MSG_ERROR([required function missing!]))
125 AC_CHECK_FUNCS(inet_aton isdigit sigaction snprintf vsnprintf strlcpy strlcat)
127 AC_CHECK_FUNCS(poll,[AC_CHECK_HEADER(sys/poll.h)],
128 [AC_CHECK_FUNCS(select,[AC_CHECK_HEADER(sys/select.h)],
129 AC_MSG_ERROR([neither poll() nor select() is available!]))
133 # -- Konfigurationsoptionen --
137 [ --without-syslog disable syslog (autodetected by default)],
138 [ if test "$withval" = "yes"; then
139 AC_CHECK_LIB(be, syslog)
140 AC_CHECK_FUNCS(syslog, x_syslog_on=yes,
141 AC_MSG_ERROR([Can't enable syslog!])
146 AC_CHECK_LIB(be, syslog)
147 AC_CHECK_FUNCS(syslog, x_syslog_on=yes)
150 if test "$x_syslog_on" = "yes"; then
151 AC_DEFINE(USE_SYSLOG, 1)
152 AC_CHECK_HEADERS(syslog.h)
157 [ --without-zlib disable zlib compression (autodetected by default)],
158 [ if test "$withval" = "yes"; then
159 AC_CHECK_LIB(z, deflate)
160 AC_CHECK_FUNCS(deflate, x_zlib_on=yes,
161 AC_MSG_ERROR([Can't enable zlib!])
165 [ AC_CHECK_LIB(z, deflate)
166 AC_CHECK_FUNCS(deflate, x_zlib_on=yes)
169 if test "$x_zlib_on" = "yes"; then
170 AC_DEFINE(USE_ZLIB, 1)
171 AC_CHECK_HEADERS(zlib.h)
175 AC_ARG_WITH(tcp-wrappers,
176 [ --with-tcp-wrappers enable TCP wrappers support],
177 [ if test "$withval" = "yes"; then
178 AC_CHECK_LIB(wrap, tcpd_warn)
179 AC_MSG_CHECKING(for hosts_access)
187 AC_DEFINE(USE_TCPWRAP, 1)
191 AC_MSG_ERROR([Can't enable TCP wrappers!])
198 AC_ARG_WITH(rendezvous,
199 [ --with-rendezvous enable support for "Rendezvous"],
200 [ if test "$withval" = "yes"; then
201 AC_CHECK_FUNCS(DNSServiceRegistrationCreate, x_rendezvous_on=yes,
202 AC_MSG_ERROR([Can't enable Rendezvous!])
207 if test "$x_rendezvous_on" = "yes"; then
208 AC_DEFINE(RENDEZVOUS, 1)
209 AC_CHECK_HEADERS(DNSServiceDiscovery/DNSServiceDiscovery.h mach/port.h)
213 AC_ARG_ENABLE(ircplus,
214 [ --disable-ircplus disable IRC+ protocol],
215 if test "$enableval" = "no"; then x_ircplus_on=no; fi
217 if test "$x_ircplus_on" = "yes"; then
218 AC_DEFINE(IRCPLUS, 1)
221 x_sniffer_on=no; x_debug_on=no
222 AC_ARG_ENABLE(sniffer,
223 [ --enable-sniffer enable IRC traffic sniffer (enables debug mode)],
224 if test "$enableval" = "yes"; then
225 AC_DEFINE(SNIFFER, 1)
226 x_sniffer_on=yes; x_debug_on=yes
231 [ --enable-debug show additional debug output],
232 if test "$enableval" = "yes"; then x_debug_on=yes; fi
234 if test "$x_debug_on" = "yes"; then
239 AC_ARG_ENABLE(strict-rfc,
240 [ --enable-strict-rfc strict RFC conformance -- may break clients!],
241 if test "$enableval" = "yes"; then
242 AC_DEFINE(STRICT_RFC, 1)
249 AC_DEFINE_UNQUOTED(TARGET_CPU, "$target_cpu" )
250 AC_DEFINE_UNQUOTED(TARGET_VENDOR, "$target_vendor" )
251 AC_DEFINE_UNQUOTED(TARGET_OS, "$target_os" )
255 if test "$GCC" = "yes"; then
256 the_CFLAGS="-Wall -Wtraditional -Wpointer-arith -Wstrict-prototypes"
257 add_CFLAGS="$CFLAGS $CFLAGS_ADD"
260 add_CFLAGS="$CFLAGS_ADD"
263 CFLAGS="$the_CFLAGS $add_CFLAGS -DSYSCONFDIR='\"\$(sysconfdir)\"'"
265 # -- Ausgabe der Dateien --
271 MacOSX/ngircd.pbproj/Makefile \
273 src/portab/Makefile \
275 src/ngircd/Makefile \
276 src/testsuite/Makefile \
284 echo "ngIRCd has been configured with the following options:"
287 # Someone please show me a better way :) [borrowed by OpenSSH]
288 B=`eval echo ${bindir}` ; B=`eval echo ${B}`
289 S=`eval echo ${sbindir}` ; S=`eval echo ${S}`
290 C=`eval echo ${sysconfdir}` ; C=`eval echo ${C}`
291 M=`eval echo ${mandir}` ; M=`eval echo ${M}`
292 D=`eval echo ${datadir}/doc/ngIRCd` ; D=`eval echo ${D}`
294 echo " Host: ${host}"
295 echo " Compiler: ${CC}"
296 echo " Compiler flags: ${the_CFLAGS}"
297 test -n "$add_CFLAGS" && echo " ${add_CFLAGS}"
298 echo " Preprocessor flags: ${CPPFLAGS}"
299 echo " Linker flags: ${LDFLAGS}"
300 echo " Libraries: ${LIBS}"
302 echo " 'ngircd' binary: $S"
303 echo " Configuration file: $C"
304 echo " Manual pages: $M"
305 echo " Documentation: $D"
308 echo $ECHO_N " Syslog support: $ECHO_C"
309 test "$x_syslog_on" = "yes" && echo "yes" || echo "no"
310 echo $ECHO_N " zlib compression: $ECHO_C"
311 test "$x_zlib_on" = "yes" && echo "yes" || echo "no"
312 echo $ECHO_N " Use TCP Wrappers: $ECHO_C"
313 test "$x_tcpwrap_on" = "yes" && echo "yes" || echo "no"
314 echo $ECHO_N " Rendezvous support: $ECHO_C"
315 test "$x_rendezvous_on" = "yes" && echo "yes" || echo "no"
316 echo $ECHO_N " Enable debug code: $ECHO_C"
317 test "$x_debug_on" = "yes" && echo "yes" || echo "no"
318 echo $ECHO_N " IRC sniffer: $ECHO_C"
319 test "$x_sniffer_on" = "yes" && echo "yes" || echo "no"
320 echo $ECHO_N " Strict RFC mode: $ECHO_C"
321 test "$x_strict_rfc_on" = "yes" && echo "yes" || echo "no"
322 echo $ECHO_N " IRC+ protocol: $ECHO_C"
323 test "$x_ircplus_on" = "yes" && echo "yes" || echo "no"