| 1 |
stu |
908 |
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 |
michael |
1670 |
AC_CHECK_FUNC(getaddrinfo, [], AC_SEARCH_LIBS(getaddrinfo, nsl)) |
| 6 |
|
|
AC_CHECK_FUNC(getnameinfo, [], AC_SEARCH_LIBS(getnameinfo, nsl)) |
| 7 |
stu |
908 |
AC_SEARCH_LIBS([socket],[socket],,[AC_MSG_ERROR([socket library not found])]) |
| 8 |
db |
941 |
AC_CHECK_TYPES([struct sockaddr_in, struct sockaddr_storage, struct addrinfo],,,[#include <sys/types.h> |
| 9 |
|
|
#include <sys/socket.h> |
| 10 |
|
|
#include <netdb.h> |
| 11 |
|
|
]) |
| 12 |
|
|
AC_CHECK_MEMBERS([struct sockaddr_in.sin_len],,,[#include <sys/types.h> |
| 13 |
|
|
<sys/socket.h>]) |
| 14 |
stu |
908 |
])dnl }}} |
| 15 |
|
|
dnl {{{ ax_check_lib_ipv6 |
| 16 |
|
|
AC_DEFUN([AX_CHECK_LIB_IPV6],[ |
| 17 |
michael |
1123 |
AC_CHECK_TYPE([struct sockaddr_in6],[AC_DEFINE([IPV6],[1],[Define to 1 if you have IPv6 support.])],,[#include <netinet/in.h>]) |
| 18 |
stu |
908 |
])dnl }}} |
| 19 |
|
|
dnl {{{ ax_arg_enable_halfops |
| 20 |
|
|
AC_DEFUN([AX_ARG_ENABLE_HALFOPS],[ |
| 21 |
michael |
1374 |
AC_ARG_ENABLE([halfops],[AS_HELP_STRING([--enable-halfops],[Enable halfops support.])],[halfops="$enableval"],[halfops="no"]) |
| 22 |
stu |
908 |
if test "$halfops" = "yes" ; then |
| 23 |
|
|
AC_DEFINE([HALFOPS],[1],[Define to 1 if you want halfops support.]) |
| 24 |
|
|
fi |
| 25 |
|
|
])dnl }}} |
| 26 |
|
|
dnl {{{ ax_arg_enable_debugging |
| 27 |
|
|
AC_DEFUN([AX_ARG_ENABLE_DEBUGGING],[ |
| 28 |
michael |
1374 |
AC_ARG_ENABLE([debugging],[AS_HELP_STRING([--enable-debugging],[Enable debugging.])],[debugging="$enableval"],[debugging="no"]) |
| 29 |
stu |
908 |
if test "$debugging" = "yes" ; then |
| 30 |
michael |
1017 |
CFLAGS="-Wall -g -O0" |
| 31 |
stu |
908 |
fi |
| 32 |
|
|
])dnl }}} |
| 33 |
|
|
dnl {{{ ax_arg_enable_warnings |
| 34 |
|
|
AC_DEFUN([AX_ARG_ENABLE_WARNINGS],[ |
| 35 |
michael |
1374 |
AC_ARG_ENABLE([warnings],[AS_HELP_STRING([--enable-warnings],[Enable compiler warnings.])],[warnings="$enableval"],[warnings="no"]) |
| 36 |
stu |
908 |
if test "$warnings" = "yes" ; then |
| 37 |
michael |
1013 |
CFLAGS="-Wall -Wextra -Wno-unused -Wcast-qual -Wcast-align -Wbad-function-cast -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wredundant-decls -Wshadow -Wwrite-strings -Wundef" |
| 38 |
stu |
908 |
fi |
| 39 |
|
|
])dnl }}} |
| 40 |
|
|
dnl {{{ ac_define_dir |
| 41 |
|
|
dnl http://autoconf-archive.cryp.to/ac_define_dir.html |
| 42 |
|
|
AC_DEFUN([AC_DEFINE_DIR], [ |
| 43 |
|
|
prefix_NONE= |
| 44 |
|
|
exec_prefix_NONE= |
| 45 |
|
|
test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix |
| 46 |
|
|
test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix |
| 47 |
|
|
eval ac_define_dir="\"[$]$2\"" |
| 48 |
|
|
eval ac_define_dir="\"$ac_define_dir\"" |
| 49 |
|
|
AC_SUBST($1, "$ac_define_dir") |
| 50 |
|
|
AC_DEFINE_UNQUOTED($1, "$ac_define_dir", [$3]) |
| 51 |
|
|
test "$prefix_NONE" && prefix=NONE |
| 52 |
|
|
test "$exec_prefix_NONE" && exec_prefix=NONE |
| 53 |
|
|
])dnl }}} |
| 54 |
|
|
]) dnl }}} |