2 # ngIRCd -- The Next Generation IRC Daemon
3 # Copyright (c)2001-2004 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.103 2004/05/15 12:24:30 alex Exp $
14 # -- Initialisation --
17 AC_INIT(ngircd, CVSHEAD)
18 AC_CONFIG_SRCDIR(src/ngircd/ngircd.c)
21 AM_CONFIG_HEADER(src/config.h)
23 # -- Templates for 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([SYSLOG], [Define if syslog should be used for logging])
30 AH_TEMPLATE([ZLIB], [Define if zlib compression should be enabled])
31 AH_TEMPLATE([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])
34 AH_TEMPLATE([IDENTAUTH], [Define if the server should do IDENT requests])
36 AH_TEMPLATE([TARGET_OS], [Target operating system name])
37 AH_TEMPLATE([TARGET_VENDOR], [Target system vendor])
38 AH_TEMPLATE([TARGET_CPU], [Target CPU name])
44 # -- Helper programs --
52 # -- Compiler Features --
57 # -- Hard coded system and compiler dependencies/features/options ... --
59 if test "$GCC" = "yes"; then
60 # We are using the GNU C compiler. Good!
61 CFLAGS="$CFLAGS -pipe -W -Wall -Wpointer-arith -Wstrict-prototypes"
66 # This is HP/UX, we need to define _XOPEN_SOURCE_EXTENDED
67 # (tested with HP/UX 11.11)
68 CFLAGS="$CFLAGS -D_XOPEN_SOURCE_EXTENDED"
72 # Add additional CFLAGS, eventually specified on the command line:
73 test -n "$CFLAGS_ADD" && CFLAGS="$CFLAGS $CFLAGS_ADD"
75 CFLAGS="$CFLAGS -DSYSCONFDIR='\"\$(sysconfdir)\"'"
84 ctype.h errno.h fcntl.h netdb.h netinet/in.h stdlib.h string.h \
85 strings.h sys/socket.h sys/time.h unistd.h \
86 ],,AC_MSG_ERROR([required C header missing!]))
88 AC_CHECK_HEADERS([arpa/inet.h ctype.h malloc.h stdint.h varargs.h])
92 AC_MSG_CHECKING(whether socklen_t exists)
94 #include <sys/socket.h>
95 #include <sys/types.h>
100 AC_DEFINE(HAVE_socklen_t) AC_MSG_RESULT(yes)
110 AC_CHECK_LIB(UTIL,memmove)
111 AC_CHECK_LIB(socket,bind)
112 AC_CHECK_LIB(nsl,gethostent)
120 bind gethostbyaddr gethostbyname gethostname inet_ntoa malloc memmove \
121 memset realloc setsid setsockopt socket strcasecmp strchr strerror \
122 strstr waitpid],,AC_MSG_ERROR([required function missing!]))
124 AC_CHECK_FUNCS(inet_aton isdigit sigaction snprintf vsnprintf strlcpy strlcat)
126 AC_CHECK_FUNCS(select,[AC_CHECK_HEADERS(sys/select.h)],
127 AC_MSG_ERROR([required function select() is missing!])
130 # -- Configuration options --
134 [ --without-syslog disable syslog (autodetected by default)],
135 [ if test "$withval" = "yes"; then
136 AC_CHECK_LIB(be, syslog)
137 AC_CHECK_FUNCS(syslog, x_syslog_on=yes,
138 AC_MSG_ERROR([Can't enable syslog!])
143 AC_CHECK_LIB(be, syslog)
144 AC_CHECK_FUNCS(syslog, x_syslog_on=yes)
147 if test "$x_syslog_on" = "yes"; then
149 AC_CHECK_HEADERS(syslog.h,,AC_MSG_ERROR([required C header missing!]))
154 [ --without-zlib disable zlib compression (autodetected by default)],
155 [ if test "$withval" = "yes"; then
156 AC_CHECK_LIB(z, deflate)
157 AC_CHECK_FUNCS(deflate, x_zlib_on=yes,
158 AC_MSG_ERROR([Can't enable zlib!])
162 [ AC_CHECK_LIB(z, deflate)
163 AC_CHECK_FUNCS(deflate, x_zlib_on=yes)
166 if test "$x_zlib_on" = "yes"; then
168 AC_CHECK_HEADERS(zlib.h,,AC_MSG_ERROR([required C header missing!]))
172 AC_ARG_WITH(tcp-wrappers,
173 [ --with-tcp-wrappers enable TCP wrappers support],
174 [ if test "$withval" = "yes"; then
175 AC_CHECK_LIB(wrap, tcpd_warn)
176 AC_MSG_CHECKING(for hosts_access)
184 AC_DEFINE(TCPWRAP, 1)
188 AC_MSG_ERROR([Can't enable TCP wrappers!])
195 AC_ARG_WITH(rendezvous,
196 [ --with-rendezvous enable support for "Rendezvous"],
197 [ if test "$withval" = "yes"; then
198 AC_CHECK_FUNCS(DNSServiceRegistrationCreate, x_rendezvous_on=yes,
199 AC_MSG_ERROR([Can't enable Rendezvous!])
204 if test "$x_rendezvous_on" = "yes"; then
205 AC_DEFINE(RENDEZVOUS, 1)
206 AC_CHECK_HEADERS([DNSServiceDiscovery/DNSServiceDiscovery.h \
207 mach/port.h],,AC_MSG_ERROR([required C header missing!]))
212 [ --with-ident enable "IDENT" ("AUTH") protocol support],
213 [ if test "$withval" = "yes"; then
214 AC_CHECK_LIB(ident, ident_id)
215 AC_CHECK_FUNCS(ident_id, x_identauth_on=yes,
216 AC_MSG_ERROR([Can't enable IDENT support!])
221 if test "$x_identauth_on" = "yes"; then
222 AC_DEFINE(IDENTAUTH, 1)
223 AC_CHECK_HEADERS(ident.h,,AC_MSG_ERROR([required C header missing!]))
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
250 test "$GCC" = "yes" && CFLAGS="-pedantic $CFLAGS"
254 AC_ARG_ENABLE(strict-rfc,
255 [ --enable-strict-rfc strict RFC conformance -- may break clients!],
256 if test "$enableval" = "yes"; then
257 AC_DEFINE(STRICT_RFC, 1)
264 AC_DEFINE_UNQUOTED(TARGET_CPU, "$target_cpu" )
265 AC_DEFINE_UNQUOTED(TARGET_VENDOR, "$target_vendor" )
266 AC_DEFINE_UNQUOTED(TARGET_OS, "$target_os" )
268 # Add additional CFLAGS, eventually specified on the command line, but after
269 # running this configure script. Useful for "-Werror" for example.
270 test -n "$CFLAGS_END" && CFLAGS="$CFLAGS $CFLAGS_END"
272 # -- Generate files --
278 src/portab/Makefile \
280 src/ngircd/Makefile \
281 src/testsuite/Makefile \
284 contrib/Debian/Makefile \
285 contrib/MacOSX/Makefile \
288 type dpkg >/dev/null 2>&1
289 if test $? -eq 0; then
290 # Generate debian/ link if the dpkg command exists
291 # (read: if we are running on a debian compatible system)
292 echo "creating Debian-specific links ..."
293 test -f debian/rules || ln -s contrib/Debian debian
299 echo "ngIRCd has been configured with the following options:"
302 # Someone please show me a better way :) [borrowed by OpenSSH]
303 B=`eval echo ${bindir}` ; B=`eval echo ${B}`
304 S=`eval echo ${sbindir}` ; S=`eval echo ${S}`
305 C=`eval echo ${sysconfdir}` ; C=`eval echo ${C}`
306 M=`eval echo ${mandir}` ; M=`eval echo ${M}`
307 D=`eval echo ${datadir}/doc/${PACKAGE}` ; D=`eval echo ${D}`
309 echo " Target: ${target}"
310 test "$target" != "$host" && echo " Host: ${host}"
311 echo " Compiler: ${CC}"
312 test -n "$CFLAGS" && echo " Compiler flags: ${CFLAGS}"
313 test -n "$CPPFLAGS" && echo " Preprocessor flags: ${CPPFLAGS}"
314 test -n "$LDFLAGS" && echo " Linker flags: ${LDFLAGS}"
315 test -n "$LIBS" && echo " Libraries: ${LIBS}"
317 echo " 'ngircd' binary: $S"
318 echo " Configuration file: $C"
319 echo " Manual pages: $M"
320 echo " Documentation: $D"
323 echo $ECHO_N " Syslog support: $ECHO_C"
324 test "$x_syslog_on" = "yes" \
325 && echo $ECHO_N "yes $ECHO_C" \
326 || echo $ECHO_N "no $ECHO_C"
327 echo $ECHO_N " Enable debug code: $ECHO_C"
328 test "$x_debug_on" = "yes" \
332 echo $ECHO_N " zlib compression: $ECHO_C"
333 test "$x_zlib_on" = "yes" \
334 && echo $ECHO_N "yes $ECHO_C" \
335 || echo $ECHO_N "no $ECHO_C"
336 echo $ECHO_N " IRC sniffer: $ECHO_C"
337 test "$x_sniffer_on" = "yes" \
341 echo $ECHO_N " Use TCP Wrappers: $ECHO_C"
342 test "$x_tcpwrap_on" = "yes" \
343 && echo $ECHO_N "yes $ECHO_C" \
344 || echo $ECHO_N "no $ECHO_C"
345 echo $ECHO_N " Strict RFC mode: $ECHO_C"
346 test "$x_strict_rfc_on" = "yes" \
350 echo $ECHO_N " Rendezvous support: $ECHO_C"
351 test "$x_rendezvous_on" = "yes" \
352 && echo $ECHO_N "yes $ECHO_C" \
353 || echo $ECHO_N "no $ECHO_C"
354 echo $ECHO_N " IRC+ protocol: $ECHO_C"
355 test "$x_ircplus_on" = "yes" \
359 echo $ECHO_N " IDENT support: $ECHO_C"
360 test "$x_identauth_on" = "yes" \
361 && echo $ECHO_N "yes $ECHO_C" \
362 || echo $ECHO_N "no $ECHO_C"