-
Notifications
You must be signed in to change notification settings - Fork 2
/
configure.ac
221 lines (194 loc) · 7.45 KB
/
configure.ac
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
dnl $Id: configure.ac 1.45 06/05/07 17:37:11+03:00 [email protected] $
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.57)
AC_INIT([MIPL Mobile IPv6 for Linux], [2.0.2-umip-0.4],
[URL:http://www.mobile-ipv6.org/bugs/], mipv6)
AC_DEFINE_UNQUOTED([PACKAGE_COPYRIGHT],
["Copyright (C) 2003-2006 Helsinki University of Technology, and others"],
[Define to the copyright statement])
AC_CONFIG_SRCDIR([src/main.c])
AM_INIT_AUTOMAKE
AM_CONFIG_HEADER(config.h)
AC_REVISION($Revision: 1.45 $)
AC_CANONICAL_HOST
AC_GNU_SOURCE
AC_PROG_CC
AC_PROG_RANLIB
AC_PROG_GCC_TRADITIONAL
AC_PROG_EGREP
AC_PROG_LEX
if test x$LEX = xflex; then
old_flex=`$LEX --version | $EGREP '2\.[[0-5]]\.[[0-4]]a?$'`
if test -n "$old_flex"; then
AC_MSG_WARN([
*** scan.l requires newer version of flex. If you need to generate
*** scan.c, upgrade to the latest flex (>=2.5.31) version.
])
fi
fi
AC_PROG_YACC
AC_PROG_AWK
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_CHECK_PROG([SED], [sed], [sed])
if test -z "$SED"; then
AC_MSG_ERROR([sed required but not found
*** sed not found in the system. Install sed to proceed.
])
fi
AC_CHECK_PROG([INDENT], [indent], [indent])
if test -z "$INDENT"; then
AC_MSG_WARN([
*** indent not found in the system. If you need to generate pmgr.c and
*** pmgr.h you need to install indent.
])
fi
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_C_RESTRICT
AC_C_VOLATILE
AC_C_BIGENDIAN
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_HEADER_TIME
AC_HEADER_STDBOOL
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS([arpa/inet.h fcntl.h sys/ioctl.h sys/param.h time.h syslog.h])
dnl Checks for library functions.
AC_FUNC_FORK
AC_FUNC_SELECT_ARGTYPES
AC_TYPE_SIGNAL
AC_FUNC_VPRINTF
AC_FUNC_WAIT3
AC_CHECK_FUNCS([memset select socket strdup strerror])
AC_MSG_NOTICE([*** checking for additional external libraries])
AC_CHECK_FUNC([clock_gettime])
if test $ac_cv_func_clock_gettime = no; then
AC_CHECK_LIB(rt, clock_gettime,,
[AC_MSG_ERROR([librt required but not found])])
fi
AC_CHECK_FUNC([dlopen])
if test $ac_cv_func_dlopen = no; then
AC_CHECK_LIB(dl, dlopen,,
[AC_MSG_ERROR([libdl required but not found])])
fi
AC_CHECK_LIB(pthread, pthread_create, [], [
AC_MSG_ERROR([POSIX thread library required but not found.])
])
AC_CHECK_LIB(netlink, rtnl_talk)
AM_CONDITIONAL(LOCAL_NETLINK, test x$ac_cv_lib_netlink_rtnl_talk = xno)
AC_ARG_WITH(builtin-crypto,
AC_HELP_STRING([--with-builtin-crypto],[use builtin crypto code]),
[ac_cv_use_builtin_crypto=$withval], [ac_cv_use_builtin_crypto=no])
if test x$ac_cv_use_builtin_crypto = xyes; then
ac_cv_lib_crypto_HMAC_Init=no
else
AC_CHECK_LIB(crypto, HMAC_Init)
if test x$ac_cv_lib_crypto_HMAC_Init = xno; then
ac_cv_use_builtin_crypto=yes
fi
fi
AC_MSG_NOTICE([*** checking for optional features])
AC_CACHE_CHECK([whether to use builtin crypto],
[ac_cv_use_builtin_crypto], [ac_cv_use_builtin_crypto=no])
AM_CONDITIONAL(BUILTIN_CRYPTO, test x$ac_cv_lib_crypto_HMAC_Init = xno)
dnl Option --disable-debug
AC_ARG_ENABLE(debug,
AC_HELP_STRING([--disable-debug],[disable debug messages and asserts]),
[ac_cv_enable_debug=$enableval], [ac_cv_enable_debug=yes])
if test x$ac_cv_enable_debug = xno; then
AC_DEFINE([MIP6_NDEBUG], [1], [Disable debugging])
fi
AC_CACHE_CHECK([whether to enable debug messages],
[ac_cv_enable_debug], [ac_cv_enable_debug=no])
dnl Option --enable-vt
AC_ARG_ENABLE(vt,
AC_HELP_STRING([--enable-vt],[enable virtual terminal for debugging]),
[ac_cv_enable_vt=$enableval], [ac_cv_enable_vt=no])
if test x$ac_cv_enable_vt = xyes; then
AC_DEFINE([ENABLE_VT], [1], [Enable VT])
fi
AC_CACHE_CHECK([whether to enable debug virtual terminal],
[ac_cv_enable_vt], [ac_cv_enable_vt=no])
AM_CONDITIONAL(ENABLE_VT, test x$enable_vt = xyes)
dnl Check Advanced IPv6 Socket API destination options header function availability
AC_MSG_NOTICE([*** checking inet6_opt for RFC3542: Advanced IPv6 Socket API support])
AC_REPLACE_FUNCS(inet6_opt_find)
dnl Check Advanced IPv6 Socket API routing header function availability
AC_MSG_NOTICE([*** checking inet6_rth for RFC3542: Advanced IPv6 Socket API support])
dnl Check Extension to Socket API for MIPv6 availability
AC_MSG_NOTICE([*** checking RH2 for RFC4584: Extension to Socket API for MIPv6])
AC_CHECK_DECLS([IPV6_RTHDR_TYPE_2],
[AC_REPLACE_FUNCS(inet6_rth_space)
AC_REPLACE_FUNCS(inet6_rth_init)
AC_REPLACE_FUNCS(inet6_rth_add)
AC_REPLACE_FUNCS(inet6_rth_getaddr)
AC_REPLACE_FUNCS(inet6_rth_gettype)],
[AC_LIBOBJ(inet6_rth_space)
AC_LIBOBJ(inet6_rth_init)
AC_LIBOBJ(inet6_rth_add)
AC_LIBOBJ(inet6_rth_getaddr)
AC_LIBOBJ(inet6_rth_gettype)],)
dnl Check some functions are really missing so we don't build empty libmissing
AM_CONDITIONAL(MISSING,
test x$ac_cv_func_inet6_opt_find != xyes -o \
x$ac_cv_func_inet6_rth_space != xyes -o \
x$ac_cv_func_inet6_rth_init != xyes -o \
x$ac_cv_func_inet6_rth_add != xyes -o \
x$ac_cv_func_inet6_rth_getaddr != xyes -o \
x$ac_cv_func_inet6_rth_gettype != xyes)
AC_MSG_NOTICE([*** checking for Mobile IPv6 support in kernel headers])
AC_CHECK_DECLS([IFA_F_HOMEADDRESS],,
[AC_MSG_ERROR([kernel headers do not support MIPv6.
*** If working Linux kernel headers are not in the default include path,
*** please use CPPFLAGS variable to specify where they can be found
*** (e.g. CPPFLAGS="-isystem /usr/src/linux/include")
])], [#include <sys/socket.h>
#include <linux/if_addr.h>])
AC_MSG_NOTICE([*** checking for Mobile IPv6 extensions in system headers])
AC_CHECK_HEADERS([netinet/in.h netinet/ip6.h netinet/icmp6.h netinet/ip6mh.h])
AC_CHECK_MEMBER(struct ip6_ext.ip6e_nxt, AC_DEFINE([HAVE_STRUCT_IP6_EXT],,
[Define to 1 if struct ip6_ext is in <netinet/ip6.h>.]),,
[#include <netinet/ip6.h>])
AC_CHECK_MEMBER(struct ip6_opt_home_address.ip6oha_type,
AC_DEFINE([HAVE_STRUCT_IP6_OPT_HOME_ADDRESS],,
[Define to 1 if struct ip6_opt_home_address is in <netinet/ip6.h>.]),,
[#include <netinet/ip6.h>])
AC_CHECK_MEMBER(struct ip6_rthdr2.ip6r2_nxt,
AC_DEFINE([HAVE_STRUCT_IP6_RTHDR2],,
[Define to 1 if struct ip6_rthdr2 is in <netinet/ip6.h>.]),,
[#include <netinet/ip6.h>])
AC_CHECK_MEMBER(struct mip_dhaad_req.mip_dhreq_hdr,
AC_DEFINE([HAVE_STRUCT_MIP_DHAAD_REQ],,
[Define to 1 if <netinet/icmp6.h> RFC3775 compatible.]),,
[#include <netinet/icmp6.h>])
AC_CHECK_MEMBER(struct mip_dhaad_rep.mip_dhrep_hdr,
AC_DEFINE([HAVE_STRUCT_MIP_DHAAD_REP],,
[Define to 1 if <netinet/icmp6.h> RFC3775 compatible.]),,
[#include <netinet/icmp6.h>])
AC_CHECK_MEMBER(struct mip_prefix_solicit.mip_ps_hdr,
AC_DEFINE([HAVE_STRUCT_MIP_PREFIX_SOLICIT],,
[Define to 1 if <netinet/icmp6.h> RFC3775 compatible.]),,
[#include <netinet/icmp6.h>])
AC_CHECK_MEMBER(struct mip_prefix_advert.mip_pa_hdr,
AC_DEFINE([HAVE_STRUCT_MIP_PREFIX_ADVERT],,
[Define to 1 if <netinet/icmp6.h> RFC3775 compatible.]),,
[#include <netinet/icmp6.h>])
AC_CHECK_MEMBER(struct nd_opt_homeagent_info.nd_opt_hai_type,
AC_DEFINE([HAVE_STRUCT_ND_OPT_HOMEAGENT_INFO],,
[Define to 1 if <netinet/icmp6.h> RFC3775 compatible.]),,
[#include <netinet/icmp6.h>])
AC_CONFIG_FILES([Makefile libnetlink/Makefile libmissing/Makefile src/Makefile man/Makefile])
AC_OUTPUT
AC_MSG_NOTICE([settings
AC_PACKAGE_NAME version AC_PACKAGE_VERSION
Use built-in crypto: ............ $ac_cv_use_builtin_crypto
Use OpenSSL crypto library: ..... $ac_cv_lib_crypto_HMAC_Init
Enable debugging mode: .......... $ac_cv_enable_debug
Enable virtual debug terminal: .. $ac_cv_enable_vt
Build target: $host
CPPFLAGS: $CPPFLAGS
])