2 # ngIRCd -- The Next Generation IRC Daemon
3 # Copyright (c)2001,2002 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.78 2003/01/13 12:20:16 alex Exp $
14 # -- Initialisierung --
16 AC_INIT(ngircd, CVSHEAD)
17 AC_CONFIG_SRCDIR(src/ngircd/ngircd.c)
20 AM_CONFIG_HEADER(src/config.h)
22 # -- Templates fuer config.h --
24 AH_TEMPLATE([DEBUG], [Define if debug-mode should be enabled])
25 AH_TEMPLATE([HAVE_socklen_t], [Define if socklen_t exists])
26 AH_TEMPLATE([SNIFFER], [Define if IRC sniffer should be enabled])
27 AH_TEMPLATE([STRICT_RFC], [Define if ngIRCd should behave strict RFC compliant])
28 AH_TEMPLATE([USE_SYSLOG], [Define if syslog should be used for logging])
29 AH_TEMPLATE([USE_ZLIB], [Define if zlib compression should be enabled])
30 AH_TEMPLATE([IRCPLUS], [Define if IRC+ protocol should be used])
32 AH_TEMPLATE([TARGET_OS], [Target operating system name])
33 AH_TEMPLATE([TARGET_VENDOR], [Target system vendor])
34 AH_TEMPLATE([TARGET_CPU], [Target CPU name])
40 # -- Hilfsprogramme --
48 # -- Compiler Features --
57 if test `uname` = "A/UX"; then
58 # unter A/UX sollte _POSIX_SOURCE definiert sein.
59 AC_MSG_RESULT([detected A/UX, defining _POSIX_SOURCE])
60 CFLAGS="$CFLAGS -D_POSIX_SOURCE"
63 if test `uname` = "HP-UX"; then
64 # unter HP-UX 11.11 muss _XOPEN_SOURCE_EXTENDED definiert sein.
65 AC_MSG_RESULT([detected HP-UX, defining _XOPEN_SOURCE_EXTENDED])
66 CFLAGS="$CFLAGS -D_XOPEN_SOURCE_EXTENDED"
78 ctype.h errno.h fcntl.h netdb.h netinet/in.h stdlib.h string.h \
79 strings.h sys/socket.h sys/time.h unistd.h \
80 ],,AC_MSG_ERROR([required C header missing!]))
82 AC_CHECK_HEADERS([arpa/inet.h ctype.h malloc.h stdint.h varargs.h])
86 AC_MSG_CHECKING(whether socklen_t exists)
88 #include <sys/socket.h>
89 #include <sys/types.h>
94 AC_DEFINE(HAVE_socklen_t) AC_MSG_RESULT(yes)
105 AC_CHECK_LIB(UTIL,memmove)
106 AC_CHECK_LIB(socket,bind)
107 AC_CHECK_LIB(nsl,gethostent)
118 bind gethostbyaddr gethostbyname gethostname inet_ntoa memmove \
119 memset setsockopt socket strcasecmp strchr strerror strstr waitpid \
120 ],,AC_MSG_ERROR([required function missing!]))
122 AC_CHECK_FUNCS(inet_aton isdigit sigaction snprintf vsnprintf strlcpy strlcat)
124 AC_CHECK_FUNCS(poll,[AC_CHECK_HEADER(sys/poll.h)],
125 [AC_CHECK_FUNCS(select,[AC_CHECK_HEADER(sys/select.h)],
126 AC_MSG_ERROR([neither poll() nor select() is available!]))
130 # -- Konfigurationsoptionen --
133 AC_ARG_ENABLE(syslog,
134 [ --disable-syslog disable syslog (autodetected by default)],
135 [ if test "$enableval" = "yes"; then
136 AC_CHECK_HEADER(syslog.h, x_syslog_on=yes,
137 AC_MSG_ERROR([Can't enable syslog: syslog.h not found!])
141 [ AC_CHECK_HEADER(syslog.h, x_syslog_on=yes) ]
143 if test "$x_syslog_on" = "yes"; then
144 AC_DEFINE(USE_SYSLOG, 1)
145 AC_CHECK_LIB(be,syslog)
150 [ --disable-zlib disable zlib compression (autodetected by default)],
151 [ if test "$enableval" = "yes"; then
152 AC_CHECK_HEADER(zlib.h, x_zlib_on=yes,
153 AC_MSG_ERROR([Can't enable zlib: zlib.h not found!])
157 [ AC_CHECK_HEADER(zlib.h, x_zlib_on=yes) ]
159 if test "$x_zlib_on" = "yes"; then
160 AC_DEFINE(USE_ZLIB, 1)
161 AC_CHECK_LIB(z,deflate)
165 AC_ARG_ENABLE(ircplus,
166 [ --disable-ircplus disable IRC+ protocol],
167 if test "$enableval" = "no"; then x_ircplus_on=no; fi
169 if test "$x_ircplus_on" = "yes"; then
170 AC_DEFINE(IRCPLUS, 1)
173 AC_ARG_ENABLE(sniffer,
174 [ --enable-sniffer enable IRC traffic sniffer (enables debug mode)],
175 if test "$enableval" = "yes"; then
176 AC_DEFINE(SNIFFER, 1)
177 x_sniffer_on=yes; x_debug_on=yes
182 [ --enable-debug show additional debug output],
183 if test "$enableval" = "yes"; then x_debug_on=yes; fi
185 if test "$x_debug_on" = "yes"; then
189 AC_ARG_ENABLE(strict-rfc,
190 [ --enable-strict-rfc strict RFC conformance -- may break clients!],
191 if test "$enableval" = "yes"; then
192 AC_DEFINE(STRICT_RFC, 1)
200 AC_DEFINE_UNQUOTED(TARGET_CPU, "$target_cpu" )
201 AC_DEFINE_UNQUOTED(TARGET_VENDOR, "$target_vendor" )
202 AC_DEFINE_UNQUOTED(TARGET_OS, "$target_os" )
206 if test "$GCC" = "yes"; then
207 the_CFLAGS="-Wall -Wtraditional -Wpointer-arith -Wstrict-prototypes"
208 add_CFLAGS="$CFLAGS $CFLAGS_ADD"
211 add_CFLAGS="$CFLAGS_ADD"
214 CFLAGS="$the_CFLAGS $add_CFLAGS -DSYSCONFDIR='\"\$(sysconfdir)\"'"
216 # -- Ausgabe der Dateien --
223 MacOSX/ngircd.pbproj/Makefile \
225 src/portab/Makefile \
227 src/ngircd/Makefile \
228 src/testsuite/Makefile \
237 # Someone please show me a better way :) [borrowed by OpenSSH]
238 B=`eval echo ${bindir}` ; B=`eval echo ${B}`
239 S=`eval echo ${sbindir}` ; S=`eval echo ${S}`
240 C=`eval echo ${sysconfdir}` ; C=`eval echo ${C}`
241 M=`eval echo ${mandir}` ; M=`eval echo ${M}`
243 echo " host: ${host}"
244 echo " compiler: ${CC}"
245 echo " compiler flags: ${the_CFLAGS}"
246 test -n "$add_CFLAGS" && echo " ${add_CFLAGS}"
247 echo " preprocessor flags: ${CPPFLAGS}"
248 echo " linker flags: ${LDFLAGS}"
249 echo " libraries: ${LIBS}"
251 echo " 'ngircd' binary: $S"
252 echo " configuration file: $C"
253 echo " manual pages: $M"
256 echo $ECHO_N " active options: $ECHO_C"
257 test "$x_syslog_on" = "yes" && echo $ECHO_N "Syslog $ECHO_C"
258 test "$x_zlib_on" = "yes" && echo $ECHO_N "zLib $ECHO_C"
259 test "$x_debug_on" = "yes" && echo $ECHO_N "Debug $ECHO_C"
260 test "$x_sniffer_on" = "yes" && echo $ECHO_N "Sniffer $ECHO_C"
261 test "$x_strict_rfc_on" = "yes" && echo $ECHO_N "Strict-RFC $ECHO_C"
262 test "$x_ircplus_on" = "yes" && echo $ECHO_N "IRC+ $ECHO_C"