2 # ngIRCd -- The Next Generation IRC Daemon
3 # Copyright (c)2001-2005 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.111.2.2 2005/07/09 11:57:07 alex Exp $
14 # -- Initialisation --
17 AC_INIT(ngircd, 0.9.0-pre1)
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 stdbool.h stddef.h varargs.h])
92 AC_MSG_CHECKING(whether socklen_t exists)
94 #include <sys/types.h>
95 #include <sys/socket.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 strdup 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" != "no"; then
136 if test "$withval" != "yes"; then
137 CFLAGS="-I$withval/include $CFLAGS"
138 CPPFLAGS="-I$withval/include $CPPFLAGS"
139 LDFLAGS="-L$withval/lib $LDFLAGS"
141 AC_CHECK_LIB(be, syslog)
142 AC_CHECK_FUNCS(syslog, x_syslog_on=yes,
143 AC_MSG_ERROR([Can't enable syslog!])
148 AC_CHECK_LIB(be, syslog)
149 AC_CHECK_FUNCS(syslog, x_syslog_on=yes)
152 if test "$x_syslog_on" = "yes"; then
154 AC_CHECK_HEADERS(syslog.h,,AC_MSG_ERROR([required C header missing!]))
159 [ --without-zlib disable zlib compression (autodetected by default)],
160 [ if test "$withval" != "no"; then
161 if test "$withval" != "yes"; then
162 CFLAGS="-I$withval/include $CFLAGS"
163 CPPFLAGS="-I$withval/include $CPPFLAGS"
164 LDFLAGS="-L$withval/lib $LDFLAGS"
166 AC_CHECK_LIB(z, deflate)
167 AC_CHECK_FUNCS(deflate, x_zlib_on=yes,
168 AC_MSG_ERROR([Can't enable zlib!])
172 [ AC_CHECK_LIB(z, deflate)
173 AC_CHECK_FUNCS(deflate, x_zlib_on=yes)
176 if test "$x_zlib_on" = "yes"; then
178 AC_CHECK_HEADERS(zlib.h,,AC_MSG_ERROR([required C header missing!]))
182 AC_ARG_WITH(tcp-wrappers,
183 [ --with-tcp-wrappers enable TCP wrappers support],
184 [ if test "$withval" != "no"; then
185 if test "$withval" != "yes"; then
186 CFLAGS="-I$withval/include $CFLAGS"
187 CPPFLAGS="-I$withval/include $CPPFLAGS"
188 LDFLAGS="-L$withval/lib $LDFLAGS"
190 AC_MSG_CHECKING(for hosts_access)
194 int allow_severity = 0;
195 int deny_severity = 0;
197 tcpd_warn("link test");
200 AC_DEFINE(TCPWRAP, 1)
204 AC_MSG_ERROR([Can't enable TCP wrappers!])
211 AC_ARG_WITH(rendezvous,
212 [ --with-rendezvous enable support for "Rendezvous"],
213 [ if test "$withval" != "no"; then
214 if test "$withval" != "yes"; then
215 CFLAGS="-I$withval/include $CFLAGS"
216 CPPFLAGS="-I$withval/include $CPPFLAGS"
217 LDFLAGS="-L$withval/lib $LDFLAGS"
219 AC_CHECK_FUNCS(DNSServiceRegistrationCreate, x_rendezvous_on=osx,
221 AC_CHECK_LIB(pthread, pthread_mutexattr_init)
222 AC_CHECK_LIB(howl, sw_discovery_init)
223 AC_CHECK_FUNCS(sw_discovery_init, \
224 x_rendezvous_on=howl, \
225 AC_MSG_ERROR([Can't enable Rendezvous!]))
230 if test "$x_rendezvous_on" = "osx"; then
231 AC_CHECK_HEADERS([DNSServiceDiscovery/DNSServiceDiscovery.h \
232 mach/port.h],,AC_MSG_ERROR([required C header missing!]))
233 AC_DEFINE(RENDEZVOUS, 1)
235 if test "$x_rendezvous_on" = "howl"; then
236 for dir in /usr/local/include /usr/local/include/howl* \
237 /usr/include /usr/include/howl*; do
238 test -d "$dir" || continue
239 AC_MSG_CHECKING([for Howl headers in $dir])
240 if test -f "$dir/rendezvous/rendezvous.h"; then
241 if test "$dir" != "/usr/local/include" -a \
242 "$dir" != "/usr/include"; then
243 CFLAGS="-I$dir $CFLAGS"
244 CPPFLAGS="-I$dir $CPPFLAGS"
252 AC_CHECK_HEADERS([rendezvous/rendezvous.h],, \
253 AC_MSG_ERROR([required C header missing!]))
254 AC_DEFINE(RENDEZVOUS, 1)
259 [ --with-ident enable "IDENT" ("AUTH") protocol support],
260 [ if test "$withval" != "no"; then
261 if test "$withval" != "yes"; then
262 CFLAGS="-I$withval/include $CFLAGS"
263 CPPFLAGS="-I$withval/include $CPPFLAGS"
264 LDFLAGS="-L$withval/lib $LDFLAGS"
266 AC_CHECK_LIB(ident, ident_id)
267 AC_CHECK_FUNCS(ident_id, x_identauth_on=yes,
268 AC_MSG_ERROR([Can't enable IDENT support!])
273 if test "$x_identauth_on" = "yes"; then
274 AC_DEFINE(IDENTAUTH, 1)
275 AC_CHECK_HEADERS(ident.h,,AC_MSG_ERROR([required C header missing!]))
279 AC_ARG_ENABLE(ircplus,
280 [ --disable-ircplus disable IRC+ protocol],
281 if test "$enableval" = "no"; then x_ircplus_on=no; fi
283 if test "$x_ircplus_on" = "yes"; then
284 AC_DEFINE(IRCPLUS, 1)
287 x_sniffer_on=no; x_debug_on=no
288 AC_ARG_ENABLE(sniffer,
289 [ --enable-sniffer enable IRC traffic sniffer (enables debug mode)],
290 if test "$enableval" = "yes"; then
291 AC_DEFINE(SNIFFER, 1)
292 x_sniffer_on=yes; x_debug_on=yes
297 [ --enable-debug show additional debug output],
298 if test "$enableval" = "yes"; then x_debug_on=yes; fi
300 if test "$x_debug_on" = "yes"; then
302 test "$GCC" = "yes" && CFLAGS="-pedantic $CFLAGS"
306 AC_ARG_ENABLE(strict-rfc,
307 [ --enable-strict-rfc strict RFC conformance -- may break clients!],
308 if test "$enableval" = "yes"; then
309 AC_DEFINE(STRICT_RFC, 1)
316 AC_DEFINE_UNQUOTED(TARGET_CPU, "$target_cpu" )
317 AC_DEFINE_UNQUOTED(TARGET_VENDOR, "$target_vendor" )
318 AC_DEFINE_UNQUOTED(TARGET_OS, "$target_os" )
320 # Add additional CFLAGS, eventually specified on the command line, but after
321 # running this configure script. Useful for "-Werror" for example.
322 test -n "$CFLAGS_END" && CFLAGS="$CFLAGS $CFLAGS_END"
324 # -- Generate files --
330 src/portab/Makefile \
332 src/ngircd/Makefile \
333 src/testsuite/Makefile \
336 contrib/Debian/Makefile \
337 contrib/MacOSX/Makefile \
340 type dpkg >/dev/null 2>&1
341 if test $? -eq 0; then
342 # Generate debian/ link if the dpkg command exists
343 # (read: if we are running on a debian compatible system)
344 echo "creating Debian-specific links ..."
345 test -f debian/rules || ln -s contrib/Debian debian
351 echo "ngIRCd $PACKAGE_VERSION has been configured with the following options:"
354 # Someone please show me a better way :) [borrowed by OpenSSH]
355 B=`eval echo ${bindir}` ; B=`eval echo ${B}`
356 S=`eval echo ${sbindir}` ; S=`eval echo ${S}`
357 C=`eval echo ${sysconfdir}` ; C=`eval echo ${C}`
358 M=`eval echo ${mandir}` ; M=`eval echo ${M}`
359 D=`eval echo ${datadir}/doc/${PACKAGE}` ; D=`eval echo ${D}`
361 echo " Target: ${target}"
362 test "$target" != "$host" && echo " Host: ${host}"
363 echo " Compiler: ${CC}"
364 test -n "$CFLAGS" && echo " Compiler flags: ${CFLAGS}"
365 test -n "$CPPFLAGS" && echo " Preprocessor flags: ${CPPFLAGS}"
366 test -n "$LDFLAGS" && echo " Linker flags: ${LDFLAGS}"
367 test -n "$LIBS" && echo " Libraries: ${LIBS}"
369 echo " 'ngircd' binary: $S"
370 echo " Configuration file: $C"
371 echo " Manual pages: $M"
372 echo " Documentation: $D"
375 echo $ECHO_N " Syslog support: $ECHO_C"
376 test "$x_syslog_on" = "yes" \
377 && echo $ECHO_N "yes $ECHO_C" \
378 || echo $ECHO_N "no $ECHO_C"
379 echo $ECHO_N " Enable debug code: $ECHO_C"
380 test "$x_debug_on" = "yes" \
384 echo $ECHO_N " zlib compression: $ECHO_C"
385 test "$x_zlib_on" = "yes" \
386 && echo $ECHO_N "yes $ECHO_C" \
387 || echo $ECHO_N "no $ECHO_C"
388 echo $ECHO_N " IRC sniffer: $ECHO_C"
389 test "$x_sniffer_on" = "yes" \
393 echo $ECHO_N " Use TCP Wrappers: $ECHO_C"
394 test "$x_tcpwrap_on" = "yes" \
395 && echo $ECHO_N "yes $ECHO_C" \
396 || echo $ECHO_N "no $ECHO_C"
397 echo $ECHO_N " Strict RFC mode: $ECHO_C"
398 test "$x_strict_rfc_on" = "yes" \
402 echo $ECHO_N " Rendezvous support: $ECHO_C"
403 test "$x_rendezvous_on" = "osx" -o "$x_rendezvous_on" = "howl" \
404 && echo $ECHO_N "yes $ECHO_C" \
405 || echo $ECHO_N "no $ECHO_C"
406 echo $ECHO_N " IRC+ protocol: $ECHO_C"
407 test "$x_ircplus_on" = "yes" \
411 echo $ECHO_N " IDENT support: $ECHO_C"
412 test "$x_identauth_on" = "yes" \
413 && echo $ECHO_N "yes $ECHO_C" \
414 || echo $ECHO_N "no $ECHO_C"