File: config_project_ipv6_types

package info (click to toggle)
net-snmp 5.9+dfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 36,760 kB
  • sloc: ansic: 283,039; perl: 17,712; sh: 11,887; makefile: 2,705; xml: 663; python: 623; pascal: 62; sql: 47
file content (165 lines) | stat: -rw-r--r-- 3,471 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
# -*- autoconf -*-
#########################################
##
# Checks for types
##
#########################################

##
#   Standard checks:
##

AC_CHECK_SIZEOF(short)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(long long)
AC_CHECK_SIZEOF(intmax_t)

AC_TYPE_INT8_T
AC_TYPE_INT16_T
AC_TYPE_INT32_T
AC_TYPE_INT64_T
AC_TYPE_INTMAX_T
AC_TYPE_UINT8_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_UINTMAX_T
AC_TYPE_INTPTR_T
AC_TYPE_UINTPTR_T

##
#   Other type checks:
##

AC_CHECK_TYPES([off64_t])
AC_CHECK_TYPES([nfds_t],,,[#include <sys/poll.h>])

#   Solaris specific checks
#       (taken from Perl's configure script)
#
AC_CHECK_TYPES([Counter64],,,[#include <inet/mib2.h>])
AC_CHECK_TYPES([mib2_ipIfStatsEntry_t],,,[#include <inet/mib2.h>])

#   N.B:  The above checks could safely be moved to
#         the later 'config_types' sub-script
#

#  Darwin: check whether or not struct in_ifaddr is available.
#
#
AC_CHECK_MEMBERS([struct in_ifaddr.ia_subnetmask],,,[
#ifdef HAVE_NETINET_IN_VAR_H
#include <netinet/in_var.h>
#endif
])


##
#   Determine the IPv6 stack type
##

#       These checks also set the LIBS/CFLAGS variables,
#       which may be needed for subsequent function tests
#

if test "x$enable_ipv6" = "xyes"; then
	v6lib=none
	v6trylibc=no

	AC_MSG_CHECKING([[ipv6 stack type]])
	for v6type in v6d toshiba kame zeta generic; do
		case $v6type in
		v6d)
			AC_EGREP_CPP(yes, [
#include </usr/local/v6/include/sys/types.h>
#ifdef __V6D__
yes
#endif],
				[v6lib=v6;
				v6libdir=/usr/local/v6/lib;
				CFLAGS="-I/usr/local/v6/include $CFLAGS"])
			;;
		toshiba)
			AC_EGREP_CPP(yes, [
#include <sys/param.h>
#ifdef _TOSHIBA_INET6
yes
#endif],
				[v6lib=inet6;
				v6libdir=/usr/local/v6/lib;
				CFLAGS="-DNETSNMP_ENABLE_IPV6 $CFLAGS"])
			;;
		kame)
			AC_EGREP_CPP(yes, [
#include <netinet/in.h>
#ifdef __KAME__
yes
#endif],
				[v6lib=inet6;
				v6libdir=/usr/local/v6/lib;
				v6trylibc=yes;
				CFLAGS="-DNETSNMP_ENABLE_IPV6 $CFLAGS"])
			;;
		zeta)
			AC_EGREP_CPP(yes, [
#include <sys/param.h>
#ifdef _ZETA_MINAMI_INET6
yes
#endif],
				[v6lib=inet6;
				v6libdir=/usr/local/v6/lib;
				CFLAGS="-DNETSNMP_ENABLE_IPV6 $CFLAGS"])
			;;
		generic)
                        AC_MSG_RESULT([[postponed]])
                        AC_CHECK_MEMBER([struct sockaddr_in6.sin6_addr],,,[[
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
#ifdef HAVE_WS2TCPIP_H
#include <ws2tcpip.h>
#endif
#endif]
AC_INCLUDES_DEFAULT()
[#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
]])
	                AC_MSG_CHECKING([[ipv6 stack type]])
                        if test "x$ac_cv_member_struct_sockaddr_in6_sin6_addr" = "xyes"; then
				v6lib=dummy
				v6libdir=none
				v6trylibc=yes
				CFLAGS="-DNETSNMP_ENABLE_IPV6 $CFLAGS"
                        fi
			;;
		esac
		if test "$v6lib" != "none"; then
			break
		fi
	done

	if test "$v6lib" != "none"; then
		if test -d $v6libdir -a -f $v6libdir/lib$v6lib.a; then
			LIBS="-L$v6libdir -l$v6lib $LIBS"
			enable_ipv6="yes"
			AC_MSG_RESULT(["$v6type, $enable_ipv6, using lib$v6lib"])
		elif test "$v6trylibc" = "yes"; then
			enable_ipv6="yes"
			AC_MSG_RESULT(["$v6type, $enable_ipv6, using libc"])
		else
			AC_MSG_ERROR(no IPv6 library lib$v6lib.a found.)
			exit 1
		fi
	else
		v6type="unknown"
		enable_ipv6="no"
		AC_MSG_RESULT(["$v6type, $enable_ipv6"])
	fi
fi