ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/acinclude.m4
(Generate patch)

Comparing:
ircd-hybrid-7.2/acinclude.m4 (file contents), Revision 1013 by michael, Sun Oct 18 14:26:49 2009 UTC vs.
ircd-hybrid/trunk/acinclude.m4 (file contents), Revision 1670 by michael, Tue Nov 20 21:30:04 2012 UTC

# Line 2 | Line 2 | dnl Inspired by work Copyright (C) 2006
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_CHECK_FUNC(getaddrinfo, [], AC_SEARCH_LIBS(getaddrinfo, nsl))
6 +  AC_CHECK_FUNC(getnameinfo, [], AC_SEARCH_LIBS(getnameinfo, nsl))
7    AC_SEARCH_LIBS([socket],[socket],,[AC_MSG_ERROR([socket library not found])])
6 –  AC_CHECK_FUNCS([inet_aton inet_ntop inet_pton])
8    AC_CHECK_TYPES([struct sockaddr_in, struct sockaddr_storage, struct addrinfo],,,[#include <sys/types.h>
9     #include <sys/socket.h>
10     #include <netdb.h>
# Line 13 | Line 14 | AC_DEFUN([AX_CHECK_LIB_IPV4],[
14   ])dnl }}}
15   dnl {{{ ax_check_lib_ipv6
16   AC_DEFUN([AX_CHECK_LIB_IPV6],[
17 <  AC_CHECK_TYPES([struct sockaddr_in6],,[AC_DEFINE([IPV6],[1],[Define to 1 if you have IPv6 support.])],,[#include <sys/types.h>
17 <   <sys/socket.h>])
17 >  AC_CHECK_TYPE([struct sockaddr_in6],[AC_DEFINE([IPV6],[1],[Define to 1 if you have IPv6 support.])],,[#include <netinet/in.h>])
18   ])dnl }}}
19   dnl {{{ ax_arg_enable_ioloop_mechanism (FIXME)
20   AC_DEFUN([AX_ARG_ENABLE_IOLOOP_MECHANISM],[
21    dnl {{{ allow the user to specify desired mechanism
22    desired_iopoll_mechanism="none"
23    dnl FIXME need to handle arguments a bit better (see ac_arg_disable_block_alloc)
24 <  AC_ARG_ENABLE([kqueue], [AC_HELP_STRING([--enable-kqueue], [Force kqueue usage.])], [desired_iopoll_mechanism="kqueue"])
25 <  AC_ARG_ENABLE([epoll],  [AC_HELP_STRING([--enable-epoll],  [Force epoll usage.])],  [desired_iopoll_mechanism="epoll"])
26 <  AC_ARG_ENABLE([devpoll],[AC_HELP_STRING([--enable-devpoll],[Force devpoll usage.])],[desired_iopoll_mechanism="devpoll"])
27 <  AC_ARG_ENABLE([rtsigio],[AC_HELP_STRING([--enable-rtsigio],[Force rtsigio usage.])],[desired_iopoll_mechanism="rtsigio"])
28 <  AC_ARG_ENABLE([poll],   [AC_HELP_STRING([--enable-poll],   [Force poll usage.])],   [desired_iopoll_mechanism="poll"])
29 <  AC_ARG_ENABLE([select], [AC_HELP_STRING([--enable-select], [Force select usage.])], [desired_iopoll_mechanism="select"])
24 >  AC_ARG_ENABLE([kqueue], [AS_HELP_STRING([--enable-kqueue], [Force kqueue usage.])], [desired_iopoll_mechanism="kqueue"])
25 >  AC_ARG_ENABLE([epoll],  [AS_HELP_STRING([--enable-epoll],  [Force epoll usage.])],  [desired_iopoll_mechanism="epoll"])
26 >  AC_ARG_ENABLE([devpoll],[AS_HELP_STRING([--enable-devpoll],[Force devpoll usage.])],[desired_iopoll_mechanism="devpoll"])
27 >  AC_ARG_ENABLE([rtsigio],[AS_HELP_STRING([--enable-rtsigio],[Force rtsigio usage.])],[desired_iopoll_mechanism="rtsigio"])
28 >  AC_ARG_ENABLE([poll],   [AS_HELP_STRING([--enable-poll],   [Force poll usage.])],   [desired_iopoll_mechanism="poll"])
29 >  AC_ARG_ENABLE([select], [AS_HELP_STRING([--enable-select], [Force select usage.])], [desired_iopoll_mechanism="select"])
30    dnl }}}
31    dnl {{{ preamble
32    AC_MSG_CHECKING([for optimal/desired iopoll mechanism])
# Line 41 | Line 41 | AC_DEFUN([AX_ARG_ENABLE_IOLOOP_MECHANISM
41    dnl {{{ check for epoll oechanism support
42    iopoll_mechanism_epoll=2
43    AC_DEFINE_UNQUOTED([__IOPOLL_MECHANISM_EPOLL],[$iopoll_mechanism_epoll],[epoll mechanism])
44 <  AC_RUN_IFELSE([
44 >  AC_RUN_IFELSE([AC_LANG_PROGRAM([[
45   #include <sys/epoll.h>
46   #include <sys/syscall.h>
47   #if defined(__stub_epoll_create) || defined(__stub___epoll_create) || defined(EPOLL_NEED_BODY)
# Line 70 | Line 70 | AC_DEFUN([AX_ARG_ENABLE_IOLOOP_MECHANISM
70   #endif
71   _syscall1(int, epoll_create, int, size)
72   #endif
73 < main() { return epoll_create(256) == -1 ? 1 : 0; }
74 <  ],[is_epoll_mechanism_available="yes"],[is_epoll_mechanism_available="no"])
73 > ]], [[ return epoll_create(256) == -1 ? 1 : 0 ]])],
74 >  [is_epoll_mechanism_available="yes"],[is_epoll_mechanism_available="no"])
75    dnl }}}
76    dnl {{{ check for devpoll mechanism support
77    iopoll_mechanism_devpoll=3
# Line 88 | Line 88 | main() { return epoll_create(256) == -1
88    dnl {{{ check for rtsigio mechanism support
89    iopoll_mechanism_rtsigio=4
90    AC_DEFINE_UNQUOTED([__IOPOLL_MECHANISM_RTSIGIO],[$iopoll_mechanism_rtsigio],[rtsigio mechanism])
91 <  AC_RUN_IFELSE([AC_LANG_PROGRAM([
91 >  AC_RUN_IFELSE([AC_LANG_PROGRAM([[
92 > #define _GNU_SOURCE
93   #include <fcntl.h>
94 + static unsigned int have_f_setsig = 0;
95 +  ]], [[
96   #ifdef F_SETSIG
97 < main () { return 0; } /* F_SETSIG defined */
95 < #else
96 < main () { return 1; } /* F_SETSIG not defined */
97 >  have_f_setsig = 1;
98   #endif
99 <  ])],[is_rtsigio_mechanism_available="yes"],[is_rtsigio_mechanism_available="no"])
99 >  return have_f_setsig == 0;
100 >  ]])], [is_rtsigio_mechanism_available="yes"],[is_rtsigio_mechanism_available="no"])
101    dnl }}}
102    dnl {{{ check for poll mechanism support
103    iopoll_mechanism_poll=5
# Line 144 | Line 146 | main () { return 1; } /* F_SETSIG not de
146   ])dnl }}}
147   dnl {{{ ax_arg_with_topiclen
148   AC_DEFUN([AX_ARG_WITH_TOPICLEN],[
149 <  AC_ARG_WITH([topiclen],[AC_HELP_STRING([--with-topiclen=<value>],[Set topic length (default 160).])],[topiclen="$withval"],[topiclen="160"])
150 <  AC_DEFINE_UNQUOTED([TOPICLEN],[($topiclen+1)],[Length of topics.])
149 >  AC_ARG_WITH([topiclen],[AS_HELP_STRING([--with-topiclen=<value>],[Set topic length (default 160).])],[topiclen="$withval"],[topiclen="160"])
150 >  AC_DEFINE_UNQUOTED([TOPICLEN],[($topiclen)],[Length of topics.])
151   ])dnl }}}
152   dnl {{{ ax_arg_with_nicklen
153   AC_DEFUN([AX_ARG_WITH_NICKLEN],[
154 <  AC_ARG_WITH([nicklen],[AC_HELP_STRING([--with-nicklen=<value>],[Set nickname length (default 9).])],[nicklen="$withval"],[nicklen="9"])
155 <  AC_DEFINE_UNQUOTED([NICKLEN],[($nicklen+1)],[Length of nicknames.])
154 < ])dnl }}}
155 < dnl {{{ ax_arg_enable_efnet
156 < AC_DEFUN([AX_ARG_ENABLE_EFNET],[
157 <  AC_ARG_ENABLE([efnet],[AC_HELP_STRING([--enable-efnet],[For IRCDs running on EFnet.])],[efnet="$enableval"],[efnet="no"])
158 <  if test "$efnet" = "yes" ; then
159 <                use_efnet="yes"
160 <    AC_DEFINE([EFNET],[1],[Define to 1 if this server will be an EFnet server.])
161 <                AC_DEFINE([TS5_ONLY],[1],[If Defined to 1 server links to your network must have a minimum of TS5.])
162 <        else
163 <                use_efnet="no"
164 <  fi
165 <  AM_CONDITIONAL([EFNET],[test "$use_efnet" = "yes"])
154 >  AC_ARG_WITH([nicklen],[AS_HELP_STRING([--with-nicklen=<value>],[Set nickname length (default 9).])],[nicklen="$withval"],[nicklen="9"])
155 >  AC_DEFINE_UNQUOTED([NICKLEN],[($nicklen)],[Length of nicknames.])
156   ])dnl }}}
157   dnl {{{ ax_arg_enable_halfops
158   AC_DEFUN([AX_ARG_ENABLE_HALFOPS],[
159 <  AC_ARG_ENABLE([halfops],[AC_HELP_STRING([--enable-halfops],[Enable halfops support.])],[halfops="$enableval"],[halfops="no"])
159 >  AC_ARG_ENABLE([halfops],[AS_HELP_STRING([--enable-halfops],[Enable halfops support.])],[halfops="$enableval"],[halfops="no"])
160    if test "$halfops" = "yes" ; then
161      AC_DEFINE([HALFOPS],[1],[Define to 1 if you want halfops support.])
162    fi
163   ])dnl }}}
164   dnl {{{ ax_arg_enable_debugging
165   AC_DEFUN([AX_ARG_ENABLE_DEBUGGING],[
166 <  AC_ARG_ENABLE([debugging],[AC_HELP_STRING([--enable-debugging],[Enable debugging.])],[debugging="$enableval"],[debugging="no"])
166 >  AC_ARG_ENABLE([debugging],[AS_HELP_STRING([--enable-debugging],[Enable debugging.])],[debugging="$enableval"],[debugging="no"])
167    if test "$debugging" = "yes" ; then
168 <    AC_DEFINE([DEBUG],[1],[Define to 1 to enable debugging.])
179 <    CFLAGS="$CFLAGS -Wall -Werror -g -O0"
180 <  else
181 <    AC_DEFINE([NDEBUG],[1],[Define to 1 to disable debugging.])
168 >    CFLAGS="-Wall -g -O0"
169    fi
170   ])dnl }}}
171   dnl {{{ ax_arg_enable_warnings
172   AC_DEFUN([AX_ARG_ENABLE_WARNINGS],[
173 <  AC_ARG_ENABLE([warnings],[AC_HELP_STRING([--enable-warnings],[Enable compiler warnings.])],[warnings="$enableval"],[warnings="no"])
173 >  AC_ARG_ENABLE([warnings],[AS_HELP_STRING([--enable-warnings],[Enable compiler warnings.])],[warnings="$enableval"],[warnings="no"])
174    if test "$warnings" = "yes" ; then
175      CFLAGS="-Wall -Wextra -Wno-unused -Wcast-qual -Wcast-align -Wbad-function-cast -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wredundant-decls -Wshadow -Wwrite-strings -Wundef"
176    fi
177   ])dnl }}}
191 – dnl {{{ ax_arg_enable_syslog
192 – AC_DEFUN([AX_ARG_ENABLE_SYSLOG],[
193 –  AC_CHECK_HEADERS([syslog.h sys/syslog.h])
194 –  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"])
195 –  if test "$enableval" != "no" ; then
196 –    for option in $enableval ; do
197 –      case "$option" in
198 –        users) AC_DEFINE([SYSLOG_USERS],[1],[Send user log stuff to syslog.]) ;;
199 –        oper) AC_DEFINE([SYSLOG_OPER],[1],[Send oper log stuff to syslog.]) ;;
200 –        yes) : ;;
201 –        *) AC_MSG_ERROR([invalid value for --enable-syslog: $option]) ;;
202 –      esac
203 –    done
204 –    AC_DEFINE([USE_SYSLOG],[1],[Define to 1 if you want to use syslog.])
205 –  fi
206 – ])dnl }}}
207 – dnl {{{ ax_arg_with_syslog_facility
208 – AC_DEFUN([AX_ARG_WITH_SYSLOG],[
209 –  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"])
210 –  AC_DEFINE_UNQUOTED([LOG_FACILITY],[$syslog_facility],[Set to syslog facility to use.])
211 – ])dnl }}}
178   dnl {{{ ac_define_dir
179   dnl http://autoconf-archive.cryp.to/ac_define_dir.html
180   AC_DEFUN([AC_DEFINE_DIR], [

Comparing:
ircd-hybrid-7.2/acinclude.m4 (property svn:eol-style), Revision 1013 by michael, Sun Oct 18 14:26:49 2009 UTC vs.
ircd-hybrid/trunk/acinclude.m4 (property svn:eol-style), Revision 1670 by michael, Tue Nov 20 21:30:04 2012 UTC

# Line 0 | Line 1
1 + native

Diff Legend

– Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)