1 |
dnl Inspired by work Copyright (C) 2006 Luca Filipozzi |
2 |
dnl vim: set fdm=marker sw=2 ts=2 et si: |
3 |
dnl {{{ ax_check_lib_ipv4 |
4 |
AC_DEFUN([AX_CHECK_LIB_IPV4],[ |
5 |
AC_SEARCH_LIBS([socket],[socket],,[AC_MSG_ERROR([socket library not found])]) |
6 |
AC_CHECK_FUNCS([inet_aton inet_ntop inet_pton]) |
7 |
AC_CHECK_TYPES([struct sockaddr_in, struct sockaddr_storage, struct addrinfo],,,[#include <netdb.h>]) |
8 |
AC_CHECK_MEMBERS([struct sockaddr_in.sin_len],,,[#include <netdb.h>]) |
9 |
])dnl }}} |
10 |
dnl {{{ ax_check_lib_ipv6 |
11 |
AC_DEFUN([AX_CHECK_LIB_IPV6],[ |
12 |
AC_CHECK_TYPES([struct sockaddr_in6],,[AC_DEFINE([IPV6],[1],[Define to 1 if you have IPv6 support.])],,[#include <netdb.h>]) |
13 |
])dnl }}} |
14 |
dnl {{{ ax_check_crypt |
15 |
AC_DEFUN([AX_CHECK_LIB_CRYPT],[ |
16 |
AC_SEARCH_LIBS(crypt, [crypt descrypt],,) |
17 |
AM_CONDITIONAL([HAVE_CRYPT],[test "$ac_cv_search_crypt" = "none required"]) |
18 |
])dnl }}} |
19 |
dnl {{{ ax_check_lib_openssl |
20 |
AC_DEFUN([AX_CHECK_LIB_OPENSSL],[ |
21 |
AC_CHECK_HEADER([openssl/sha.h],,[AC_MSG_ERROR([openssl header files not found])]) |
22 |
AC_CHECK_LIB([ssl],[SHA_Init],,[AC_MSG_ERROR([openssl library not found])]) |
23 |
AC_CHECK_LIB([crypto],[EVP_MD_CTX_init],,[AC_MSG_ERROR([openssl library not found])]) |
24 |
])dnl }}} |
25 |
dnl {{{ ax_arg_enable_ioloop_mechanism (FIXME) |
26 |
AC_DEFUN([AX_ARG_ENABLE_IOLOOP_MECHANISM],[ |
27 |
dnl {{{ allow the user to specify desired mechanism |
28 |
desired_iopoll_mechanism="none" |
29 |
dnl FIXME need to handle arguments a bit better (see ac_arg_disable_block_alloc) |
30 |
AC_ARG_ENABLE([kqueue], [AC_HELP_STRING([--enable-kqueue], [Force kqueue usage.])], [desired_iopoll_mechanism="kqueue"]) |
31 |
AC_ARG_ENABLE([epoll], [AC_HELP_STRING([--enable-epoll], [Force epoll usage.])], [desired_iopoll_mechanism="epoll"]) |
32 |
AC_ARG_ENABLE([devpoll],[AC_HELP_STRING([--enable-devpoll],[Force devpoll usage.])],[desired_iopoll_mechanism="devpoll"]) |
33 |
AC_ARG_ENABLE([rtsigio],[AC_HELP_STRING([--enable-rtsigio],[Force rtsigio usage.])],[desired_iopoll_mechanism="rtsigio"]) |
34 |
AC_ARG_ENABLE([poll], [AC_HELP_STRING([--enable-poll], [Force poll usage.])], [desired_iopoll_mechanism="poll"]) |
35 |
AC_ARG_ENABLE([select], [AC_HELP_STRING([--enable-select], [Force select usage.])], [desired_iopoll_mechanism="select"]) |
36 |
dnl }}} |
37 |
dnl {{{ preamble |
38 |
AC_MSG_CHECKING([for optimal/desired iopoll mechanism]) |
39 |
iopoll_mechanism_none=0 |
40 |
AC_DEFINE_UNQUOTED([__IOPOLL_MECHANISM_NONE],[$iopoll_mechanism_none],[no iopoll mechanism]) |
41 |
dnl }}} |
42 |
dnl {{{ check for kqueue mechanism support |
43 |
iopoll_mechanism_kqueue=1 |
44 |
AC_DEFINE_UNQUOTED([__IOPOLL_MECHANISM_KQUEUE],[$iopoll_mechanism_kqueue],[kqueue mechanism]) |
45 |
AC_LINK_IFELSE([AC_LANG_FUNC_LINK_TRY([kevent])],[is_kqueue_mechanism_available="yes"],[is_kqueue_mechanism_available="no"]) |
46 |
dnl }}} |
47 |
dnl {{{ check for epoll oechanism support |
48 |
iopoll_mechanism_epoll=2 |
49 |
AC_DEFINE_UNQUOTED([__IOPOLL_MECHANISM_EPOLL],[$iopoll_mechanism_epoll],[epoll mechanism]) |
50 |
AC_RUN_IFELSE([ |
51 |
#include <sys/epoll.h> |
52 |
#include <sys/syscall.h> |
53 |
#if defined(__stub_epoll_create) || defined(__stub___epoll_create) || defined(EPOLL_NEED_BODY) |
54 |
#if !defined(__NR_epoll_create) |
55 |
#if defined(__ia64__) |
56 |
#define __NR_epoll_create 1243 |
57 |
#elif defined(__x86_64__) |
58 |
#define __NR_epoll_create 214 |
59 |
#elif defined(__sparc64__) || defined(__sparc__) |
60 |
#define __NR_epoll_create 193 |
61 |
#elif defined(__s390__) || defined(__m68k__) |
62 |
#define __NR_epoll_create 249 |
63 |
#elif defined(__ppc64__) || defined(__ppc__) |
64 |
#define __NR_epoll_create 236 |
65 |
#elif defined(__parisc__) || defined(__arm26__) || defined(__arm__) |
66 |
#define __NR_epoll_create 224 |
67 |
#elif defined(__alpha__) |
68 |
#define __NR_epoll_create 407 |
69 |
#elif defined(__sh64__) |
70 |
#define __NR_epoll_create 282 |
71 |
#elif defined(__i386__) || defined(__sh__) || defined(__m32r__) || defined(__h8300__) || defined(__frv__) |
72 |
#define __NR_epoll_create 254 |
73 |
#else |
74 |
#error No system call numbers defined for epoll family. |
75 |
#endif |
76 |
#endif |
77 |
_syscall1(int, epoll_create, int, size) |
78 |
#endif |
79 |
main() { return epoll_create(256) == -1 ? 1 : 0; } |
80 |
],[is_epoll_mechanism_available="yes"],[is_epoll_mechanism_available="no"]) |
81 |
dnl }}} |
82 |
dnl {{{ check for devpoll mechanism support |
83 |
iopoll_mechanism_devpoll=3 |
84 |
AC_DEFINE_UNQUOTED([__IOPOLL_MECHANISM_DEVPOLL],[$iopoll_mechanism_devpoll],[devpoll mechanism]) |
85 |
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <devpoll.h>])],[is_devpoll_mechanism_available="yes"],[is_devpoll_mechanism_available="no"]) |
86 |
if test "$is_devpoll_mechanism_available" = "yes" ; then |
87 |
AC_DEFINE([HAVE_DEVPOLL_H],[1],[Define to 1 if you have the <devpoll.h> header file.]) |
88 |
fi |
89 |
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/devpoll.h>])],[is_devpoll_mechanism_available="yes"],[is_devpoll_mechanism_available="no"]) |
90 |
if test "$is_devpoll_mechanism_available" = "yes" ; then |
91 |
AC_DEFINE([HAVE_SYS_DEVPOLL_H],[1],[Define to 1 if you have the <sys/devpoll.h> header file.]) |
92 |
fi |
93 |
dnl }}} |
94 |
dnl {{{ check for rtsigio mechanism support |
95 |
iopoll_mechanism_rtsigio=4 |
96 |
AC_DEFINE_UNQUOTED([__IOPOLL_MECHANISM_RTSIGIO],[$iopoll_mechanism_rtsigio],[rtsigio mechanism]) |
97 |
AC_RUN_IFELSE([AC_LANG_PROGRAM([ |
98 |
#include <fcntl.h> |
99 |
#ifdef F_SETSIG |
100 |
main () { return 0; } /* F_SETSIG defined */ |
101 |
#else |
102 |
main () { return 1; } /* F_SETSIG not defined */ |
103 |
#endif |
104 |
])],[is_rtsigio_mechanism_available="yes"],[is_rtsigio_mechanism_available="no"]) |
105 |
dnl }}} |
106 |
dnl {{{ check for poll mechanism support |
107 |
iopoll_mechanism_poll=5 |
108 |
AC_DEFINE_UNQUOTED([__IOPOLL_MECHANISM_POLL],[$iopoll_mechanism_poll],[poll mechanism]) |
109 |
AC_LINK_IFELSE([AC_LANG_FUNC_LINK_TRY([poll])],[is_poll_mechanism_available="yes"],[is_poll_mechanism_available="no"]) |
110 |
dnl }}} |
111 |
dnl {{{ check for select mechanism support |
112 |
iopoll_mechanism_select=6 |
113 |
AC_DEFINE_UNQUOTED([__IOPOLL_MECHANISM_SELECT],[$iopoll_mechanism_select],[select mechanism]) |
114 |
AC_LINK_IFELSE([AC_LANG_FUNC_LINK_TRY([select])],[is_select_mechanism_available="yes"],[is_select_mechanism_available="no"]) |
115 |
dnl }}} |
116 |
dnl {{{ determine the optimal mechanism |
117 |
optimal_iopoll_mechanism="none" |
118 |
for mechanism in "kqueue" "epoll" "devpoll" "rtsigio" "poll" "select" ; do # order is important |
119 |
eval "is_optimal_iopoll_mechanism_available=\$is_${mechanism}_mechanism_available" |
120 |
if test "$is_optimal_iopoll_mechanism_available" = "yes" ; then |
121 |
optimal_iopoll_mechanism="$mechanism" |
122 |
break |
123 |
fi |
124 |
done |
125 |
dnl }}} |
126 |
dnl {{{ select between optimal mechanism and desired mechanism (if specified) |
127 |
if test "$desired_iopoll_mechanism" = "none" ; then |
128 |
if test "$optimal_iopoll_mechanism" = "none" ; then |
129 |
AC_MSG_RESULT([none]) |
130 |
AC_MSG_ERROR([no iopoll mechanism found!]) |
131 |
else |
132 |
selected_iopoll_mechanism=$optimal_iopoll_mechanism |
133 |
AC_MSG_RESULT([$selected_iopoll_mechanism]) |
134 |
fi |
135 |
else |
136 |
eval "is_desired_iopoll_mechanism_available=\$is_${desired_iopoll_mechanism}_mechanism_available" |
137 |
if test "$is_desired_iopoll_mechanism_available" = "yes" ; then |
138 |
selected_iopoll_mechanism=$desired_iopoll_mechanism |
139 |
AC_MSG_RESULT([$selected_iopoll_mechanism]) |
140 |
else |
141 |
AC_MSG_RESULT([none]) |
142 |
AC_MSG_ERROR([desired iopoll mechanism, $desired_iopoll_mechanism, is not available]) |
143 |
fi |
144 |
fi |
145 |
dnl }}} |
146 |
dnl {{{ postamble |
147 |
eval "use_iopoll_mechanism=\$iopoll_mechanism_${selected_iopoll_mechanism}" |
148 |
AC_DEFINE_UNQUOTED([USE_IOPOLL_MECHANISM],[$use_iopoll_mechanism],[use this iopoll mechanism]) |
149 |
dnl }}} |
150 |
])dnl }}} |
151 |
dnl {{{ ax_arg_disable_block_alloc |
152 |
AC_DEFUN([AX_ARG_DISABLE_BLOCK_ALLOC],[ |
153 |
AC_ARG_ENABLE([block-alloc],[AC_HELP_STRING([--disable-block-alloc],[Disable block alloc.])],[block_alloc="$enableval"],[block_alloc="yes"]) |
154 |
if test "$block_alloc" = "no" ; then |
155 |
use_block_alloc=0 |
156 |
else |
157 |
use_block_alloc=1 |
158 |
fi |
159 |
AC_DEFINE_UNQUOTED([USE_BLOCK_ALLOC],[$use_block_alloc],[use block alloc]) |
160 |
])dnl }}} |
161 |
dnl {{{ ax_arg_disable_shared_modules (FIXME) |
162 |
AC_DEFUN([AX_ARG_DISABLE_SHARED_MODULES],[ |
163 |
AC_ARG_ENABLE([shared-modules],[AC_HELP_STRING([--disable-shared-modules],[Disable shared modules.])],[shared_modules="$enableval"],[shared_modules="yes"]) |
164 |
AC_CHECK_HEADERS([dlfcn.h link.h]) |
165 |
AC_CHECK_FUNCS([dlopen dlinfo]) |
166 |
if test "$shared_modules" = "yes" ; then |
167 |
use_shared_modules="yes" |
168 |
AC_CHECK_LIB([dl],[dlopen],,[AC_MSG_ERROR([dl library not found])]) |
169 |
AC_DEFINE([USE_SHARED_MODULES],[1],[Define to 1 if you want to use shared modules.]) |
170 |
else |
171 |
use_shared_modules="no" |
172 |
AC_MSG_WARN([shared module support has been disabled per supplied configure option]) |
173 |
fi |
174 |
AM_CONDITIONAL([USE_SHARED_MODULES],[test "$shared_modules" = "yes"]) |
175 |
])dnl }}} |
176 |
dnl {{{ ax_arg_with_topiclen |
177 |
AC_DEFUN([AX_ARG_WITH_TOPICLEN],[ |
178 |
AC_ARG_WITH([topiclen],[AC_HELP_STRING([--with-topiclen=<value>],[Set topic length (default 160).])],[topiclen="$withval"],[topiclen="160"]) |
179 |
AC_DEFINE_UNQUOTED([TOPICLEN],[($topiclen+1)],[Length of topics.]) |
180 |
])dnl }}} |
181 |
dnl {{{ ax_arg_with_nicklen |
182 |
AC_DEFUN([AX_ARG_WITH_NICKLEN],[ |
183 |
AC_ARG_WITH([nicklen],[AC_HELP_STRING([--with-nicklen=<value>],[Set nickname length (default 9).])],[nicklen="$withval"],[nicklen="9"]) |
184 |
AC_DEFINE_UNQUOTED([NICKLEN],[($nicklen+1)],[Length of nicknames.]) |
185 |
])dnl }}} |
186 |
dnl {{{ ax_arg_with_userlen |
187 |
AC_DEFUN([AX_ARG_WITH_USERLEN],[ |
188 |
AC_ARG_WITH([userlen],[AC_HELP_STRING([--with-userlen=<value>],[Set username length (default 9).])],[userlen="$withval"],[userlen="9"]) |
189 |
AC_DEFINE_UNQUOTED([USERLEN],[($userlen+1)],[Length of nicknames.]) |
190 |
])dnl }}} |
191 |
dnl {{{ ax_arg_with_hostlen |
192 |
AC_DEFUN([AX_ARG_WITH_HOSTLEN],[ |
193 |
AC_ARG_WITH([hostlen],[AC_HELP_STRING([--with-hostlen=<value>],[Set username length (default 62).])],[hostlen="$withval"],[hostlen="62"]) |
194 |
AC_DEFINE_UNQUOTED([HOSTLEN],[($hostlen+1)],[Length of nicknames.]) |
195 |
])dnl }}} |
196 |
dnl {{{ ax_arg_with_lclient_heap_size |
197 |
AC_DEFUN([AX_ARG_WITH_LCLIENT_HEAP_SIZE],[ |
198 |
AC_ARG_WITH([lclient-heap-size],[AC_HELP_STRING([--lclient-heap-size=<value>],[Set local client heap size (default 256).])],[lclient_heap_size="$withval"],[lclient_heap_size="256"]) |
199 |
AC_DEFINE_UNQUOTED([LCLIENT_HEAP_SIZE],[$lclient_heap_size],[Size of the local client heap.]) |
200 |
])dnl }}} |
201 |
dnl {{{ ax_arg_with_nickname_history_length |
202 |
AC_DEFUN([AX_ARG_WITH_NICKNAME_HISTORY_LENGTH],[ |
203 |
AC_ARG_WITH([nickname-history-length],[AC_HELP_STRING([--nickname-history-length=<value>],[Set length of nickname history list (default 1500).])],[nickname_history_length="$withval"],[nickname_history_length="1500"]) |
204 |
AC_DEFINE_UNQUOTED([NICKNAMEHISTORYLENGTH],[$nickname_history_length],[Size of the nickname history list.]) |
205 |
])dnl }}} |
206 |
dnl {{{ ax_arg_with_client_heap_size |
207 |
AC_DEFUN([AX_ARG_WITH_CLIENT_HEAP_SIZE],[ |
208 |
AC_ARG_WITH([client-heap-size],[AC_HELP_STRING([--client-heap-size=<value>],[Set client heap size (default 256).])],[client_heap_size="$withval"],[client_heap_size="256"]) |
209 |
AC_DEFINE_UNQUOTED([CLIENT_HEAP_SIZE],[$client_heap_size],[Size of the client heap.]) |
210 |
])dnl }}} |
211 |
dnl {{{ ax_arg_with_channel_heap_size |
212 |
AC_DEFUN([AX_ARG_WITH_CHANNEL_HEAP_SIZE],[ |
213 |
AC_ARG_WITH([channel-heap-size],[AC_HELP_STRING([--channel-heap-size=<value>],[Set channel heap size (default 256).])],[channel_heap_size="$withval"],[channel_heap_size="256"]) |
214 |
AC_DEFINE_UNQUOTED([CHANNEL_HEAP_SIZE],[$channel_heap_size],[Size of the channel heap.]) |
215 |
])dnl }}} |
216 |
dnl {{{ ax_arg_with_dbuf_heap_size |
217 |
AC_DEFUN([AX_ARG_WITH_DBUF_HEAP_SIZE],[ |
218 |
AC_ARG_WITH([dbuf-heap-size],[AC_HELP_STRING([--dbuf-heap-size=<value>],[Set dbuf heap size (default 64).])],[dbuf_heap_size="$withval"],[dbuf_heap_size="64"]) |
219 |
AC_DEFINE_UNQUOTED([DBUF_HEAP_SIZE],[$dbuf_heap_size],[Size of the dbuf heap.]) |
220 |
])dnl }}} |
221 |
dnl {{{ ax_arg_with_dnode_heap_size |
222 |
AC_DEFUN([AX_ARG_WITH_DNODE_HEAP_SIZE],[ |
223 |
AC_ARG_WITH([dnode-heap-size],[AC_HELP_STRING([--dnode-heap-size=<value>],[Set dnode heap size (default 256).])],[dnode_heap_size="$withval"],[dnode_heap_size="256"]) |
224 |
AC_DEFINE_UNQUOTED([DNODE_HEAP_SIZE],[$dnode_heap_size],[Size of the dlink_node heap.]) |
225 |
])dnl }}} |
226 |
dnl {{{ ax_arg_with_ban_heap_size |
227 |
AC_DEFUN([AX_ARG_WITH_BAN_HEAP_SIZE],[ |
228 |
AC_ARG_WITH([ban-heap-size],[AC_HELP_STRING([--ban-heap-size=<value>],[Set ban heap size (default 128).])],[ban_heap_size="$withval"],[ban_heap_size="128"]) |
229 |
AC_DEFINE_UNQUOTED([BAN_HEAP_SIZE],[$ban_heap_size],[Size of the ban heap.]) |
230 |
])dnl }}} |
231 |
dnl {{{ ax_arg_with_topic_heap_size |
232 |
AC_DEFUN([AX_ARG_WITH_TOPIC_HEAP_SIZE],[ |
233 |
AC_ARG_WITH([topic-heap-size],[AC_HELP_STRING([--topic-heap-size=<value>],[Set topic heap size (default 256).])],[topic_heap_size="$withval"],[topic_heap_size="256"]) |
234 |
AC_DEFINE_UNQUOTED([TOPIC_HEAP_SIZE],[$topic_heap_size],[Size of the topic heap.]) |
235 |
])dnl }}} |
236 |
dnl {{{ ax_arg_with_ircd_heap_size |
237 |
AC_DEFUN([AX_ARG_WITH_IRCD_HEAP_SIZE],[ |
238 |
AC_ARG_WITH([ircd-heap-size],[AC_HELP_STRING([--ircd-heap-size=<value>],[Set ircd heap size (default 8).])],[ircd_heap_size="$withval"],[ircd_heap_size="8"]) |
239 |
AC_DEFINE_UNQUOTED([IRCD_HEAP_SIZE],[$ircd_heap_size],[Size of the ircd heap.]) |
240 |
])dnl }}} |
241 |
dnl {{{ ax_arg_with_mqueue_heap_size |
242 |
AC_DEFUN([AX_ARG_WITH_MQUEUE_HEAP_SIZE],[ |
243 |
AC_ARG_WITH([mqueue-heap-size],[AC_HELP_STRING([--mqueue-size=<value>],[Set mqueue heap size (default 256).])],[mqueue_heap_size="$withval"],[mqueue_heap_size="256"]) |
244 |
AC_DEFINE_UNQUOTED([MQUEUE_HEAP_SIZE],[$mqueue_heap_size],[Size of the floodserv mqueue heap.]) |
245 |
])dnl }}} |
246 |
dnl {{{ ax_arg_with_fmsg_heap_size |
247 |
AC_DEFUN([AX_ARG_WITH_FMSG_HEAP_SIZE],[ |
248 |
AC_ARG_WITH([fmsg-heap-size],[AC_HELP_STRING([--fmsg-size=<value>],[Set fmsg heap size (default 256).])],[fmsg_heap_size="$withval"],[fmsg_heap_size="256"]) |
249 |
AC_DEFINE_UNQUOTED([FMSG_HEAP_SIZE],[$fmsg_heap_size],[Size of the floodserv fmsg heap.]) |
250 |
])dnl }}} |
251 |
dnl {{{ ax_arg_enable_efnet |
252 |
AC_DEFUN([AX_ARG_ENABLE_EFNET],[ |
253 |
AC_ARG_ENABLE([efnet],[AC_HELP_STRING([--enable-efnet],[For IRCDs running on EFnet.])],[efnet="$enableval"],[efnet="no"]) |
254 |
if test "$efnet" = "yes" ; then |
255 |
use_efnet="yes" |
256 |
AC_DEFINE([EFNET],[1],[Define to 1 if this server will be an EFnet server.]) |
257 |
AC_DEFINE([TS5_ONLY],[1],[If Defined to 1 server links to your network must have a minimum of TS5.]) |
258 |
else |
259 |
AC_DEFINE([INVARIANTS],[1],[Miscellaneous sanity checks for the IRCd. Makes it slightly slower]) |
260 |
use_efnet="no" |
261 |
fi |
262 |
AM_CONDITIONAL([EFNET],[test "$use_efnet" = "yes"]) |
263 |
])dnl }}} |
264 |
dnl {{{ ax_arg_enable_halfops |
265 |
AC_DEFUN([AX_ARG_ENABLE_HALFOPS],[ |
266 |
AC_ARG_ENABLE([halfops],[AC_HELP_STRING([--enable-halfops],[Enable halfops support.])],[halfops="$enableval"],[halfops="no"]) |
267 |
if test "$halfops" = "yes" ; then |
268 |
AC_DEFINE([HALFOPS],[1],[Define to 1 if you want halfops support.]) |
269 |
fi |
270 |
])dnl }}} |
271 |
dnl {{{ ax_arg_enable_debugging |
272 |
AC_DEFUN([AX_ARG_ENABLE_DEBUGGING],[ |
273 |
AC_ARG_ENABLE([debugging],[AC_HELP_STRING([--enable-debugging],[Enable debugging.])],[debugging="$enableval"],[debugging="no"]) |
274 |
if test "$debugging" = "yes" ; then |
275 |
AC_DEFINE([DEBUG],[1],[Define to 1 to enable debugging.]) |
276 |
CFLAGS="$CFLAGS -Wall -Werror -g -O0" |
277 |
else |
278 |
AC_DEFINE([NDEBUG],[1],[Define to 1 to disable debugging.]) |
279 |
fi |
280 |
])dnl }}} |
281 |
dnl {{{ ax_arg_enable_warnings |
282 |
AC_DEFUN([AX_ARG_ENABLE_WARNINGS],[ |
283 |
AC_ARG_ENABLE([warnings],[AC_HELP_STRING([--enable-warnings],[Enable compiler warnings.])],[warnings="$enableval"],[warnings="no"]) |
284 |
if test "$warnings" = "yes" ; then |
285 |
CFLAGS="-Wcast-qual -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wredundant-decls -Wshadow -Wwrite-strings -Wno-unused" |
286 |
fi |
287 |
])dnl }}} |
288 |
dnl {{{ ax_arg_enable_efence |
289 |
AC_DEFUN([AX_ARG_ENABLE_EFENCE],[ |
290 |
AC_ARG_ENABLE([efence],[AC_HELP_STRING([--enable-efence],[Enable compilation with ElectricFence.])],[efence="$enableval"],[efence="no"]) |
291 |
if test "$efence" = "yes" ; then |
292 |
AC_SEARCH_LIBS([malloc],[efence],,[AC_MSG_ERROR([efence library not found])]) |
293 |
fi |
294 |
])dnl }}} |
295 |
dnl {{{ ax_arg_enable_syslog |
296 |
AC_DEFUN([AX_ARG_ENABLE_SYSLOG],[ |
297 |
AC_CHECK_HEADERS([syslog.h sys/syslog.h]) |
298 |
AC_ARG_ENABLE([syslog],[AC_HELP_STRING([--enable-syslog="EVENTS"],[Enable syslog for events: users oper (space separated in quotes; default: disabled).])],[syslog="$enableval"],[syslog="no"]) |
299 |
if test "$enableval" != "no" ; then |
300 |
for option in $enableval ; do |
301 |
case "$option" in |
302 |
users) AC_DEFINE([SYSLOG_USERS],[1],[Send user log stuff to syslog.]) ;; |
303 |
oper) AC_DEFINE([SYSLOG_OPER],[1],[Send oper log stuff to syslog.]) ;; |
304 |
yes) : ;; |
305 |
*) AC_MSG_ERROR([invalid value for --enable-syslog: $option]) ;; |
306 |
esac |
307 |
done |
308 |
AC_DEFINE([USE_SYSLOG],[1],[Define to 1 if you want to use syslog.]) |
309 |
fi |
310 |
])dnl }}} |
311 |
dnl {{{ ax_arg_with_syslog_facility |
312 |
AC_DEFUN([AX_ARG_WITH_SYSLOG],[ |
313 |
AC_ARG_WITH([syslog-facility],[AC_HELP_STRING([--with-syslog-facility=LOG],[Define the syslog facility to use (default: LOG_LOCAL4)])],[syslog_facility="$withval"],[syslog_facility="LOG_LOCAL4"]) |
314 |
AC_DEFINE_UNQUOTED([LOG_FACILITY],[$syslog_facility],[Set to syslog facility to use.]) |
315 |
])dnl }}} |
316 |
dnl {{{ ac_define_dir |
317 |
dnl http://autoconf-archive.cryp.to/ac_define_dir.html |
318 |
AC_DEFUN([AC_DEFINE_DIR], [ |
319 |
prefix_NONE= |
320 |
exec_prefix_NONE= |
321 |
test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix |
322 |
test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix |
323 |
eval ac_define_dir="\"[$]$2\"" |
324 |
eval ac_define_dir="\"$ac_define_dir\"" |
325 |
AC_SUBST($1, "$ac_define_dir") |
326 |
AC_DEFINE_UNQUOTED($1, "$ac_define_dir", [$3]) |
327 |
test "$prefix_NONE" && prefix=NONE |
328 |
test "$exec_prefix_NONE" && exec_prefix=NONE |
329 |
])dnl }}} |
330 |
]) dnl }}} |