paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1 | ## |
| 2 | ## Configure template file for Zebra. |
| 3 | ## autoconf will generate configure script. |
| 4 | ## |
| 5 | ## Copyright (c) 1996, 97, 98, 99, 2000 Kunihiro Ishiguro <kunihiro@zebra.org> |
| 6 | ## |
| 7 | AC_PREREQ(2.13) |
| 8 | |
| 9 | AC_INIT(lib/zebra.h) |
paul | 1bb066b | 2003-03-17 01:18:55 +0000 | [diff] [blame] | 10 | AM_INIT_AUTOMAKE(zebra, 0.94) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 11 | AM_CONFIG_HEADER(config.h) |
| 12 | |
| 13 | dnl ----------------------------------- |
| 14 | dnl Get hostname and other information. |
| 15 | dnl ----------------------------------- |
| 16 | AC_CANONICAL_HOST |
| 17 | |
| 18 | dnl ------------ |
| 19 | dnl Check CFLAGS |
| 20 | dnl ------------ |
| 21 | AC_ARG_WITH(cflags, |
| 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 ; |
| 27 | fi |
| 28 | |
| 29 | dnl -------- |
| 30 | dnl Check CC |
| 31 | dnl -------- |
| 32 | AC_PROG_CC |
| 33 | |
| 34 | dnl ----------------------------------------- |
| 35 | dnl If CLFAGS doesn\'t exist set default value |
| 36 | dnl ----------------------------------------- |
| 37 | if test "x$cflags_specified" = "x" ; then |
| 38 | CFLAGS="$CFLAGS -Wall" |
| 39 | fi |
| 40 | |
| 41 | dnl -------------- |
| 42 | dnl Check programs |
| 43 | dnl -------------- |
| 44 | AC_PROG_CPP |
| 45 | AC_PROG_INSTALL |
| 46 | AC_PROG_MAKE_SET |
| 47 | AC_CHECK_TOOL(AR, ar) |
| 48 | AC_CHECK_TOOL(RANLIB, ranlib, :) |
| 49 | |
| 50 | dnl --------- |
| 51 | dnl AIX check |
| 52 | dnl --------- |
| 53 | AC_AIX |
| 54 | |
| 55 | dnl ---------------------- |
| 56 | dnl Packages configuration |
| 57 | dnl ---------------------- |
| 58 | AC_ARG_ENABLE(vtysh, |
| 59 | [ --enable-vtysh, Make integrated VTY version of zebra]) |
| 60 | AC_ARG_ENABLE(ipv6, |
| 61 | [ --disable-ipv6 turn off IPv6 related features and daemons]) |
| 62 | AC_ARG_ENABLE(zebra, |
| 63 | [ --disable-zebra do not build zebra daemon]) |
| 64 | AC_ARG_ENABLE(bgpd, |
| 65 | [ --disable-bgpd do not build bgpd]) |
| 66 | AC_ARG_ENABLE(ripd, |
| 67 | [ --disable-ripd do not build ripd]) |
| 68 | AC_ARG_ENABLE(ripngd, |
| 69 | [ --disable-ripngd do not build ripngd]) |
| 70 | AC_ARG_ENABLE(ospfd, |
| 71 | [ --disable-ospfd do not build ospfd]) |
| 72 | AC_ARG_ENABLE(ospf6d, |
| 73 | [ --disable-ospf6d do not build ospf6d]) |
| 74 | AC_ARG_ENABLE(bgp-announce, |
| 75 | [ --disable-bgp-announce, turn off BGP route announcement]) |
| 76 | AC_ARG_ENABLE(netlink, |
| 77 | [ --enable-netlink force to use Linux netlink interface]) |
| 78 | AC_ARG_ENABLE(broken-aliases, |
| 79 | [ --enable-broken-aliases enable aliases as distinct interfaces for Linux 2.2.X]) |
| 80 | AC_ARG_ENABLE(snmp, |
| 81 | [ --enable-snmp enable SNMP support]) |
| 82 | AC_ARG_WITH(libpam, |
| 83 | [ --with-libpam use libpam for PAM support in vtysh]) |
| 84 | AC_ARG_ENABLE(tcpsock, |
| 85 | [ --enable-tcp-zebra enable TCP/IP socket connection between zebra and protocol daemon]) |
| 86 | dnl Temporary option until OSPF NSSA implementation complete |
| 87 | AC_ARG_ENABLE(nssa, |
| 88 | [ --enable-nssa enable OSPF NSSA option]) |
| 89 | AC_ARG_ENABLE(opaque-lsa, |
paul | 6898008 | 2003-03-25 05:07:42 +0000 | [diff] [blame] | 90 | [ --enable-opaque-lsa enable OSPF Opaque-LSA with OSPFAPI support (RFC2370)]) |
| 91 | AC_ARG_ENABLE(ospfapi, |
| 92 | [ --disable-ospfapi do not build OSPFAPI to access the OSPF LSA Database, |
| 93 | (this is the default if --enable-opaque-lsa is not set)]) |
| 94 | AC_ARG_ENABLE(ospfclient, |
| 95 | [ --disable-ospfclient do not build OSPFAPI client for OSPFAPI, |
| 96 | (this is the default if --disable-ospfapi is set)]) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 97 | AC_ARG_ENABLE(ospf-te, |
| 98 | [ --enable-ospf-te enable Traffic Engineering Extension to OSPF]) |
| 99 | AC_ARG_ENABLE(multipath, |
| 100 | [ --enable-multipath=ARG enable multipath function, ARG must be digit]) |
| 101 | |
| 102 | dnl AC_ARG_ENABLE(rtadv, |
| 103 | dnl [ --enable-rtadv enable IPV6 router advertisment option]) |
| 104 | |
| 105 | if test "${enable_broken_aliases}" = "yes"; then |
| 106 | if test "${enable_netlink}" = "yes" |
| 107 | then |
| 108 | echo "Sorry, you can't use netlink with broken aliases" |
| 109 | exit 1 |
| 110 | fi |
paul | 1bb066b | 2003-03-17 01:18:55 +0000 | [diff] [blame] | 111 | AC_DEFINE(HAVE_BROKEN_ALIASES,,Broken Alias) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 112 | enable_netlink=no |
| 113 | fi |
| 114 | |
| 115 | if test "${enable_tcp_zebra}" = "yes"; then |
paul | 1bb066b | 2003-03-17 01:18:55 +0000 | [diff] [blame] | 116 | AC_DEFINE(HAVE_TCP_ZEBRA,,Use TCP for zebra communication) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 117 | fi |
| 118 | |
| 119 | if test "${enable_nssa}" = "yes"; then |
paul | 1bb066b | 2003-03-17 01:18:55 +0000 | [diff] [blame] | 120 | AC_DEFINE(HAVE_NSSA,,OSPF NSSA) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 121 | fi |
| 122 | |
| 123 | if test "${enable_opaque_lsa}" = "yes"; then |
paul | 1bb066b | 2003-03-17 01:18:55 +0000 | [diff] [blame] | 124 | AC_DEFINE(HAVE_OPAQUE_LSA,,OSPF Opaque LSA) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 125 | fi |
| 126 | |
| 127 | if test "${enable_ospf_te}" = "yes"; then |
paul | 1bb066b | 2003-03-17 01:18:55 +0000 | [diff] [blame] | 128 | AC_DEFINE(HAVE_OPAQUE_LSA,,OSPF Opaque LSA) |
| 129 | AC_DEFINE(HAVE_OSPF_TE,,OSPF TE) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 130 | fi |
| 131 | |
| 132 | dnl if test "${enable_rtadv}" = "yes"; then |
| 133 | dnl AC_DEFINE(HAVE_RTADV) |
| 134 | dnl fi |
| 135 | |
| 136 | changequote(, )dnl |
| 137 | |
| 138 | MULTIPATH_NUM=1 |
| 139 | |
| 140 | case "${enable_multipath}" in |
| 141 | [0-9]|[1-9][0-9]) |
| 142 | MULTIPATH_NUM="${enable_multipath}" |
| 143 | ;; |
| 144 | "") |
| 145 | ;; |
| 146 | *) |
| 147 | echo "Please specify digit to --enable-multipath ARG." |
| 148 | exit 1 |
| 149 | ;; |
| 150 | esac |
| 151 | |
| 152 | changequote([, ])dnl |
| 153 | |
| 154 | AC_SUBST(MULTIPATH_NUM) |
| 155 | |
| 156 | dnl ------------------- |
| 157 | dnl Check header files. |
| 158 | dnl ------------------- |
| 159 | AC_STDC_HEADERS |
| 160 | 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) |
| 161 | |
| 162 | dnl check some types |
| 163 | AC_C_CONST |
| 164 | dnl AC_TYPE_PID_T |
| 165 | AC_TYPE_SIGNAL |
| 166 | |
| 167 | dnl Some systems (Solaris 2.x) require libnsl (Network Services Library) |
| 168 | case "$host" in |
| 169 | *-sunos5.6* | *-solaris2.6*) |
| 170 | opsys=sol2-6 |
paul | 1bb066b | 2003-03-17 01:18:55 +0000 | [diff] [blame] | 171 | AC_DEFINE(SUNOS_5,,SunOS 5) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 172 | AC_CHECK_LIB(xnet, main) |
| 173 | CURSES=-lcurses |
| 174 | ;; |
| 175 | *-sunos5* | *-solaris2*) |
paul | 1bb066b | 2003-03-17 01:18:55 +0000 | [diff] [blame] | 176 | AC_DEFINE(SUNOS_5,,SunOS 5) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 177 | AC_CHECK_LIB(socket, main) |
| 178 | AC_CHECK_LIB(nsl, main) |
| 179 | CURSES=-lcurses |
| 180 | ;; |
| 181 | *-linux-*) |
| 182 | opsys=gnu-linux |
paul | 1bb066b | 2003-03-17 01:18:55 +0000 | [diff] [blame] | 183 | AC_DEFINE(GNU_LINUX,,GNU Linux) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 184 | ;; |
| 185 | *-nec-sysv4*) |
| 186 | AC_CHECK_LIB(nsl, gethostbyname) |
| 187 | AC_CHECK_LIB(socket, socket) |
| 188 | ;; |
| 189 | *-freebsd3.2) |
paul | 1bb066b | 2003-03-17 01:18:55 +0000 | [diff] [blame] | 190 | AC_DEFINE(FREEBSD_32,,FreeBSD 3.2) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 191 | ;; |
| 192 | *-openbsd*) |
| 193 | opsys=openbsd |
paul | 1bb066b | 2003-03-17 01:18:55 +0000 | [diff] [blame] | 194 | AC_DEFINE(OPEN_BSD,,OpenBSD) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 195 | ;; |
| 196 | *-bsdi*) |
| 197 | opsys=bsdi |
| 198 | OTHER_METHOD="mtu_kvm.o" |
| 199 | AC_CHECK_LIB(kvm, main) |
| 200 | ;; |
| 201 | esac |
| 202 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 203 | dnl --------------------- |
| 204 | dnl Integrated VTY option |
| 205 | dnl --------------------- |
| 206 | case "${enable_vtysh}" in |
| 207 | "yes") VTYSH="vtysh"; |
paul | 1bb066b | 2003-03-17 01:18:55 +0000 | [diff] [blame] | 208 | AC_DEFINE(VTYSH,,VTY shell) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 209 | AC_CHECK_LIB(tinfo, tputs, , AC_CHECK_LIB(ncurses, tputs)) |
| 210 | AC_CHECK_LIB(readline, main) |
| 211 | if test $ac_cv_lib_readline_main = no; then |
| 212 | AC_MSG_ERROR([vtysh needs libreadline but was not found on your system.]) |
| 213 | fi |
| 214 | AC_CHECK_HEADER(readline/history.h) |
| 215 | if test $ac_cv_header_readline_history_h = no;then |
| 216 | AC_MSG_ERROR([readline is too old to have readline/history.h, please update to the latest readline library.]) |
| 217 | fi |
| 218 | ;; |
| 219 | "no" ) VTYSH="";; |
| 220 | * ) ;; |
| 221 | esac |
| 222 | |
| 223 | dnl ---------- |
| 224 | dnl PAM module |
| 225 | dnl ---------- |
| 226 | if test "$with_libpam" = "yes"; then |
| 227 | dnl took this test from proftpd's configure.in and suited to our needs |
| 228 | dnl ------------------------------------------------------------------------- |
| 229 | dnl |
| 230 | dnl This next check looks funky due to a linker problem with some versions |
| 231 | dnl of the PAM library. Prior to 0.72 release, the Linux PAM shared library |
| 232 | dnl omitted requiring libdl linking information. PAM-0.72 or better ships |
| 233 | dnl with RedHat 6.2 and Debian 2.2 or better. |
| 234 | AC_CHECK_LIB(pam, pam_start, |
| 235 | [AC_CHECK_LIB(pam, misc_conv, |
paul | 1bb066b | 2003-03-17 01:18:55 +0000 | [diff] [blame] | 236 | [AC_DEFINE(USE_PAM,,Use PAM for authentication) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 237 | LIBPAM="-lpam"], |
paul | 1bb066b | 2003-03-17 01:18:55 +0000 | [diff] [blame] | 238 | [AC_DEFINE(USE_PAM,,Use PAM for authentication) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 239 | LIBPAM="-lpam -lpam_misc"] |
| 240 | ) |
| 241 | ], |
| 242 | |
| 243 | [AC_CHECK_LIB(pam, pam_end, |
| 244 | [AC_CHECK_LIB(pam, misc_conv, |
| 245 | [AC_DEFINE(USE_PAM) |
| 246 | LIBPAM="-lpam -ldl"], |
| 247 | [AC_DEFINE(USE_PAM) |
| 248 | LIBPAM="-lpam -ldl -lpam_misc"] |
| 249 | ) |
| 250 | ],AC_MSG_WARN([*** pam support will not be built ***]), |
| 251 | [-ldl]) |
| 252 | ] |
| 253 | ) |
| 254 | fi |
| 255 | AC_SUBST(LIBPAM) |
| 256 | |
| 257 | dnl ------------------------------- |
| 258 | dnl Endian-ness check |
| 259 | dnl ------------------------------- |
paul | 1bb066b | 2003-03-17 01:18:55 +0000 | [diff] [blame] | 260 | AC_WORDS_BIGENDIAN |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 261 | |
| 262 | dnl ------------------------------- |
| 263 | dnl check the size in byte of the C |
| 264 | dnl ------------------------------- |
| 265 | dnl AC_CHECK_SIZEOF(char) |
| 266 | dnl AC_CHECK_SIZEOF(int) |
| 267 | dnl AC_CHECK_SIZEOF(short) |
| 268 | dnl AC_CHECK_SIZEOF(long) |
| 269 | |
| 270 | dnl ---------------------------- |
| 271 | dnl check existance of functions |
| 272 | dnl ---------------------------- |
| 273 | AC_CHECK_FUNCS(bcopy bzero strerror inet_aton daemon snprintf vsnprintf strlcat strlcpy if_nametoindex if_indextoname getifaddrs) |
| 274 | AC_CHECK_FUNCS(setproctitle, ,[AC_CHECK_LIB(util, setproctitle, [LIBS="$LIBS -lutil"; AC_DEFINE(HAVE_SETPROCTITLE)])]) |
| 275 | |
| 276 | dnl ------------------------------------ |
| 277 | dnl Determine routing get and set method |
| 278 | dnl ------------------------------------ |
| 279 | AC_MSG_CHECKING(zebra between kernel interface method) |
| 280 | if test x"$opsys" = x"gnu-linux"; then |
| 281 | if test "${enable_netlink}" = "yes";then |
| 282 | AC_MSG_RESULT(netlink) |
| 283 | RT_METHOD=rt_netlink.o |
paul | 1bb066b | 2003-03-17 01:18:55 +0000 | [diff] [blame] | 284 | AC_DEFINE(HAVE_NETLINK,,netlink) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 285 | netlink=yes |
| 286 | elif test "${enable_netlink}" = "no"; then |
| 287 | AC_MSG_RESULT(ioctl) |
| 288 | RT_METHOD=rt_ioctl.o |
| 289 | netlink=no |
| 290 | else |
paul | 1bb066b | 2003-03-17 01:18:55 +0000 | [diff] [blame] | 291 | AC_MSG_RESULT(netlink) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 292 | RT_METHOD=rt_netlink.o |
paul | 1bb066b | 2003-03-17 01:18:55 +0000 | [diff] [blame] | 293 | AC_DEFINE(HAVE_NETLINK,,netlink) |
| 294 | netlink=yes |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 295 | fi |
| 296 | else |
| 297 | if test "$opsys" = "sol2-6";then |
| 298 | AC_MSG_RESULT(solaris) |
| 299 | KERNEL_METHOD="kernel_socket.o" |
| 300 | RT_METHOD="rt_socket.o" |
| 301 | else |
| 302 | AC_TRY_RUN([#include <errno.h> |
| 303 | #include <sys/types.h> |
| 304 | #include <sys/socket.h> |
| 305 | |
| 306 | main () |
| 307 | { |
| 308 | int ac_sock; |
| 309 | |
| 310 | ac_sock = socket (AF_ROUTE, SOCK_RAW, 0); |
| 311 | if (ac_sock < 0 && errno == EINVAL) |
| 312 | exit (1); |
| 313 | exit (0); |
| 314 | }], |
paul | 1bb066b | 2003-03-17 01:18:55 +0000 | [diff] [blame] | 315 | [KERNEL_METHOD=kernel_socket.o |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 316 | RT_METHOD=rt_socket.o |
| 317 | AC_MSG_RESULT(socket)], |
| 318 | [RT_METHOD=rt_ioctl.o |
| 319 | AC_MSG_RESULT(ioctl)], |
| 320 | [KERNEL_METHOD=kernel_socket.o |
| 321 | RT_METHOD=rt_socket.o |
| 322 | AC_MSG_RESULT(socket)]) |
| 323 | fi |
| 324 | fi |
| 325 | AC_SUBST(RT_METHOD) |
| 326 | AC_SUBST(KERNEL_METHOD) |
| 327 | AC_SUBST(OTHER_METHOD) |
| 328 | |
| 329 | dnl ------------------------------ |
| 330 | dnl check kernel route read method |
| 331 | dnl ------------------------------ |
| 332 | AC_CACHE_CHECK(route read method check, zebra_rtread, |
| 333 | [if test "$netlink" = yes; then |
| 334 | RTREAD_METHOD="rtread_netlink.o" |
| 335 | zebra_rtread="netlink" |
| 336 | else |
| 337 | for zebra_rtread in /proc/net/route /dev/ip /dev/null; |
| 338 | do |
| 339 | test x`ls $zebra_rtread 2>/dev/null` = x"$zebra_rtread" && break |
| 340 | done |
| 341 | case $zebra_rtread in |
| 342 | "/proc/net/route") RTREAD_METHOD="rtread_proc.o" |
| 343 | zebra_rtread="proc";; |
| 344 | "/dev/ip") RTREAD_METHOD="rtread_getmsg.o" |
| 345 | zebra_rtread="getmsg";; |
| 346 | *) RTREAD_METHOD="rtread_sysctl.o" |
| 347 | zebra_rtread="sysctl";; |
| 348 | esac |
| 349 | fi]) |
| 350 | AC_SUBST(RTREAD_METHOD) |
| 351 | |
| 352 | dnl ----------------------------- |
| 353 | dnl check interface lookup method |
| 354 | dnl ----------------------------- |
| 355 | AC_MSG_CHECKING(interface looking up method) |
| 356 | if test "$netlink" = yes; then |
| 357 | AC_MSG_RESULT(netlink) |
| 358 | IF_METHOD=if_netlink.o |
| 359 | else |
| 360 | if test "$opsys" = "sol2-6";then |
| 361 | AC_MSG_RESULT(solaris) |
| 362 | IF_METHOD=if_ioctl.o |
| 363 | elif test "$opsys" = "openbsd";then |
| 364 | AC_MSG_RESULT(openbsd) |
| 365 | IF_METHOD=if_ioctl.o |
| 366 | elif grep NET_RT_IFLIST /usr/include/sys/socket.h >/dev/null 2>&1; then |
| 367 | AC_MSG_RESULT(sysctl) |
| 368 | IF_METHOD=if_sysctl.o |
paul | 1bb066b | 2003-03-17 01:18:55 +0000 | [diff] [blame] | 369 | AC_DEFINE(HAVE_NET_RT_IFLIST,,NET_RT_IFLIST) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 370 | else |
| 371 | AC_MSG_RESULT(ioctl) |
| 372 | IF_METHOD=if_ioctl.o |
| 373 | fi |
| 374 | fi |
| 375 | AC_SUBST(IF_METHOD) |
| 376 | |
| 377 | dnl ----------------------- |
| 378 | dnl check proc file system. |
| 379 | dnl ----------------------- |
| 380 | if test -r /proc/net/dev; then |
paul | 1bb066b | 2003-03-17 01:18:55 +0000 | [diff] [blame] | 381 | AC_DEFINE(HAVE_PROC_NET_DEV,,/proc/net/dev) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 382 | IF_PROC=if_proc.o |
| 383 | fi |
| 384 | |
| 385 | if test -r /proc/net/if_inet6; then |
paul | 1bb066b | 2003-03-17 01:18:55 +0000 | [diff] [blame] | 386 | AC_DEFINE(HAVE_PROC_NET_IF_INET6,,/proc/net/if_inet6) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 387 | IF_PROC=if_proc.o |
| 388 | fi |
| 389 | AC_SUBST(IF_PROC) |
| 390 | |
| 391 | dnl ----------------------------- |
| 392 | dnl check ipforward detect method |
| 393 | dnl ----------------------------- |
| 394 | AC_CACHE_CHECK(ipforward method check, zebra_ipforward_path, |
| 395 | [for zebra_ipforward_path in /proc/net/snmp /dev/ip /dev/null; |
| 396 | do |
| 397 | test x`ls $zebra_ipforward_path 2>/dev/null` = x"$zebra_ipforward_path" && break |
| 398 | done |
| 399 | case $zebra_ipforward_path in |
| 400 | "/proc/net/snmp") IPFORWARD=ipforward_proc.o |
| 401 | zebra_ipforward_path="proc";; |
| 402 | "/dev/ip") |
| 403 | case "$host" in |
| 404 | *-nec-sysv4*) IPFORWARD=ipforward_ews.o |
| 405 | zebra_ipforward_path="ews";; |
| 406 | *) IPFORWARD=ipforward_solaris.o |
| 407 | zebra_ipforward_path="solaris";; |
| 408 | esac;; |
| 409 | *) IPFORWARD=ipforward_sysctl.o |
| 410 | zebra_ipforward_path="sysctl";; |
| 411 | esac]) |
| 412 | AC_SUBST(IPFORWARD) |
| 413 | |
| 414 | AC_CHECK_FUNCS(getaddrinfo, [have_getaddrinfo=yes], [have_getaddrinfo=no]) |
| 415 | |
| 416 | dnl ---------- |
| 417 | dnl IPv6 check |
| 418 | dnl ---------- |
| 419 | AC_MSG_CHECKING(whether does this OS have IPv6 stack) |
| 420 | if test "${enable_ipv6}" = "no"; then |
| 421 | AC_MSG_RESULT(disabled) |
| 422 | else |
| 423 | dnl ---------- |
| 424 | dnl INRIA IPv6 |
| 425 | dnl ---------- |
| 426 | if grep IPV6_INRIA_VERSION /usr/include/netinet/in.h >/dev/null 2>&1; then |
| 427 | zebra_cv_ipv6=yes |
paul | 1bb066b | 2003-03-17 01:18:55 +0000 | [diff] [blame] | 428 | AC_DEFINE(HAVE_IPV6,,IPv6) |
| 429 | AC_DEFINE(INRIA_IPV6,,Inria IPv6) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 430 | RIPNGD="ripngd" |
| 431 | OSPF6D="ospf6d" |
| 432 | LIB_IPV6="" |
| 433 | AC_MSG_RESULT(INRIA IPv6) |
| 434 | fi |
| 435 | dnl --------- |
| 436 | dnl KAME IPv6 |
| 437 | dnl --------- |
| 438 | if grep WIDE /usr/include/netinet6/in6.h >/dev/null 2>&1; then |
| 439 | zebra_cv_ipv6=yes |
paul | 1bb066b | 2003-03-17 01:18:55 +0000 | [diff] [blame] | 440 | AC_DEFINE(HAVE_IPV6,,IPv6) |
| 441 | AC_DEFINE(KAME,,KAME IPv6) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 442 | RIPNGD="ripngd" |
| 443 | OSPF6D="ospf6d" |
| 444 | if test -d /usr/local/v6/lib -a -f /usr/local/v6/lib/libinet6.a; then |
| 445 | LIB_IPV6="-L/usr/local/v6/lib -linet6" |
| 446 | fi |
| 447 | AC_MSG_RESULT(KAME) |
| 448 | fi |
| 449 | dnl --------- |
| 450 | dnl NRL check |
| 451 | dnl --------- |
| 452 | if grep NRL /usr/include/netinet6/in6.h >/dev/null 2>&1; then |
| 453 | zebra_cv_ipv6=yes |
paul | 1bb066b | 2003-03-17 01:18:55 +0000 | [diff] [blame] | 454 | AC_DEFINE(HAVE_IPV6,,IPv6) |
| 455 | AC_DEFINE(NRL,,NRL) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 456 | RIPNGD="ripngd" |
| 457 | OSPF6D="ospf6d" |
| 458 | if test x"$opsys" = x"bsdi";then |
paul | 1bb066b | 2003-03-17 01:18:55 +0000 | [diff] [blame] | 459 | AC_DEFINE(BSDI_NRL,,BSDI) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 460 | AC_MSG_RESULT(BSDI_NRL) |
| 461 | else |
| 462 | AC_MSG_RESULT(NRL) |
| 463 | fi |
| 464 | fi |
| 465 | |
| 466 | dnl ---------- |
| 467 | dnl Linux IPv6 |
| 468 | dnl ---------- |
| 469 | if test "${enable_ipv6}" = "yes"; then |
| 470 | AC_EGREP_CPP(yes, [ |
| 471 | #include <linux/version.h> |
| 472 | /* 2.1.128 or later */ |
| 473 | #if LINUX_VERSION_CODE >= 0x020180 |
| 474 | yes |
| 475 | #endif], |
| 476 | [zebra_cv_ipv6=yes; zebra_cv_linux_ipv6=yes;AC_MSG_RESULT(Linux IPv6)]) |
| 477 | else |
| 478 | if test x`ls /proc/net/ipv6_route 2>/dev/null` = x"/proc/net/ipv6_route" |
| 479 | then |
| 480 | zebra_cv_ipv6=yes |
| 481 | zebra_cv_linux_ipv6=yes |
| 482 | AC_MSG_RESULT(Linux IPv6) |
| 483 | fi |
| 484 | fi |
| 485 | |
| 486 | if test "$zebra_cv_linux_ipv6" = "yes";then |
| 487 | AC_DEFINE(HAVE_IPV6) |
| 488 | AC_MSG_CHECKING(for GNU libc 2.1) |
| 489 | AC_EGREP_CPP(yes, [ |
| 490 | #include <features.h> |
| 491 | #if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 |
| 492 | yes |
| 493 | #endif], [glibc=yes; AC_MSG_RESULT(yes)], AC_MSG_RESULT(no)) |
paul | 1bb066b | 2003-03-17 01:18:55 +0000 | [diff] [blame] | 494 | AC_DEFINE(LINUX_IPV6,,Linux IPv6) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 495 | RIPNGD="ripngd" |
| 496 | OSPF6D="ospf6d" |
| 497 | if test "$glibc" != "yes"; then |
| 498 | INCLUDES="-I/usr/inet6/include" |
| 499 | if test x`ls /usr/inet6/lib/libinet6.a 2>/dev/null` != x;then |
| 500 | LIB_IPV6="-L/usr/inet6/lib -linet6" |
| 501 | fi |
| 502 | fi |
| 503 | fi |
| 504 | |
| 505 | dnl ----------------------- |
| 506 | dnl Set IPv6 related values |
| 507 | dnl ----------------------- |
| 508 | LIBS="$LIB_IPV6 $LIBS" |
| 509 | AC_SUBST(LIB_IPV6) |
| 510 | |
| 511 | if test x"$RIPNGD" = x""; then |
| 512 | AC_MSG_RESULT(IPv4 only) |
| 513 | fi |
| 514 | fi |
| 515 | |
| 516 | dnl -------------------- |
| 517 | dnl Daemon disable check |
| 518 | dnl -------------------- |
| 519 | if test "${enable_zebra}" = "no";then |
| 520 | ZEBRA="" |
| 521 | else |
| 522 | ZEBRA="zebra" |
| 523 | fi |
| 524 | |
| 525 | if test "${enable_bgpd}" = "no";then |
| 526 | BGPD="" |
| 527 | else |
| 528 | BGPD="bgpd" |
| 529 | fi |
| 530 | |
| 531 | if test "${enable_ripd}" = "no";then |
| 532 | RIPD="" |
| 533 | else |
| 534 | RIPD="ripd" |
| 535 | fi |
| 536 | |
| 537 | if test "${enable_ospfd}" = "no";then |
| 538 | OSPFD="" |
| 539 | else |
| 540 | OSPFD="ospfd" |
| 541 | fi |
| 542 | |
paul | 6898008 | 2003-03-25 05:07:42 +0000 | [diff] [blame] | 543 | OSPFAPI="" |
| 544 | OSPFCLIENT="" |
| 545 | if test "${enable_opaque_lsa}" = "yes"; then |
| 546 | if test "${enable_ospfapi}" != "no";then |
| 547 | OSPFAPI="-DSUPPORT_OSPF_API" |
| 548 | |
| 549 | if test "${enable_ospfclient}" != "no";then |
| 550 | OSPFCLIENT="ospfclient" |
| 551 | fi |
| 552 | fi |
| 553 | |
paul | 1bb066b | 2003-03-17 01:18:55 +0000 | [diff] [blame] | 554 | fi |
| 555 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 556 | case "${enable_ripngd}" in |
| 557 | "yes") RIPNGD="ripngd";; |
| 558 | "no" ) RIPNGD="";; |
| 559 | * ) ;; |
| 560 | esac |
| 561 | |
| 562 | case "${enable_ospf6d}" in |
| 563 | "yes") OSPF6D="ospf6d";; |
| 564 | "no" ) OSPF6D="";; |
| 565 | * ) ;; |
| 566 | esac |
| 567 | |
| 568 | if test "${enable_bgp_announce}" = "no";then |
paul | 1bb066b | 2003-03-17 01:18:55 +0000 | [diff] [blame] | 569 | AC_DEFINE(DISABLE_BGP_ANNOUNCE,,Disable BGP installation to zebra) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 570 | fi |
| 571 | |
| 572 | AC_SUBST(ZEBRA) |
| 573 | AC_SUBST(BGPD) |
| 574 | AC_SUBST(RIPD) |
| 575 | AC_SUBST(RIPNGD) |
| 576 | AC_SUBST(OSPFD) |
| 577 | AC_SUBST(OSPF6D) |
| 578 | AC_SUBST(VTYSH) |
| 579 | AC_SUBST(INCLUDES) |
| 580 | AC_SUBST(CURSES) |
paul | 1bb066b | 2003-03-17 01:18:55 +0000 | [diff] [blame] | 581 | AC_SUBST(OSPFCLIENT) |
paul | 6898008 | 2003-03-25 05:07:42 +0000 | [diff] [blame] | 582 | AC_SUBST(OSPFAPI) |
paul | 1bb066b | 2003-03-17 01:18:55 +0000 | [diff] [blame] | 583 | AC_CHECK_LIB(c, inet_ntop, [AC_DEFINE(HAVE_INET_NTOP,,inet_ntop)]) |
| 584 | AC_CHECK_LIB(c, inet_pton, [AC_DEFINE(HAVE_INET_PTON,,inet_pton)]) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 585 | AC_CHECK_LIB(crypt, crypt) |
| 586 | AC_CHECK_LIB(resolv, res_init) |
| 587 | AC_CHECK_LIB(m, main) |
| 588 | |
| 589 | dnl --------------------------------------------------- |
| 590 | dnl BSD/OS 4.1 define inet_XtoY function as __inet_XtoY |
| 591 | dnl --------------------------------------------------- |
| 592 | AC_CHECK_FUNC(__inet_ntop, AC_DEFINE(HAVE_INET_NTOP)) |
| 593 | AC_CHECK_FUNC(__inet_pton, AC_DEFINE(HAVE_INET_PTON)) |
| 594 | AC_CHECK_FUNC(__inet_aton, AC_DEFINE(HAVE_INET_ATON)) |
| 595 | |
| 596 | dnl --------------------------- |
| 597 | dnl check system has GNU regexp |
| 598 | dnl --------------------------- |
| 599 | dnl AC_MSG_CHECKING(whether system has GNU regex) |
| 600 | AC_CHECK_LIB(c, regexec, |
paul | 1bb066b | 2003-03-17 01:18:55 +0000 | [diff] [blame] | 601 | [AC_DEFINE(HAVE_GNU_REGEX,,GNU regexp library) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 602 | LIB_REGEX=""], |
| 603 | [LIB_REGEX="regex.o"]) |
| 604 | AC_SUBST(LIB_REGEX) |
| 605 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 606 | dnl ------------------ |
| 607 | dnl check SNMP library |
| 608 | dnl ------------------ |
| 609 | if test "${enable_snmp}" = "yes";then |
| 610 | dnl AC_CHECK_LIB(snmp, asn_parse_int, HAVE_SNMP=yes) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 611 | if test "${HAVE_SNMP}" = ""; then |
paul | 6898008 | 2003-03-25 05:07:42 +0000 | [diff] [blame] | 612 | old_libs="${LIBS}" |
| 613 | LIBS="-L/usr/lib" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 614 | unset ac_cv_lib_snmp_asn_parse_int |
paul | 6898008 | 2003-03-25 05:07:42 +0000 | [diff] [blame] | 615 | AC_CHECK_LIB(crypto, main, NEED_CRYPTO=yes, ) |
| 616 | if test "${NEED_CRYPTO}" = ""; then |
| 617 | AC_CHECK_LIB(netsnmp, asn_parse_int, [HAVE_NETSNMP=yes; HAVE_SNMP=yes ]) |
| 618 | else |
| 619 | AC_CHECK_LIB(netsnmp, asn_parse_int, [HAVE_NETSNMP=yes; HAVE_SNMP=yes; NEED_CRYPTO=yes;LIBS="$LIBS -lcrypto" ],,"-lcrypto") |
| 620 | fi |
| 621 | LIBS="${old_libs}" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 622 | fi |
paul | 6898008 | 2003-03-25 05:07:42 +0000 | [diff] [blame] | 623 | if test "${HAVE_SNMP}" = ""; then |
| 624 | old_libs="${LIBS}" |
| 625 | LIBS="-L/usr/lib" |
| 626 | unset ac_cv_lib_snmp_asn_parse_int |
| 627 | AC_CHECK_LIB(snmp, asn_parse_int, HAVE_SNMP=yes, ) |
| 628 | if test "${HAVE_SNMP}" = ""; then |
| 629 | unset ac_cv_lib_snmp_asn_parse_int |
| 630 | AC_CHECK_LIB(crypto, main, NEED_CRYPTO=yes, ) |
| 631 | if test "${NEED_CRYPTO}" = "yes"; then |
| 632 | AC_CHECK_LIB(snmp, asn_parse_int, [HAVE_SNMP=yes; NEED_CRYPTO=yes; LIBS="$LIBS -lcrypto" ],,"-lcrypto") |
| 633 | fi |
| 634 | fi |
| 635 | LIBS="${old_libs}" |
| 636 | fi |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 637 | |
| 638 | if test "${HAVE_SNMP}" = ""; then |
paul | 6898008 | 2003-03-25 05:07:42 +0000 | [diff] [blame] | 639 | old_libs="${LIBS}" |
| 640 | LIBS="-L/usr/local/lib" |
| 641 | unset ac_cv_lib_snmp_asn_parse_int |
| 642 | AC_CHECK_LIB(snmp, asn_parse_int, HAVE_SNMP=yes) |
| 643 | if test "${HAVE_SNMP}" = ""; then |
| 644 | unset ac_cv_lib_snmp_asn_parse_int |
| 645 | AC_CHECK_LIB(crypto, main, NEED_CRYPTO=yes, ) |
| 646 | if test "${NEED_CRYPTO}" = "yes"; then |
| 647 | AC_CHECK_LIB(snmp, asn_parse_int, [HAVE_SNMP=yes; NEED_CRYPTO=yes; LIBS="$LIBS -lcrypto" ],,"-lcrypto") |
| 648 | fi |
| 649 | fi |
| 650 | LIBS="${old_libs}" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 651 | fi |
paul | 6898008 | 2003-03-25 05:07:42 +0000 | [diff] [blame] | 652 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 653 | if test "${HAVE_SNMP}" = "yes"; then |
paul | 1bb066b | 2003-03-17 01:18:55 +0000 | [diff] [blame] | 654 | 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 |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 655 | do |
| 656 | test -f "${ac_snmp}" && break |
| 657 | done |
paul | 6898008 | 2003-03-25 05:07:42 +0000 | [diff] [blame] | 658 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 659 | case ${ac_snmp} in |
paul | 1bb066b | 2003-03-17 01:18:55 +0000 | [diff] [blame] | 660 | /usr/include/net-snmp/*) |
| 661 | AC_DEFINE(HAVE_SNMP,,SNMP) |
paul | 6898008 | 2003-03-25 05:07:42 +0000 | [diff] [blame] | 662 | AC_DEFINE(HAVE_NETSNMP,,SNMP) |
paul | 1bb066b | 2003-03-17 01:18:55 +0000 | [diff] [blame] | 663 | AC_DEFINE(UCD_COMPATIBLE,,SNMP) |
paul | ac7c4bb | 2003-03-19 04:25:08 +0000 | [diff] [blame] | 664 | CFLAGS="${CFLAGS} -I/usr/include/net-snmp -I/usr/include/net-snmp/library" |
| 665 | if test "${HAVE_NETSNMP}" = "yes"; then |
paul | 6898008 | 2003-03-25 05:07:42 +0000 | [diff] [blame] | 666 | LIBS="${LIBS} -lnetsnmp" |
paul | ac7c4bb | 2003-03-19 04:25:08 +0000 | [diff] [blame] | 667 | else |
paul | 6898008 | 2003-03-25 05:07:42 +0000 | [diff] [blame] | 668 | LIBS="${LIBS} -lsnmp" |
paul | ac7c4bb | 2003-03-19 04:25:08 +0000 | [diff] [blame] | 669 | fi |
paul | 1bb066b | 2003-03-17 01:18:55 +0000 | [diff] [blame] | 670 | ;; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 671 | /usr/include/ucd-snmp/*) |
paul | 1bb066b | 2003-03-17 01:18:55 +0000 | [diff] [blame] | 672 | AC_DEFINE(HAVE_SNMP,,SNMP) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 673 | CFLAGS="${CFLAGS} -I/usr/include/ucd-snmp" |
| 674 | LIBS="${LIBS} -lsnmp" |
| 675 | ;; |
| 676 | /usr/local/include/ucd-snmp/*) |
paul | 1bb066b | 2003-03-17 01:18:55 +0000 | [diff] [blame] | 677 | AC_DEFINE(HAVE_SNMP,,SNMP) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 678 | CFLAGS="${CFLAGS} -I/usr/local/include/ucd-snmp" |
| 679 | LIBS="${LIBS} -L/usr/local/lib -lsnmp" |
| 680 | ;; |
| 681 | esac |
| 682 | if test "${NEED_CRYPTO}" = "yes"; then |
| 683 | LIBS="${LIBS} -lcrypto" |
| 684 | fi |
| 685 | fi |
| 686 | fi |
| 687 | |
| 688 | dnl ---------------------------- |
| 689 | dnl check sa_len of sockaddr |
| 690 | dnl ---------------------------- |
| 691 | AC_MSG_CHECKING(whether struct sockaddr has a sa_len field) |
| 692 | AC_TRY_COMPILE([#include <sys/types.h> |
| 693 | #include <sys/socket.h> |
| 694 | ],[static struct sockaddr ac_i;int ac_j = sizeof (ac_i.sa_len);], |
| 695 | [AC_MSG_RESULT(yes) |
paul | 1bb066b | 2003-03-17 01:18:55 +0000 | [diff] [blame] | 696 | AC_DEFINE(HAVE_SA_LEN,,sa_len)], |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 697 | AC_MSG_RESULT(no)) |
| 698 | |
| 699 | dnl ---------------------------- |
| 700 | dnl check sin_len of sockaddr_in |
| 701 | dnl ---------------------------- |
| 702 | AC_MSG_CHECKING(whether struct sockaddr_in has a sin_len field) |
| 703 | AC_TRY_COMPILE([#include <sys/types.h> |
| 704 | #include <netinet/in.h> |
| 705 | ],[static struct sockaddr_in ac_i;int ac_j = sizeof (ac_i.sin_len);], |
| 706 | [AC_MSG_RESULT(yes) |
paul | 1bb066b | 2003-03-17 01:18:55 +0000 | [diff] [blame] | 707 | AC_DEFINE(HAVE_SIN_LEN,,sin_len)], |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 708 | AC_MSG_RESULT(no)) |
| 709 | |
| 710 | dnl ---------------------------- |
| 711 | dnl check sun_len of sockaddr_un |
| 712 | dnl ---------------------------- |
| 713 | AC_MSG_CHECKING(whether struct sockaddr_un has a sun_len field) |
| 714 | AC_TRY_COMPILE([#include <sys/types.h> |
| 715 | #include <sys/un.h> |
| 716 | ],[static struct sockaddr_un ac_i;int ac_j = sizeof (ac_i.sun_len);], |
| 717 | [AC_MSG_RESULT(yes) |
paul | 1bb066b | 2003-03-17 01:18:55 +0000 | [diff] [blame] | 718 | AC_DEFINE(HAVE_SUN_LEN,,sun_len)], |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 719 | AC_MSG_RESULT(no)) |
| 720 | |
| 721 | dnl ----------------------------------- |
| 722 | dnl check sin6_scope_id of sockaddr_in6 |
| 723 | dnl ----------------------------------- |
| 724 | if test "$zebra_cv_ipv6" = yes; then |
| 725 | AC_MSG_CHECKING(whether struct sockaddr_in6 has a sin6_scope_id field) |
| 726 | AC_TRY_COMPILE([#include <sys/types.h> |
| 727 | #include <netinet/in.h> |
| 728 | ],[static struct sockaddr_in6 ac_i;int ac_j = sizeof (ac_i.sin6_scope_id);], |
| 729 | [AC_MSG_RESULT(yes) |
paul | 1bb066b | 2003-03-17 01:18:55 +0000 | [diff] [blame] | 730 | AC_DEFINE(HAVE_SIN6_SCOPE_ID,,scope id)], |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 731 | AC_MSG_RESULT(no)) |
| 732 | fi |
| 733 | |
| 734 | dnl ---------------------------- |
| 735 | dnl check socklen_t exist or not |
| 736 | dnl ---------------------------- |
| 737 | AC_MSG_CHECKING(whther socklen_t is defined) |
| 738 | AC_TRY_COMPILE([#include <sys/types.h> |
| 739 | #include <sys/socket.h> |
| 740 | #include <netinet/in.h> |
| 741 | ],[socklen_t ac_x;], |
| 742 | [AC_MSG_RESULT(yes) |
paul | 1bb066b | 2003-03-17 01:18:55 +0000 | [diff] [blame] | 743 | AC_DEFINE(HAVE_SOCKLEN_T,,socklen_t)], |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 744 | AC_MSG_RESULT(no)) |
| 745 | |
| 746 | dnl ------------------------ |
| 747 | dnl check struct sockaddr_dl |
| 748 | dnl ------------------------ |
| 749 | AC_MSG_CHECKING(whether struct sockaddr_dl exist) |
| 750 | AC_EGREP_HEADER(sockaddr_dl, |
| 751 | net/if_dl.h, |
| 752 | [AC_MSG_RESULT(yes) |
paul | 1bb066b | 2003-03-17 01:18:55 +0000 | [diff] [blame] | 753 | AC_DEFINE(HAVE_SOCKADDR_DL,,sockaddr_dl)], |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 754 | AC_MSG_RESULT(no)) |
| 755 | |
| 756 | dnl -------------------------- |
| 757 | dnl check structure ifaliasreq |
| 758 | dnl -------------------------- |
| 759 | AC_MSG_CHECKING(whether struct ifaliasreq exist) |
| 760 | AC_EGREP_HEADER(ifaliasreq, |
| 761 | net/if.h, |
| 762 | [AC_MSG_RESULT(yes) |
paul | 1bb066b | 2003-03-17 01:18:55 +0000 | [diff] [blame] | 763 | AC_DEFINE(HAVE_IFALIASREQ,,ifaliasreq)], |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 764 | AC_MSG_RESULT(no)) |
| 765 | |
| 766 | dnl ---------------------------- |
| 767 | dnl check structure in6_aliasreq |
| 768 | dnl ---------------------------- |
| 769 | AC_MSG_CHECKING(whether struct if6_aliasreq exist) |
| 770 | AC_EGREP_HEADER(in6_aliasreq, |
| 771 | netinet6/in6_var.h, |
| 772 | [AC_MSG_RESULT(yes) |
paul | 1bb066b | 2003-03-17 01:18:55 +0000 | [diff] [blame] | 773 | AC_DEFINE(HAVE_IN6_ALIASREQ,,in6_aliasreq)], |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 774 | AC_MSG_RESULT(no)) |
| 775 | |
| 776 | dnl --------------------------- |
| 777 | dnl check structure rt_addrinfo |
| 778 | dnl --------------------------- |
| 779 | AC_MSG_CHECKING(whether struct rt_addrinfo exist) |
| 780 | AC_EGREP_HEADER(rt_addrinfo, |
| 781 | net/route.h, |
| 782 | [AC_MSG_RESULT(yes) |
paul | 1bb066b | 2003-03-17 01:18:55 +0000 | [diff] [blame] | 783 | AC_DEFINE(HAVE_RT_ADDRINFO,,rt_addrinfo)], |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 784 | AC_MSG_RESULT(no)) |
| 785 | |
| 786 | dnl -------------------------- |
| 787 | dnl check structure in_pktinfo |
| 788 | dnl -------------------------- |
| 789 | AC_MSG_CHECKING(whether struct in_pktinfo exist) |
| 790 | AC_TRY_COMPILE([#include <netinet/in.h> |
| 791 | ],[struct in_pktinfo ac_x;], |
| 792 | [AC_MSG_RESULT(yes) |
paul | 1bb066b | 2003-03-17 01:18:55 +0000 | [diff] [blame] | 793 | AC_DEFINE(HAVE_INPKTINFO,,in_pktinfo)], |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 794 | AC_MSG_RESULT(no)) |
| 795 | |
| 796 | dnl -------------------------------------- |
| 797 | dnl checking for getrusage struct and call |
| 798 | dnl -------------------------------------- |
| 799 | AC_MSG_CHECKING(whether getrusage is available) |
| 800 | AC_TRY_COMPILE([#include <sys/resource.h> |
| 801 | ],[struct rusage ac_x; getrusage (RUSAGE_SELF, &ac_x);], |
| 802 | [AC_MSG_RESULT(yes) |
paul | 1bb066b | 2003-03-17 01:18:55 +0000 | [diff] [blame] | 803 | AC_DEFINE(HAVE_RUSAGE,,rusage)], |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 804 | AC_MSG_RESULT(no)) |
| 805 | |
| 806 | dnl ------------- |
| 807 | dnl check version |
| 808 | dnl ------------- |
| 809 | file="${srcdir}/lib/version.h" |
| 810 | VERSION=`sed -ne 's/^#.*ZEBRA_VERSION.*\"\([^\"]*\)\"$/\1/p' $file` |
| 811 | AC_SUBST(VERSION) |
| 812 | |
| 813 | dnl ------------------------------ |
| 814 | dnl set paths for process id files |
| 815 | dnl ------------------------------ |
| 816 | AC_CACHE_CHECK(pid file directory,ac_piddir, |
| 817 | [for ZEBRA_PID_DIR in /var/run dnl |
| 818 | /var/adm dnl |
| 819 | /etc dnl |
| 820 | /dev/null; |
| 821 | do |
| 822 | test -d $ZEBRA_PID_DIR && break |
| 823 | done |
| 824 | ac_piddir=$ZEBRA_PID_DIR |
| 825 | if test $ZEBRA_PID_DIR = "/dev/null"; then |
| 826 | echo "PID DIRECTORY NOT FOUND!" |
| 827 | fi]) |
paul | 1bb066b | 2003-03-17 01:18:55 +0000 | [diff] [blame] | 828 | AC_DEFINE_UNQUOTED(PATH_ZEBRA_PID, "$ac_piddir/zebra.pid",zebra PID) |
| 829 | AC_DEFINE_UNQUOTED(PATH_RIPD_PID, "$ac_piddir/ripd.pid",ripd PID) |
| 830 | AC_DEFINE_UNQUOTED(PATH_RIPNGD_PID, "$ac_piddir/ripngd.pid",ripngd PID) |
| 831 | AC_DEFINE_UNQUOTED(PATH_BGPD_PID, "$ac_piddir/bgpd.pid",bgpd PID) |
| 832 | AC_DEFINE_UNQUOTED(PATH_OSPFD_PID, "$ac_piddir/ospfd.pid",ospfd PID) |
| 833 | AC_DEFINE_UNQUOTED(PATH_OSPF6D_PID, "$ac_piddir/ospf6d.pid",ospf6d PID) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 834 | |
| 835 | |
| 836 | dnl --------------------------- |
| 837 | dnl Check htonl works correctly |
| 838 | dnl --------------------------- |
| 839 | AC_MSG_CHECKING(for working htonl) |
| 840 | AC_CACHE_VAL(ac_cv_htonl_works, [ |
| 841 | AC_TRY_LINK([#ifdef HAVE_SYS_TYPES_H |
| 842 | #include <sys/types.h> |
| 843 | #endif |
| 844 | #ifdef HAVE_NETDB_H |
| 845 | #include <netdb.h> |
| 846 | #endif |
| 847 | #ifdef HAVE_NETINET_IN_H |
| 848 | #include <netinet/in.h> |
| 849 | #endif], |
| 850 | [htonl (0);], |
| 851 | ac_cv_htonl_works=yes, |
| 852 | ac_cv_htonl_works=no)]) |
| 853 | AC_MSG_RESULT($ac_cv_htonl_works) |
| 854 | |
paul | 1bb066b | 2003-03-17 01:18:55 +0000 | [diff] [blame] | 855 | AC_OUTPUT(Makefile lib/Makefile zebra/Makefile ripd/Makefile ripngd/Makefile bgpd/Makefile ospfd/Makefile ospf6d/Makefile vtysh/Makefile doc/Makefile ospfclient/Makefile) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 856 | |
| 857 | echo " |
| 858 | zebra configuration |
| 859 | ------------------- |
| 860 | zebra version : ${VERSION} |
| 861 | host operationg system : ${host_os} |
| 862 | source code location : ${srcdir} |
| 863 | compiler : ${CC} |
| 864 | compiler flags : ${CFLAGS} |
| 865 | directory for pid files : ${ac_piddir} |
| 866 | " |