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.89.2.7 2003/07/09 18:57:20 alex Exp $
14 # -- Initialisierung --
17 AC_INIT(ngircd, 0.7-CVS)
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` = "Linux"; then
61 # define _POSIX_SOURCE, _GNU_SOURCE and _BSD_SOURCE when compiling
62 # on Linux (glibc-based systems):
63 AC_MSG_RESULT([detected Linux, defining _POSIX_SOURCE, _GNU_SOURCE and _BSD_SOURCE])
64 add_DEFINES="-D_POSIX_SOURCE -D_GNU_SOURCE -D_BSD_SOURCE $add_DEFINES"
67 if test `uname` = "A/UX"; then
68 # define _POSIX_SOURCE when compiling on A/UX:
69 AC_MSG_RESULT([detected A/UX, defining _POSIX_SOURCE])
70 add_DEFINES="-D_POSIX_SOURCE $add_DEFINES"
73 if test `uname` = "HP-UX"; then
74 # define _XOPEN_SOURCE_EXTENDED when compiling on HP-UX (11.11):
75 AC_MSG_RESULT([detected HP-UX, defining _XOPEN_SOURCE_EXTENDED])
76 add_DEFINES="-D_XOPEN_SOURCE_EXTENDED $add_DEFINES"
79 if test `uname` = "SunOS"; then
80 # define _XOPEN_SOURCE, _XOPEN_SOURCE_EXTENDED=1 and __EXTENSIONS__
81 # when compiling on SunOS (tested with 5.6):
82 AC_MSG_RESULT([detected SunOS, defining _XOPEN_SOURCE, _XOPEN_SOURCE_EXTENDED=1 and __EXTENSIONS__])
83 add_DEFINES="-D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1 -D__EXTENSIONS__ $add_DEFINES"
95 ctype.h errno.h fcntl.h netdb.h netinet/in.h stdlib.h string.h \
96 strings.h sys/socket.h sys/time.h unistd.h \
97 ],,AC_MSG_ERROR([required C header missing!]))
99 AC_CHECK_HEADERS([arpa/inet.h ctype.h malloc.h stdint.h varargs.h])
103 AC_MSG_CHECKING(whether socklen_t exists)
105 #include <sys/socket.h>
106 #include <sys/types.h>
109 a = 2; b = 4; a += b;
111 AC_DEFINE(HAVE_socklen_t) AC_MSG_RESULT(yes)
122 AC_CHECK_LIB(UTIL,memmove)
123 AC_CHECK_LIB(socket,bind)
124 AC_CHECK_LIB(nsl,gethostent)
135 bind gethostbyaddr gethostbyname gethostname inet_ntoa memmove \
136 memset setsockopt socket strcasecmp strchr strerror strstr waitpid \
137 ],,AC_MSG_ERROR([required function missing!]))
139 AC_CHECK_FUNCS(inet_aton isdigit sigaction snprintf vsnprintf strlcpy strlcat)
141 AC_CHECK_FUNCS(select,[AC_CHECK_HEADERS(sys/select.h)],
142 AC_MSG_ERROR([required function select() is missing!])
145 # -- Konfigurationsoptionen --
149 [ --without-syslog disable syslog (autodetected by default)],
150 [ if test "$withval" = "yes"; then
151 AC_CHECK_LIB(be, syslog)
152 AC_CHECK_FUNCS(syslog, x_syslog_on=yes,
153 AC_MSG_ERROR([Can't enable syslog!])
158 AC_CHECK_LIB(be, syslog)
159 AC_CHECK_FUNCS(syslog, x_syslog_on=yes)
162 if test "$x_syslog_on" = "yes"; then
163 AC_DEFINE(USE_SYSLOG, 1)
164 AC_CHECK_HEADERS(syslog.h)
169 [ --without-zlib disable zlib compression (autodetected by default)],
170 [ if test "$withval" = "yes"; then
171 AC_CHECK_LIB(z, deflate)
172 AC_CHECK_FUNCS(deflate, x_zlib_on=yes,
173 AC_MSG_ERROR([Can't enable zlib!])
177 [ AC_CHECK_LIB(z, deflate)
178 AC_CHECK_FUNCS(deflate, x_zlib_on=yes)
181 if test "$x_zlib_on" = "yes"; then
182 AC_DEFINE(USE_ZLIB, 1)
183 AC_CHECK_HEADERS(zlib.h)
187 AC_ARG_WITH(tcp-wrappers,
188 [ --with-tcp-wrappers enable TCP wrappers support],
189 [ if test "$withval" = "yes"; then
190 AC_CHECK_LIB(wrap, tcpd_warn)
191 AC_MSG_CHECKING(for hosts_access)
199 AC_DEFINE(USE_TCPWRAP, 1)
203 AC_MSG_ERROR([Can't enable TCP wrappers!])
210 AC_ARG_WITH(rendezvous,
211 [ --with-rendezvous enable support for "Rendezvous"],
212 [ if test "$withval" = "yes"; then
213 AC_CHECK_FUNCS(DNSServiceRegistrationCreate, x_rendezvous_on=yes,
214 AC_MSG_ERROR([Can't enable Rendezvous!])
219 if test "$x_rendezvous_on" = "yes"; then
220 AC_DEFINE(RENDEZVOUS, 1)
221 AC_CHECK_HEADERS(DNSServiceDiscovery/DNSServiceDiscovery.h mach/port.h)
225 AC_ARG_ENABLE(ircplus,
226 [ --disable-ircplus disable IRC+ protocol],
227 if test "$enableval" = "no"; then x_ircplus_on=no; fi
229 if test "$x_ircplus_on" = "yes"; then
230 AC_DEFINE(IRCPLUS, 1)
233 x_sniffer_on=no; x_debug_on=no
234 AC_ARG_ENABLE(sniffer,
235 [ --enable-sniffer enable IRC traffic sniffer (enables debug mode)],
236 if test "$enableval" = "yes"; then
237 AC_DEFINE(SNIFFER, 1)
238 x_sniffer_on=yes; x_debug_on=yes
243 [ --enable-debug show additional debug output],
244 if test "$enableval" = "yes"; then x_debug_on=yes; fi
246 if test "$x_debug_on" = "yes"; then
251 AC_ARG_ENABLE(strict-rfc,
252 [ --enable-strict-rfc strict RFC conformance -- may break clients!],
253 if test "$enableval" = "yes"; then
254 AC_DEFINE(STRICT_RFC, 1)
261 AC_DEFINE_UNQUOTED(TARGET_CPU, "$target_cpu" )
262 AC_DEFINE_UNQUOTED(TARGET_VENDOR, "$target_vendor" )
263 AC_DEFINE_UNQUOTED(TARGET_OS, "$target_os" )
267 if test "$GCC" = "yes"; then
268 the_CFLAGS="-Wmissing-declarations -Wpointer-arith -Wstrict-prototypes"
270 pedantic=" -pedantic"
272 $CC --version | grep 20020420 > /dev/null 2>&1
273 if test $? -eq 0; then
274 # Mac OS X (and Darwin?) ship with a slightly broken
275 # prerelease of GCC 3.1 which don't like -pedantic:
276 AC_MSG_RESULT([detected broken GNU C compiler, disabling "-pedantic"])
280 uname | grep "CYGWIN" > /dev/null 2>&1
281 if test $? -eq 0; then
282 # The include files of Cygwin don't like -ansi,
284 AC_MSG_RESULT([detected Cygwin, disabling "-ansi"])
288 add_CFLAGS="-Wall -W${ansi}${pedantic} $CFLAGS $CFLAGS_ADD"
291 add_CFLAGS="$CFLAGS_ADD"
294 CFLAGS="$the_CFLAGS $add_CFLAGS $add_DEFINES -DSYSCONFDIR='\"\$(sysconfdir)\"'"
296 # -- Ausgabe der Dateien --
302 MacOSX/ngircd.pbproj/Makefile \
304 src/portab/Makefile \
306 src/ngircd/Makefile \
307 src/testsuite/Makefile \
315 echo "ngIRCd has been configured with the following options:"
318 # Someone please show me a better way :) [borrowed by OpenSSH]
319 B=`eval echo ${bindir}` ; B=`eval echo ${B}`
320 S=`eval echo ${sbindir}` ; S=`eval echo ${S}`
321 C=`eval echo ${sysconfdir}` ; C=`eval echo ${C}`
322 M=`eval echo ${mandir}` ; M=`eval echo ${M}`
323 D=`eval echo ${datadir}/doc/${PACKAGE}` ; D=`eval echo ${D}`
325 echo " Host: ${host}"
326 echo " Compiler: ${CC}"
327 echo " Compiler flags: ${the_CFLAGS}"
328 test -n "$add_CFLAGS" && echo " ${add_CFLAGS}"
329 test -n "$add_DEFINES" && echo " ${add_DEFINES}"
330 test -n "$CPPFLAGS" && echo " Preprocessor flags: ${CPPFLAGS}"
331 test -n "$LDFLAGS" && echo " Linker flags: ${LDFLAGS}"
332 test -n "$LIBS" && echo " Libraries: ${LIBS}"
334 echo " 'ngircd' binary: $S"
335 echo " Configuration file: $C"
336 echo " Manual pages: $M"
337 echo " Documentation: $D"
340 echo $ECHO_N " Syslog support: $ECHO_C"
341 test "$x_syslog_on" = "yes" \
342 && echo $ECHO_N "yes $ECHO_C" \
343 || echo $ECHO_N "no $ECHO_C"
344 echo $ECHO_N " Enable debug code: $ECHO_C"
345 test "$x_debug_on" = "yes" \
349 echo $ECHO_N " zlib compression: $ECHO_C"
350 test "$x_zlib_on" = "yes" \
351 && echo $ECHO_N "yes $ECHO_C" \
352 || echo $ECHO_N "no $ECHO_C"
353 echo $ECHO_N " IRC sniffer: $ECHO_C"
354 test "$x_sniffer_on" = "yes" \
358 echo $ECHO_N " Use TCP Wrappers: $ECHO_C"
359 test "$x_tcpwrap_on" = "yes" \
360 && echo $ECHO_N "yes $ECHO_C" \
361 || echo $ECHO_N "no $ECHO_C"
362 echo $ECHO_N " Strict RFC mode: $ECHO_C"
363 test "$x_strict_rfc_on" = "yes" \
367 echo $ECHO_N " Rendezvous support: $ECHO_C"
368 test "$x_rendezvous_on" = "yes" \
369 && echo $ECHO_N "yes $ECHO_C" \
370 || echo $ECHO_N "no $ECHO_C"
371 echo $ECHO_N " IRC+ protocol: $ECHO_C"
372 test "$x_ircplus_on" = "yes" \