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 61ac8be2 2020-03-29 alex AM_INIT_AUTOMAKE([-Wall 1.10 foreign ]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 34824abe 2013-11-11 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 bc098794 2014-01-02 alex ],[
120 bc098794 2014-01-02 alex AC_MSG_RESULT(no)
121 b8433e92 2013-12-27 alex ],[
122 b8433e92 2013-12-27 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 8cfb9104 2012-09-24 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 d803ff05 2018-02-25 alex fcntl.h \
158 d803ff05 2018-02-25 alex netdb.h \
159 d803ff05 2018-02-25 alex netinet/in.h \
160 d803ff05 2018-02-25 alex stdlib.h \
161 d803ff05 2018-02-25 alex string.h \
162 d803ff05 2018-02-25 alex strings.h \
163 d803ff05 2018-02-25 alex sys/socket.h \
164 d803ff05 2018-02-25 alex sys/time.h \
165 d803ff05 2018-02-25 alex sys/types.h \
166 d803ff05 2018-02-25 alex unistd.h \
167 8cfb9104 2012-09-24 alex ],,AC_MSG_ERROR([required C header missing!]))
168 8cfb9104 2012-09-24 alex
169 8cfb9104 2012-09-24 alex # Optional header files
170 8cfb9104 2012-09-24 alex AC_CHECK_HEADERS_ONCE([ \
171 d803ff05 2018-02-25 alex arpa/inet.h \
172 d803ff05 2018-02-25 alex inttypes.h \
173 d803ff05 2018-02-25 alex malloc.h \
174 d803ff05 2018-02-25 alex netinet/in_systm.h \
175 d803ff05 2018-02-25 alex netinet/ip.h \
176 d803ff05 2018-02-25 alex stdbool.h \
177 d803ff05 2018-02-25 alex stddef.h \
178 d803ff05 2018-02-25 alex stdint.h \
179 d803ff05 2018-02-25 alex varargs.h \
180 d803ff05 2018-02-25 alex ])
181 8cfb9104 2012-09-24 alex
182 8cfb9104 2012-09-24 alex # -- Datatypes --
183 8cfb9104 2012-09-24 alex
184 8cfb9104 2012-09-24 alex AC_MSG_CHECKING(whether socklen_t exists)
185 bc098794 2014-01-02 alex AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
186 8cfb9104 2012-09-24 alex #include <sys/types.h>
187 8cfb9104 2012-09-24 alex #include <sys/socket.h>
188 bc098794 2014-01-02 alex ]],[[
189 8cfb9104 2012-09-24 alex socklen_t a, b;
190 8cfb9104 2012-09-24 alex a = 2; b = 4; a += b;
191 bc098794 2014-01-02 alex ]])],[
192 8cfb9104 2012-09-24 alex AC_DEFINE(HAVE_socklen_t) AC_MSG_RESULT(yes)
193 8cfb9104 2012-09-24 alex ],[
194 8cfb9104 2012-09-24 alex AC_MSG_RESULT(no)
195 8cfb9104 2012-09-24 alex ])
196 8cfb9104 2012-09-24 alex
197 8cfb9104 2012-09-24 alex AC_TYPE_PID_T
198 8cfb9104 2012-09-24 alex AC_TYPE_SIZE_T
199 8cfb9104 2012-09-24 alex AC_TYPE_SSIZE_T
200 8cfb9104 2012-09-24 alex AC_TYPE_UID_T
201 8cfb9104 2012-09-24 alex AC_TYPE_UINT16_T
202 8cfb9104 2012-09-24 alex AC_TYPE_UINT32_T
203 8cfb9104 2012-09-24 alex AC_TYPE_UINT8_T
204 8cfb9104 2012-09-24 alex
205 8cfb9104 2012-09-24 alex AC_CHECK_MEMBER([struct sockaddr_in.sin_len], AC_DEFINE(HAVE_sockaddr_in_len),,
206 8cfb9104 2012-09-24 alex [#include <arpa/inet.h>])
207 8cfb9104 2012-09-24 alex
208 8cfb9104 2012-09-24 alex # -- Libraries --
209 8cfb9104 2012-09-24 alex
210 8cfb9104 2012-09-24 alex # memmove: A/UX libUTIL
211 8cfb9104 2012-09-24 alex AC_SEARCH_LIBS([memmove], [UTIL], [], [
212 8cfb9104 2012-09-24 alex AC_MSG_ERROR([unable to find the memmove() function])
213 8cfb9104 2012-09-24 alex ])
214 8cfb9104 2012-09-24 alex # gethostbyname: Solaris libnsl
215 cdaaae0c 2012-10-11 alex AC_SEARCH_LIBS([gethostbyname], [bind nsl network], [], [
216 8cfb9104 2012-09-24 alex AC_MSG_ERROR([unable to find the gethostbyname() function])
217 8cfb9104 2012-09-24 alex ])
218 8cfb9104 2012-09-24 alex # bind: SVR4 libsocket
219 cdaaae0c 2012-10-11 alex AC_SEARCH_LIBS([bind], [socket network], [], [
220 8cfb9104 2012-09-24 alex AC_MSG_ERROR([unable to find the bind() function])
221 8cfb9104 2012-09-24 alex ])
222 8cfb9104 2012-09-24 alex
223 8cfb9104 2012-09-24 alex # -- Functions --
224 8cfb9104 2012-09-24 alex
225 8cfb9104 2012-09-24 alex AC_FUNC_FORK
226 8cfb9104 2012-09-24 alex AC_FUNC_STRFTIME
227 8cfb9104 2012-09-24 alex
228 8cfb9104 2012-09-24 alex # Required functions
229 8cfb9104 2012-09-24 alex AC_CHECK_FUNCS([ \
230 d803ff05 2018-02-25 alex alarm \
231 d803ff05 2018-02-25 alex dup2 \
232 d803ff05 2018-02-25 alex endpwent \
233 d803ff05 2018-02-25 alex gethostbyaddr \
234 d803ff05 2018-02-25 alex gethostbyname \
235 d803ff05 2018-02-25 alex gethostname \
236 d803ff05 2018-02-25 alex gettimeofday \
237 d803ff05 2018-02-25 alex inet_ntoa \
238 d803ff05 2018-02-25 alex memmove \
239 d803ff05 2018-02-25 alex memset \
240 d803ff05 2018-02-25 alex setsid \
241 d803ff05 2018-02-25 alex socket \
242 d803ff05 2018-02-25 alex strcasecmp \
243 d803ff05 2018-02-25 alex strchr \
244 d803ff05 2018-02-25 alex strcspn \
245 d803ff05 2018-02-25 alex strerror \
246 d803ff05 2018-02-25 alex strncasecmp \
247 d803ff05 2018-02-25 alex strrchr \
248 d803ff05 2018-02-25 alex strspn \
249 d803ff05 2018-02-25 alex strstr \
250 8cfb9104 2012-09-24 alex ],,
251 8cfb9104 2012-09-24 alex AC_MSG_ERROR([required function missing!]))
252 8cfb9104 2012-09-24 alex
253 8cfb9104 2012-09-24 alex # Optional functions
254 b8433e92 2013-12-27 alex AC_CHECK_FUNCS_ONCE([
255 d803ff05 2018-02-25 alex arc4random \
256 d803ff05 2018-02-25 alex arc4random_stir \
257 d803ff05 2018-02-25 alex gai_strerror \
258 d803ff05 2018-02-25 alex getnameinfo \
259 d803ff05 2018-02-25 alex inet_aton \
260 d803ff05 2018-02-25 alex setgroups \
261 d803ff05 2018-02-25 alex sigaction \
262 d803ff05 2018-02-25 alex sigprocmask \
263 d803ff05 2018-02-25 alex snprintf \
264 d803ff05 2018-02-25 alex strdup \
265 d803ff05 2018-02-25 alex strlcat \
266 d803ff05 2018-02-25 alex strlcpy \
267 d803ff05 2018-02-25 alex strndup \
268 de1de405 2019-11-10 alex strsignal \
269 d803ff05 2018-02-25 alex strtok_r \
270 d803ff05 2018-02-25 alex unsetenv \
271 d803ff05 2018-02-25 alex vsnprintf \
272 d803ff05 2018-02-25 alex waitpid \
273 d803ff05 2018-02-25 alex ])
274 8cfb9104 2012-09-24 alex
275 b8433e92 2013-12-27 alex WORKING_GETADDRINFO
276 b8433e92 2013-12-27 alex
277 8cfb9104 2012-09-24 alex # -- Configuration options --
278 8cfb9104 2012-09-24 alex
279 8cfb9104 2012-09-24 alex # use syslog?
280 8cfb9104 2012-09-24 alex
281 8cfb9104 2012-09-24 alex x_syslog_on=no
282 8cfb9104 2012-09-24 alex AC_ARG_WITH(syslog,
283 8cfb9104 2012-09-24 alex AS_HELP_STRING([--without-syslog],
284 8cfb9104 2012-09-24 alex [disable syslog (autodetected by default)]),
285 8cfb9104 2012-09-24 alex [ if test "$withval" != "no"; then
286 8cfb9104 2012-09-24 alex if test "$withval" != "yes"; then
287 8cfb9104 2012-09-24 alex CFLAGS="-I$withval/include $CFLAGS"
288 8cfb9104 2012-09-24 alex CPPFLAGS="-I$withval/include $CPPFLAGS"
289 8cfb9104 2012-09-24 alex LDFLAGS="-L$withval/lib $LDFLAGS"
290 8cfb9104 2012-09-24 alex fi
291 8cfb9104 2012-09-24 alex AC_SEARCH_LIBS([syslog], [be], [x_syslog_on=yes], [
292 8cfb9104 2012-09-24 alex AC_MSG_ERROR([Can't enable syslog!])
293 8cfb9104 2012-09-24 alex ])
294 8cfb9104 2012-09-24 alex fi
295 8cfb9104 2012-09-24 alex ],
296 8cfb9104 2012-09-24 alex [ AC_SEARCH_LIBS([syslog], [be], [x_syslog_on=yes])
297 8cfb9104 2012-09-24 alex ]
298 8cfb9104 2012-09-24 alex )
299 8cfb9104 2012-09-24 alex if test "$x_syslog_on" = "yes"; then
300 8cfb9104 2012-09-24 alex AC_DEFINE(SYSLOG, 1)
301 8cfb9104 2012-09-24 alex AC_CHECK_HEADERS(syslog.h,,AC_MSG_ERROR([required C header missing!]))
302 8cfb9104 2012-09-24 alex fi
303 8cfb9104 2012-09-24 alex
304 8cfb9104 2012-09-24 alex # use zlib compression?
305 8cfb9104 2012-09-24 alex
306 8cfb9104 2012-09-24 alex x_zlib_on=no
307 8cfb9104 2012-09-24 alex AC_ARG_WITH(zlib,
308 8cfb9104 2012-09-24 alex AS_HELP_STRING([--without-zlib],
309 8cfb9104 2012-09-24 alex [disable zlib compression (autodetected by default)]),
310 8cfb9104 2012-09-24 alex [ if test "$withval" != "no"; then
311 8cfb9104 2012-09-24 alex if test "$withval" != "yes"; then
312 8cfb9104 2012-09-24 alex CFLAGS="-I$withval/include $CFLAGS"
313 8cfb9104 2012-09-24 alex CPPFLAGS="-I$withval/include $CPPFLAGS"
314 8cfb9104 2012-09-24 alex LDFLAGS="-L$withval/lib $LDFLAGS"
315 8cfb9104 2012-09-24 alex fi
316 8cfb9104 2012-09-24 alex AC_CHECK_LIB(z, deflate)
317 8cfb9104 2012-09-24 alex AC_CHECK_FUNCS(deflate, x_zlib_on=yes,
318 8cfb9104 2012-09-24 alex AC_MSG_ERROR([Can't enable zlib!])
319 8cfb9104 2012-09-24 alex )
320 8cfb9104 2012-09-24 alex fi
321 8cfb9104 2012-09-24 alex ],
322 8cfb9104 2012-09-24 alex [ AC_CHECK_LIB(z, deflate)
323 8cfb9104 2012-09-24 alex AC_CHECK_FUNCS(deflate, x_zlib_on=yes)
324 8cfb9104 2012-09-24 alex ]
325 8cfb9104 2012-09-24 alex )
326 8cfb9104 2012-09-24 alex if test "$x_zlib_on" = "yes"; then
327 8cfb9104 2012-09-24 alex AC_DEFINE(ZLIB, 1)
328 8cfb9104 2012-09-24 alex AC_CHECK_HEADERS(zlib.h,,AC_MSG_ERROR([required C header missing!]))
329 8cfb9104 2012-09-24 alex fi
330 8cfb9104 2012-09-24 alex
331 8cfb9104 2012-09-24 alex # detect which IO API to use:
332 8cfb9104 2012-09-24 alex
333 8cfb9104 2012-09-24 alex x_io_backend=none
334 8cfb9104 2012-09-24 alex
335 8cfb9104 2012-09-24 alex AC_ARG_WITH(select,
336 8cfb9104 2012-09-24 alex AS_HELP_STRING([--without-select],
337 8cfb9104 2012-09-24 alex [disable select IO support (autodetected by default)]),
338 8cfb9104 2012-09-24 alex [ if test "$withval" != "no"; then
339 8cfb9104 2012-09-24 alex if test "$withval" != "yes"; then
340 8cfb9104 2012-09-24 alex CFLAGS="-I$withval/include $CFLAGS"
341 8cfb9104 2012-09-24 alex CPPFLAGS="-I$withval/include $CPPFLAGS"
342 8cfb9104 2012-09-24 alex LDFLAGS="-L$withval/lib $LDFLAGS"
343 8cfb9104 2012-09-24 alex fi
344 8cfb9104 2012-09-24 alex AC_CHECK_FUNCS(select, x_io_select=yes,
345 8cfb9104 2012-09-24 alex AC_MSG_ERROR([Can't enable select IO support!])
346 8cfb9104 2012-09-24 alex )
347 8cfb9104 2012-09-24 alex fi
348 8cfb9104 2012-09-24 alex ],
349 8cfb9104 2012-09-24 alex [
350 8cfb9104 2012-09-24 alex AC_CHECK_FUNCS(select, x_io_select=yes)
351 8cfb9104 2012-09-24 alex ]
352 8cfb9104 2012-09-24 alex )
353 8cfb9104 2012-09-24 alex
354 8cfb9104 2012-09-24 alex AC_ARG_WITH(poll,
355 8cfb9104 2012-09-24 alex AS_HELP_STRING([--without-poll],
356 8cfb9104 2012-09-24 alex [disable poll support (autodetected by default)]),
357 8cfb9104 2012-09-24 alex [ if test "$withval" != "no"; then
358 8cfb9104 2012-09-24 alex if test "$withval" != "yes"; then
359 8cfb9104 2012-09-24 alex CFLAGS="-I$withval/include $CFLAGS"
360 8cfb9104 2012-09-24 alex CPPFLAGS="-I$withval/include $CPPFLAGS"
361 8cfb9104 2012-09-24 alex LDFLAGS="-L$withval/lib $LDFLAGS"
362 8cfb9104 2012-09-24 alex fi
363 8cfb9104 2012-09-24 alex AC_CHECK_FUNCS(poll, [
364 8cfb9104 2012-09-24 alex AC_CHECK_HEADERS(poll.h,
365 8cfb9104 2012-09-24 alex x_io_backend=poll\(\),
366 8cfb9104 2012-09-24 alex AC_MSG_ERROR(
367 8cfb9104 2012-09-24 alex [Can't enable poll IO support!])
368 8cfb9104 2012-09-24 alex )
369 8cfb9104 2012-09-24 alex ], [
370 8cfb9104 2012-09-24 alex AC_MSG_ERROR([Can't enable poll IO support!])
371 8cfb9104 2012-09-24 alex ])
372 8cfb9104 2012-09-24 alex fi
373 8cfb9104 2012-09-24 alex ],
374 8cfb9104 2012-09-24 alex [
375 8cfb9104 2012-09-24 alex AC_CHECK_FUNCS(poll, [
376 8cfb9104 2012-09-24 alex AC_CHECK_HEADERS(poll.h, x_io_backend=poll\(\))
377 8cfb9104 2012-09-24 alex ])
378 8cfb9104 2012-09-24 alex ]
379 8cfb9104 2012-09-24 alex )
380 8cfb9104 2012-09-24 alex
381 8cfb9104 2012-09-24 alex AC_ARG_WITH(devpoll,
382 8cfb9104 2012-09-24 alex AS_HELP_STRING([--without-devpoll],
383 8cfb9104 2012-09-24 alex [disable /dev/poll IO support (autodetected by default)]),
384 8cfb9104 2012-09-24 alex [ if test "$withval" != "no"; then
385 8cfb9104 2012-09-24 alex if test "$withval" != "yes"; then
386 8cfb9104 2012-09-24 alex CFLAGS="-I$withval/include $CFLAGS"
387 8cfb9104 2012-09-24 alex CPPFLAGS="-I$withval/include $CPPFLAGS"
388 8cfb9104 2012-09-24 alex LDFLAGS="-L$withval/lib $LDFLAGS"
389 8cfb9104 2012-09-24 alex fi
390 8cfb9104 2012-09-24 alex
391 8cfb9104 2012-09-24 alex AC_CHECK_HEADERS(sys/devpoll.h,,AC_MSG_ERROR([required C header missing!]))
392 8cfb9104 2012-09-24 alex fi
393 8cfb9104 2012-09-24 alex ],
394 8cfb9104 2012-09-24 alex [
395 8cfb9104 2012-09-24 alex AC_CHECK_HEADERS(sys/devpoll.h, x_io_backend=/dev/poll)
396 8cfb9104 2012-09-24 alex ]
397 8cfb9104 2012-09-24 alex )
398 8cfb9104 2012-09-24 alex
399 8cfb9104 2012-09-24 alex AC_ARG_WITH(epoll,
400 8cfb9104 2012-09-24 alex AS_HELP_STRING([--without-epoll],
401 8cfb9104 2012-09-24 alex [disable epoll IO support (autodetected by default)]),
402 8cfb9104 2012-09-24 alex [ if test "$withval" != "no"; then
403 8cfb9104 2012-09-24 alex if test "$withval" != "yes"; then
404 8cfb9104 2012-09-24 alex CFLAGS="-I$withval/include $CFLAGS"
405 8cfb9104 2012-09-24 alex CPPFLAGS="-I$withval/include $CPPFLAGS"
406 8cfb9104 2012-09-24 alex LDFLAGS="-L$withval/lib $LDFLAGS"
407 8cfb9104 2012-09-24 alex fi
408 8cfb9104 2012-09-24 alex AC_CHECK_FUNCS(epoll_create, x_io_epoll=yes,
409 8cfb9104 2012-09-24 alex AC_MSG_ERROR([Can't enable epoll IO support!])
410 8cfb9104 2012-09-24 alex )
411 8cfb9104 2012-09-24 alex fi
412 8cfb9104 2012-09-24 alex ],
413 8cfb9104 2012-09-24 alex [
414 8cfb9104 2012-09-24 alex AC_CHECK_FUNCS(epoll_create, x_io_epoll=yes)
415 8cfb9104 2012-09-24 alex ]
416 8cfb9104 2012-09-24 alex )
417 8cfb9104 2012-09-24 alex
418 8cfb9104 2012-09-24 alex AC_ARG_WITH(kqueue,
419 8cfb9104 2012-09-24 alex AS_HELP_STRING([--without-kqueue],
420 8cfb9104 2012-09-24 alex [disable kqueue IO support (autodetected by default)]),
421 8cfb9104 2012-09-24 alex [ if test "$withval" != "no"; then
422 8cfb9104 2012-09-24 alex if test "$withval" != "yes"; then
423 8cfb9104 2012-09-24 alex CFLAGS="-I$withval/include $CFLAGS"
424 8cfb9104 2012-09-24 alex CPPFLAGS="-I$withval/include $CPPFLAGS"
425 8cfb9104 2012-09-24 alex LDFLAGS="-L$withval/lib $LDFLAGS"
426 8cfb9104 2012-09-24 alex fi
427 8cfb9104 2012-09-24 alex AC_CHECK_FUNCS(kqueue, x_io_backend=kqueue\(\),
428 8cfb9104 2012-09-24 alex AC_MSG_ERROR([Can't enable kqueue IO support!])
429 8cfb9104 2012-09-24 alex )
430 8cfb9104 2012-09-24 alex fi
431 8cfb9104 2012-09-24 alex ],
432 8cfb9104 2012-09-24 alex [
433 8cfb9104 2012-09-24 alex AC_CHECK_FUNCS(kqueue, x_io_backend=kqueue\(\))
434 8cfb9104 2012-09-24 alex ]
435 8cfb9104 2012-09-24 alex )
436 8cfb9104 2012-09-24 alex
437 8cfb9104 2012-09-24 alex if test "$x_io_epoll" = "yes" -a "$x_io_select" = "yes"; then
438 8cfb9104 2012-09-24 alex # when epoll() and select() are available, we'll use both!
439 8cfb9104 2012-09-24 alex x_io_backend="epoll(), select()"
440 8cfb9104 2012-09-24 alex else
441 8cfb9104 2012-09-24 alex if test "$x_io_epoll" = "yes"; then
442 8cfb9104 2012-09-24 alex # we prefere epoll() if it is available
443 8cfb9104 2012-09-24 alex x_io_backend="epoll()"
444 8cfb9104 2012-09-24 alex else
445 8cfb9104 2012-09-24 alex if test "$x_io_select" = "yes" -a "$x_io_backend" = "none"; then
446 8cfb9104 2012-09-24 alex # we'll use select, when available and no "better"
447 8cfb9104 2012-09-24 alex # interface has been detected ...
448 8cfb9104 2012-09-24 alex x_io_backend="select()"
449 8cfb9104 2012-09-24 alex fi
450 8cfb9104 2012-09-24 alex fi
451 8cfb9104 2012-09-24 alex fi
452 8cfb9104 2012-09-24 alex
453 8cfb9104 2012-09-24 alex if test "$x_io_backend" = "none"; then
454 8cfb9104 2012-09-24 alex AC_MSG_ERROR([No useable IO API activated/found!?])
455 8cfb9104 2012-09-24 alex fi
456 8cfb9104 2012-09-24 alex
457 8cfb9104 2012-09-24 alex # use SSL?
458 8cfb9104 2012-09-24 alex
459 8cfb9104 2012-09-24 alex AC_ARG_WITH(openssl,
460 8cfb9104 2012-09-24 alex AS_HELP_STRING([--with-openssl],
461 8cfb9104 2012-09-24 alex [enable SSL support using OpenSSL]),
462 8cfb9104 2012-09-24 alex [ if test "$withval" != "no"; then
463 8cfb9104 2012-09-24 alex if test "$withval" != "yes"; then
464 8cfb9104 2012-09-24 alex CFLAGS="-I$withval/include $CFLAGS"
465 8cfb9104 2012-09-24 alex CPPFLAGS="-I$withval/include $CPPFLAGS"
466 8cfb9104 2012-09-24 alex LDFLAGS="-L$withval/lib $LDFLAGS"
467 8cfb9104 2012-09-24 alex fi
468 ad86a41e 2019-04-20 alex PKG_CHECK_MODULES([OPENSSL], [libssl libcrypto],
469 b1893e74 2019-07-01 alex [LIBS="$LIBS $OPENSSL_LIBS" CFLAGS="$CFLAGS $OPENSSL_CFLAGS"
470 b1893e74 2019-07-01 alex AC_DEFINE(HAVE_LIBSSL, 1)],
471 ad86a41e 2019-04-20 alex [AC_CHECK_LIB(crypto, BIO_s_mem)
472 ad86a41e 2019-04-20 alex AC_CHECK_LIB(ssl, SSL_new)]
473 ad86a41e 2019-04-20 alex )
474 daa88b76 2016-12-05 alex AC_CHECK_FUNCS(SSL_new, x_ssl_openssl=yes,
475 8cfb9104 2012-09-24 alex AC_MSG_ERROR([Can't enable openssl])
476 8cfb9104 2012-09-24 alex )
477 8cfb9104 2012-09-24 alex fi
478 8cfb9104 2012-09-24 alex ]
479 8cfb9104 2012-09-24 alex )
480 8cfb9104 2012-09-24 alex
481 8cfb9104 2012-09-24 alex AC_ARG_WITH(gnutls,
482 8cfb9104 2012-09-24 alex AS_HELP_STRING([--with-gnutls],
483 8cfb9104 2012-09-24 alex [enable SSL support using gnutls]),
484 8cfb9104 2012-09-24 alex [ if test "$withval" != "no"; then
485 8cfb9104 2012-09-24 alex if test "$withval" != "yes"; then
486 8cfb9104 2012-09-24 alex CFLAGS="-I$withval/include $CFLAGS"
487 8cfb9104 2012-09-24 alex CPPFLAGS="-I$withval/include $CPPFLAGS"
488 8cfb9104 2012-09-24 alex LDFLAGS="-L$withval/lib $LDFLAGS"
489 8cfb9104 2012-09-24 alex fi
490 8cfb9104 2012-09-24 alex AC_CHECK_LIB(gnutls, gnutls_global_init)
491 8cfb9104 2012-09-24 alex AC_CHECK_FUNCS(gnutls_global_init, x_ssl_gnutls=yes,
492 8cfb9104 2012-09-24 alex AC_MSG_ERROR([Can't enable gnutls])
493 8cfb9104 2012-09-24 alex )
494 8cfb9104 2012-09-24 alex fi
495 8cfb9104 2012-09-24 alex ]
496 8cfb9104 2012-09-24 alex )
497 8cfb9104 2012-09-24 alex
498 8cfb9104 2012-09-24 alex x_ssl_lib="no"
499 8cfb9104 2012-09-24 alex if test "$x_ssl_gnutls" = "yes"; then
500 8cfb9104 2012-09-24 alex if test "$x_ssl_openssl" = "yes";then
501 8cfb9104 2012-09-24 alex AC_MSG_ERROR([Cannot enable both gnutls and openssl])
502 8cfb9104 2012-09-24 alex fi
503 8cfb9104 2012-09-24 alex x_ssl_lib=gnutls
504 8cfb9104 2012-09-24 alex fi
505 8cfb9104 2012-09-24 alex if test "$x_ssl_openssl" = "yes"; then
506 8cfb9104 2012-09-24 alex x_ssl_lib=openssl
507 8cfb9104 2012-09-24 alex fi
508 02850008 2020-05-06 noreply
509 02850008 2020-05-06 noreply AM_CONDITIONAL(HAVE_SSL, [test $x_ssl_lib != "no"])
510 8cfb9104 2012-09-24 alex
511 8cfb9104 2012-09-24 alex # use TCP wrappers?
512 8cfb9104 2012-09-24 alex
513 8cfb9104 2012-09-24 alex x_tcpwrap_on=no
514 8cfb9104 2012-09-24 alex AC_ARG_WITH(tcp-wrappers,
515 8cfb9104 2012-09-24 alex AS_HELP_STRING([--with-tcp-wrappers],
516 8cfb9104 2012-09-24 alex [enable TCP wrappers support]),
517 8cfb9104 2012-09-24 alex [ if test "$withval" != "no"; then
518 8cfb9104 2012-09-24 alex if test "$withval" != "yes"; then
519 8cfb9104 2012-09-24 alex CFLAGS="-I$withval/include $CFLAGS"
520 8cfb9104 2012-09-24 alex CPPFLAGS="-I$withval/include $CPPFLAGS"
521 8cfb9104 2012-09-24 alex LDFLAGS="-L$withval/lib $LDFLAGS"
522 8cfb9104 2012-09-24 alex fi
523 8cfb9104 2012-09-24 alex AC_MSG_CHECKING(for hosts_access)
524 0f85c4c6 2014-01-17 alex saved_LIBS="$LIBS"
525 8cfb9104 2012-09-24 alex LIBS="-lwrap $LIBS"
526 0f85c4c6 2014-01-17 alex LIBS_END="-lwrap $LIBS_END"
527 bc098794 2014-01-02 alex AC_LINK_IFELSE([AC_LANG_PROGRAM([[
528 e747fe92 2014-01-17 alex #include <sys/types.h>
529 e747fe92 2014-01-17 alex #include <sys/socket.h>
530 8cfb9104 2012-09-24 alex #include <tcpd.h>
531 8cfb9104 2012-09-24 alex int allow_severity = 0;
532 8cfb9104 2012-09-24 alex int deny_severity = 0;
533 bc098794 2014-01-02 alex ]],[[
534 8cfb9104 2012-09-24 alex tcpd_warn("link test");
535 bc098794 2014-01-02 alex ]])],[
536 8cfb9104 2012-09-24 alex AC_MSG_RESULT(yes)
537 8cfb9104 2012-09-24 alex AC_DEFINE(TCPWRAP, 1)
538 8cfb9104 2012-09-24 alex x_tcpwrap_on=yes
539 8cfb9104 2012-09-24 alex ],[
540 8cfb9104 2012-09-24 alex AC_MSG_RESULT(no)
541 8cfb9104 2012-09-24 alex AC_MSG_ERROR([Can't enable TCP wrappers!])
542 8cfb9104 2012-09-24 alex ])
543 0f85c4c6 2014-01-17 alex LIBS="$saved_LIBS"
544 8cfb9104 2012-09-24 alex fi
545 8cfb9104 2012-09-24 alex ]
546 8cfb9104 2012-09-24 alex )
547 8cfb9104 2012-09-24 alex
548 8cfb9104 2012-09-24 alex # do IDENT requests using libident?
549 8cfb9104 2012-09-24 alex
550 8cfb9104 2012-09-24 alex x_identauth_on=no
551 8cfb9104 2012-09-24 alex AC_ARG_WITH(ident,
552 8cfb9104 2012-09-24 alex AS_HELP_STRING([--with-ident],
553 8cfb9104 2012-09-24 alex [enable "IDENT" ("AUTH") protocol support]),
554 8cfb9104 2012-09-24 alex [ if test "$withval" != "no"; then
555 8cfb9104 2012-09-24 alex if test "$withval" != "yes"; then
556 8cfb9104 2012-09-24 alex CFLAGS="-I$withval/include $CFLAGS"
557 8cfb9104 2012-09-24 alex CPPFLAGS="-I$withval/include $CPPFLAGS"
558 8cfb9104 2012-09-24 alex LDFLAGS="-L$withval/lib $LDFLAGS"
559 8cfb9104 2012-09-24 alex fi
560 8cfb9104 2012-09-24 alex AC_CHECK_LIB(ident, ident_id)
561 8cfb9104 2012-09-24 alex AC_CHECK_FUNCS(ident_id, x_identauth_on=yes,
562 8cfb9104 2012-09-24 alex AC_MSG_ERROR([Can't enable IDENT support!])
563 8cfb9104 2012-09-24 alex )
564 8cfb9104 2012-09-24 alex fi
565 8cfb9104 2012-09-24 alex ]
566 8cfb9104 2012-09-24 alex )
567 8cfb9104 2012-09-24 alex if test "$x_identauth_on" = "yes"; then
568 8cfb9104 2012-09-24 alex AC_DEFINE(IDENTAUTH, 1)
569 8cfb9104 2012-09-24 alex AC_CHECK_HEADERS(ident.h,,AC_MSG_ERROR([required C header missing!]))
570 8cfb9104 2012-09-24 alex fi
571 8cfb9104 2012-09-24 alex
572 8cfb9104 2012-09-24 alex # compile in PAM support?
573 8cfb9104 2012-09-24 alex
574 8cfb9104 2012-09-24 alex x_pam_on=no
575 8cfb9104 2012-09-24 alex AC_ARG_WITH(pam,
576 8cfb9104 2012-09-24 alex AS_HELP_STRING([--with-pam],
577 8cfb9104 2012-09-24 alex [enable user authentication using PAM]),
578 8cfb9104 2012-09-24 alex [ if test "$withval" != "no"; then
579 8cfb9104 2012-09-24 alex if test "$withval" != "yes"; then
580 8cfb9104 2012-09-24 alex CFLAGS="-I$withval/include $CFLAGS"
581 8cfb9104 2012-09-24 alex CPPFLAGS="-I$withval/include $CPPFLAGS"
582 8cfb9104 2012-09-24 alex LDFLAGS="-L$withval/lib $LDFLAGS"
583 8cfb9104 2012-09-24 alex fi
584 8cfb9104 2012-09-24 alex AC_CHECK_LIB(pam, pam_authenticate)
585 8cfb9104 2012-09-24 alex AC_CHECK_FUNCS(pam_authenticate, x_pam_on=yes,
586 8cfb9104 2012-09-24 alex AC_MSG_ERROR([Can't enable PAM support!])
587 8cfb9104 2012-09-24 alex )
588 8cfb9104 2012-09-24 alex fi
589 8cfb9104 2012-09-24 alex ]
590 8cfb9104 2012-09-24 alex )
591 8cfb9104 2012-09-24 alex if test "$x_pam_on" = "yes"; then
592 8cfb9104 2012-09-24 alex AC_DEFINE(PAM, 1)
593 8cfb9104 2012-09-24 alex AC_CHECK_HEADERS(security/pam_appl.h,pam_ok=yes)
594 8cfb9104 2012-09-24 alex if test "$pam_ok" != "yes"; then
595 8cfb9104 2012-09-24 alex AC_CHECK_HEADERS(pam/pam_appl.h,pam_ok=yes,
596 8cfb9104 2012-09-24 alex AC_MSG_ERROR([required C header missing!]))
597 8cfb9104 2012-09-24 alex fi
598 8cfb9104 2012-09-24 alex fi
599 8cfb9104 2012-09-24 alex
600 8cfb9104 2012-09-24 alex # compile in IRC+ protocol support?
601 8cfb9104 2012-09-24 alex
602 8cfb9104 2012-09-24 alex x_ircplus_on=yes
603 8cfb9104 2012-09-24 alex AC_ARG_ENABLE(ircplus,
604 8cfb9104 2012-09-24 alex AS_HELP_STRING([--disable-ircplus],
605 8cfb9104 2012-09-24 alex [disable IRC+ protocol]),
606 8cfb9104 2012-09-24 alex if test "$enableval" = "no"; then x_ircplus_on=no; fi
607 8cfb9104 2012-09-24 alex )
608 8cfb9104 2012-09-24 alex if test "$x_ircplus_on" = "yes"; then
609 8cfb9104 2012-09-24 alex AC_DEFINE(IRCPLUS, 1)
610 46b0eef7 2012-10-06 alex
611 46b0eef7 2012-10-06 alex # Compile in iconv support?
612 46b0eef7 2012-10-06 alex # We only check for it when IRC+ is enabled, because the IRC+ command
613 46b0eef7 2012-10-06 alex # CHARCONV is the only function depending on it.
614 46b0eef7 2012-10-06 alex x_iconv_on=no
615 46b0eef7 2012-10-06 alex AC_ARG_WITH(iconv,
616 b4966aa1 2013-01-06 alex AS_HELP_STRING([--with-iconv],
617 d5763937 2013-02-15 alex [enable character conversion using libiconv]),
618 46b0eef7 2012-10-06 alex [ if test "$withval" != "no"; then
619 46b0eef7 2012-10-06 alex if test "$withval" != "yes"; then
620 46b0eef7 2012-10-06 alex CFLAGS="-I$withval/include $CFLAGS"
621 46b0eef7 2012-10-06 alex CPPFLAGS="-I$withval/include $CPPFLAGS"
622 46b0eef7 2012-10-06 alex LDFLAGS="-L$withval/lib $LDFLAGS"
623 46b0eef7 2012-10-06 alex fi
624 46b0eef7 2012-10-06 alex AC_CHECK_LIB(iconv, iconv_open)
625 a14eb495 2013-03-24 alex AC_CHECK_FUNCS(iconv_open, x_iconv_on=yes)
626 a14eb495 2013-03-24 alex if test "$x_iconv_on" != "yes"; then
627 2c969664 2013-02-15 alex AC_CHECK_LIB(iconv, libiconv_open)
628 a14eb495 2013-03-24 alex AC_CHECK_FUNCS(libiconv_open, x_iconv_on=yes)
629 a14eb495 2013-03-24 alex fi
630 a14eb495 2013-03-24 alex if test "$x_iconv_on" != "yes"; then
631 a14eb495 2013-03-24 alex AC_MSG_ERROR([Can't enable libiconv support!])
632 a14eb495 2013-03-24 alex fi
633 a14eb495 2013-03-24 alex fi ]
634 46b0eef7 2012-10-06 alex )
635 46b0eef7 2012-10-06 alex if test "$x_iconv_on" = "yes"; then
636 46b0eef7 2012-10-06 alex AC_DEFINE(ICONV, 1)
637 46b0eef7 2012-10-06 alex fi
638 8cfb9104 2012-09-24 alex fi
639 8cfb9104 2012-09-24 alex
640 8cfb9104 2012-09-24 alex # enable support for IPv6?
641 8cfb9104 2012-09-24 alex x_ipv6_on=no
642 8cfb9104 2012-09-24 alex AC_ARG_ENABLE(ipv6,
643 8cfb9104 2012-09-24 alex AS_HELP_STRING([--enable-ipv6],
644 8cfb9104 2012-09-24 alex [enable IPv6 protocol support]),
645 8cfb9104 2012-09-24 alex if test "$enableval" = "yes"; then x_ipv6_on=yes; fi
646 8cfb9104 2012-09-24 alex )
647 8cfb9104 2012-09-24 alex if test "$x_ipv6_on" = "yes"; then
648 8cfb9104 2012-09-24 alex # getaddrinfo() and getnameinfo() are optional when not compiling
649 8cfb9104 2012-09-24 alex # with IPv6 support, but are required for IPv6 to work!
650 8cfb9104 2012-09-24 alex AC_CHECK_FUNCS([ \
651 8cfb9104 2012-09-24 alex getaddrinfo getnameinfo \
652 8cfb9104 2012-09-24 alex ],,AC_MSG_ERROR([required function missing for IPv6 support!]))
653 8cfb9104 2012-09-24 alex AC_DEFINE(WANT_IPV6, 1)
654 8cfb9104 2012-09-24 alex fi
655 8cfb9104 2012-09-24 alex
656 8cfb9104 2012-09-24 alex # compile in IRC "sniffer"?
657 8cfb9104 2012-09-24 alex
658 8cfb9104 2012-09-24 alex x_sniffer_on=no; x_debug_on=no
659 8cfb9104 2012-09-24 alex AC_ARG_ENABLE(sniffer,
660 8cfb9104 2012-09-24 alex AS_HELP_STRING([--enable-sniffer],
661 8cfb9104 2012-09-24 alex [enable IRC traffic sniffer (enables debug mode)]),
662 8cfb9104 2012-09-24 alex if test "$enableval" = "yes"; then
663 8cfb9104 2012-09-24 alex AC_DEFINE(SNIFFER, 1)
664 8cfb9104 2012-09-24 alex x_sniffer_on=yes; x_debug_on=yes
665 8cfb9104 2012-09-24 alex fi
666 8cfb9104 2012-09-24 alex )
667 8cfb9104 2012-09-24 alex
668 8cfb9104 2012-09-24 alex # enable additional debugging code?
669 8cfb9104 2012-09-24 alex
670 8cfb9104 2012-09-24 alex AC_ARG_ENABLE(debug,
671 8cfb9104 2012-09-24 alex AS_HELP_STRING([--enable-debug],
672 8cfb9104 2012-09-24 alex [show additional debug output]),
673 8cfb9104 2012-09-24 alex if test "$enableval" = "yes"; then x_debug_on=yes; fi
674 8cfb9104 2012-09-24 alex )
675 8cfb9104 2012-09-24 alex if test "$x_debug_on" = "yes"; then
676 8cfb9104 2012-09-24 alex AC_DEFINE(DEBUG, 1)
677 8cfb9104 2012-09-24 alex test "$GCC" = "yes" && CFLAGS="-pedantic $CFLAGS"
678 8cfb9104 2012-09-24 alex AC_CHECK_FUNCS(mtrace)
679 8cfb9104 2012-09-24 alex fi
680 8cfb9104 2012-09-24 alex
681 8cfb9104 2012-09-24 alex # enable "strict RFC rules"?
682 8cfb9104 2012-09-24 alex
683 8cfb9104 2012-09-24 alex x_strict_rfc_on=no
684 8cfb9104 2012-09-24 alex AC_ARG_ENABLE(strict-rfc,
685 8cfb9104 2012-09-24 alex AS_HELP_STRING([--enable-strict-rfc],
686 8cfb9104 2012-09-24 alex [strict RFC conformance -- may break clients!]),
687 8cfb9104 2012-09-24 alex if test "$enableval" = "yes"; then
688 8cfb9104 2012-09-24 alex AC_DEFINE(STRICT_RFC, 1)
689 8cfb9104 2012-09-24 alex x_strict_rfc_on=yes
690 8cfb9104 2012-09-24 alex fi
691 8cfb9104 2012-09-24 alex )
692 8cfb9104 2012-09-24 alex
693 8cfb9104 2012-09-24 alex # -- Definitions --
694 8cfb9104 2012-09-24 alex
695 8cfb9104 2012-09-24 alex AC_DEFINE_UNQUOTED(HOST_CPU, "$host_cpu" )
696 8cfb9104 2012-09-24 alex AC_DEFINE_UNQUOTED(HOST_VENDOR, "$host_vendor" )
697 8cfb9104 2012-09-24 alex AC_DEFINE_UNQUOTED(HOST_OS, "$host_os" )
698 8cfb9104 2012-09-24 alex
699 0f85c4c6 2014-01-17 alex # Add additional CFLAGS, LDFLAGS and LIBS which were specified on the command
700 0f85c4c6 2014-01-17 alex # line or by some tests from above, but after running this script. Useful for
701 0f85c4c6 2014-01-17 alex # adding "-Werror", for example:
702 8cfb9104 2012-09-24 alex test -n "$CFLAGS_END" && CFLAGS="$CFLAGS $CFLAGS_END"
703 0f85c4c6 2014-01-17 alex test -n "$LDFLAGS_END" && LDFLAGS="$LDFLAGS $LDFLAGS_END"
704 0f85c4c6 2014-01-17 alex test -n "$LIBS_END" && LIBS="$LIBS $LIBS_END"
705 8cfb9104 2012-09-24 alex
706 8cfb9104 2012-09-24 alex # -- Generate files --
707 8cfb9104 2012-09-24 alex
708 8cfb9104 2012-09-24 alex AC_CONFIG_FILES([ \
709 8cfb9104 2012-09-24 alex Makefile \
710 8cfb9104 2012-09-24 alex contrib/Debian/Makefile \
711 8cfb9104 2012-09-24 alex contrib/MacOSX/Makefile \
712 8cfb9104 2012-09-24 alex contrib/MacOSX/ngIRCd.pmdoc/Makefile \
713 8cfb9104 2012-09-24 alex contrib/MacOSX/ngIRCd.xcodeproj/Makefile \
714 8cfb9104 2012-09-24 alex contrib/Makefile \
715 8cfb9104 2012-09-24 alex doc/Makefile \
716 8cfb9104 2012-09-24 alex doc/src/Makefile \
717 8cfb9104 2012-09-24 alex man/Makefile \
718 8cfb9104 2012-09-24 alex src/ipaddr/Makefile \
719 8cfb9104 2012-09-24 alex src/Makefile \
720 8cfb9104 2012-09-24 alex src/ngircd/Makefile \
721 8cfb9104 2012-09-24 alex src/portab/Makefile \
722 8cfb9104 2012-09-24 alex src/testsuite/Makefile \
723 8cfb9104 2012-09-24 alex src/tool/Makefile \
724 8cfb9104 2012-09-24 alex ])
725 8cfb9104 2012-09-24 alex
726 8cfb9104 2012-09-24 alex AC_OUTPUT
727 8cfb9104 2012-09-24 alex
728 8cfb9104 2012-09-24 alex type dpkg >/dev/null 2>&1
729 8cfb9104 2012-09-24 alex if test $? -eq 0; then
730 8cfb9104 2012-09-24 alex # Generate debian/ link if the dpkg command exists
731 8cfb9104 2012-09-24 alex # (read: if we are running on a debian compatible system)
732 8cfb9104 2012-09-24 alex echo "creating Debian-specific links ..."
733 14a84dfc 2014-01-26 alex if test ! -f debian/rules -a -f contrib/Debian/rules; then
734 14a84dfc 2014-01-26 alex ln -s contrib/Debian debian
735 14a84dfc 2014-01-26 alex fi
736 8cfb9104 2012-09-24 alex fi
737 8cfb9104 2012-09-24 alex
738 8cfb9104 2012-09-24 alex # -- Result --
739 8cfb9104 2012-09-24 alex
740 8cfb9104 2012-09-24 alex echo
741 8cfb9104 2012-09-24 alex echo "ngIRCd $PACKAGE_VERSION has been configured with the following options:"
742 8cfb9104 2012-09-24 alex echo
743 8cfb9104 2012-09-24 alex
744 8cfb9104 2012-09-24 alex # Someone please show me a better way :) [borrowed by OpenSSH]
745 8cfb9104 2012-09-24 alex B=`eval echo ${bindir}` ; B=`eval echo ${B}`
746 8cfb9104 2012-09-24 alex S=`eval echo ${sbindir}` ; S=`eval echo ${S}`
747 8cfb9104 2012-09-24 alex C=`eval echo ${sysconfdir}` ; C=`eval echo ${C}`
748 8cfb9104 2012-09-24 alex M=`eval echo ${mandir}` ; M=`eval echo ${M}`
749 8cfb9104 2012-09-24 alex D=`eval echo ${docdir}` ; D=`eval echo ${D}`
750 8cfb9104 2012-09-24 alex
751 8cfb9104 2012-09-24 alex echo " Host: ${host}"
752 8cfb9104 2012-09-24 alex echo " Compiler: ${CC}"
753 8cfb9104 2012-09-24 alex test -n "$CFLAGS" && echo " Compiler flags: ${CFLAGS}"
754 8cfb9104 2012-09-24 alex test -n "$CPPFLAGS" && echo " Preprocessor flags: ${CPPFLAGS}"
755 8cfb9104 2012-09-24 alex test -n "$LDFLAGS" && echo " Linker flags: ${LDFLAGS}"
756 8cfb9104 2012-09-24 alex test -n "$LIBS" && echo " Libraries: ${LIBS}"
757 8cfb9104 2012-09-24 alex echo
758 8cfb9104 2012-09-24 alex echo " 'ngircd' binary: $S"
759 8cfb9104 2012-09-24 alex echo " Configuration file: $C"
760 8cfb9104 2012-09-24 alex echo " Manual pages: $M"
761 8cfb9104 2012-09-24 alex echo " Documentation: $D"
762 8cfb9104 2012-09-24 alex echo
763 8cfb9104 2012-09-24 alex
764 8cfb9104 2012-09-24 alex echo $ECHO_N " Syslog support: $ECHO_C"
765 8cfb9104 2012-09-24 alex test "$x_syslog_on" = "yes" \
766 8cfb9104 2012-09-24 alex && echo $ECHO_N "yes $ECHO_C" \
767 8cfb9104 2012-09-24 alex || echo $ECHO_N "no $ECHO_C"
768 8cfb9104 2012-09-24 alex echo $ECHO_N " Enable debug code: $ECHO_C"
769 8cfb9104 2012-09-24 alex test "$x_debug_on" = "yes" \
770 8cfb9104 2012-09-24 alex && echo "yes" \
771 8cfb9104 2012-09-24 alex || echo "no"
772 8cfb9104 2012-09-24 alex
773 8cfb9104 2012-09-24 alex echo $ECHO_N " zlib compression: $ECHO_C"
774 8cfb9104 2012-09-24 alex test "$x_zlib_on" = "yes" \
775 8cfb9104 2012-09-24 alex && echo $ECHO_N "yes $ECHO_C" \
776 8cfb9104 2012-09-24 alex || echo $ECHO_N "no $ECHO_C"
777 8cfb9104 2012-09-24 alex echo $ECHO_N " IRC sniffer: $ECHO_C"
778 8cfb9104 2012-09-24 alex test "$x_sniffer_on" = "yes" \
779 8cfb9104 2012-09-24 alex && echo "yes" \
780 8cfb9104 2012-09-24 alex || echo "no"
781 8cfb9104 2012-09-24 alex
782 8cfb9104 2012-09-24 alex echo $ECHO_N " Use TCP Wrappers: $ECHO_C"
783 8cfb9104 2012-09-24 alex test "$x_tcpwrap_on" = "yes" \
784 8cfb9104 2012-09-24 alex && echo $ECHO_N "yes $ECHO_C" \
785 8cfb9104 2012-09-24 alex || echo $ECHO_N "no $ECHO_C"
786 8cfb9104 2012-09-24 alex echo $ECHO_N " Strict RFC mode: $ECHO_C"
787 8cfb9104 2012-09-24 alex test "$x_strict_rfc_on" = "yes" \
788 8cfb9104 2012-09-24 alex && echo "yes" \
789 8cfb9104 2012-09-24 alex || echo "no"
790 8cfb9104 2012-09-24 alex
791 8cfb9104 2012-09-24 alex echo $ECHO_N " IDENT support: $ECHO_C"
792 8cfb9104 2012-09-24 alex test "$x_identauth_on" = "yes" \
793 8cfb9104 2012-09-24 alex && echo $ECHO_N "yes $ECHO_C" \
794 8cfb9104 2012-09-24 alex || echo $ECHO_N "no $ECHO_C"
795 8cfb9104 2012-09-24 alex echo $ECHO_N " IRC+ protocol: $ECHO_C"
796 8cfb9104 2012-09-24 alex test "$x_ircplus_on" = "yes" \
797 8cfb9104 2012-09-24 alex && echo "yes" \
798 8cfb9104 2012-09-24 alex || echo "no"
799 8cfb9104 2012-09-24 alex
800 8cfb9104 2012-09-24 alex echo $ECHO_N " IPv6 protocol: $ECHO_C"
801 8cfb9104 2012-09-24 alex test "$x_ipv6_on" = "yes" \
802 8cfb9104 2012-09-24 alex && echo $ECHO_N "yes $ECHO_C" \
803 8cfb9104 2012-09-24 alex || echo $ECHO_N "no $ECHO_C"
804 8cfb9104 2012-09-24 alex echo $ECHO_N " I/O backend: $ECHO_C"
805 aeebde46 2013-08-11 alex echo "$x_io_backend"
806 8cfb9104 2012-09-24 alex
807 8cfb9104 2012-09-24 alex echo $ECHO_N " PAM support: $ECHO_C"
808 8cfb9104 2012-09-24 alex test "$x_pam_on" = "yes" \
809 8cfb9104 2012-09-24 alex && echo $ECHO_N "yes $ECHO_C" \
810 8cfb9104 2012-09-24 alex || echo $ECHO_N "no $ECHO_C"
811 8cfb9104 2012-09-24 alex echo $ECHO_N " SSL support: $ECHO_C"
812 8cfb9104 2012-09-24 alex echo "$x_ssl_lib"
813 8cfb9104 2012-09-24 alex
814 46b0eef7 2012-10-06 alex echo $ECHO_N " libiconv support: $ECHO_C"
815 46b0eef7 2012-10-06 alex echo "$x_iconv_on"
816 46b0eef7 2012-10-06 alex
817 8cfb9104 2012-09-24 alex echo
818 8cfb9104 2012-09-24 alex
819 0703fcd7 2013-01-05 alex define(_automake_regex_,[[^AUTOMAKE_OPTIONS = [a-z .\-]*/portab/ansi2knr]])
820 0703fcd7 2013-01-05 alex if ! grep "_automake_regex_" src/ngircd/Makefile.am >/dev/null 2>&1; then
821 8cfb9104 2012-09-24 alex echo "WARNING:"
822 8cfb9104 2012-09-24 alex echo "This GNU automake generated build system does not support \"de-ANSI-fication\","
823 8cfb9104 2012-09-24 alex echo "therefore don't use it to generate \"official\" distribution archives!"
824 8cfb9104 2012-09-24 alex echo "(Most probably you want to use GNU automake 1.11.x for this purpose ...)"
825 8cfb9104 2012-09-24 alex echo
826 8cfb9104 2012-09-24 alex fi
827 8cfb9104 2012-09-24 alex
828 8cfb9104 2012-09-24 alex # -eof-