summaryrefslogtreecommitdiff
path: root/am/ipv6.m4
diff options
context:
space:
mode:
Diffstat (limited to 'am/ipv6.m4')
-rw-r--r--am/ipv6.m456
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 @@
1dnl This file is part of GNU Mailutils. -*- autoconf -*-
2dnl Copyright (C) 2011 Free Software Foundation, Inc.
3dnl
4dnl GNU Mailutils is free software; you can redistribute it and/or modify
5dnl it under the terms of the GNU General Public License as published by
6dnl the Free Software Foundation; either version 3 of the License, or
7dnl (at your option) any later version.
8dnl
9dnl GNU Mailutils is distributed in the hope that it will be useful,
10dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
11dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12dnl GNU General Public License for more details.
13dnl
14dnl You should have received a copy of the GNU General Public License
15dnl along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.
16
17AC_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)
28MAILUTILS_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

Return to:

Send suggestions and report system problems to the System administrator.