2 ## Configure template file for Zebra.
3 ## autoconf will generate configure script.
5 ## Copyright (c) 1996, 97, 98, 99, 2000 Kunihiro Ishiguro <kunihiro@zebra.org>
10 AM_INIT_AUTOMAKE(zebra, 0.95)
11 AM_CONFIG_HEADER(config.h)
13 dnl -----------------------------------
14 dnl Get hostname and other information.
15 dnl -----------------------------------
22 [ --with-cflags Set CFLAGS for use in compilation.])
23 if test "x$with_cflags" != "x" ; then
24 CFLAGS="$with_cflags" ; cflags_specified=yes ;
25 elif test -n "$CFLAGS" ; then
26 cflags_specified=yes ;
33 [ --with-linkbase Set local library base for use in compilation.])
34 if test "x$with_linkbase" != "x" ; then
35 linkbase_specified=yes ;
43 dnl -----------------------------------------
44 dnl If CLFAGS doesn\'t exist set default value
45 dnl -----------------------------------------
46 if test "x$cflags_specified" = "x" ; then
47 CFLAGS="$CFLAGS -Wall"
50 dnl -----------------------------------------
51 dnl If linkbase specified expand it
52 dnl -----------------------------------------
53 if test "$linkbase_specified" = "yes" ; then
54 CFLAGS="$CFLAGS -I${with_linkbase}/include" ;
55 LIBS="$LIBS -L${with_linkbase}/lib" ;
65 AC_CHECK_TOOL(RANLIB, ranlib, :)
72 dnl ----------------------
73 dnl Packages configuration
74 dnl ----------------------
76 [ --enable-vtysh, Make integrated VTY version of zebra])
78 [ --disable-ipv6 turn off IPv6 related features and daemons])
80 [ --disable-zebra do not build zebra daemon])
82 [ --disable-bgpd do not build bgpd])
84 [ --disable-ripd do not build ripd])
86 [ --disable-ripngd do not build ripngd])
88 [ --disable-ospfd do not build ospfd])
90 [ --disable-ospf6d do not build ospf6d])
92 [ --enable-irdp enable IRDP server support in zebra])
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])
100 [ --enable-snmp enable SNMP support])
102 [ --with-libpam use libpam for PAM support in vtysh])
103 AC_ARG_ENABLE(tcpsock,
104 [ --enable-tcp-zebra enable TCP/IP socket connection between zebra and protocol daemon])
105 dnl Temporary option until OSPF NSSA implementation complete
107 [ --enable-nssa enable OSPF NSSA option])
108 AC_ARG_ENABLE(opaque-lsa,
109 [ --enable-opaque-lsa enable OSPF Opaque-LSA support (RFC2370)])
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])
114 AC_ARG_ENABLE(tcp-signature,
115 [ --enable-tcp-signature enable TCP MD5 Signature Option (RFC2385) (for Linux and OpenBSD)])
117 if test "${enable_broken_aliases}" = "yes"; then
118 if test "${enable_netlink}" = "yes"
120 echo "Sorry, you can't use netlink with broken aliases"
123 AC_DEFINE(HAVE_BROKEN_ALIASES,,Broken Alias)
127 if test "${enable_tcp_zebra}" = "yes"; then
128 AC_DEFINE(HAVE_TCP_ZEBRA,,Use TCP for zebra communication)
131 if test "${enable_nssa}" = "yes"; then
132 AC_DEFINE(HAVE_NSSA,,OSPF NSSA)
135 if test "${enable_irdp}" = "yes"; then
136 AC_DEFINE(HAVE_IRDP,, IRDP )
139 if test "${enable_opaque_lsa}" = "yes"; then
140 AC_DEFINE(HAVE_OPAQUE_LSA,,OSPF Opaque LSA)
143 if test "${enable_ospf_te}" = "yes"; then
144 AC_DEFINE(HAVE_OPAQUE_LSA,,OSPF Opaque LSA)
145 AC_DEFINE(HAVE_OSPF_TE,,OSPF TE)
152 case "${enable_multipath}" in
154 MULTIPATH_NUM="${enable_multipath}"
159 echo "Please specify digit to --enable-multipath ARG."
166 AC_SUBST(MULTIPATH_NUM)
168 dnl -------------------
169 dnl Check header files.
170 dnl -------------------
172 AC_CHECK_HEADERS(string.h stropts.h sys/conf.h sys/ksym.h sys/time.h sys/times.h sys/select.h sys/sysctl.h sys/sockio.h sys/types.h net/if_dl.h net/if_var.h linux/version.h kvm.h netdb.h netinet/in.h net/netopt.h netinet/in_var.h netinet/in6_var.h netinet/in6.h inet/nd.h asm/types.h netinet/icmp6.h netinet6/nd6.h libutil.h)
179 dnl Some systems (Solaris 2.x) require libnsl (Network Services Library)
181 *-sunos5.6* | *-solaris2.6*)
183 AC_DEFINE(SUNOS_5,,SunOS 5)
184 AC_CHECK_LIB(xnet, main)
187 *-sunos5* | *-solaris2*)
188 AC_DEFINE(SUNOS_5,,SunOS 5)
189 AC_CHECK_LIB(socket, main)
190 AC_CHECK_LIB(nsl, main)
195 AC_DEFINE(GNU_LINUX,,GNU Linux)
198 AC_CHECK_LIB(nsl, gethostbyname)
199 AC_CHECK_LIB(socket, socket)
202 AC_DEFINE(FREEBSD_32,,FreeBSD 3.2)
206 AC_DEFINE(OPEN_BSD,,OpenBSD)
210 OTHER_METHOD="mtu_kvm.o"
211 AC_CHECK_LIB(kvm, main)
215 dnl ---------------------
216 dnl Integrated VTY option
217 dnl ---------------------
218 case "${enable_vtysh}" in
221 AC_DEFINE(VTYSH,,VTY shell)
222 AC_CHECK_LIB(tinfo, tputs, , AC_CHECK_LIB(ncurses, tputs, ,
223 AC_CHECK_LIB(termcap, tputs)))
224 AC_CHECK_LIB(readline, main)
225 if test $ac_cv_lib_readline_main = no; then
226 AC_MSG_ERROR([vtysh needs libreadline but was not found on your system.])
228 AC_CHECK_HEADER(readline/history.h)
229 if test $ac_cv_header_readline_history_h = no;then
230 AC_MSG_ERROR([readline is too old to have readline/history.h, please update to the latest readline library.])
243 if test "$with_libpam" = "yes"; then
244 dnl took this test from proftpd's configure.in and suited to our needs
245 dnl -------------------------------------------------------------------------
247 dnl This next check looks funky due to a linker problem with some versions
248 dnl of the PAM library. Prior to 0.72 release, the Linux PAM shared library
249 dnl omitted requiring libdl linking information. PAM-0.72 or better ships
250 dnl with RedHat 6.2 and Debian 2.2 or better.
251 AC_CHECK_LIB(pam, pam_start,
252 [AC_CHECK_LIB(pam, misc_conv,
253 [AC_DEFINE(USE_PAM,,Use PAM for authentication)
255 [AC_DEFINE(USE_PAM,,Use PAM for authentication)
256 LIBPAM="-lpam -lpam_misc"]
260 [AC_CHECK_LIB(pam, pam_end,
261 [AC_CHECK_LIB(pam, misc_conv,
263 LIBPAM="-lpam -ldl"],
265 LIBPAM="-lpam -ldl -lpam_misc"]
267 ],AC_MSG_WARN([*** pam support will not be built ***]),
274 dnl -------------------------------
275 dnl Endian-ness check
276 dnl -------------------------------
279 dnl -------------------------------
280 dnl check the size in byte of the C
281 dnl -------------------------------
282 dnl AC_CHECK_SIZEOF(char)
283 dnl AC_CHECK_SIZEOF(int)
284 dnl AC_CHECK_SIZEOF(short)
285 dnl AC_CHECK_SIZEOF(long)
287 dnl ----------------------------
288 dnl check existance of functions
289 dnl ----------------------------
290 AC_CHECK_FUNCS(bcopy bzero strerror inet_aton daemon snprintf vsnprintf strlcat strlcpy if_nametoindex if_indextoname getifaddrs)
291 AC_CHECK_FUNCS(setproctitle, ,[AC_CHECK_LIB(util, setproctitle, [LIBS="$LIBS -lutil"; AC_DEFINE(HAVE_SETPROCTITLE)])])
293 dnl ------------------------------------
294 dnl Determine routing get and set method
295 dnl ------------------------------------
296 AC_MSG_CHECKING(zebra between kernel interface method)
297 if test x"$opsys" = x"gnu-linux"; then
298 if test "${enable_netlink}" = "yes";then
299 AC_MSG_RESULT(netlink)
300 RT_METHOD=rt_netlink.o
301 AC_DEFINE(HAVE_NETLINK,,netlink)
303 elif test "${enable_netlink}" = "no"; then
308 AC_MSG_RESULT(netlink)
309 RT_METHOD=rt_netlink.o
310 AC_DEFINE(HAVE_NETLINK,,netlink)
314 if test "$opsys" = "sol2-6";then
315 AC_MSG_RESULT(solaris)
316 KERNEL_METHOD="kernel_socket.o"
317 RT_METHOD="rt_socket.o"
319 AC_TRY_RUN([#include <errno.h>
320 #include <sys/types.h>
321 #include <sys/socket.h>
327 ac_sock = socket (AF_ROUTE, SOCK_RAW, 0);
328 if (ac_sock < 0 && errno == EINVAL)
332 [KERNEL_METHOD=kernel_socket.o
333 RT_METHOD=rt_socket.o
334 AC_MSG_RESULT(socket)],
335 [RT_METHOD=rt_ioctl.o
336 AC_MSG_RESULT(ioctl)],
337 [KERNEL_METHOD=kernel_socket.o
338 RT_METHOD=rt_socket.o
339 AC_MSG_RESULT(socket)])
343 AC_SUBST(KERNEL_METHOD)
344 AC_SUBST(OTHER_METHOD)
346 dnl ------------------------------
347 dnl check kernel route read method
348 dnl ------------------------------
349 AC_CACHE_CHECK(route read method check, zebra_rtread,
350 [if test "$netlink" = yes; then
351 RTREAD_METHOD="rtread_netlink.o"
352 zebra_rtread="netlink"
354 for zebra_rtread in /proc/net/route /dev/ip /dev/null;
356 test x`ls $zebra_rtread 2>/dev/null` = x"$zebra_rtread" && break
358 case $zebra_rtread in
359 "/proc/net/route") RTREAD_METHOD="rtread_proc.o"
360 zebra_rtread="proc";;
361 "/dev/ip") RTREAD_METHOD="rtread_getmsg.o"
362 zebra_rtread="getmsg";;
363 *) RTREAD_METHOD="rtread_sysctl.o"
364 zebra_rtread="sysctl";;
367 AC_SUBST(RTREAD_METHOD)
369 dnl -----------------------------
370 dnl check interface lookup method
371 dnl -----------------------------
372 AC_MSG_CHECKING(interface looking up method)
373 if test "$netlink" = yes; then
374 AC_MSG_RESULT(netlink)
375 IF_METHOD=if_netlink.o
377 if test "$opsys" = "sol2-6";then
378 AC_MSG_RESULT(solaris)
380 elif test "$opsys" = "openbsd";then
381 AC_MSG_RESULT(openbsd)
383 elif grep NET_RT_IFLIST /usr/include/sys/socket.h >/dev/null 2>&1; then
384 AC_MSG_RESULT(sysctl)
385 IF_METHOD=if_sysctl.o
386 AC_DEFINE(HAVE_NET_RT_IFLIST,,NET_RT_IFLIST)
394 dnl -----------------------
395 dnl check proc file system.
396 dnl -----------------------
397 if test -r /proc/net/dev; then
398 AC_DEFINE(HAVE_PROC_NET_DEV,,/proc/net/dev)
402 if test -r /proc/net/if_inet6; then
403 AC_DEFINE(HAVE_PROC_NET_IF_INET6,,/proc/net/if_inet6)
408 dnl -----------------------------
409 dnl check ipforward detect method
410 dnl -----------------------------
411 AC_CACHE_CHECK(ipforward method check, zebra_ipforward_path,
412 [for zebra_ipforward_path in /proc/net/snmp /dev/ip /dev/null;
414 test x`ls $zebra_ipforward_path 2>/dev/null` = x"$zebra_ipforward_path" && break
416 case $zebra_ipforward_path in
417 "/proc/net/snmp") IPFORWARD=ipforward_proc.o
418 zebra_ipforward_path="proc";;
421 *-linux-*) IPFORWARD=ipforward_proc.o
422 zebra_ipforward_path="proc";;
423 *-nec-sysv4*) IPFORWARD=ipforward_ews.o
424 zebra_ipforward_path="ews";;
425 *) IPFORWARD=ipforward_solaris.o
426 zebra_ipforward_path="solaris";;
428 *) IPFORWARD=ipforward_sysctl.o
429 zebra_ipforward_path="sysctl";;
433 AC_CHECK_FUNCS(getaddrinfo, [have_getaddrinfo=yes], [have_getaddrinfo=no])
438 AC_MSG_CHECKING(whether does this OS have IPv6 stack)
439 if test "${enable_ipv6}" = "no"; then
440 AC_MSG_RESULT(disabled)
445 if grep IPV6_INRIA_VERSION /usr/include/netinet/in.h >/dev/null 2>&1; then
447 AC_DEFINE(HAVE_IPV6,,IPv6)
448 AC_DEFINE(INRIA_IPV6,,Inria IPv6)
452 AC_MSG_RESULT(INRIA IPv6)
457 if grep WIDE /usr/include/netinet6/in6.h >/dev/null 2>&1; then
459 AC_DEFINE(HAVE_IPV6,,IPv6)
460 AC_DEFINE(KAME,,KAME IPv6)
463 if test -d /usr/local/v6/lib -a -f /usr/local/v6/lib/libinet6.a; then
464 LIB_IPV6="-L/usr/local/v6/lib -linet6"
471 if grep NRL /usr/include/netinet6/in6.h >/dev/null 2>&1; then
473 AC_DEFINE(HAVE_IPV6,,IPv6)
477 if test x"$opsys" = x"bsdi";then
478 AC_DEFINE(BSDI_NRL,,BSDI)
479 AC_MSG_RESULT(BSDI_NRL)
488 if test "${enable_ipv6}" = "yes"; then
490 #include <linux/version.h>
491 /* 2.1.128 or later */
492 #if LINUX_VERSION_CODE >= 0x020180
495 [zebra_cv_ipv6=yes; zebra_cv_linux_ipv6=yes;AC_MSG_RESULT(Linux IPv6)])
497 if test x`ls /proc/net/ipv6_route 2>/dev/null` = x"/proc/net/ipv6_route"
500 zebra_cv_linux_ipv6=yes
501 AC_MSG_RESULT(Linux IPv6)
505 if test "$zebra_cv_linux_ipv6" = "yes";then
507 AC_MSG_CHECKING(for GNU libc 2.1)
509 #include <features.h>
510 #if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
512 #endif], [glibc=yes; AC_MSG_RESULT(yes)], AC_MSG_RESULT(no))
513 AC_DEFINE(LINUX_IPV6,,Linux IPv6)
516 if test "$glibc" != "yes"; then
517 INCLUDES="-I/usr/inet6/include"
518 if test x`ls /usr/inet6/lib/libinet6.a 2>/dev/null` != x;then
519 LIB_IPV6="-L/usr/inet6/lib -linet6"
524 dnl -----------------------
525 dnl Set IPv6 related values
526 dnl -----------------------
527 LIBS="$LIB_IPV6 $LIBS"
530 if test x"$RIPNGD" = x""; then
531 AC_MSG_RESULT(IPv4 only)
535 dnl ----------------------------
536 dnl Check TCP Signature support.
537 dnl ----------------------------
538 if test "${enable_tcp_signature}" = "yes"; then
539 AC_DEFINE(HAVE_TCP_SIGNATURE,,TCP Signature Option)
542 AC_DEFINE(HAVE_LINUX_TCP_SIGNATURE,,Linux TCP Signature Option)
545 AC_DEFINE(HAVE_OPENBSD_TCP_SIGNATURE,,OpenBSD TCP Signature Option)
548 echo "Sorry, your OS don't support TCP signature."
554 dnl --------------------
555 dnl Daemon disable check
556 dnl --------------------
557 if test "${enable_zebra}" = "no";then
563 if test "${enable_bgpd}" = "no";then
569 if test "${enable_ripd}" = "no";then
575 if test "${enable_ospfd}" = "no";then
581 case "${enable_ripngd}" in
582 "yes") RIPNGD="ripngd";;
587 case "${enable_ospf6d}" in
588 "yes") OSPF6D="ospf6d";;
593 if test "${enable_bgp_announce}" = "no";then
594 AC_DEFINE(DISABLE_BGP_ANNOUNCE,,Disable BGP installation to zebra)
606 AC_CHECK_LIB(c, inet_ntop, [AC_DEFINE(HAVE_INET_NTOP,,inet_ntop)])
607 AC_CHECK_LIB(c, inet_pton, [AC_DEFINE(HAVE_INET_PTON,,inet_pton)])
608 AC_CHECK_LIB(crypt, crypt)
609 AC_CHECK_LIB(resolv, res_init)
610 AC_CHECK_LIB(m, main)
612 dnl ---------------------------------------------------
613 dnl BSD/OS 4.1 define inet_XtoY function as __inet_XtoY
614 dnl ---------------------------------------------------
615 AC_CHECK_FUNC(__inet_ntop, AC_DEFINE(HAVE_INET_NTOP))
616 AC_CHECK_FUNC(__inet_pton, AC_DEFINE(HAVE_INET_PTON))
617 AC_CHECK_FUNC(__inet_aton, AC_DEFINE(HAVE_INET_ATON))
619 dnl ---------------------------
620 dnl check system has GNU regexp
621 dnl ---------------------------
622 dnl AC_MSG_CHECKING(whether system has GNU regex)
623 AC_CHECK_LIB(c, regexec,
624 [AC_DEFINE(HAVE_GNU_REGEX,,GNU regexp library)
626 [LIB_REGEX="regex.o"])
629 dnl ------------------
630 dnl check SNMP library
631 dnl ------------------
632 if test "${enable_snmp}" = "yes"; then
636 unset link_dir link_dirs
637 test "${linkbase_specified}" = "yes" && link_dirs=${with_linkbase}
638 link_dirs="$link_dirs /usr/local"
639 for link_dir in '' ${link_dirs}; do
640 test "x${link_dir}" != "x" && link_dir="-L${link_dir}/lib"
643 AC_MSG_NOTICE(try linking with LIBS: $LIBS)
644 unset ac_cv_lib_netsnmp_asn_parse_int
645 AC_CHECK_LIB(netsnmp, asn_parse_int,
646 [HAVE_SNMP=yes; ac_snmp_lib="$LIBS -lnetsnmp"])
647 test "${HAVE_SNMP}" = "yes" && break
649 unset ac_cv_lib_snmp_asn_parse_int
650 AC_CHECK_LIB(snmp, asn_parse_int,
651 [HAVE_SNMP=yes; ac_snmp_lib="$LIBS -lsnmp"])
652 test "${HAVE_SNMP}" = "yes" && break
654 AC_CHECK_LIB(crypto, main, [NEED_CRYPTO=yes])
655 test "${NEED_CRYPTO}" != "yes" && continue
656 LIBS="$LIBS -lcrypto"
658 AC_MSG_NOTICE(try linking with LIBS: $LIBS)
659 unset ac_cv_lib_netsnmp_asn_parse_int
660 AC_CHECK_LIB(netsnmp, asn_parse_int,
661 [HAVE_SNMP=yes; ac_snmp_lib="$LIBS -lnetsnmp"],, -lcrypto)
662 test "${HAVE_SNMP}" = "yes" && break
664 unset ac_cv_lib_snmp_asn_parse_int
665 AC_CHECK_LIB(snmp, asn_parse_int,
666 [HAVE_SNMP=yes; ac_snmp_lib="$LIBS -lsnmp"],, -lcrypto)
667 test "${HAVE_SNMP}" = "yes" && break
669 if test "${HAVE_SNMP}" = ""; then
670 AC_MSG_ERROR(cannot find valid snmp library)
672 LIBS="${saved_libs} $ac_snmp_lib"
674 AC_MSG_CHECKING(for snmp library header)
675 unset link_dir link_dirs ac_snmp ac_snmps ac_snmp_dir ac_snmp_dirs
676 link_dirs="/usr/include";
677 if test "${linkbase_specified}" = "yes"; then
678 link_dirs="${link_dirs} ${with_linkbase}/include"
680 link_dirs="${link_dirs} /usr/local/include"
681 ac_snmp_dirs="net-snmp net-snmp/library ucd-snmp"
683 for link_dir in '' ${link_dirs}; do
684 test -z $link_dir && continue
685 for ac_snmp_dir in '' ${ac_snmp_dirs}; do
686 test -z $ac_snmp_dir && continue
687 ac_snmps="${ac_snmps} ${link_dir}/${ac_snmp_dir}/asn1.h"
690 ac_snmps="${ac_snmps}"
692 for ac_snmp in '' ${ac_snmps}; do
693 test -z ${ac_snmp} && continue
694 test -f ${ac_snmp} && break
696 ac_snmp_header=`echo ${ac_snmp} | sed -e 's/\/asn1.h//'`
697 ac_snmp_header="-I${ac_snmp_header}"
700 /usr/local/include/net-snmp/*)
701 AC_DEFINE(HAVE_SNMP,,SNMP)
702 AC_DEFINE(HAVE_NETSNMP,,NET-SNMP)
703 CFLAGS="${CFLAGS} -I/usr/local/include"
706 AC_DEFINE(HAVE_SNMP,,SNMP)
707 AC_DEFINE(HAVE_NETSNMP,,NET-SNMP)
709 /usr/local/include/ucd-snmp/*)
710 AC_DEFINE(HAVE_SNMP,,SNMP)
711 CFLAGS="${CFLAGS} -I/usr/local/include"
714 AC_DEFINE(HAVE_SNMP,,SNMP)
717 AC_MSG_RESULT($ac_snmp_header)
718 CFLAGS="${CFLAGS} ${ac_snmp_header}"
721 dnl ----------------------------
722 dnl check sa_len of sockaddr
723 dnl ----------------------------
724 AC_MSG_CHECKING(whether struct sockaddr has a sa_len field)
725 AC_TRY_COMPILE([#include <sys/types.h>
726 #include <sys/socket.h>
727 ],[static struct sockaddr ac_i;int ac_j = sizeof (ac_i.sa_len);],
729 AC_DEFINE(HAVE_SA_LEN,,sa_len)],
732 dnl ----------------------------
733 dnl check sin_len of sockaddr_in
734 dnl ----------------------------
735 AC_MSG_CHECKING(whether struct sockaddr_in has a sin_len field)
736 AC_TRY_COMPILE([#include <sys/types.h>
737 #include <netinet/in.h>
738 ],[static struct sockaddr_in ac_i;int ac_j = sizeof (ac_i.sin_len);],
740 AC_DEFINE(HAVE_SIN_LEN,,sin_len)],
743 dnl ----------------------------
744 dnl check sun_len of sockaddr_un
745 dnl ----------------------------
746 AC_MSG_CHECKING(whether struct sockaddr_un has a sun_len field)
747 AC_TRY_COMPILE([#include <sys/types.h>
749 ],[static struct sockaddr_un ac_i;int ac_j = sizeof (ac_i.sun_len);],
751 AC_DEFINE(HAVE_SUN_LEN,,sun_len)],
754 dnl -----------------------------------
755 dnl check sin6_scope_id of sockaddr_in6
756 dnl -----------------------------------
757 if test "$zebra_cv_ipv6" = yes; then
758 AC_MSG_CHECKING(whether struct sockaddr_in6 has a sin6_scope_id field)
759 AC_TRY_COMPILE([#include <sys/types.h>
760 #include <netinet/in.h>
761 ],[static struct sockaddr_in6 ac_i;int ac_j = sizeof (ac_i.sin6_scope_id);],
763 AC_DEFINE(HAVE_SIN6_SCOPE_ID,,scope id)],
767 dnl -----------------------------------
768 dnl check in6addr_loopback global variable
769 dnl -----------------------------------
770 if test "$zebra_cv_ipv6" = yes; then
771 AC_MSG_CHECKING(whether in6addr_loopback is usable)
772 AC_TRY_COMPILE([#include <sys/types.h>
773 #include <netinet/in.h>
774 ],[static struct in6_addr ac_i; ac_i = in6addr_loopback;],
776 AC_DEFINE(HAVE_IN6ADDR_GLOBAL,,in6addr global variables e.g. in6addr_loopback)],
780 dnl ----------------------------
781 dnl check socklen_t exist or not
782 dnl ----------------------------
783 AC_MSG_CHECKING(whther socklen_t is defined)
784 AC_TRY_COMPILE([#include <sys/types.h>
785 #include <sys/socket.h>
786 #include <netinet/in.h>
789 AC_DEFINE(HAVE_SOCKLEN_T,,socklen_t)],
792 dnl ------------------------
793 dnl check struct sockaddr_dl
794 dnl ------------------------
795 AC_MSG_CHECKING(whether struct sockaddr_dl exist)
796 AC_EGREP_HEADER(sockaddr_dl,
799 AC_DEFINE(HAVE_SOCKADDR_DL,,sockaddr_dl)],
802 dnl --------------------------
803 dnl check structure ifaliasreq
804 dnl --------------------------
805 AC_MSG_CHECKING(whether struct ifaliasreq exist)
806 AC_EGREP_HEADER(ifaliasreq,
809 AC_DEFINE(HAVE_IFALIASREQ,,ifaliasreq)],
812 dnl ----------------------------
813 dnl check structure in6_aliasreq
814 dnl ----------------------------
815 AC_MSG_CHECKING(whether struct if6_aliasreq exist)
816 AC_EGREP_HEADER(in6_aliasreq,
819 AC_DEFINE(HAVE_IN6_ALIASREQ,,in6_aliasreq)],
822 dnl ---------------------------
823 dnl check structure rt_addrinfo
824 dnl ---------------------------
825 AC_MSG_CHECKING(whether struct rt_addrinfo exist)
826 AC_EGREP_HEADER(rt_addrinfo,
829 AC_DEFINE(HAVE_RT_ADDRINFO,,rt_addrinfo)],
832 dnl --------------------------
833 dnl check structure in_pktinfo
834 dnl --------------------------
835 AC_MSG_CHECKING(whether struct in_pktinfo exist)
836 AC_TRY_COMPILE([#include <netinet/in.h>
837 ],[struct in_pktinfo ac_x;],
839 AC_DEFINE(HAVE_INPKTINFO,,in_pktinfo)],
842 dnl --------------------------------------
843 dnl checking for getrusage struct and call
844 dnl --------------------------------------
845 AC_MSG_CHECKING(whether getrusage is available)
846 AC_TRY_COMPILE([#include <sys/resource.h>
847 ],[struct rusage ac_x; getrusage (RUSAGE_SELF, &ac_x);],
849 AC_DEFINE(HAVE_RUSAGE,,rusage)],
855 file="${srcdir}/lib/version.h"
856 VERSION=`sed -ne 's/^#.*ZEBRA_VERSION.*\"\([^\"]*\)\"$/\1/p' $file`
859 dnl ------------------------------
860 dnl set paths for process id files
861 dnl ------------------------------
862 AC_CACHE_CHECK(pid file directory,ac_piddir,
863 [for ZEBRA_PID_DIR in /var/run dnl
868 test -d $ZEBRA_PID_DIR && break
870 ac_piddir=$ZEBRA_PID_DIR
871 if test $ZEBRA_PID_DIR = "/dev/null"; then
872 echo "PID DIRECTORY NOT FOUND!"
874 AC_DEFINE_UNQUOTED(PATH_ZEBRA_PID, "$ac_piddir/zebra.pid",zebra PID)
875 AC_DEFINE_UNQUOTED(PATH_RIPD_PID, "$ac_piddir/ripd.pid",ripd PID)
876 AC_DEFINE_UNQUOTED(PATH_RIPNGD_PID, "$ac_piddir/ripngd.pid",ripngd PID)
877 AC_DEFINE_UNQUOTED(PATH_BGPD_PID, "$ac_piddir/bgpd.pid",bgpd PID)
878 AC_DEFINE_UNQUOTED(PATH_OSPFD_PID, "$ac_piddir/ospfd.pid",ospfd PID)
879 AC_DEFINE_UNQUOTED(PATH_OSPF6D_PID, "$ac_piddir/ospf6d.pid",ospf6d PID)
882 dnl ---------------------------
883 dnl Check htonl works correctly
884 dnl ---------------------------
885 AC_MSG_CHECKING(for working htonl)
886 AC_CACHE_VAL(ac_cv_htonl_works, [
887 AC_TRY_LINK([#ifdef HAVE_SYS_TYPES_H
888 #include <sys/types.h>
893 #ifdef HAVE_NETINET_IN_H
894 #include <netinet/in.h>
897 ac_cv_htonl_works=yes,
898 ac_cv_htonl_works=no)])
899 AC_MSG_RESULT($ac_cv_htonl_works)
901 AC_OUTPUT(Makefile lib/Makefile zebra/Makefile ripd/Makefile ripngd/Makefile bgpd/Makefile ospfd/Makefile ospf6d/Makefile vtysh/Makefile doc/Makefile)
906 zebra version : ${VERSION}
907 host operationg system : ${host_os}
908 source code location : ${srcdir}
910 compiler flags : ${CFLAGS}
911 link libraries : ${LIBS}
912 directory for pid files : ${ac_piddir}