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