Blame


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