]>
Commit | Line | Data |
---|---|---|
7ea487bc | 1 | ## |
e8f2984c | 2 | ## Configure template file for Quagga. |
7ea487bc | 3 | ## autoconf will generate configure script. |
4 | ## | |
5 | ## Copyright (c) 1996, 97, 98, 99, 2000 Kunihiro Ishiguro <kunihiro@zebra.org> | |
e8f2984c | 6 | ## Portions Copyright (c) 2003 Paul Jakma <paul@dishone.st> |
7ea487bc | 7 | ## |
fc9d0745 | 8 | ## $Id: configure.ac,v 1.54 2004/06/30 14:25:12 gdt Exp $ |
e8f2984c | 9 | AC_PREREQ(2.53) |
7ea487bc | 10 | |
8b338fe9 | 11 | AC_INIT(quagga, 0.96.5, [http://bugzilla.quagga.net]) |
fa1253d0 | 12 | AC_CONFIG_SRCDIR(lib/zebra.h) |
81b81822 | 13 | AM_INIT_AUTOMAKE(1.6) |
7ea487bc | 14 | AM_CONFIG_HEADER(config.h) |
15 | ||
d6b72f7a | 16 | dnl default is to match previous behavior |
c4f0efe6 | 17 | exampledir=${sysconfdir} |
d6b72f7a | 18 | AC_ARG_ENABLE([exampledir], |
19 | AC_HELP_STRING([--enable-exampledir], | |
20 | [specify alternate directory for examples]), | |
21 | exampledir="$enableval",) | |
c4f0efe6 | 22 | dnl XXX add --exampledir to autoconf standard directory list somehow |
d6b72f7a | 23 | AC_SUBST(exampledir) |
24 | ||
7ea487bc | 25 | dnl ----------------------------------- |
26 | dnl Get hostname and other information. | |
27 | dnl ----------------------------------- | |
28 | AC_CANONICAL_HOST | |
29 | ||
30 | dnl ------------ | |
31 | dnl Check CFLAGS | |
32 | dnl ------------ | |
33 | AC_ARG_WITH(cflags, | |
34 | [ --with-cflags Set CFLAGS for use in compilation.]) | |
35 | if test "x$with_cflags" != "x" ; then | |
36 | CFLAGS="$with_cflags" ; cflags_specified=yes ; | |
37 | elif test -n "$CFLAGS" ; then | |
38 | cflags_specified=yes ; | |
39 | fi | |
40 | ||
41 | dnl -------- | |
42 | dnl Check CC | |
43 | dnl -------- | |
44 | AC_PROG_CC | |
45 | ||
46 | dnl ----------------------------------------- | |
47 | dnl If CLFAGS doesn\'t exist set default value | |
48 | dnl ----------------------------------------- | |
49 | if test "x$cflags_specified" = "x" ; then | |
50 | CFLAGS="$CFLAGS -Wall" | |
51 | fi | |
52 | ||
53 | dnl -------------- | |
54 | dnl Check programs | |
55 | dnl -------------- | |
56 | AC_PROG_CPP | |
57 | AC_PROG_INSTALL | |
58 | AC_PROG_MAKE_SET | |
59 | AC_CHECK_TOOL(AR, ar) | |
60 | AC_CHECK_TOOL(RANLIB, ranlib, :) | |
61 | ||
62 | dnl --------- | |
63 | dnl AIX check | |
64 | dnl --------- | |
65 | AC_AIX | |
66 | ||
67 | dnl ---------------------- | |
68 | dnl Packages configuration | |
69 | dnl ---------------------- | |
70 | AC_ARG_ENABLE(vtysh, | |
fc9d0745 | 71 | [ --enable-vtysh include integrated vty shell for Quagga]) |
7ea487bc | 72 | AC_ARG_ENABLE(ipv6, |
73 | [ --disable-ipv6 turn off IPv6 related features and daemons]) | |
74 | AC_ARG_ENABLE(zebra, | |
75 | [ --disable-zebra do not build zebra daemon]) | |
76 | AC_ARG_ENABLE(bgpd, | |
77 | [ --disable-bgpd do not build bgpd]) | |
78 | AC_ARG_ENABLE(ripd, | |
79 | [ --disable-ripd do not build ripd]) | |
80 | AC_ARG_ENABLE(ripngd, | |
81 | [ --disable-ripngd do not build ripngd]) | |
82 | AC_ARG_ENABLE(ospfd, | |
83 | [ --disable-ospfd do not build ospfd]) | |
7ea487bc | 84 | AC_ARG_ENABLE(ospf6d, |
85 | [ --disable-ospf6d do not build ospf6d]) | |
9e867fe6 | 86 | AC_ARG_ENABLE(isisd, |
87 | [ --disable-isisd do not build isisd]) | |
7ea487bc | 88 | AC_ARG_ENABLE(bgp-announce, |
89 | [ --disable-bgp-announce, turn off BGP route announcement]) | |
90 | AC_ARG_ENABLE(netlink, | |
91 | [ --enable-netlink force to use Linux netlink interface]) | |
92 | AC_ARG_ENABLE(broken-aliases, | |
93 | [ --enable-broken-aliases enable aliases as distinct interfaces for Linux 2.2.X]) | |
94 | AC_ARG_ENABLE(snmp, | |
95 | [ --enable-snmp enable SNMP support]) | |
96 | AC_ARG_WITH(libpam, | |
97 | [ --with-libpam use libpam for PAM support in vtysh]) | |
71c0fb50 | 98 | AC_ARG_ENABLE(tcp-zebra, |
7ea487bc | 99 | [ --enable-tcp-zebra enable TCP/IP socket connection between zebra and protocol daemon]) |
7ea487bc | 100 | AC_ARG_ENABLE(opaque-lsa, |
1ef74ef7 | 101 | [ --enable-opaque-lsa enable OSPF Opaque-LSA with OSPFAPI support (RFC2370)]) |
102 | AC_ARG_ENABLE(ospfapi, | |
103 | [ --disable-ospfapi do not build OSPFAPI to access the OSPF LSA Database, | |
104 | (this is the default if --enable-opaque-lsa is not set)]) | |
105 | AC_ARG_ENABLE(ospfclient, | |
106 | [ --disable-ospfclient do not build OSPFAPI client for OSPFAPI, | |
107 | (this is the default if --disable-ospfapi is set)]) | |
7ea487bc | 108 | AC_ARG_ENABLE(ospf-te, |
109 | [ --enable-ospf-te enable Traffic Engineering Extension to OSPF]) | |
110 | AC_ARG_ENABLE(multipath, | |
111 | [ --enable-multipath=ARG enable multipath function, ARG must be digit]) | |
e8f2984c | 112 | AC_ARG_ENABLE(quagga_user, |
113 | [ --enable-user=ARG user to run Quagga suite as (default quagga)]) | |
114 | AC_ARG_ENABLE(quagga_group, | |
115 | [ --enable-group=ARG group to run Quagga suite as (default quagga)]) | |
edd7c245 | 116 | AC_ARG_ENABLE(vty_group, |
117 | [ --enable-vty-group=ARG set vty sockets to have specified group as owner]) | |
aa593d5e | 118 | AC_ARG_ENABLE(configfile_mask, |
119 | [ --enable-configfile-mask=ARG set mask for config files]) | |
120 | AC_ARG_ENABLE(logfile_mask, | |
121 | [ --enable-logfile-mask=ARG set mask for log files]) | |
edd7c245 | 122 | |
71c0fb50 | 123 | AC_ARG_ENABLE(rtadv, |
d2a0ccc6 | 124 | [ --disable-rtadv disable IPV6 router advertisement feature]) |
ca776988 | 125 | AC_ARG_ENABLE(irdp, |
126 | [ --enable-irdp enable IRDP server support in zebra]) | |
41d3fc96 | 127 | AC_ARG_ENABLE(capabilities, |
128 | [ --disable-capabilities disable using POSIX capabilities]) | |
7ea487bc | 129 | |
130 | if test "${enable_broken_aliases}" = "yes"; then | |
131 | if test "${enable_netlink}" = "yes" | |
132 | then | |
133 | echo "Sorry, you can't use netlink with broken aliases" | |
134 | exit 1 | |
135 | fi | |
136 | AC_DEFINE(HAVE_BROKEN_ALIASES,,Broken Alias) | |
137 | enable_netlink=no | |
138 | fi | |
139 | ||
140 | if test "${enable_tcp_zebra}" = "yes"; then | |
141 | AC_DEFINE(HAVE_TCP_ZEBRA,,Use TCP for zebra communication) | |
142 | fi | |
143 | ||
7ea487bc | 144 | if test "${enable_opaque_lsa}" = "yes"; then |
145 | AC_DEFINE(HAVE_OPAQUE_LSA,,OSPF Opaque LSA) | |
146 | fi | |
147 | ||
148 | if test "${enable_ospf_te}" = "yes"; then | |
149 | AC_DEFINE(HAVE_OPAQUE_LSA,,OSPF Opaque LSA) | |
150 | AC_DEFINE(HAVE_OSPF_TE,,OSPF TE) | |
151 | fi | |
152 | ||
d2a0ccc6 | 153 | AC_MSG_CHECKING(if zebra should be configurable to send Route Advertisements) |
154 | if test "${enable_rtadv}" != "no"; then | |
71c0fb50 | 155 | AC_MSG_RESULT(yes) |
d2a0ccc6 | 156 | AC_DEFINE(HAVE_RTADV,,Enable IPv6 Routing Advertisement support) |
2487bea1 | 157 | else |
158 | AC_MSG_RESULT(no) | |
71c0fb50 | 159 | fi |
7ea487bc | 160 | |
ca776988 | 161 | if test "${enable_irdp}" = "yes"; then |
162 | AC_DEFINE(HAVE_IRDP,, IRDP ) | |
163 | fi | |
164 | ||
79cb2169 | 165 | if test "${enable_user}" = "yes" || test x"${enable_user}" = x""; then |
e8f2984c | 166 | enable_user="quagga" |
edd7c245 | 167 | elif test "${enable_user}" = "no"; then |
168 | enable_user="root" | |
169 | fi | |
e8f2984c | 170 | AC_DEFINE_UNQUOTED(QUAGGA_USER, "${enable_user}", Quagga User) |
edd7c245 | 171 | |
79cb2169 | 172 | if test "${enable_group}" = "yes" || test x"${enable_group}" = x""; then |
e8f2984c | 173 | enable_group="quagga" |
edd7c245 | 174 | elif test "${enable_group}" = "no"; then |
175 | enable_group="root" | |
176 | fi | |
e8f2984c | 177 | AC_DEFINE_UNQUOTED(QUAGGA_GROUP, "${enable_group}", Quagga Group) |
edd7c245 | 178 | |
179 | if test x"${enable_vty_group}" = x"yes" ; then | |
8d4aee5d | 180 | AC_MSG_ERROR([--enable-vty-group requires a group as argument, not yes]) |
79cb2169 | 181 | elif test x"${enable_vty_group}" != x""; then |
8d4aee5d | 182 | if test x"${enable_vty_group}" != x"no"; then |
edd7c245 | 183 | AC_DEFINE_UNQUOTED(VTY_GROUP, "${enable_vty_group}", VTY Sockets Group) |
184 | fi | |
185 | fi | |
186 | ||
aa593d5e | 187 | enable_configfile_mask=${enable_configfile_mask:-0600} |
188 | AC_DEFINE_UNQUOTED(CONFIGFILE_MASK, ${enable_configfile_mask}, Mask for config files) | |
189 | ||
190 | enable_logfile_mask=${enable_logfile_mask:-0600} | |
191 | AC_DEFINE_UNQUOTED(LOGFILE_MASK, ${enable_logfile_mask}, Mask for log files) | |
192 | ||
7ea487bc | 193 | changequote(, )dnl |
194 | ||
195 | MULTIPATH_NUM=1 | |
196 | ||
197 | case "${enable_multipath}" in | |
198 | [0-9]|[1-9][0-9]) | |
199 | MULTIPATH_NUM="${enable_multipath}" | |
200 | ;; | |
201 | "") | |
202 | ;; | |
203 | *) | |
204 | echo "Please specify digit to --enable-multipath ARG." | |
205 | exit 1 | |
206 | ;; | |
207 | esac | |
208 | ||
209 | changequote([, ])dnl | |
210 | ||
211 | AC_SUBST(MULTIPATH_NUM) | |
212 | ||
213 | dnl ------------------- | |
214 | dnl Check header files. | |
215 | dnl ------------------- | |
dc7a2bf1 | 216 | AC_HEADER_STDC |
217 | AC_CHECK_HEADERS([string.h stropts.h sys/conf.h sys/ksym.h sys/time.h \ | |
218 | sys/times.h sys/select.h sys/sysctl.h sys/sockio.h \ | |
219 | sys/types.h linux/version.h kvm.h netdb.h asm/types.h \ | |
220 | libutil.h limits.h]) | |
221 | ||
835b7f1b | 222 | AC_CHECK_HEADERS([sys/socket.h netinet/in_systm.h netinet/in.h \ |
f3bd1a78 | 223 | net/if_dl.h net/netopt.h inet/nd.h net/route.h \ |
835b7f1b | 224 | net/if.h net/if_var.h netinet/in_var.h]) |
dc7a2bf1 | 225 | |
fa3232e1 | 226 | dnl V6 headers are checked below, after we check for v6 |
7ea487bc | 227 | |
228 | dnl check some types | |
229 | AC_C_CONST | |
230 | dnl AC_TYPE_PID_T | |
231 | AC_TYPE_SIGNAL | |
232 | ||
233 | dnl Some systems (Solaris 2.x) require libnsl (Network Services Library) | |
234 | case "$host" in | |
19877dd2 | 235 | [*-sunos5.[6-8]*] | [*-solaris2.[6-8]*]) |
7ea487bc | 236 | opsys=sol2-6 |
19877dd2 | 237 | AC_DEFINE(SUNOS_56, 1, SunOS 5.6 to 5.8) |
238 | AC_DEFINE(SUNOS_5, 1, SunOS 5) | |
7ea487bc | 239 | AC_CHECK_LIB(xnet, main) |
240 | CURSES=-lcurses | |
241 | ;; | |
19877dd2 | 242 | [*-sunos5.[8-9]] | [*-sunos5.1[0-9]] \ |
243 | | [*-solaris2.[8-9]] | [*-solaris2.1[0-9]]) | |
244 | opsys=sol9 | |
245 | AC_DEFINE(SUNOS_59,,SunOS 5.9 up) | |
246 | AC_DEFINE(SUNOS_5, 1, SunOS 5) | |
247 | AC_CHECK_LIB(socket, main) | |
248 | AC_CHECK_LIB(nsl, main) | |
249 | CURSES=-lcurses | |
250 | ;; | |
7ea487bc | 251 | *-sunos5* | *-solaris2*) |
19877dd2 | 252 | AC_DEFINE(SUNOS_5,,SunOS 5, Unknown SunOS) |
7ea487bc | 253 | AC_CHECK_LIB(socket, main) |
254 | AC_CHECK_LIB(nsl, main) | |
255 | CURSES=-lcurses | |
256 | ;; | |
257 | *-linux-*) | |
258 | opsys=gnu-linux | |
259 | AC_DEFINE(GNU_LINUX,,GNU Linux) | |
260 | ;; | |
261 | *-nec-sysv4*) | |
262 | AC_CHECK_LIB(nsl, gethostbyname) | |
263 | AC_CHECK_LIB(socket, socket) | |
264 | ;; | |
265 | *-freebsd3.2) | |
266 | AC_DEFINE(FREEBSD_32,,FreeBSD 3.2) | |
267 | ;; | |
268 | *-openbsd*) | |
269 | opsys=openbsd | |
270 | AC_DEFINE(OPEN_BSD,,OpenBSD) | |
271 | ;; | |
272 | *-bsdi*) | |
273 | opsys=bsdi | |
274 | OTHER_METHOD="mtu_kvm.o" | |
275 | AC_CHECK_LIB(kvm, main) | |
276 | ;; | |
49e3b3c0 | 277 | *-irix6.5) |
dc7a2bf1 | 278 | opsys=irix |
279 | AC_DEFINE(IRIX_65,,IRIX 6.5) | |
280 | ;; | |
7ea487bc | 281 | esac |
282 | ||
283 | dnl --------------------- | |
284 | dnl Integrated VTY option | |
285 | dnl --------------------- | |
286 | case "${enable_vtysh}" in | |
287 | "yes") VTYSH="vtysh"; | |
288 | AC_DEFINE(VTYSH,,VTY shell) | |
fc9d0745 | 289 | AC_PATH_PROG(PERL, perl) |
290 | dnl Vtysh uses libreadline, which looks for termcap functions at | |
291 | dnl configure time. We follow readline's search order. | |
292 | dnl The required procedures are in libtermcap on NetBSD, in | |
293 | dnl [TODO] on Linux, and in [TODO] on Solaris. | |
294 | AC_CHECK_LIB(termcap, tputs, , | |
295 | AC_CHECK_LIB(tinfo, tputs, , | |
296 | AC_CHECK_LIB(curses, tputs, , | |
297 | AC_CHECK_LIB(ncurses, tputs)))) | |
7ea487bc | 298 | AC_CHECK_LIB(readline, main) |
299 | if test $ac_cv_lib_readline_main = no; then | |
fc9d0745 | 300 | AC_MSG_ERROR([vtysh needs libreadline but was not found and usable on your system.]) |
7ea487bc | 301 | fi |
302 | AC_CHECK_HEADER(readline/history.h) | |
303 | if test $ac_cv_header_readline_history_h = no;then | |
304 | AC_MSG_ERROR([readline is too old to have readline/history.h, please update to the latest readline library.]) | |
305 | fi | |
3d3de8c4 | 306 | AC_CHECK_LIB(readline, rl_completion_matches) |
307 | if test $ac_cv_lib_readline_rl_completion_matches = no; then | |
308 | AC_DEFINE(rl_completion_matches,completion_matches,Old readline) | |
309 | fi | |
310 | ;; | |
7ea487bc | 311 | "no" ) VTYSH="";; |
312 | * ) ;; | |
313 | esac | |
314 | ||
315 | dnl ---------- | |
316 | dnl PAM module | |
317 | dnl ---------- | |
24cd435b | 318 | if test "$with_libpam" = "yes"; then |
24cd435b | 319 | AC_CHECK_HEADER(security/pam_misc.h) |
320 | if test "$ac_cv_header_security_pam_misc_h" = yes; then | |
321 | AC_DEFINE(HAVE_PAM_MISC_H,,Have pam_misc.h) | |
322 | AC_DEFINE(PAM_CONV_FUNC,misc_conv,Have misc_conv) | |
323 | pam_conv_func="misc_conv" | |
24cd435b | 324 | fi |
24cd435b | 325 | AC_CHECK_HEADER(security/openpam.h) |
326 | if test "$ac_cv_header_security_openpam_h" = yes; then | |
327 | AC_DEFINE(HAVE_OPENPAM_H,,Have openpam.h) | |
328 | AC_DEFINE(PAM_CONV_FUNC,openpam_ttyconv,Have openpam_ttyconv) | |
329 | pam_conv_func="openpam_ttyconv" | |
24cd435b | 330 | fi |
331 | if test -z "$ac_cv_header_security_pam_misc_h$ac_cv_header_security_openpam_h" ; then | |
332 | AC_MSG_WARN([*** pam support will not be built ***]) | |
333 | with_libpam="no" | |
334 | fi | |
335 | fi | |
336 | ||
7ea487bc | 337 | if test "$with_libpam" = "yes"; then |
338 | dnl took this test from proftpd's configure.in and suited to our needs | |
339 | dnl ------------------------------------------------------------------------- | |
340 | dnl | |
341 | dnl This next check looks funky due to a linker problem with some versions | |
342 | dnl of the PAM library. Prior to 0.72 release, the Linux PAM shared library | |
343 | dnl omitted requiring libdl linking information. PAM-0.72 or better ships | |
344 | dnl with RedHat 6.2 and Debian 2.2 or better. | |
345 | AC_CHECK_LIB(pam, pam_start, | |
24cd435b | 346 | [AC_CHECK_LIB(pam, $pam_conv_func, |
7ea487bc | 347 | [AC_DEFINE(USE_PAM,,Use PAM for authentication) |
348 | LIBPAM="-lpam"], | |
349 | [AC_DEFINE(USE_PAM,,Use PAM for authentication) | |
350 | LIBPAM="-lpam -lpam_misc"] | |
351 | ) | |
352 | ], | |
353 | ||
354 | [AC_CHECK_LIB(pam, pam_end, | |
24cd435b | 355 | [AC_CHECK_LIB(pam, $pam_conv_func, |
a159ed93 | 356 | [AC_DEFINE(USE_PAM,,Use PAM for authentication) |
7ea487bc | 357 | LIBPAM="-lpam -ldl"], |
a159ed93 | 358 | [AC_DEFINE(USE_PAM,,Use PAM for authentication) |
7ea487bc | 359 | LIBPAM="-lpam -ldl -lpam_misc"] |
360 | ) | |
361 | ],AC_MSG_WARN([*** pam support will not be built ***]), | |
362 | [-ldl]) | |
363 | ] | |
364 | ) | |
365 | fi | |
366 | AC_SUBST(LIBPAM) | |
367 | ||
368 | dnl ------------------------------- | |
369 | dnl Endian-ness check | |
370 | dnl ------------------------------- | |
371 | AC_WORDS_BIGENDIAN | |
372 | ||
373 | dnl ------------------------------- | |
374 | dnl check the size in byte of the C | |
375 | dnl ------------------------------- | |
376 | dnl AC_CHECK_SIZEOF(char) | |
377 | dnl AC_CHECK_SIZEOF(int) | |
378 | dnl AC_CHECK_SIZEOF(short) | |
379 | dnl AC_CHECK_SIZEOF(long) | |
380 | ||
381 | dnl ---------------------------- | |
382 | dnl check existance of functions | |
383 | dnl ---------------------------- | |
49e3b3c0 | 384 | AC_CHECK_FUNCS(memset memcpy strerror inet_aton daemon snprintf vsnprintf \ |
04bd484b | 385 | strlcat strlcpy if_nametoindex if_indextoname getifaddrs \ |
386 | fcntl) | |
a159ed93 | 387 | AC_CHECK_FUNCS(setproctitle, , |
388 | [AC_CHECK_LIB(util, setproctitle, | |
389 | [LIBS="$LIBS -lutil" | |
390 | AC_DEFINE(HAVE_SETPROCTITLE,, Have setproctitle) | |
391 | ] | |
392 | ) | |
393 | ] | |
394 | ) | |
7ea487bc | 395 | |
396 | dnl ------------------------------------ | |
397 | dnl Determine routing get and set method | |
398 | dnl ------------------------------------ | |
399 | AC_MSG_CHECKING(zebra between kernel interface method) | |
400 | if test x"$opsys" = x"gnu-linux"; then | |
401 | if test "${enable_netlink}" = "yes";then | |
402 | AC_MSG_RESULT(netlink) | |
403 | RT_METHOD=rt_netlink.o | |
404 | AC_DEFINE(HAVE_NETLINK,,netlink) | |
405 | netlink=yes | |
406 | elif test "${enable_netlink}" = "no"; then | |
407 | AC_MSG_RESULT(ioctl) | |
408 | RT_METHOD=rt_ioctl.o | |
409 | netlink=no | |
410 | else | |
411 | AC_MSG_RESULT(netlink) | |
412 | RT_METHOD=rt_netlink.o | |
413 | AC_DEFINE(HAVE_NETLINK,,netlink) | |
414 | netlink=yes | |
415 | fi | |
19877dd2 | 416 | elif test x"$opsys" = x"sol2-6";then |
417 | AC_MSG_RESULT(Route socket) | |
418 | KERNEL_METHOD="kernel_socket.o" | |
419 | RT_METHOD="rt_socket.o" | |
420 | elif test x"$opsys" = x"sol9";then | |
421 | AC_MSG_RESULT(Route socket) | |
422 | KERNEL_METHOD="kernel_socket.o" | |
423 | RT_METHOD="rt_socket.o" | |
424 | elif test "$opsys" = "irix" ; then | |
425 | AC_MSG_RESULT(Route socket) | |
426 | KERNEL_METHOD="kernel_socket.o" | |
427 | RT_METHOD="rt_socket.o" | |
7ea487bc | 428 | else |
19877dd2 | 429 | AC_TRY_RUN([#include <errno.h> |
7ea487bc | 430 | #include <sys/types.h> |
431 | #include <sys/socket.h> | |
432 | ||
433 | main () | |
434 | { | |
435 | int ac_sock; | |
436 | ||
437 | ac_sock = socket (AF_ROUTE, SOCK_RAW, 0); | |
438 | if (ac_sock < 0 && errno == EINVAL) | |
439 | exit (1); | |
440 | exit (0); | |
441 | }], | |
442 | [KERNEL_METHOD=kernel_socket.o | |
443 | RT_METHOD=rt_socket.o | |
444 | AC_MSG_RESULT(socket)], | |
445 | [RT_METHOD=rt_ioctl.o | |
446 | AC_MSG_RESULT(ioctl)], | |
447 | [KERNEL_METHOD=kernel_socket.o | |
448 | RT_METHOD=rt_socket.o | |
449 | AC_MSG_RESULT(socket)]) | |
7ea487bc | 450 | fi |
451 | AC_SUBST(RT_METHOD) | |
452 | AC_SUBST(KERNEL_METHOD) | |
453 | AC_SUBST(OTHER_METHOD) | |
454 | ||
455 | dnl ------------------------------ | |
456 | dnl check kernel route read method | |
457 | dnl ------------------------------ | |
458 | AC_CACHE_CHECK(route read method check, zebra_rtread, | |
459 | [if test "$netlink" = yes; then | |
460 | RTREAD_METHOD="rtread_netlink.o" | |
461 | zebra_rtread="netlink" | |
462 | else | |
463 | for zebra_rtread in /proc/net/route /dev/ip /dev/null; | |
464 | do | |
465 | test x`ls $zebra_rtread 2>/dev/null` = x"$zebra_rtread" && break | |
466 | done | |
467 | case $zebra_rtread in | |
468 | "/proc/net/route") RTREAD_METHOD="rtread_proc.o" | |
469 | zebra_rtread="proc";; | |
9c30ab6b | 470 | "/dev/ip") |
471 | case "$host" in | |
472 | *-freebsd*) RTREAD_METHOD=rtread_sysctl.o | |
473 | zebra_rtread="sysctl";; | |
474 | *) RTREAD_METHOD="rtread_getmsg.o" | |
475 | zebra_rtread="getmsg";; | |
476 | esac;; | |
7ea487bc | 477 | *) RTREAD_METHOD="rtread_sysctl.o" |
478 | zebra_rtread="sysctl";; | |
479 | esac | |
480 | fi]) | |
481 | AC_SUBST(RTREAD_METHOD) | |
482 | ||
483 | dnl ----------------------------- | |
484 | dnl check interface lookup method | |
485 | dnl ----------------------------- | |
19877dd2 | 486 | IOCTL_METHOD=ioctl.o |
7ea487bc | 487 | AC_MSG_CHECKING(interface looking up method) |
488 | if test "$netlink" = yes; then | |
489 | AC_MSG_RESULT(netlink) | |
490 | IF_METHOD=if_netlink.o | |
19877dd2 | 491 | elif test "$opsys" = "sol2-6";then |
492 | AC_MSG_RESULT(Solaris GIF) | |
493 | IF_METHOD=if_ioctl.o | |
494 | elif test "$opsys" = "sol9";then | |
495 | AC_MSG_RESULT(Solaris GLIF) | |
496 | IF_METHOD=if_ioctl_solaris.o | |
497 | IOCTL_METHOD=ioctl_solaris.o | |
498 | elif test "$opsys" = "irix" ; then | |
499 | AC_MSG_RESULT(IRIX) | |
500 | IF_METHOD=if_ioctl.o | |
501 | elif test "$opsys" = "openbsd";then | |
502 | AC_MSG_RESULT(openbsd) | |
503 | IF_METHOD=if_ioctl.o | |
504 | elif grep NET_RT_IFLIST /usr/include/sys/socket.h >/dev/null 2>&1; then | |
505 | AC_MSG_RESULT(sysctl) | |
7ea487bc | 506 | IF_METHOD=if_sysctl.o |
507 | AC_DEFINE(HAVE_NET_RT_IFLIST,,NET_RT_IFLIST) | |
19877dd2 | 508 | else |
7ea487bc | 509 | AC_MSG_RESULT(ioctl) |
510 | IF_METHOD=if_ioctl.o | |
7ea487bc | 511 | fi |
512 | AC_SUBST(IF_METHOD) | |
19877dd2 | 513 | AC_SUBST(IOCTL_METHOD) |
7ea487bc | 514 | |
515 | dnl ----------------------- | |
516 | dnl check proc file system. | |
517 | dnl ----------------------- | |
518 | if test -r /proc/net/dev; then | |
519 | AC_DEFINE(HAVE_PROC_NET_DEV,,/proc/net/dev) | |
520 | IF_PROC=if_proc.o | |
521 | fi | |
522 | ||
523 | if test -r /proc/net/if_inet6; then | |
524 | AC_DEFINE(HAVE_PROC_NET_IF_INET6,,/proc/net/if_inet6) | |
525 | IF_PROC=if_proc.o | |
526 | fi | |
527 | AC_SUBST(IF_PROC) | |
528 | ||
529 | dnl ----------------------------- | |
530 | dnl check ipforward detect method | |
531 | dnl ----------------------------- | |
532 | AC_CACHE_CHECK(ipforward method check, zebra_ipforward_path, | |
533 | [for zebra_ipforward_path in /proc/net/snmp /dev/ip /dev/null; | |
534 | do | |
535 | test x`ls $zebra_ipforward_path 2>/dev/null` = x"$zebra_ipforward_path" && break | |
536 | done | |
537 | case $zebra_ipforward_path in | |
538 | "/proc/net/snmp") IPFORWARD=ipforward_proc.o | |
539 | zebra_ipforward_path="proc";; | |
540 | "/dev/ip") | |
541 | case "$host" in | |
542 | *-nec-sysv4*) IPFORWARD=ipforward_ews.o | |
543 | zebra_ipforward_path="ews";; | |
9c30ab6b | 544 | *-freebsd*) IPFORWARD=ipforward_sysctl.o |
545 | zebra_ipforward_path="sysctl";; | |
7ea487bc | 546 | *) IPFORWARD=ipforward_solaris.o |
547 | zebra_ipforward_path="solaris";; | |
548 | esac;; | |
549 | *) IPFORWARD=ipforward_sysctl.o | |
550 | zebra_ipforward_path="sysctl";; | |
551 | esac]) | |
552 | AC_SUBST(IPFORWARD) | |
553 | ||
554 | AC_CHECK_FUNCS(getaddrinfo, [have_getaddrinfo=yes], [have_getaddrinfo=no]) | |
555 | ||
556 | dnl ---------- | |
557 | dnl IPv6 check | |
558 | dnl ---------- | |
559 | AC_MSG_CHECKING(whether does this OS have IPv6 stack) | |
560 | if test "${enable_ipv6}" = "no"; then | |
561 | AC_MSG_RESULT(disabled) | |
562 | else | |
563 | dnl ---------- | |
564 | dnl INRIA IPv6 | |
565 | dnl ---------- | |
a159ed93 | 566 | if grep IPV6_INRIA_VERSION /usr/include/netinet/in.h >/dev/null 2>&1; then |
567 | zebra_cv_ipv6=yes | |
568 | AC_DEFINE(HAVE_IPV6,1,INRIA IPv6) | |
569 | AC_DEFINE(INRIA_IPV6,1,INRIA IPv6) | |
570 | RIPNGD="ripngd" | |
571 | OSPF6D="ospf6d" | |
572 | LIB_IPV6="" | |
573 | AC_MSG_RESULT(INRIA IPv6) | |
7ea487bc | 574 | dnl --------- |
575 | dnl KAME IPv6 | |
576 | dnl --------- | |
a159ed93 | 577 | elif grep WIDE /usr/include/netinet6/in6.h >/dev/null 2>&1; then |
578 | zebra_cv_ipv6=yes | |
579 | AC_DEFINE(HAVE_IPV6,1,KAME IPv6) | |
580 | AC_DEFINE(KAME,1,KAME IPv6) | |
581 | RIPNGD="ripngd" | |
582 | OSPF6D="ospf6d" | |
583 | if test -d /usr/local/v6/lib -a -f /usr/local/v6/lib/libinet6.a; then | |
7ea487bc | 584 | LIB_IPV6="-L/usr/local/v6/lib -linet6" |
a159ed93 | 585 | fi |
586 | AC_MSG_RESULT(KAME) | |
71c0fb50 | 587 | dnl ------------------------- |
588 | dnl MUSICA IPv6 | |
589 | dnl default host check | |
590 | dnl It is not used by Kheops | |
591 | dnl ------------------------- | |
a159ed93 | 592 | elif grep MUSICA /usr/include6/netinet6/in6.h >/dev/null 2>&1; then |
593 | zebra_cv_ipv6=yes | |
594 | AC_DEFINE(HAVE_IPV6,1,Musicia IPv6) | |
595 | AC_DEFINE(MUSICA,1,Musica IPv6 stack) | |
596 | AC_DEFINE(KAME,1,KAME IPv6 stack) | |
597 | RIPNGD="ripngd" | |
598 | OSPF6D="ospf6d" | |
599 | if test -d /usr/local/v6/lib -a -f /usr/local/v6/lib/libinet6.a; then | |
71c0fb50 | 600 | LIB_IPV6="-L/usr/local/v6/lib -linet6" |
a159ed93 | 601 | fi |
602 | AC_MSG_RESULT(MUSICA) | |
7ea487bc | 603 | dnl --------- |
604 | dnl NRL check | |
605 | dnl --------- | |
a159ed93 | 606 | elif grep NRL /usr/include/netinet6/in6.h >/dev/null 2>&1; then |
607 | zebra_cv_ipv6=yes | |
608 | AC_DEFINE(HAVE_IPV6,1,NRL IPv6) | |
609 | AC_DEFINE(NRL,1,NRL) | |
610 | RIPNGD="ripngd" | |
611 | OSPF6D="ospf6d" | |
612 | if test x"$opsys" = x"bsdi";then | |
7ea487bc | 613 | AC_DEFINE(BSDI_NRL,,BSDI) |
614 | AC_MSG_RESULT(BSDI_NRL) | |
a159ed93 | 615 | else |
7ea487bc | 616 | AC_MSG_RESULT(NRL) |
a159ed93 | 617 | fi |
19877dd2 | 618 | dnl ------------------------------------ |
619 | dnl Solaris 9, 10 and potentially higher | |
620 | dnl ------------------------------------ | |
621 | elif test x"$opsys" = x"sol9"; then | |
622 | zebra_cv_ipv6=yes; | |
623 | AC_DEFINE(HAVE_IPV6, 1, IPv6) | |
624 | AC_DEFINE(SOLARIS_IPV6, 1, Solaris IPv6) | |
625 | RIPNGD="ripngd" | |
626 | OSPF6D="ospf6d" | |
627 | AC_MSG_RESULT(Solaris IPv6) | |
7ea487bc | 628 | dnl ---------- |
629 | dnl Linux IPv6 | |
630 | dnl ---------- | |
a159ed93 | 631 | elif test "${enable_ipv6}" = "yes"; then |
632 | AC_EGREP_CPP(yes, [ | |
633 | #include <linux/version.h> | |
634 | /* 2.1.128 or later */ | |
635 | #if LINUX_VERSION_CODE >= 0x020180 | |
636 | yes | |
637 | #endif], | |
638 | [zebra_cv_ipv6=yes | |
639 | zebra_cv_linux_ipv6=yes | |
640 | AC_MSG_RESULT(Linux IPv6)]) | |
641 | else | |
642 | if test x`ls /proc/net/ipv6_route 2>/dev/null` = x"/proc/net/ipv6_route" | |
643 | then | |
7ea487bc | 644 | zebra_cv_ipv6=yes |
645 | zebra_cv_linux_ipv6=yes | |
646 | AC_MSG_RESULT(Linux IPv6) | |
a159ed93 | 647 | fi |
648 | fi | |
7ea487bc | 649 | |
a159ed93 | 650 | if test "$zebra_cv_linux_ipv6" = "yes";then |
651 | AC_MSG_CHECKING(for GNU libc >= 2.1) | |
652 | AC_DEFINE(HAVE_IPV6,1,Linux IPv6) | |
653 | AC_EGREP_CPP(yes, [ | |
7ea487bc | 654 | #include <features.h> |
655 | #if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 | |
656 | yes | |
a159ed93 | 657 | #endif], |
658 | [glibc=yes | |
659 | AC_DEFINE(LINUX_IPV6,1,Linux IPv6 stack) | |
660 | AC_MSG_RESULT(yes)], | |
661 | AC_MSG_RESULT(no) | |
662 | ) | |
663 | RIPNGD="ripngd" | |
664 | OSPF6D="ospf6d" | |
665 | if test "$glibc" != "yes"; then | |
7ea487bc | 666 | INCLUDES="-I/usr/inet6/include" |
667 | if test x`ls /usr/inet6/lib/libinet6.a 2>/dev/null` != x;then | |
668 | LIB_IPV6="-L/usr/inet6/lib -linet6" | |
669 | fi | |
a159ed93 | 670 | fi |
671 | fi | |
7ea487bc | 672 | |
673 | dnl ----------------------- | |
674 | dnl Set IPv6 related values | |
675 | dnl ----------------------- | |
a159ed93 | 676 | LIBS="$LIB_IPV6 $LIBS" |
677 | AC_SUBST(LIB_IPV6) | |
7ea487bc | 678 | |
a159ed93 | 679 | if test x"$RIPNGD" = x""; then |
680 | AC_MSG_RESULT(IPv4 only) | |
681 | fi | |
7ea487bc | 682 | fi |
683 | ||
fa3232e1 | 684 | dnl ------------------ |
685 | dnl IPv6 header checks | |
686 | dnl ------------------ | |
687 | if test "x${zebra_cv_ipv6}" = "xyes"; then | |
688 | AC_CHECK_HEADERS([netinet6/in6.h netinet/in6_var.h netinet/icmp6.h \ | |
689 | netinet6/in6_var.h netinet6/nd6.h]) | |
690 | fi | |
691 | ||
7ea487bc | 692 | dnl -------------------- |
693 | dnl Daemon disable check | |
694 | dnl -------------------- | |
695 | if test "${enable_zebra}" = "no";then | |
696 | ZEBRA="" | |
697 | else | |
698 | ZEBRA="zebra" | |
699 | fi | |
700 | ||
701 | if test "${enable_bgpd}" = "no";then | |
702 | BGPD="" | |
703 | else | |
704 | BGPD="bgpd" | |
705 | fi | |
706 | ||
707 | if test "${enable_ripd}" = "no";then | |
708 | RIPD="" | |
709 | else | |
710 | RIPD="ripd" | |
711 | fi | |
712 | ||
713 | if test "${enable_ospfd}" = "no";then | |
714 | OSPFD="" | |
715 | else | |
716 | OSPFD="ospfd" | |
717 | fi | |
718 | ||
1ef74ef7 | 719 | OSPFCLIENT="" |
720 | if test "${enable_opaque_lsa}" = "yes"; then | |
721 | if test "${enable_ospfapi}" != "no";then | |
9a569848 | 722 | AC_DEFINE(SUPPORT_OSPF_API,,OSPFAPI) |
1ef74ef7 | 723 | |
724 | if test "${enable_ospfclient}" != "no";then | |
725 | OSPFCLIENT="ospfclient" | |
726 | fi | |
727 | fi | |
728 | ||
7ea487bc | 729 | fi |
730 | ||
731 | case "${enable_ripngd}" in | |
732 | "yes") RIPNGD="ripngd";; | |
733 | "no" ) RIPNGD="";; | |
734 | * ) ;; | |
735 | esac | |
736 | ||
737 | case "${enable_ospf6d}" in | |
738 | "yes") OSPF6D="ospf6d";; | |
739 | "no" ) OSPF6D="";; | |
740 | * ) ;; | |
741 | esac | |
742 | ||
9e867fe6 | 743 | case "${enable_isisd}" in |
744 | "yes") ISISD="isisd";; | |
745 | "no" ) ISISD="";; | |
746 | * ) ISISD="isisd";; | |
747 | esac | |
748 | ||
7ea487bc | 749 | if test "${enable_bgp_announce}" = "no";then |
750 | AC_DEFINE(DISABLE_BGP_ANNOUNCE,,Disable BGP installation to zebra) | |
751 | fi | |
752 | ||
753 | AC_SUBST(ZEBRA) | |
754 | AC_SUBST(BGPD) | |
755 | AC_SUBST(RIPD) | |
756 | AC_SUBST(RIPNGD) | |
757 | AC_SUBST(OSPFD) | |
758 | AC_SUBST(OSPF6D) | |
9e867fe6 | 759 | AC_SUBST(ISISD) |
7ea487bc | 760 | AC_SUBST(VTYSH) |
761 | AC_SUBST(INCLUDES) | |
762 | AC_SUBST(CURSES) | |
763 | AC_SUBST(OSPFCLIENT) | |
1ef74ef7 | 764 | AC_SUBST(OSPFAPI) |
7ea487bc | 765 | AC_CHECK_LIB(c, inet_ntop, [AC_DEFINE(HAVE_INET_NTOP,,inet_ntop)]) |
766 | AC_CHECK_LIB(c, inet_pton, [AC_DEFINE(HAVE_INET_PTON,,inet_pton)]) | |
767 | AC_CHECK_LIB(crypt, crypt) | |
768 | AC_CHECK_LIB(resolv, res_init) | |
769 | AC_CHECK_LIB(m, main) | |
770 | ||
771 | dnl --------------------------------------------------- | |
772 | dnl BSD/OS 4.1 define inet_XtoY function as __inet_XtoY | |
773 | dnl --------------------------------------------------- | |
a159ed93 | 774 | AC_CHECK_FUNC(__inet_ntop, AC_DEFINE(HAVE_INET_NTOP,,__inet_ntop)) |
775 | AC_CHECK_FUNC(__inet_pton, AC_DEFINE(HAVE_INET_PTON,,__inet_pton)) | |
776 | AC_CHECK_FUNC(__inet_aton, AC_DEFINE(HAVE_INET_ATON,,__inet_aton)) | |
7ea487bc | 777 | |
778 | dnl --------------------------- | |
779 | dnl check system has GNU regexp | |
780 | dnl --------------------------- | |
781 | dnl AC_MSG_CHECKING(whether system has GNU regex) | |
782 | AC_CHECK_LIB(c, regexec, | |
783 | [AC_DEFINE(HAVE_GNU_REGEX,,GNU regexp library) | |
784 | LIB_REGEX=""], | |
785 | [LIB_REGEX="regex.o"]) | |
786 | AC_SUBST(LIB_REGEX) | |
787 | ||
788 | dnl ------------------ | |
789 | dnl check SNMP library | |
790 | dnl ------------------ | |
791 | if test "${enable_snmp}" = "yes";then | |
792 | dnl AC_CHECK_LIB(snmp, asn_parse_int, HAVE_SNMP=yes) | |
7ea487bc | 793 | if test "${HAVE_SNMP}" = ""; then |
1ef74ef7 | 794 | old_libs="${LIBS}" |
795 | LIBS="-L/usr/lib" | |
7ea487bc | 796 | unset ac_cv_lib_snmp_asn_parse_int |
1ef74ef7 | 797 | AC_CHECK_LIB(crypto, main, NEED_CRYPTO=yes, ) |
798 | if test "${NEED_CRYPTO}" = ""; then | |
799 | AC_CHECK_LIB(netsnmp, asn_parse_int, [HAVE_NETSNMP=yes; HAVE_SNMP=yes ]) | |
800 | else | |
801 | AC_CHECK_LIB(netsnmp, asn_parse_int, [HAVE_NETSNMP=yes; HAVE_SNMP=yes; NEED_CRYPTO=yes;LIBS="$LIBS -lcrypto" ],,"-lcrypto") | |
802 | fi | |
803 | LIBS="${old_libs}" | |
7ea487bc | 804 | fi |
7ea487bc | 805 | if test "${HAVE_SNMP}" = ""; then |
1ef74ef7 | 806 | old_libs="${LIBS}" |
807 | LIBS="-L/usr/lib" | |
808 | unset ac_cv_lib_snmp_asn_parse_int | |
809 | AC_CHECK_LIB(snmp, asn_parse_int, HAVE_SNMP=yes, ) | |
810 | if test "${HAVE_SNMP}" = ""; then | |
811 | unset ac_cv_lib_snmp_asn_parse_int | |
812 | AC_CHECK_LIB(crypto, main, NEED_CRYPTO=yes, ) | |
813 | if test "${NEED_CRYPTO}" = "yes"; then | |
814 | AC_CHECK_LIB(snmp, asn_parse_int, [HAVE_SNMP=yes; NEED_CRYPTO=yes; LIBS="$LIBS -lcrypto" ],,"-lcrypto") | |
815 | fi | |
816 | fi | |
817 | LIBS="${old_libs}" | |
7ea487bc | 818 | fi |
1ef74ef7 | 819 | |
ac7c4bb6 | 820 | if test "${HAVE_SNMP}" = ""; then |
1ef74ef7 | 821 | old_libs="${LIBS}" |
822 | LIBS="-L/usr/local/lib" | |
823 | unset ac_cv_lib_snmp_asn_parse_int | |
824 | AC_CHECK_LIB(snmp, asn_parse_int, HAVE_SNMP=yes) | |
825 | if test "${HAVE_SNMP}" = ""; then | |
826 | unset ac_cv_lib_snmp_asn_parse_int | |
827 | AC_CHECK_LIB(crypto, main, NEED_CRYPTO=yes, ) | |
828 | if test "${NEED_CRYPTO}" = "yes"; then | |
829 | AC_CHECK_LIB(snmp, asn_parse_int, [HAVE_SNMP=yes; NEED_CRYPTO=yes; LIBS="$LIBS -lcrypto" ],,"-lcrypto") | |
830 | fi | |
831 | fi | |
832 | LIBS="${old_libs}" | |
ac7c4bb6 | 833 | fi |
1ef74ef7 | 834 | |
7ea487bc | 835 | if test "${HAVE_SNMP}" = "yes"; then |
836 | for ac_snmp in /usr/include/net-snmp/library/asn1.h /usr/include/ucd-snmp/asn1.h /usr/local/include/ucd-snmp/asn1.h /dev/null | |
837 | do | |
838 | test -f "${ac_snmp}" && break | |
839 | done | |
1ef74ef7 | 840 | |
7ea487bc | 841 | case ${ac_snmp} in |
842 | /usr/include/net-snmp/*) | |
843 | AC_DEFINE(HAVE_SNMP,,SNMP) | |
1ef74ef7 | 844 | AC_DEFINE(HAVE_NETSNMP,,SNMP) |
7ea487bc | 845 | AC_DEFINE(UCD_COMPATIBLE,,SNMP) |
ac7c4bb6 | 846 | CFLAGS="${CFLAGS} -I/usr/include/net-snmp -I/usr/include/net-snmp/library" |
847 | if test "${HAVE_NETSNMP}" = "yes"; then | |
1ef74ef7 | 848 | LIBS="${LIBS} -lnetsnmp" |
ac7c4bb6 | 849 | else |
1ef74ef7 | 850 | LIBS="${LIBS} -lsnmp" |
ac7c4bb6 | 851 | fi |
7ea487bc | 852 | ;; |
853 | /usr/include/ucd-snmp/*) | |
854 | AC_DEFINE(HAVE_SNMP,,SNMP) | |
855 | CFLAGS="${CFLAGS} -I/usr/include/ucd-snmp" | |
856 | LIBS="${LIBS} -lsnmp" | |
857 | ;; | |
858 | /usr/local/include/ucd-snmp/*) | |
859 | AC_DEFINE(HAVE_SNMP,,SNMP) | |
860 | CFLAGS="${CFLAGS} -I/usr/local/include/ucd-snmp" | |
861 | LIBS="${LIBS} -L/usr/local/lib -lsnmp" | |
862 | ;; | |
f3bd1a78 | 863 | /usr/local/include/net-snmp/*) |
864 | AC_DEFINE(HAVE_SNMP,,SNMP) | |
865 | AC_DEFINE(HAVE_NET_SNMP,,SNMP) | |
866 | AC_DEFINE(UCD_COMPATIBLE,,SNMP) | |
867 | CFLAGS="${CFLAGS} -I/usr/local/include/net-snmp" | |
868 | LIBS="${LIBS} -L/usr/local/lib -lnetsnmp" | |
869 | ;; | |
7ea487bc | 870 | esac |
871 | if test "${NEED_CRYPTO}" = "yes"; then | |
872 | LIBS="${LIBS} -lcrypto" | |
873 | fi | |
874 | fi | |
875 | fi | |
876 | ||
877 | dnl ---------------------------- | |
878 | dnl check sa_len of sockaddr | |
879 | dnl ---------------------------- | |
880 | AC_MSG_CHECKING(whether struct sockaddr has a sa_len field) | |
881 | AC_TRY_COMPILE([#include <sys/types.h> | |
882 | #include <sys/socket.h> | |
883 | ],[static struct sockaddr ac_i;int ac_j = sizeof (ac_i.sa_len);], | |
884 | [AC_MSG_RESULT(yes) | |
885 | AC_DEFINE(HAVE_SA_LEN,,sa_len)], | |
886 | AC_MSG_RESULT(no)) | |
887 | ||
888 | dnl ---------------------------- | |
889 | dnl check sin_len of sockaddr_in | |
890 | dnl ---------------------------- | |
891 | AC_MSG_CHECKING(whether struct sockaddr_in has a sin_len field) | |
892 | AC_TRY_COMPILE([#include <sys/types.h> | |
893 | #include <netinet/in.h> | |
894 | ],[static struct sockaddr_in ac_i;int ac_j = sizeof (ac_i.sin_len);], | |
895 | [AC_MSG_RESULT(yes) | |
896 | AC_DEFINE(HAVE_SIN_LEN,,sin_len)], | |
897 | AC_MSG_RESULT(no)) | |
898 | ||
899 | dnl ---------------------------- | |
900 | dnl check sun_len of sockaddr_un | |
901 | dnl ---------------------------- | |
902 | AC_MSG_CHECKING(whether struct sockaddr_un has a sun_len field) | |
903 | AC_TRY_COMPILE([#include <sys/types.h> | |
904 | #include <sys/un.h> | |
905 | ],[static struct sockaddr_un ac_i;int ac_j = sizeof (ac_i.sun_len);], | |
906 | [AC_MSG_RESULT(yes) | |
907 | AC_DEFINE(HAVE_SUN_LEN,,sun_len)], | |
908 | AC_MSG_RESULT(no)) | |
909 | ||
910 | dnl ----------------------------------- | |
911 | dnl check sin6_scope_id of sockaddr_in6 | |
912 | dnl ----------------------------------- | |
913 | if test "$zebra_cv_ipv6" = yes; then | |
914 | AC_MSG_CHECKING(whether struct sockaddr_in6 has a sin6_scope_id field) | |
915 | AC_TRY_COMPILE([#include <sys/types.h> | |
916 | #include <netinet/in.h> | |
917 | ],[static struct sockaddr_in6 ac_i;int ac_j = sizeof (ac_i.sin6_scope_id);], | |
918 | [AC_MSG_RESULT(yes) | |
919 | AC_DEFINE(HAVE_SIN6_SCOPE_ID,,scope id)], | |
920 | AC_MSG_RESULT(no)) | |
921 | fi | |
922 | ||
923 | dnl ---------------------------- | |
924 | dnl check socklen_t exist or not | |
925 | dnl ---------------------------- | |
926 | AC_MSG_CHECKING(whther socklen_t is defined) | |
927 | AC_TRY_COMPILE([#include <sys/types.h> | |
928 | #include <sys/socket.h> | |
929 | #include <netinet/in.h> | |
930 | ],[socklen_t ac_x;], | |
931 | [AC_MSG_RESULT(yes) | |
932 | AC_DEFINE(HAVE_SOCKLEN_T,,socklen_t)], | |
933 | AC_MSG_RESULT(no)) | |
934 | ||
935 | dnl ------------------------ | |
936 | dnl check struct sockaddr_dl | |
937 | dnl ------------------------ | |
938 | AC_MSG_CHECKING(whether struct sockaddr_dl exist) | |
939 | AC_EGREP_HEADER(sockaddr_dl, | |
940 | net/if_dl.h, | |
941 | [AC_MSG_RESULT(yes) | |
942 | AC_DEFINE(HAVE_SOCKADDR_DL,,sockaddr_dl)], | |
943 | AC_MSG_RESULT(no)) | |
944 | ||
945 | dnl -------------------------- | |
946 | dnl check structure ifaliasreq | |
947 | dnl -------------------------- | |
948 | AC_MSG_CHECKING(whether struct ifaliasreq exist) | |
949 | AC_EGREP_HEADER(ifaliasreq, | |
950 | net/if.h, | |
951 | [AC_MSG_RESULT(yes) | |
952 | AC_DEFINE(HAVE_IFALIASREQ,,ifaliasreq)], | |
953 | AC_MSG_RESULT(no)) | |
954 | ||
955 | dnl ---------------------------- | |
956 | dnl check structure in6_aliasreq | |
957 | dnl ---------------------------- | |
71c0fb50 | 958 | AC_MSG_CHECKING(whether struct in6_aliasreq exist) |
7ea487bc | 959 | AC_EGREP_HEADER(in6_aliasreq, |
960 | netinet6/in6_var.h, | |
961 | [AC_MSG_RESULT(yes) | |
962 | AC_DEFINE(HAVE_IN6_ALIASREQ,,in6_aliasreq)], | |
963 | AC_MSG_RESULT(no)) | |
964 | ||
71c0fb50 | 965 | dnl ----------------------------------- |
966 | dnl check ifra_lifetime of in6_aliasreq | |
967 | dnl ----------------------------------- | |
968 | AC_MSG_CHECKING(whether in6_aliasreq.ifra_lifetime exist) | |
969 | AC_TRY_COMPILE([#include <sys/types.h> | |
970 | #include <netinet6/in6_var.h> | |
971 | ],[static struct if6_aliasreq ac_i;int ac_j = sizeof (ac_i.ifra_lifetime);], | |
972 | [AC_MSG_RESULT(yes) | |
a159ed93 | 973 | AC_DEFINE(HAVE_IFRA_LIFETIME,,Have in6_aliasreq.ifra_lifetime)], |
71c0fb50 | 974 | AC_MSG_RESULT(no)) |
975 | ||
7ea487bc | 976 | dnl --------------------------- |
977 | dnl check structure rt_addrinfo | |
978 | dnl --------------------------- | |
979 | AC_MSG_CHECKING(whether struct rt_addrinfo exist) | |
980 | AC_EGREP_HEADER(rt_addrinfo, | |
981 | net/route.h, | |
982 | [AC_MSG_RESULT(yes) | |
983 | AC_DEFINE(HAVE_RT_ADDRINFO,,rt_addrinfo)], | |
984 | AC_MSG_RESULT(no)) | |
985 | ||
986 | dnl -------------------------- | |
987 | dnl check structure in_pktinfo | |
988 | dnl -------------------------- | |
989 | AC_MSG_CHECKING(whether struct in_pktinfo exist) | |
990 | AC_TRY_COMPILE([#include <netinet/in.h> | |
991 | ],[struct in_pktinfo ac_x;], | |
992 | [AC_MSG_RESULT(yes) | |
993 | AC_DEFINE(HAVE_INPKTINFO,,in_pktinfo)], | |
994 | AC_MSG_RESULT(no)) | |
995 | ||
996 | dnl -------------------------------------- | |
997 | dnl checking for getrusage struct and call | |
998 | dnl -------------------------------------- | |
999 | AC_MSG_CHECKING(whether getrusage is available) | |
1000 | AC_TRY_COMPILE([#include <sys/resource.h> | |
1001 | ],[struct rusage ac_x; getrusage (RUSAGE_SELF, &ac_x);], | |
1002 | [AC_MSG_RESULT(yes) | |
1003 | AC_DEFINE(HAVE_RUSAGE,,rusage)], | |
1004 | AC_MSG_RESULT(no)) | |
1005 | ||
edd7c245 | 1006 | dnl ------------------- |
1007 | dnl capabilities checks | |
1008 | dnl ------------------- | |
41d3fc96 | 1009 | if test "${enable_capabilities}" != "no"; then |
1010 | AC_MSG_CHECKING(whether prctl PR_SET_KEEPCAPS is available) | |
1011 | AC_TRY_COMPILE([#include <sys/prctl.h>],[prctl(PR_SET_KEEPCAPS, 1, 0, 0, 0);], | |
1012 | [AC_MSG_RESULT(yes) | |
1013 | AC_DEFINE(HAVE_PR_SET_KEEPCAPS,,prctl) | |
1014 | quagga_ac_keepcaps="yes"], | |
1015 | AC_MSG_RESULT(no) | |
edd7c245 | 1016 | ) |
41d3fc96 | 1017 | if test x"${quagga_ac_keepcaps}" = x"yes"; then |
1018 | AC_CHECK_HEADERS(sys/capability.h) | |
1019 | fi | |
1020 | if test x"${ac_cv_header_sys_capability_h}" = x"yes"; then | |
1021 | AC_CHECK_LIB(cap, cap_init, | |
1022 | [AC_DEFINE(HAVE_LCAPS,1,Capabilities) | |
1023 | LIBCAP="-lcap" | |
1024 | ] | |
1025 | ) | |
1026 | fi | |
edd7c245 | 1027 | fi |
1028 | AC_SUBST(LIBCAP) | |
1029 | ||
fb2d1502 | 1030 | dnl --------------------------- |
1031 | dnl check for glibc 'backtrace' | |
1032 | dnl --------------------------- | |
1033 | if test "${glibc}" = "yes"; then | |
1034 | AC_CHECK_HEADER(execinfo.h) | |
1035 | fi | |
1036 | if test x"${ac_cv_header_execinfo_h}" = x"yes"; then | |
1037 | AC_CHECK_FUNC(backtrace, | |
1038 | [AC_DEFINE(HAVE_GLIBC_BACKTRACE,,Glibc backtrace)] | |
1039 | ) | |
1040 | fi | |
1041 | ||
408ad943 | 1042 | dnl ---------- |
1043 | dnl configure date | |
1044 | dnl ---------- | |
1045 | CONFDATE=`date '+%Y%m%d'` | |
1046 | AC_SUBST(CONFDATE) | |
1047 | ||
7ea487bc | 1048 | dnl ------------------------------ |
a159ed93 | 1049 | dnl set paths for state directory |
23bd12c3 | 1050 | dnl ------------------------------ |
1051 | if test "${prefix}" = "NONE"; then | |
e8f2984c | 1052 | quagga_statedir_prefix=""; |
23bd12c3 | 1053 | else |
e8f2984c | 1054 | quagga_statedir_prefix=${prefix} |
23bd12c3 | 1055 | fi |
1056 | if test "${localstatedir}" = '${prefix}/var'; then | |
a159ed93 | 1057 | AC_CACHE_CHECK(state directory,ac_statedir, |
e8f2984c | 1058 | [for QUAGGA_STATE_DIR in ${quagga_statedir_prefix}/var/run dnl |
1059 | ${quagga_statedir_prefix}/var/adm dnl | |
1060 | ${quagga_statedir_prefix}/etc dnl | |
a159ed93 | 1061 | /var/run dnl |
1062 | /var/adm dnl | |
1063 | /etc dnl | |
1064 | /dev/null; | |
23bd12c3 | 1065 | do |
e8f2984c | 1066 | test -d $QUAGGA_STATE_DIR && break |
23bd12c3 | 1067 | done |
e8f2984c | 1068 | quagga_statedir=$QUAGGA_STATE_DIR]) |
23bd12c3 | 1069 | else |
e8f2984c | 1070 | quagga_statedir=${localstatedir} |
a159ed93 | 1071 | AC_MSG_CHECKING(directory to use for state file) |
e8f2984c | 1072 | AC_MSG_RESULT(${quagga_statedir}) |
a159ed93 | 1073 | fi |
e8f2984c | 1074 | if test $quagga_statedir = "/dev/null"; then |
a159ed93 | 1075 | AC_MSG_ERROR('STATE DIRECTORY NOT FOUND! FIX OR SPECIFY --localstatedir!') |
1076 | fi | |
1077 | ||
e8f2984c | 1078 | AC_DEFINE_UNQUOTED(PATH_ZEBRA_PID, "$quagga_statedir/zebra.pid",zebra PID) |
1079 | AC_DEFINE_UNQUOTED(PATH_RIPD_PID, "$quagga_statedir/ripd.pid",ripd PID) | |
1080 | AC_DEFINE_UNQUOTED(PATH_RIPNGD_PID, "$quagga_statedir/ripngd.pid",ripngd PID) | |
1081 | AC_DEFINE_UNQUOTED(PATH_BGPD_PID, "$quagga_statedir/bgpd.pid",bgpd PID) | |
1082 | AC_DEFINE_UNQUOTED(PATH_OSPFD_PID, "$quagga_statedir/ospfd.pid",ospfd PID) | |
1083 | AC_DEFINE_UNQUOTED(PATH_OSPF6D_PID, "$quagga_statedir/ospf6d.pid",ospf6d PID) | |
9e867fe6 | 1084 | AC_DEFINE_UNQUOTED(PATH_ISISD_PID, "$quagga_statedir/isisd.pid",isisd PID) |
e8f2984c | 1085 | AC_DEFINE_UNQUOTED(ZEBRA_SERV_PATH, "$quagga_statedir/zserv.api",zebra api socket) |
1086 | AC_DEFINE_UNQUOTED(ZEBRA_VTYSH_PATH, "$quagga_statedir/zebra.vty",zebra vty socket) | |
1087 | AC_DEFINE_UNQUOTED(RIP_VTYSH_PATH, "$quagga_statedir/ripd.vty",rip vty socket) | |
1088 | AC_DEFINE_UNQUOTED(RIPNG_VTYSH_PATH, "$quagga_statedir/ripngd.vty",ripng vty socket) | |
1089 | AC_DEFINE_UNQUOTED(BGP_VTYSH_PATH, "$quagga_statedir/bgpd.vty",bgpd vty socket) | |
1090 | AC_DEFINE_UNQUOTED(OSPF_VTYSH_PATH, "$quagga_statedir/ospfd.vty",ospfd vty socket) | |
1091 | AC_DEFINE_UNQUOTED(OSPF6_VTYSH_PATH, "$quagga_statedir/ospf6d.vty",ospf6d vty socket) | |
9e867fe6 | 1092 | AC_DEFINE_UNQUOTED(ISIS_VTYSH_PATH, "$quagga_statedir/isisd.vty",isisd vty socket) |
7ea487bc | 1093 | |
1094 | dnl --------------------------- | |
1095 | dnl Check htonl works correctly | |
1096 | dnl --------------------------- | |
1097 | AC_MSG_CHECKING(for working htonl) | |
1098 | AC_CACHE_VAL(ac_cv_htonl_works, [ | |
1099 | AC_TRY_LINK([#ifdef HAVE_SYS_TYPES_H | |
1100 | #include <sys/types.h> | |
1101 | #endif | |
1102 | #ifdef HAVE_NETDB_H | |
1103 | #include <netdb.h> | |
1104 | #endif | |
1105 | #ifdef HAVE_NETINET_IN_H | |
1106 | #include <netinet/in.h> | |
1107 | #endif], | |
1108 | [htonl (0);], | |
1109 | ac_cv_htonl_works=yes, | |
1110 | ac_cv_htonl_works=no)]) | |
1111 | AC_MSG_RESULT($ac_cv_htonl_works) | |
1112 | ||
6382b6f8 | 1113 | AC_OUTPUT(Makefile lib/Makefile zebra/Makefile ripd/Makefile |
1114 | ripngd/Makefile bgpd/Makefile ospfd/Makefile | |
9e867fe6 | 1115 | ospf6d/Makefile isisd/Makefile vtysh/Makefile doc/Makefile |
6382b6f8 | 1116 | ospfclient/Makefile |
fc9d0745 | 1117 | vtysh/extract.pl |
a4d2a0d2 | 1118 | redhat/Makefile redhat/quagga.spec |
fc9d0745 | 1119 | lib/version.h, |
1120 | [chmod +x vtysh/extract.pl]) | |
7ea487bc | 1121 | |
1122 | echo " | |
1123 | zebra configuration | |
1124 | ------------------- | |
fa1253d0 | 1125 | quagga version : ${PACKAGE_VERSION} |
7ea487bc | 1126 | host operationg system : ${host_os} |
1127 | source code location : ${srcdir} | |
1128 | compiler : ${CC} | |
1129 | compiler flags : ${CFLAGS} | |
71c0fb50 | 1130 | linker flags : ${LDFLAGS} ${LIBS} |
e8f2984c | 1131 | state file directory : ${quagga_statedir} |
dc7a2bf1 | 1132 | config file directory : `eval echo \`echo ${sysconfdir}\`` |
d6b72f7a | 1133 | example directory : `eval echo \`echo ${exampledir}\`` |
8d4aee5d | 1134 | user to run as : ${enable_user} |
1135 | group to run as : ${enable_group} | |
1136 | group for vty sockets : ${enable_vty_group} | |
aa593d5e | 1137 | config file mask : ${enable_configfile_mask} |
1138 | log file mask : ${enable_logfile_mask} | |
dc7a2bf1 | 1139 | |
1140 | The above user and group must have read/write access to the state file | |
1141 | directory and to the config files in the config file directory. | |
7ea487bc | 1142 | " |