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.69.2.6 2003/03/09 22:33:19 alex Exp $
14 # -- Initialisierung --
19 AC_CONFIG_SRCDIR(src/config.h.in)
20 AM_INIT_AUTOMAKE(ngircd,0.6.x-CVS)
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([IRCPLUS], [Define if IRC+ protocol should be used])
33 AH_TEMPLATE([TARGET_OS], [Target operating system name])
34 AH_TEMPLATE([TARGET_VENDOR], [Target system vendor])
35 AH_TEMPLATE([TARGET_CPU], [Target CPU name])
41 # -- Hilfsprogramme --
49 # -- Compiler Features --
58 if test `uname` = "A/UX"; then
59 # unter A/UX sollte _POSIX_SOURCE definiert sein.
60 AC_MSG_RESULT([detected A/UX, defining _POSIX_SOURCE])
61 CFLAGS="$CFLAGS -D_POSIX_SOURCE"
64 if test `uname` = "HP-UX"; then
65 # unter HP-UX 11.11 muss _XOPEN_SOURCE_EXTENDED definiert sein.
66 AC_MSG_RESULT([detected HP-UX, defining _XOPEN_SOURCE_EXTENDED])
67 CFLAGS="$CFLAGS -D_XOPEN_SOURCE_EXTENDED"
79 ctype.h errno.h fcntl.h netdb.h netinet/in.h stdlib.h string.h \
80 strings.h sys/socket.h sys/time.h unistd.h \
81 ],,AC_MSG_ERROR([required C header missing!]))
83 AC_CHECK_HEADERS(arpa/inet.h ctype.h malloc.h stdint.h sys/select.h varargs.h)
87 AC_MSG_CHECKING(whether socklen_t exists)
89 #include <sys/socket.h>
90 #include <sys/types.h>
95 AC_DEFINE(HAVE_socklen_t) AC_MSG_RESULT(yes)
106 AC_CHECK_LIB(UTIL,memmove)
107 AC_CHECK_LIB(socket,bind)
108 AC_CHECK_LIB(nsl,gethostent)
119 bind gethostbyaddr gethostbyname gethostname inet_ntoa memmove \
120 memset select setsockopt socket strcasecmp strchr strerror \
122 ],,AC_MSG_ERROR([required function missing!]))
124 AC_CHECK_FUNCS(inet_aton isdigit sigaction snprintf vsnprintf)
126 # -- Konfigurationsoptionen --
129 AC_ARG_ENABLE(syslog,
130 [ --disable-syslog disable syslog (autodetected by default)],
131 [ if test "$enableval" = "yes"; then
132 AC_CHECK_HEADER(syslog.h, x_syslog_on=yes,
133 AC_MSG_ERROR([Can't enable syslog: syslog.h not found!])
137 [ AC_CHECK_HEADER(syslog.h, x_syslog_on=yes) ]
139 if test "$x_syslog_on" = "yes"; then
140 AC_DEFINE(USE_SYSLOG, 1)
141 AC_CHECK_LIB(be,syslog)
146 [ --disable-zlib disable zlib compression (autodetected by default)],
147 [ if test "$enableval" = "yes"; then
148 AC_CHECK_HEADER(zlib.h, x_zlib_on=yes,
149 AC_MSG_ERROR([Can't enable zlib: zlib.h not found!])
153 [ AC_CHECK_HEADER(zlib.h, x_zlib_on=yes) ]
155 if test "$x_zlib_on" = "yes"; then
156 AC_DEFINE(USE_ZLIB, 1)
157 AC_CHECK_LIB(z,deflate)
161 AC_ARG_ENABLE(ircplus,
162 [ --disable-ircplus disable IRC+ protocol],
163 if test "$enableval" = "no"; then x_ircplus_on=no; fi
165 if test "$x_ircplus_on" = "yes"; then
166 AC_DEFINE(IRCPLUS, 1)
169 AC_ARG_ENABLE(sniffer,
170 [ --enable-sniffer enable IRC traffic sniffer (enables debug mode)],
171 if test "$enableval" = "yes"; then
172 AC_DEFINE(SNIFFER, 1)
173 x_sniffer_on=yes; x_debug_on=yes
178 [ --enable-debug show additional debug output],
179 if test "$enableval" = "yes"; then x_debug_on=yes; fi
181 if test "$x_debug_on" = "yes"; then
185 AC_ARG_ENABLE(strict-rfc,
186 [ --enable-strict-rfc strict RFC conformance -- may break clients!],
187 if test "$enableval" = "yes"; then
188 AC_DEFINE(STRICT_RFC, 1)
196 AC_DEFINE_UNQUOTED(TARGET_CPU, "$target_cpu" )
197 AC_DEFINE_UNQUOTED(TARGET_VENDOR, "$target_vendor" )
198 AC_DEFINE_UNQUOTED(TARGET_OS, "$target_os" )
202 if test "$GCC" = "yes"; then
203 CFLAGS="-Wall $CFLAGS"
208 CFLAGS="$CFLAGS -DSYSCONFDIR='\"\$(sysconfdir)\"'"
210 # -- Ausgabe der Dateien --
217 MacOSX/ngircd.pbproj/Makefile \
219 src/portab/Makefile \
220 src/ngircd/Makefile \
221 src/testsuite/Makefile \
230 # Someone please show me a better way :) [borrowed by OpenSSH]
231 B=`eval echo ${bindir}` ; B=`eval echo ${B}`
232 S=`eval echo ${sbindir}` ; S=`eval echo ${S}`
233 C=`eval echo ${sysconfdir}` ; C=`eval echo ${C}`
234 M=`eval echo ${mandir}` ; M=`eval echo ${M}`
236 echo " host: ${host}"
237 echo " compiler: ${CC}"
238 echo " compiler flags: ${the_CFLAGS}"
239 echo " preprocessor flags: ${CPPFLAGS}"
240 echo " linker flags: ${LDFLAGS}"
241 echo " libraries: ${LIBS}"
243 echo " 'ngircd' binary: $S"
244 echo " configuration file: $C"
245 echo " manual pages: $M"
248 echo $ECHO_N " active options: $ECHO_C"
249 test "$x_syslog_on" = "yes" && echo $ECHO_N "Syslog $ECHO_C"
250 test "$x_zlib_on" = "yes" && echo $ECHO_N "zLib $ECHO_C"
251 test "$x_debug_on" = "yes" && echo $ECHO_N "Debug $ECHO_C"
252 test "$x_sniffer_on" = "yes" && echo $ECHO_N "Sniffer $ECHO_C"
253 test "$x_strict_rfc_on" = "yes" && echo $ECHO_N "Strict-RFC $ECHO_C"
254 test "$x_ircplus_on" = "yes" && echo $ECHO_N "IRC+ $ECHO_C"