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.96 2003/11/04 00:41:07 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 --
62 if test "$os" = "Linux" -o $os = "GNU"; then
63 # define _POSIX_SOURCE, _GNU_SOURCE and _BSD_SOURCE when compiling
64 # on Linux or Hurd (glibc-based systems):
65 AC_MSG_RESULT([detected ${os}, defining _POSIX_SOURCE, _GNU_SOURCE and _BSD_SOURCE])
66 add_DEFINES="-D_POSIX_SOURCE -D_GNU_SOURCE -D_BSD_SOURCE $add_DEFINES"
69 if test "$os" = "A/UX"; then
70 # define _POSIX_SOURCE when compiling on A/UX:
71 AC_MSG_RESULT([detected A/UX, defining _POSIX_SOURCE])
72 add_DEFINES="-D_POSIX_SOURCE $add_DEFINES"
75 if test "$os" = "HP-UX"; then
76 # define _XOPEN_SOURCE_EXTENDED when compiling on HP-UX (11.11):
77 AC_MSG_RESULT([detected HP-UX, defining _XOPEN_SOURCE_EXTENDED])
78 add_DEFINES="-D_XOPEN_SOURCE_EXTENDED $add_DEFINES"
81 if test "$os" = "SunOS"; then
82 # define _XOPEN_SOURCE, _XOPEN_SOURCE_EXTENDED=1 and __EXTENSIONS__
83 # when compiling on SunOS (tested with 5.6):
84 AC_MSG_RESULT([detected SunOS, defining _XOPEN_SOURCE, _XOPEN_SOURCE_EXTENDED=1 and __EXTENSIONS__])
85 add_DEFINES="-D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1 -D__EXTENSIONS__ $add_DEFINES"
97 ctype.h errno.h fcntl.h netdb.h netinet/in.h stdlib.h string.h \
98 strings.h sys/socket.h sys/time.h unistd.h \
99 ],,AC_MSG_ERROR([required C header missing!]))
101 AC_CHECK_HEADERS([arpa/inet.h ctype.h malloc.h stdint.h varargs.h])
105 AC_MSG_CHECKING(whether socklen_t exists)
107 #include <sys/socket.h>
108 #include <sys/types.h>
111 a = 2; b = 4; a += b;
113 AC_DEFINE(HAVE_socklen_t) AC_MSG_RESULT(yes)
124 AC_CHECK_LIB(UTIL,memmove)
125 AC_CHECK_LIB(socket,bind)
126 AC_CHECK_LIB(nsl,gethostent)
137 bind gethostbyaddr gethostbyname gethostname inet_ntoa memmove \
138 memset setsockopt socket strcasecmp strchr strerror strstr waitpid \
139 ],,AC_MSG_ERROR([required function missing!]))
141 AC_CHECK_FUNCS(inet_aton isdigit sigaction snprintf vsnprintf strlcpy strlcat)
143 AC_CHECK_FUNCS(select,[AC_CHECK_HEADERS(sys/select.h)],
144 AC_MSG_ERROR([required function select() is missing!])
147 # -- Konfigurationsoptionen --
151 [ --without-syslog disable syslog (autodetected by default)],
152 [ if test "$withval" = "yes"; then
153 AC_CHECK_LIB(be, syslog)
154 AC_CHECK_FUNCS(syslog, x_syslog_on=yes,
155 AC_MSG_ERROR([Can't enable syslog!])
160 AC_CHECK_LIB(be, syslog)
161 AC_CHECK_FUNCS(syslog, x_syslog_on=yes)
164 if test "$x_syslog_on" = "yes"; then
165 AC_DEFINE(USE_SYSLOG, 1)
166 AC_CHECK_HEADERS(syslog.h)
171 [ --without-zlib disable zlib compression (autodetected by default)],
172 [ if test "$withval" = "yes"; then
173 AC_CHECK_LIB(z, deflate)
174 AC_CHECK_FUNCS(deflate, x_zlib_on=yes,
175 AC_MSG_ERROR([Can't enable zlib!])
179 [ AC_CHECK_LIB(z, deflate)
180 AC_CHECK_FUNCS(deflate, x_zlib_on=yes)
183 if test "$x_zlib_on" = "yes"; then
184 AC_DEFINE(USE_ZLIB, 1)
185 AC_CHECK_HEADERS(zlib.h)
189 AC_ARG_WITH(tcp-wrappers,
190 [ --with-tcp-wrappers enable TCP wrappers support],
191 [ if test "$withval" = "yes"; then
192 AC_CHECK_LIB(wrap, tcpd_warn)
193 AC_MSG_CHECKING(for hosts_access)
201 AC_DEFINE(USE_TCPWRAP, 1)
205 AC_MSG_ERROR([Can't enable TCP wrappers!])
212 AC_ARG_WITH(rendezvous,
213 [ --with-rendezvous enable support for "Rendezvous"],
214 [ if test "$withval" = "yes"; then
215 AC_CHECK_FUNCS(DNSServiceRegistrationCreate, x_rendezvous_on=yes,
216 AC_MSG_ERROR([Can't enable Rendezvous!])
221 if test "$x_rendezvous_on" = "yes"; then
222 AC_DEFINE(RENDEZVOUS, 1)
223 AC_CHECK_HEADERS(DNSServiceDiscovery/DNSServiceDiscovery.h mach/port.h)
227 AC_ARG_ENABLE(ircplus,
228 [ --disable-ircplus disable IRC+ protocol],
229 if test "$enableval" = "no"; then x_ircplus_on=no; fi
231 if test "$x_ircplus_on" = "yes"; then
232 AC_DEFINE(IRCPLUS, 1)
235 x_sniffer_on=no; x_debug_on=no
236 AC_ARG_ENABLE(sniffer,
237 [ --enable-sniffer enable IRC traffic sniffer (enables debug mode)],
238 if test "$enableval" = "yes"; then
239 AC_DEFINE(SNIFFER, 1)
240 x_sniffer_on=yes; x_debug_on=yes
245 [ --enable-debug show additional debug output],
246 if test "$enableval" = "yes"; then x_debug_on=yes; fi
248 if test "$x_debug_on" = "yes"; then
253 AC_ARG_ENABLE(strict-rfc,
254 [ --enable-strict-rfc strict RFC conformance -- may break clients!],
255 if test "$enableval" = "yes"; then
256 AC_DEFINE(STRICT_RFC, 1)
263 AC_DEFINE_UNQUOTED(TARGET_CPU, "$target_cpu" )
264 AC_DEFINE_UNQUOTED(TARGET_VENDOR, "$target_vendor" )
265 AC_DEFINE_UNQUOTED(TARGET_OS, "$target_os" )
269 if test "$GCC" = "yes"; then
270 the_CFLAGS="-Wmissing-declarations -Wpointer-arith -Wstrict-prototypes"
272 pedantic=" -pedantic"
274 $CC --version | grep 20020420 >/dev/null 2>&1
275 if test $? -eq 0; then
276 # Mac OS X (and Darwin?) ship with a slightly broken
277 # prerelease of GCC 3.1 which don't like -pedantic:
278 AC_MSG_RESULT([detected broken GNU C compiler, disabling "-pedantic"])
282 $CC --version | grep 20030304 >/dev/null 2>&1
283 if test $? -eq 0; then
284 # Mac OS X 10.3 (and Darwin 7.0?) have a strange gcc (or
285 # system header files?) which produces lots of errors when
286 # using -ansi; so we don't =:-)
287 AC_MSG_RESULT([detected broken GNU C compiler, disabling "-ansi"])
291 uname | grep "CYGWIN" >/dev/null 2>&1
292 if test $? -eq 0; then
293 # The include files of Cygwin don't like -ansi,
295 AC_MSG_RESULT([detected Cygwin, disabling "-ansi"])
299 add_CFLAGS="-pipe -Wall -W${ansi}${pedantic} $CFLAGS $CFLAGS_ADD"
302 add_CFLAGS="$CFLAGS_ADD"
305 CFLAGS="$the_CFLAGS $add_CFLAGS $add_DEFINES -DSYSCONFDIR='\"\$(sysconfdir)\"'"
307 # -- Ausgabe der Dateien --
313 MacOSX/ngircd.pbproj/Makefile \
315 src/portab/Makefile \
317 src/ngircd/Makefile \
318 src/testsuite/Makefile \
327 echo "ngIRCd has been configured with the following options:"
330 # Someone please show me a better way :) [borrowed by OpenSSH]
331 B=`eval echo ${bindir}` ; B=`eval echo ${B}`
332 S=`eval echo ${sbindir}` ; S=`eval echo ${S}`
333 C=`eval echo ${sysconfdir}` ; C=`eval echo ${C}`
334 M=`eval echo ${mandir}` ; M=`eval echo ${M}`
335 D=`eval echo ${datadir}/doc/${PACKAGE}` ; D=`eval echo ${D}`
337 echo " Host: ${host}"
338 echo " Compiler: ${CC}"
339 echo " Compiler flags: ${the_CFLAGS}"
340 test -n "$add_CFLAGS" && echo " ${add_CFLAGS}"
341 test -n "$add_DEFINES" && echo " ${add_DEFINES}"
342 test -n "$CPPFLAGS" && echo " Preprocessor flags: ${CPPFLAGS}"
343 test -n "$LDFLAGS" && echo " Linker flags: ${LDFLAGS}"
344 test -n "$LIBS" && echo " Libraries: ${LIBS}"
346 echo " 'ngircd' binary: $S"
347 echo " Configuration file: $C"
348 echo " Manual pages: $M"
349 echo " Documentation: $D"
352 echo $ECHO_N " Syslog support: $ECHO_C"
353 test "$x_syslog_on" = "yes" \
354 && echo $ECHO_N "yes $ECHO_C" \
355 || echo $ECHO_N "no $ECHO_C"
356 echo $ECHO_N " Enable debug code: $ECHO_C"
357 test "$x_debug_on" = "yes" \
361 echo $ECHO_N " zlib compression: $ECHO_C"
362 test "$x_zlib_on" = "yes" \
363 && echo $ECHO_N "yes $ECHO_C" \
364 || echo $ECHO_N "no $ECHO_C"
365 echo $ECHO_N " IRC sniffer: $ECHO_C"
366 test "$x_sniffer_on" = "yes" \
370 echo $ECHO_N " Use TCP Wrappers: $ECHO_C"
371 test "$x_tcpwrap_on" = "yes" \
372 && echo $ECHO_N "yes $ECHO_C" \
373 || echo $ECHO_N "no $ECHO_C"
374 echo $ECHO_N " Strict RFC mode: $ECHO_C"
375 test "$x_strict_rfc_on" = "yes" \
379 echo $ECHO_N " Rendezvous support: $ECHO_C"
380 test "$x_rendezvous_on" = "yes" \
381 && echo $ECHO_N "yes $ECHO_C" \
382 || echo $ECHO_N "no $ECHO_C"
383 echo $ECHO_N " IRC+ protocol: $ECHO_C"
384 test "$x_ircplus_on" = "yes" \