]> arthur.barton.de Git - ngircd-alex.git/blob - configure.ng
Change the certificate fingerprint digest to sha256
[ngircd-alex.git] / configure.ng
1 #
2 # ngIRCd -- The Next Generation IRC Daemon
3 # Copyright (c)2001-2013 Alexander Barton (alex@barton.de) and Contributors
4 #
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.
10 #
11
12 define(VERSION_ID,esyscmd([
13         V=`git describe 2>/dev/null | sed -e 's/rel-//g' | sed -e 's/-/~/'`;
14         [ -z "$V" -a -r configure ] \
15                 && V=`grep "PACKAGE_STRING=" configure | cut -d"'" -f2 | cut -d' ' -f2`
16         ( [ -n "$V" ] && echo "$V" || echo "??" ) | tr -d '\n';
17 ]))
18
19 m4_ifdef([AM_SILENT_RULES],
20         [m4_define([ng_color_tests], [color-tests])],
21         [m4_define([ng_color_tests], [])])
22
23 # -- Initialisation --
24
25 AC_PREREQ([2.61])
26 AC_INIT([ngIRCd], VERSION_ID,
27         [ngircd-ml@ngircd.barton.de], [ngircd], [http://ngircd.barton.de/])
28
29 AC_CONFIG_SRCDIR([src/ngircd/ngircd.c])
30 AC_CONFIG_HEADER([src/config.h])
31 AC_CANONICAL_HOST
32
33 AM_INIT_AUTOMAKE([-Wall 1.10 ]ng_color_tests)
34
35 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
36
37 # -- Templates for config.h --
38
39 AH_TEMPLATE([DEBUG], [Define if debug-mode should be enabled])
40 AH_TEMPLATE([HAVE_sockaddr_in_len], [Define if sockaddr_in.sin_len exists])
41 AH_TEMPLATE([HAVE_socklen_t], [Define if socklen_t exists])
42 AH_TEMPLATE([ICONV], [Define if libiconv can be used, e.g. for CHARCONV])
43 AH_TEMPLATE([IDENTAUTH], [Define if the server should do IDENT requests])
44 AH_TEMPLATE([IRCPLUS], [Define if IRC+ protocol should be used])
45 AH_TEMPLATE([PAM], [Define if PAM should be used])
46 AH_TEMPLATE([SNIFFER], [Define if IRC sniffer should be enabled])
47 AH_TEMPLATE([STRICT_RFC], [Define if ngIRCd should behave strict RFC compliant])
48 AH_TEMPLATE([SYSLOG], [Define if syslog should be used for logging])
49 AH_TEMPLATE([TCPWRAP], [Define if TCP wrappers should be used])
50 AH_TEMPLATE([WANT_IPV6], [Define if IPV6 protocol should be enabled])
51 AH_TEMPLATE([ZLIB], [Define if zlib compression should be enabled])
52
53 AH_TEMPLATE([HOST_OS], [Target operating system name])
54 AH_TEMPLATE([HOST_VENDOR], [Target system vendor])
55 AH_TEMPLATE([HOST_CPU], [Target CPU name])
56
57 # -- C Compiler --
58
59 AC_PROG_CC
60 AC_PROG_CC_STDC
61
62 # -- Helper programs --
63
64 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
65
66 AC_PROG_AWK
67 AC_PROG_INSTALL
68 AC_PROG_LN_S
69 AC_PROG_MAKE_SET
70 AC_PROG_RANLIB
71
72 # -- Compiler Features --
73
74 AC_C_CONST
75 AC_C_INLINE
76 __ng_PROTOTYPES__
77
78 # -- Hard coded system and compiler dependencies/features/options ... --
79
80 AC_DEFUN([GCC_STACK_PROTECT_CC],[
81   ssp_cc=yes
82   # we use -fstack-protector-all for the test to enfoce the use of the guard variable 
83   AC_MSG_CHECKING([whether ${CC} accepts -fstack-protector])
84   ssp_old_cflags="$CFLAGS"
85   CFLAGS="$CFLAGS -fstack-protector-all"
86   AC_TRY_LINK(,,, ssp_cc=no)
87   echo $ssp_cc
88   CFLAGS="$ssp_old_cflags"
89   if test "X$ssp_cc" = "Xyes"; then
90       CFLAGS="$CFLAGS -fstack-protector"
91       AC_DEFINE([ENABLE_SSP_CC], 1, [Define if SSP C support is enabled.])
92   fi
93 ])
94
95 if test "$GCC" = "yes"; then
96         # We are using the GNU C compiler. Good!
97         CFLAGS="$CFLAGS -pipe -W -Wall -Wpointer-arith -Wstrict-prototypes"
98
99         GCC_STACK_PROTECT_CC
100 fi
101
102 case "$host_os" in
103         hpux*)
104                 # This is HP/UX, we need to define _XOPEN_SOURCE_EXTENDED
105                 # (tested with HP/UX 11.11)
106                 CFLAGS="$CFLAGS -D_XOPEN_SOURCE_EXTENDED"
107                 ;;
108 esac
109
110 # Add additional CFLAGS, eventually specified on the command line:
111 test -n "$CFLAGS_ADD" && CFLAGS="$CFLAGS $CFLAGS_ADD"
112
113 CFLAGS="$CFLAGS -DSYSCONFDIR='\"\$(sysconfdir)\"' -DDOCDIR='\"\$(docdir)\"'"
114
115 # -- Headers --
116
117 AC_HEADER_STDC
118 AC_HEADER_SYS_WAIT
119 AC_HEADER_TIME
120
121 # Required header files
122 AC_CHECK_HEADERS([ \
123         fcntl.h netdb.h netinet/in.h stdlib.h string.h \
124         strings.h sys/socket.h sys/time.h unistd.h \
125         ],,AC_MSG_ERROR([required C header missing!]))
126
127 # Optional header files
128 AC_CHECK_HEADERS_ONCE([ \
129         arpa/inet.h inttypes.h malloc.h netinet/in_systm.h netinet/ip.h \
130         stdbool.h stddef.h stdint.h varargs.h \
131         ])
132
133 # -- Datatypes --
134
135 AC_MSG_CHECKING(whether socklen_t exists)
136 AC_TRY_COMPILE([
137 #include <sys/types.h>
138 #include <sys/socket.h>
139         ],[
140         socklen_t a, b;
141         a = 2; b = 4; a += b;
142         ],[
143         AC_DEFINE(HAVE_socklen_t) AC_MSG_RESULT(yes)
144         ],[
145         AC_MSG_RESULT(no)
146 ])
147
148 AC_TYPE_PID_T
149 AC_TYPE_SIGNAL
150 AC_TYPE_SIZE_T
151 AC_TYPE_SSIZE_T
152 AC_TYPE_UID_T
153 AC_TYPE_UINT16_T
154 AC_TYPE_UINT32_T
155 AC_TYPE_UINT8_T
156
157 AC_CHECK_MEMBER([struct sockaddr_in.sin_len], AC_DEFINE(HAVE_sockaddr_in_len),,
158  [#include <arpa/inet.h>])
159
160 # -- Libraries --
161
162 # memmove: A/UX libUTIL
163 AC_SEARCH_LIBS([memmove], [UTIL], [], [
164         AC_MSG_ERROR([unable to find the memmove() function])
165 ])
166 # gethostbyname: Solaris libnsl
167 AC_SEARCH_LIBS([gethostbyname], [bind nsl network], [], [
168         AC_MSG_ERROR([unable to find the gethostbyname() function])
169 ])
170 # bind: SVR4 libsocket
171 AC_SEARCH_LIBS([bind], [socket network], [], [
172         AC_MSG_ERROR([unable to find the bind() function])
173 ])
174
175 # -- Functions --
176
177 AC_FUNC_FORK
178 AC_FUNC_STRFTIME
179
180 # Required functions
181 AC_CHECK_FUNCS([ \
182         alarm dup2 endpwent gethostbyaddr gethostbyname gethostname \
183         gettimeofday inet_ntoa memmove memset setsid socket strcasecmp \
184         strchr strcspn strerror strncasecmp strrchr strspn strstr \
185         ],,
186         AC_MSG_ERROR([required function missing!]))
187
188 # Optional functions
189 AC_CHECK_FUNCS_ONCE([ \
190         gai_strerror getaddrinfo getnameinfo inet_aton sigaction sigprocmask \
191         snprintf vsnprintf strdup strndup strlcpy strlcat strtok_r waitpid])
192
193 # -- Configuration options --
194
195 # use syslog?
196
197 x_syslog_on=no
198 AC_ARG_WITH(syslog,
199         AS_HELP_STRING([--without-syslog],
200                        [disable syslog (autodetected by default)]),
201         [       if test "$withval" != "no"; then
202                         if test "$withval" != "yes"; then
203                                 CFLAGS="-I$withval/include $CFLAGS"
204                                 CPPFLAGS="-I$withval/include $CPPFLAGS"
205                                 LDFLAGS="-L$withval/lib $LDFLAGS"
206                         fi
207                         AC_SEARCH_LIBS([syslog], [be], [x_syslog_on=yes], [
208                                 AC_MSG_ERROR([Can't enable syslog!])
209                         ])
210                 fi
211         ],
212         [       AC_SEARCH_LIBS([syslog], [be], [x_syslog_on=yes])
213         ]
214 )
215 if test "$x_syslog_on" = "yes"; then
216         AC_DEFINE(SYSLOG, 1)
217         AC_CHECK_HEADERS(syslog.h,,AC_MSG_ERROR([required C header missing!]))
218 fi
219
220 # use zlib compression?
221
222 x_zlib_on=no
223 AC_ARG_WITH(zlib,
224         AS_HELP_STRING([--without-zlib],
225                        [disable zlib compression (autodetected by default)]),
226         [       if test "$withval" != "no"; then
227                         if test "$withval" != "yes"; then
228                                 CFLAGS="-I$withval/include $CFLAGS"
229                                 CPPFLAGS="-I$withval/include $CPPFLAGS"
230                                 LDFLAGS="-L$withval/lib $LDFLAGS"
231                         fi
232                         AC_CHECK_LIB(z, deflate)
233                         AC_CHECK_FUNCS(deflate, x_zlib_on=yes,
234                                 AC_MSG_ERROR([Can't enable zlib!])
235                         )
236                 fi
237         ],
238         [       AC_CHECK_LIB(z, deflate)
239                 AC_CHECK_FUNCS(deflate, x_zlib_on=yes)
240         ]
241 )
242 if test "$x_zlib_on" = "yes"; then
243         AC_DEFINE(ZLIB, 1)
244         AC_CHECK_HEADERS(zlib.h,,AC_MSG_ERROR([required C header missing!]))
245 fi
246
247 # detect which IO API to use:
248
249 x_io_backend=none
250
251 AC_ARG_WITH(select,
252         AS_HELP_STRING([--without-select],
253                        [disable select IO support (autodetected by default)]),
254         [       if test "$withval" != "no"; then
255                         if test "$withval" != "yes"; then
256                                 CFLAGS="-I$withval/include $CFLAGS"
257                                 CPPFLAGS="-I$withval/include $CPPFLAGS"
258                                 LDFLAGS="-L$withval/lib $LDFLAGS"
259                         fi
260                         AC_CHECK_FUNCS(select, x_io_select=yes,
261                                 AC_MSG_ERROR([Can't enable select IO support!])
262                         )
263                 fi
264         ],
265         [
266                 AC_CHECK_FUNCS(select, x_io_select=yes)
267         ]
268 )
269
270 AC_ARG_WITH(poll,
271         AS_HELP_STRING([--without-poll],
272                        [disable poll support (autodetected by default)]),
273         [       if test "$withval" != "no"; then
274                         if test "$withval" != "yes"; then
275                                 CFLAGS="-I$withval/include $CFLAGS"
276                                 CPPFLAGS="-I$withval/include $CPPFLAGS"
277                                 LDFLAGS="-L$withval/lib $LDFLAGS"
278                         fi
279                         AC_CHECK_FUNCS(poll, [
280                                 AC_CHECK_HEADERS(poll.h,
281                                         x_io_backend=poll\(\),
282                                         AC_MSG_ERROR(
283                                              [Can't enable poll IO support!])
284                                 )
285                         ], [
286                                 AC_MSG_ERROR([Can't enable poll IO support!])
287                         ])
288                 fi
289         ],
290         [
291                 AC_CHECK_FUNCS(poll, [
292                         AC_CHECK_HEADERS(poll.h, x_io_backend=poll\(\))
293                 ])
294         ]
295 )
296
297 AC_ARG_WITH(devpoll,
298         AS_HELP_STRING([--without-devpoll],
299                        [disable /dev/poll IO support (autodetected by default)]),
300         [       if test "$withval" != "no"; then
301                         if test "$withval" != "yes"; then
302                                 CFLAGS="-I$withval/include $CFLAGS"
303                                 CPPFLAGS="-I$withval/include $CPPFLAGS"
304                                 LDFLAGS="-L$withval/lib $LDFLAGS"
305                         fi
306
307                                 AC_CHECK_HEADERS(sys/devpoll.h,,AC_MSG_ERROR([required C header missing!]))
308                 fi
309         ],
310         [
311                 AC_CHECK_HEADERS(sys/devpoll.h, x_io_backend=/dev/poll)
312         ]
313 )
314
315 AC_ARG_WITH(epoll,
316         AS_HELP_STRING([--without-epoll],
317                        [disable epoll IO support (autodetected by default)]),
318         [       if test "$withval" != "no"; then
319                         if test "$withval" != "yes"; then
320                                 CFLAGS="-I$withval/include $CFLAGS"
321                                 CPPFLAGS="-I$withval/include $CPPFLAGS"
322                                 LDFLAGS="-L$withval/lib $LDFLAGS"
323                         fi
324                         AC_CHECK_FUNCS(epoll_create, x_io_epoll=yes,
325                                 AC_MSG_ERROR([Can't enable epoll IO support!])
326                         )
327                 fi
328         ],
329         [
330                 AC_CHECK_FUNCS(epoll_create, x_io_epoll=yes)
331         ]
332 )
333
334 AC_ARG_WITH(kqueue,
335         AS_HELP_STRING([--without-kqueue],
336                        [disable kqueue IO support (autodetected by default)]),
337         [       if test "$withval" != "no"; then
338                         if test "$withval" != "yes"; then
339                                 CFLAGS="-I$withval/include $CFLAGS"
340                                 CPPFLAGS="-I$withval/include $CPPFLAGS"
341                                 LDFLAGS="-L$withval/lib $LDFLAGS"
342                         fi
343                         AC_CHECK_FUNCS(kqueue, x_io_backend=kqueue\(\),
344                                 AC_MSG_ERROR([Can't enable kqueue IO support!])
345                         )
346                 fi
347         ],
348         [
349                 AC_CHECK_FUNCS(kqueue, x_io_backend=kqueue\(\))
350         ]
351 )
352
353 if test "$x_io_epoll" = "yes" -a "$x_io_select" = "yes"; then
354         # when epoll() and select() are available, we'll use both!
355         x_io_backend="epoll(), select()"
356 else
357         if test "$x_io_epoll" = "yes"; then
358                 # we prefere epoll() if it is available
359                 x_io_backend="epoll()"
360         else
361                 if test "$x_io_select" = "yes" -a "$x_io_backend" = "none"; then
362                         # we'll use select, when available and no "better"
363                         # interface has been detected ...
364                         x_io_backend="select()"
365                 fi
366         fi
367 fi
368
369 if test "$x_io_backend" = "none"; then
370         AC_MSG_ERROR([No useable IO API activated/found!?])
371 fi
372
373 # use SSL?
374
375 AC_ARG_WITH(openssl,
376         AS_HELP_STRING([--with-openssl],
377                        [enable SSL support using OpenSSL]),
378         [       if test "$withval" != "no"; then
379                         if test "$withval" != "yes"; then
380                                 CFLAGS="-I$withval/include $CFLAGS"
381                                 CPPFLAGS="-I$withval/include $CPPFLAGS"
382                                 LDFLAGS="-L$withval/lib $LDFLAGS"
383                         fi
384                         AC_CHECK_LIB(crypto, BIO_s_mem)
385                         AC_CHECK_LIB(ssl, SSL_library_init)
386                         AC_CHECK_FUNCS(SSL_library_init, x_ssl_openssl=yes,
387                                 AC_MSG_ERROR([Can't enable openssl])
388                         )
389                 fi
390         ]
391 )
392
393 AC_ARG_WITH(gnutls,
394         AS_HELP_STRING([--with-gnutls],
395                        [enable SSL support using gnutls]),
396         [       if test "$withval" != "no"; then
397                         if test "$withval" != "yes"; then
398                                 CFLAGS="-I$withval/include $CFLAGS"
399                                 CPPFLAGS="-I$withval/include $CPPFLAGS"
400                                 LDFLAGS="-L$withval/lib $LDFLAGS"
401                         fi
402                         AC_CHECK_LIB(gnutls, gnutls_global_init)
403                         AC_CHECK_FUNCS(gnutls_global_init, x_ssl_gnutls=yes,
404                                 AC_MSG_ERROR([Can't enable gnutls])
405                         )
406                 fi
407         ]
408 )
409
410 x_ssl_lib="no"
411 if test "$x_ssl_gnutls" = "yes"; then
412         if test "$x_ssl_openssl" = "yes";then
413                 AC_MSG_ERROR([Cannot enable both gnutls and openssl])
414         fi
415         x_ssl_lib=gnutls
416 fi
417 if test "$x_ssl_openssl" = "yes"; then
418         x_ssl_lib=openssl
419 fi
420
421 # use TCP wrappers?
422
423 x_tcpwrap_on=no
424 AC_ARG_WITH(tcp-wrappers,
425         AS_HELP_STRING([--with-tcp-wrappers],
426                        [enable TCP wrappers support]),
427         [       if test "$withval" != "no"; then
428                         if test "$withval" != "yes"; then
429                                 CFLAGS="-I$withval/include $CFLAGS"
430                                 CPPFLAGS="-I$withval/include $CPPFLAGS"
431                                 LDFLAGS="-L$withval/lib $LDFLAGS"
432                         fi
433                         AC_MSG_CHECKING(for hosts_access)
434                         LIBS="-lwrap $LIBS"
435                         AC_TRY_LINK([
436 #include <tcpd.h>
437 int allow_severity = 0;
438 int deny_severity = 0;
439                                 ],[
440                                 tcpd_warn("link test");
441                                 ],[
442                                 AC_MSG_RESULT(yes)
443                                 AC_DEFINE(TCPWRAP, 1)
444                                 x_tcpwrap_on=yes
445                                 ],[
446                                 AC_MSG_RESULT(no)
447                                 AC_MSG_ERROR([Can't enable TCP wrappers!])
448                         ])
449                 fi
450         ]
451 )
452
453 # do IDENT requests using libident?
454
455 x_identauth_on=no
456 AC_ARG_WITH(ident,
457         AS_HELP_STRING([--with-ident],
458                        [enable "IDENT" ("AUTH") protocol support]),
459         [       if test "$withval" != "no"; then
460                         if test "$withval" != "yes"; then
461                                 CFLAGS="-I$withval/include $CFLAGS"
462                                 CPPFLAGS="-I$withval/include $CPPFLAGS"
463                                 LDFLAGS="-L$withval/lib $LDFLAGS"
464                         fi
465                         AC_CHECK_LIB(ident, ident_id)
466                         AC_CHECK_FUNCS(ident_id, x_identauth_on=yes,
467                                 AC_MSG_ERROR([Can't enable IDENT support!])
468                         )
469                 fi
470         ]
471 )
472 if test "$x_identauth_on" = "yes"; then
473         AC_DEFINE(IDENTAUTH, 1)
474         AC_CHECK_HEADERS(ident.h,,AC_MSG_ERROR([required C header missing!]))
475 fi
476
477 # compile in PAM support?
478
479 x_pam_on=no
480 AC_ARG_WITH(pam,
481         AS_HELP_STRING([--with-pam],
482                        [enable user authentication using PAM]),
483         [       if test "$withval" != "no"; then
484                         if test "$withval" != "yes"; then
485                                 CFLAGS="-I$withval/include $CFLAGS"
486                                 CPPFLAGS="-I$withval/include $CPPFLAGS"
487                                 LDFLAGS="-L$withval/lib $LDFLAGS"
488                         fi
489                         AC_CHECK_LIB(pam, pam_authenticate)
490                         AC_CHECK_FUNCS(pam_authenticate, x_pam_on=yes,
491                                 AC_MSG_ERROR([Can't enable PAM support!])
492                         )
493                 fi
494         ]
495 )
496 if test "$x_pam_on" = "yes"; then
497         AC_DEFINE(PAM, 1)
498         AC_CHECK_HEADERS(security/pam_appl.h,pam_ok=yes)
499         if test "$pam_ok" != "yes"; then
500                 AC_CHECK_HEADERS(pam/pam_appl.h,pam_ok=yes,
501                         AC_MSG_ERROR([required C header missing!]))
502         fi
503 fi
504
505 # compile in IRC+ protocol support?
506
507 x_ircplus_on=yes
508 AC_ARG_ENABLE(ircplus,
509         AS_HELP_STRING([--disable-ircplus],
510                        [disable IRC+ protocol]),
511         if test "$enableval" = "no"; then x_ircplus_on=no; fi
512 )
513 if test "$x_ircplus_on" = "yes"; then
514         AC_DEFINE(IRCPLUS, 1)
515
516         # Compile in iconv support?
517         # We only check for it when IRC+ is enabled, because the IRC+ command
518         # CHARCONV is the only function depending on it.
519         x_iconv_on=no
520         AC_ARG_WITH(iconv,
521                 AS_HELP_STRING([--with-iconv],
522                                [enable character conversion using libiconv]),
523                 [ if test "$withval" != "no"; then
524                         if test "$withval" != "yes"; then
525                                 CFLAGS="-I$withval/include $CFLAGS"
526                                 CPPFLAGS="-I$withval/include $CPPFLAGS"
527                                 LDFLAGS="-L$withval/lib $LDFLAGS"
528                         fi
529                         AC_CHECK_LIB(iconv, iconv_open)
530                         AC_CHECK_FUNCS(iconv_open, x_iconv_on=yes)
531                         if test "$x_iconv_on" != "yes"; then
532                                 AC_CHECK_LIB(iconv, libiconv_open)
533                                 AC_CHECK_FUNCS(libiconv_open, x_iconv_on=yes)
534                         fi
535                         if test "$x_iconv_on" != "yes"; then
536                                 AC_MSG_ERROR([Can't enable libiconv support!])
537                         fi
538                 fi ]
539         )
540         if test "$x_iconv_on" = "yes"; then
541                 AC_DEFINE(ICONV, 1)
542         fi
543 fi
544
545 # enable support for IPv6?
546 x_ipv6_on=no
547 AC_ARG_ENABLE(ipv6,
548         AS_HELP_STRING([--enable-ipv6],
549                        [enable IPv6 protocol support]),
550         if test "$enableval" = "yes"; then x_ipv6_on=yes; fi
551 )
552 if test "$x_ipv6_on" = "yes"; then
553         # getaddrinfo() and getnameinfo() are optional when not compiling
554         # with IPv6 support, but are required for IPv6 to work!
555         AC_CHECK_FUNCS([ \
556                 getaddrinfo getnameinfo \
557                 ],,AC_MSG_ERROR([required function missing for IPv6 support!]))
558         AC_DEFINE(WANT_IPV6, 1)
559 fi
560
561 # compile in IRC "sniffer"?
562
563 x_sniffer_on=no; x_debug_on=no
564 AC_ARG_ENABLE(sniffer,
565         AS_HELP_STRING([--enable-sniffer],
566                        [enable IRC traffic sniffer (enables debug mode)]),
567         if test "$enableval" = "yes"; then
568                 AC_DEFINE(SNIFFER, 1)
569                 x_sniffer_on=yes; x_debug_on=yes
570         fi
571 )
572
573 # enable additional debugging code?
574
575 AC_ARG_ENABLE(debug,
576         AS_HELP_STRING([--enable-debug],
577                        [show additional debug output]),
578         if test "$enableval" = "yes"; then x_debug_on=yes; fi
579 )
580 if test "$x_debug_on" = "yes"; then
581         AC_DEFINE(DEBUG, 1)
582         test "$GCC" = "yes" && CFLAGS="-pedantic $CFLAGS"
583         AC_CHECK_FUNCS(mtrace)
584 fi
585
586 # enable "strict RFC rules"?
587
588 x_strict_rfc_on=no
589 AC_ARG_ENABLE(strict-rfc,
590         AS_HELP_STRING([--enable-strict-rfc],
591                        [strict RFC conformance -- may break clients!]),
592         if test "$enableval" = "yes"; then
593                 AC_DEFINE(STRICT_RFC, 1)
594                 x_strict_rfc_on=yes
595         fi
596 )
597
598 # -- Definitions --
599
600 AC_DEFINE_UNQUOTED(HOST_CPU, "$host_cpu" )
601 AC_DEFINE_UNQUOTED(HOST_VENDOR, "$host_vendor" )
602 AC_DEFINE_UNQUOTED(HOST_OS, "$host_os" )
603
604 # Add additional CFLAGS, eventually specified on the command line, but after
605 # running this configure script. Useful for "-Werror" for example.
606 test -n "$CFLAGS_END" && CFLAGS="$CFLAGS $CFLAGS_END"
607
608 # -- Generate files --
609
610 AC_CONFIG_FILES([ \
611         Makefile \
612         contrib/Debian/Makefile \
613         contrib/MacOSX/Makefile \
614         contrib/MacOSX/ngIRCd.pmdoc/Makefile \
615         contrib/MacOSX/ngIRCd.xcodeproj/Makefile \
616         contrib/Makefile \
617         doc/Makefile \
618         doc/src/Makefile \
619         man/Makefile \
620         src/ipaddr/Makefile \
621         src/Makefile \
622         src/ngircd/Makefile \
623         src/portab/Makefile \
624         src/testsuite/Makefile \
625         src/tool/Makefile \
626 ])
627
628 AC_OUTPUT
629
630 type dpkg >/dev/null 2>&1
631 if test $? -eq 0; then
632         # Generate debian/ link if the dpkg command exists
633         # (read: if we are running on a debian compatible system)
634         echo "creating Debian-specific links ..."
635         test -f debian/rules || ln -s contrib/Debian debian
636 fi
637
638 # -- Result --
639
640 echo
641 echo "ngIRCd $PACKAGE_VERSION has been configured with the following options:"
642 echo
643
644 # Someone please show me a better way :)  [borrowed by OpenSSH]
645 B=`eval echo ${bindir}` ; B=`eval echo ${B}`
646 S=`eval echo ${sbindir}` ; S=`eval echo ${S}`
647 C=`eval echo ${sysconfdir}` ; C=`eval echo ${C}`
648 M=`eval echo ${mandir}` ; M=`eval echo ${M}`
649 D=`eval echo ${docdir}` ; D=`eval echo ${D}`
650
651 echo "               Host: ${host}"
652 echo "           Compiler: ${CC}"
653 test -n "$CFLAGS"       && echo "     Compiler flags: ${CFLAGS}"
654 test -n "$CPPFLAGS"     && echo " Preprocessor flags: ${CPPFLAGS}"
655 test -n "$LDFLAGS"      && echo "       Linker flags: ${LDFLAGS}"
656 test -n "$LIBS"         && echo "          Libraries: ${LIBS}"
657 echo
658 echo "    'ngircd' binary: $S"
659 echo " Configuration file: $C"
660 echo "       Manual pages: $M"
661 echo "      Documentation: $D"
662 echo
663
664 echo $ECHO_N "     Syslog support: $ECHO_C"
665 test "$x_syslog_on" = "yes" \
666         && echo $ECHO_N "yes   $ECHO_C" \
667         || echo $ECHO_N "no    $ECHO_C"
668 echo $ECHO_N "  Enable debug code: $ECHO_C"
669 test "$x_debug_on" = "yes" \
670         && echo "yes" \
671         || echo "no"
672
673 echo $ECHO_N "   zlib compression: $ECHO_C"
674 test "$x_zlib_on" = "yes" \
675         && echo $ECHO_N "yes   $ECHO_C" \
676         || echo $ECHO_N "no    $ECHO_C"
677 echo $ECHO_N "        IRC sniffer: $ECHO_C"
678 test "$x_sniffer_on" = "yes" \
679         && echo "yes" \
680         || echo "no"
681
682 echo $ECHO_N "   Use TCP Wrappers: $ECHO_C"
683 test "$x_tcpwrap_on" = "yes" \
684         && echo $ECHO_N "yes   $ECHO_C" \
685         || echo $ECHO_N "no    $ECHO_C"
686 echo $ECHO_N "    Strict RFC mode: $ECHO_C"
687 test "$x_strict_rfc_on" = "yes" \
688         && echo "yes" \
689         || echo "no"
690
691 echo $ECHO_N "      IDENT support: $ECHO_C"
692 test "$x_identauth_on" = "yes" \
693         && echo $ECHO_N "yes   $ECHO_C" \
694         || echo $ECHO_N "no    $ECHO_C"
695 echo $ECHO_N "      IRC+ protocol: $ECHO_C"
696 test "$x_ircplus_on" = "yes" \
697         && echo "yes" \
698         || echo "no"
699
700 echo $ECHO_N "      IPv6 protocol: $ECHO_C"
701 test "$x_ipv6_on" = "yes" \
702         && echo $ECHO_N "yes   $ECHO_C" \
703         || echo $ECHO_N "no    $ECHO_C"
704 echo $ECHO_N "        I/O backend: $ECHO_C"
705         echo "$x_io_backend"
706
707 echo $ECHO_N "        PAM support: $ECHO_C"
708 test "$x_pam_on" = "yes" \
709         && echo $ECHO_N "yes   $ECHO_C" \
710         || echo $ECHO_N "no    $ECHO_C"
711 echo $ECHO_N "        SSL support: $ECHO_C"
712 echo "$x_ssl_lib"
713
714 echo $ECHO_N "   libiconv support: $ECHO_C"
715         echo "$x_iconv_on"
716
717 echo
718
719 define(_automake_regex_,[[^AUTOMAKE_OPTIONS = [a-z .\-]*/portab/ansi2knr]])
720 if ! grep "_automake_regex_" src/ngircd/Makefile.am >/dev/null 2>&1; then
721         echo "WARNING:"
722         echo "This GNU automake generated build system does not support \"de-ANSI-fication\","
723         echo "therefore don't use it to generate \"official\" distribution archives!"
724         echo "(Most probably you want to use GNU automake 1.11.x for this purpose ...)"
725         echo
726 fi
727
728 # -eof-