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