2 # ngIRCd -- The Next Generation IRC Daemon
3 # Copyright (c)2001,2002 by Alexander Barton (alex@barton.de)
5 # Dieses Programm ist freie Software. Sie koennen es unter den Bedingungen
6 # der GNU General Public License (GPL), wie von der Free Software Foundation
7 # herausgegeben, weitergeben und/oder modifizieren, entweder unter Version 2
8 # der Lizenz oder (wenn Sie es wuenschen) jeder spaeteren Version.
9 # Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
10 # der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
12 # $Id: configure.in,v 1.75 2002/12/28 21:58:02 alex Exp $
15 # -- Initialisierung --
20 AC_CONFIG_SRCDIR(src/config.h.in)
21 AM_INIT_AUTOMAKE(ngircd,CVSHEAD)
22 AM_CONFIG_HEADER(src/config.h)
24 # -- Templates fuer config.h --
26 AH_TEMPLATE([DEBUG], [Define if debug-mode should be enabled])
27 AH_TEMPLATE([HAVE_socklen_t], [Define if socklen_t exists])
28 AH_TEMPLATE([SNIFFER], [Define if IRC sniffer should be enabled])
29 AH_TEMPLATE([STRICT_RFC], [Define if ngIRCd should behave strict RFC compliant])
30 AH_TEMPLATE([USE_SYSLOG], [Define if syslog should be used for logging])
31 AH_TEMPLATE([USE_ZLIB], [Define if zlib compression should be enabled])
32 AH_TEMPLATE([IRCPLUS], [Define if IRC+ protocol should be used])
34 AH_TEMPLATE([TARGET_OS], [Target operating system name])
35 AH_TEMPLATE([TARGET_VENDOR], [Target system vendor])
36 AH_TEMPLATE([TARGET_CPU], [Target CPU name])
42 # -- Hilfsprogramme --
50 # -- Compiler Features --
59 if test `uname` = "A/UX"; then
60 # unter A/UX sollte _POSIX_SOURCE definiert sein.
61 AC_MSG_RESULT([detected A/UX, defining _POSIX_SOURCE])
62 CFLAGS="$CFLAGS -D_POSIX_SOURCE"
65 if test `uname` = "HP-UX"; then
66 # unter HP-UX 11.11 muss _XOPEN_SOURCE_EXTENDED definiert sein.
67 AC_MSG_RESULT([detected HP-UX, defining _XOPEN_SOURCE_EXTENDED])
68 CFLAGS="$CFLAGS -D_XOPEN_SOURCE_EXTENDED"
80 ctype.h errno.h fcntl.h netdb.h netinet/in.h stdlib.h string.h \
81 strings.h sys/socket.h sys/time.h unistd.h \
82 ],,AC_MSG_ERROR([required C header missing!]))
84 AC_CHECK_HEADERS([arpa/inet.h ctype.h malloc.h stdint.h varargs.h])
88 AC_MSG_CHECKING(whether socklen_t exists)
90 #include <sys/socket.h>
91 #include <sys/types.h>
96 AC_DEFINE(HAVE_socklen_t) AC_MSG_RESULT(yes)
107 AC_CHECK_LIB(UTIL,memmove)
108 AC_CHECK_LIB(socket,bind)
109 AC_CHECK_LIB(nsl,gethostent)
120 bind gethostbyaddr gethostbyname gethostname inet_ntoa memmove \
121 memset setsockopt socket strcasecmp strchr strerror strstr waitpid \
122 ],,AC_MSG_ERROR([required function missing!]))
124 AC_CHECK_FUNCS(inet_aton isdigit sigaction snprintf vsnprintf strlcpy strlcat)
126 AC_CHECK_FUNCS(poll,[AC_CHECK_HEADER(sys/poll.h)],
127 [AC_CHECK_FUNCS(select,[AC_CHECK_HEADER(sys/select.h)],
128 AC_MSG_ERROR([neither poll() nor select() is available!]))
132 # -- Konfigurationsoptionen --
135 AC_ARG_ENABLE(syslog,
136 [ --disable-syslog disable syslog (autodetected by default)],
137 [ if test "$enableval" = "yes"; then
138 AC_CHECK_HEADER(syslog.h, x_syslog_on=yes,
139 AC_MSG_ERROR([Can't enable syslog: syslog.h not found!])
143 [ AC_CHECK_HEADER(syslog.h, x_syslog_on=yes) ]
145 if test "$x_syslog_on" = "yes"; then
146 AC_DEFINE(USE_SYSLOG, 1)
147 AC_CHECK_LIB(be,syslog)
152 [ --disable-zlib disable zlib compression (autodetected by default)],
153 [ if test "$enableval" = "yes"; then
154 AC_CHECK_HEADER(zlib.h, x_zlib_on=yes,
155 AC_MSG_ERROR([Can't enable zlib: zlib.h not found!])
159 [ AC_CHECK_HEADER(zlib.h, x_zlib_on=yes) ]
161 if test "$x_zlib_on" = "yes"; then
162 AC_DEFINE(USE_ZLIB, 1)
163 AC_CHECK_LIB(z,deflate)
167 AC_ARG_ENABLE(ircplus,
168 [ --disable-ircplus disable IRC+ protocol],
169 if test "$enableval" = "no"; then x_ircplus_on=no; fi
171 if test "$x_ircplus_on" = "yes"; then
172 AC_DEFINE(IRCPLUS, 1)
175 AC_ARG_ENABLE(sniffer,
176 [ --enable-sniffer enable IRC traffic sniffer (enables debug mode)],
177 if test "$enableval" = "yes"; then
178 AC_DEFINE(SNIFFER, 1)
179 x_sniffer_on=yes; x_debug_on=yes
184 [ --enable-debug show additional debug output],
185 if test "$enableval" = "yes"; then x_debug_on=yes; fi
187 if test "$x_debug_on" = "yes"; then
191 AC_ARG_ENABLE(strict-rfc,
192 [ --enable-strict-rfc strict RFC conformance -- may break clients!],
193 if test "$enableval" = "yes"; then
194 AC_DEFINE(STRICT_RFC, 1)
202 AC_DEFINE_UNQUOTED(TARGET_CPU, "$target_cpu" )
203 AC_DEFINE_UNQUOTED(TARGET_VENDOR, "$target_vendor" )
204 AC_DEFINE_UNQUOTED(TARGET_OS, "$target_os" )
208 if test "$GCC" = "yes"; then
209 the_CFLAGS="-Wall -Wtraditional -Wpointer-arith -Wstrict-prototypes"
210 add_CFLAGS="$CFLAGS $CFLAGS_ADD"
213 add_CFLAGS="$CFLAGS_ADD"
216 CFLAGS="$the_CFLAGS $add_CFLAGS -DSYSCONFDIR='\"\$(sysconfdir)\"'"
218 # -- Ausgabe der Dateien --
225 MacOSX/ngircd.pbproj/Makefile \
227 src/portab/Makefile \
228 src/ngircd/Makefile \
229 src/testsuite/Makefile \
238 # Someone please show me a better way :) [borrowed by OpenSSH]
239 B=`eval echo ${bindir}` ; B=`eval echo ${B}`
240 S=`eval echo ${sbindir}` ; S=`eval echo ${S}`
241 C=`eval echo ${sysconfdir}` ; C=`eval echo ${C}`
242 M=`eval echo ${mandir}` ; M=`eval echo ${M}`
244 echo " host: ${host}"
245 echo " compiler: ${CC}"
246 echo " compiler flags: ${the_CFLAGS}"
247 test -n "$add_CFLAGS" && echo " ${add_CFLAGS}"
248 echo " preprocessor flags: ${CPPFLAGS}"
249 echo " linker flags: ${LDFLAGS}"
250 echo " libraries: ${LIBS}"
252 echo " 'ngircd' binary: $S"
253 echo " configuration file: $C"
254 echo " manual pages: $M"
257 echo $ECHO_N " active options: $ECHO_C"
258 test "$x_syslog_on" = "yes" && echo $ECHO_N "Syslog $ECHO_C"
259 test "$x_zlib_on" = "yes" && echo $ECHO_N "zLib $ECHO_C"
260 test "$x_debug_on" = "yes" && echo $ECHO_N "Debug $ECHO_C"
261 test "$x_sniffer_on" = "yes" && echo $ECHO_N "Sniffer $ECHO_C"
262 test "$x_strict_rfc_on" = "yes" && echo $ECHO_N "Strict-RFC $ECHO_C"
263 test "$x_ircplus_on" = "yes" && echo $ECHO_N "IRC+ $ECHO_C"