diff options
Diffstat (limited to 'am/ipv6.m4')
-rw-r--r-- | am/ipv6.m4 | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/am/ipv6.m4 b/am/ipv6.m4 new file mode 100644 index 000000000..2357314b9 --- /dev/null +++ b/am/ipv6.m4 | |||
@@ -0,0 +1,56 @@ | |||
1 | dnl This file is part of GNU Mailutils. -*- autoconf -*- | ||
2 | dnl Copyright (C) 2011 Free Software Foundation, Inc. | ||
3 | dnl | ||
4 | dnl GNU Mailutils is free software; you can redistribute it and/or modify | ||
5 | dnl it under the terms of the GNU General Public License as published by | ||
6 | dnl the Free Software Foundation; either version 3 of the License, or | ||
7 | dnl (at your option) any later version. | ||
8 | dnl | ||
9 | dnl GNU Mailutils is distributed in the hope that it will be useful, | ||
10 | dnl but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | dnl GNU General Public License for more details. | ||
13 | dnl | ||
14 | dnl You should have received a copy of the GNU General Public License | ||
15 | dnl along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>. | ||
16 | |||
17 | AC_DEFUN([MU_ENABLE_IPV6], | ||
18 | [AC_ARG_ENABLE(ipv6, | ||
19 | [AC_HELP_STRING([--enable-ipv6], [enable IPv6 support])], | ||
20 | [status_ipv6=$enableval], | ||
21 | [status_ipv6=maybe]) | ||
22 | |||
23 | if test $status_ipv6 != no; then | ||
24 | working_ipv6=no | ||
25 | AC_EGREP_CPP(MAILUTILS_AF_INET6_DEFINED,[ | ||
26 | #include <sys/socket.h> | ||
27 | #if defined(AF_INET6) | ||
28 | MAILUTILS_AF_INET6_DEFINED | ||
29 | #endif | ||
30 | ],[working_ipv6=yes]) | ||
31 | |||
32 | AC_CHECK_TYPE([struct sockaddr_storage], | ||
33 | [working_ipv6=yes], [working_ipv6=no], | ||
34 | [#include <sys/socket.h>]) | ||
35 | AC_CHECK_TYPE([struct sockaddr_in6], | ||
36 | [working_ipv6=yes], [working_ipv6=no], | ||
37 | [#include <sys/types.h> | ||
38 | #include <netinet/in.h>]) | ||
39 | AC_CHECK_TYPE([struct addrinfo], | ||
40 | [working_ipv6=yes], [working_ipv6=no], | ||
41 | [#include <netdb.h>]) | ||
42 | AC_CHECK_FUNC([getnameinfo], | ||
43 | [working_ipv6=yes], [working_ipv6=no], | ||
44 | [#include <netdb.h>]) | ||
45 | |||
46 | if test $working_ipv6 = no; then | ||
47 | if test $status_ipv6 = yes; then | ||
48 | AC_MSG_ERROR([IPv6 support is required but not available]) | ||
49 | fi | ||
50 | fi | ||
51 | status_ipv6=$working_ipv6 | ||
52 | if test $status_ipv6 = yes; then | ||
53 | AC_DEFINE_UNQUOTED([MAILUTILS_IPV6],1, | ||
54 | [Define to 1 if IPv6 support is enabled]) | ||
55 | fi | ||
56 | fi]) \ No newline at end of file | ||