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