paul | 7ea487b | 2003-03-17 02:05:07 +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) |
| 10 | AM_INIT_AUTOMAKE(zebra, 0.94) |
| 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]) |
paul | 7ea487b | 2003-03-17 02:05:07 +0000 | [diff] [blame] | 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 | 1ef74ef | 2003-03-21 15:16:05 +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 | 7ea487b | 2003-03-17 02:05:07 +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 |
| 111 | AC_DEFINE(HAVE_BROKEN_ALIASES,,Broken Alias) |
| 112 | enable_netlink=no |
| 113 | fi |
| 114 | |
| 115 | if test "${enable_tcp_zebra}" = "yes"; then |
| 116 | AC_DEFINE(HAVE_TCP_ZEBRA,,Use TCP for zebra communication) |
| 117 | fi |
| 118 | |
| 119 | if test "${enable_nssa}" = "yes"; then |
| 120 | AC_DEFINE(HAVE_NSSA,,OSPF NSSA) |
| 121 | fi |
| 122 | |
| 123 | if test "${enable_opaque_lsa}" = "yes"; then |
| 124 | AC_DEFINE(HAVE_OPAQUE_LSA,,OSPF Opaque LSA) |
| 125 | fi |
| 126 | |
| 127 | if test "${enable_ospf_te}" = "yes"; then |
| 128 | AC_DEFINE(HAVE_OPAQUE_LSA,,OSPF Opaque LSA) |
| 129 | AC_DEFINE(HAVE_OSPF_TE,,OSPF TE) |
| 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 |
| 171 | AC_DEFINE(SUNOS_5,,SunOS 5) |
| 172 | AC_CHECK_LIB(xnet, main) |
| 173 | CURSES=-lcurses |
| 174 | ;; |
| 175 | *-sunos5* | *-solaris2*) |
| 176 | AC_DEFINE(SUNOS_5,,SunOS 5) |
| 177 | AC_CHECK_LIB(socket, main) |
| 178 | AC_CHECK_LIB(nsl, main) |
| 179 | CURSES=-lcurses |
| 180 | ;; |
| 181 | *-linux-*) |
| 182 | opsys=gnu-linux |
| 183 | AC_DEFINE(GNU_LINUX,,GNU Linux) |
| 184 | ;; |
| 185 | *-nec-sysv4*) |
| 186 | AC_CHECK_LIB(nsl, gethostbyname) |
| 187 | AC_CHECK_LIB(socket, socket) |
| 188 | ;; |
| 189 | *-freebsd3.2) |
| 190 | AC_DEFINE(FREEBSD_32,,FreeBSD 3.2) |
| 191 | ;; |
| 192 | *-openbsd*) |
| 193 | opsys=openbsd |
| 194 | AC_DEFINE(OPEN_BSD,,OpenBSD) |
| 195 | ;; |
| 196 | *-bsdi*) |
| 197 | opsys=bsdi |
| 198 | OTHER_METHOD="mtu_kvm.o" |
| 199 | AC_CHECK_LIB(kvm, main) |
| 200 | ;; |
| 201 | esac |
| 202 | |
| 203 | dnl --------------------- |
| 204 | dnl Integrated VTY option |
| 205 | dnl --------------------- |
| 206 | case "${enable_vtysh}" in |
| 207 | "yes") VTYSH="vtysh"; |
| 208 | AC_DEFINE(VTYSH,,VTY shell) |
| 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 |
paul | 24cd435 | 2003-05-06 12:16:27 +0000 | [diff] [blame] | 227 | AC_MSG_CHECKING(security/pam_misc.h) |
| 228 | AC_CHECK_HEADER(security/pam_misc.h) |
| 229 | if test "$ac_cv_header_security_pam_misc_h" = yes; then |
| 230 | AC_DEFINE(HAVE_PAM_MISC_H,,Have pam_misc.h) |
| 231 | AC_DEFINE(PAM_CONV_FUNC,misc_conv,Have misc_conv) |
| 232 | pam_conv_func="misc_conv" |
| 233 | AC_MSG_RESULT(yes) |
| 234 | else |
| 235 | AC_MSG_RESULT(no) |
| 236 | fi |
| 237 | AC_MSG_CHECKING(security/openpam.h) |
| 238 | AC_CHECK_HEADER(security/openpam.h) |
| 239 | if test "$ac_cv_header_security_openpam_h" = yes; then |
| 240 | AC_DEFINE(HAVE_OPENPAM_H,,Have openpam.h) |
| 241 | AC_DEFINE(PAM_CONV_FUNC,openpam_ttyconv,Have openpam_ttyconv) |
| 242 | pam_conv_func="openpam_ttyconv" |
| 243 | AC_MSG_RESULT(yes) |
| 244 | else |
| 245 | AC_MSG_RESULT(no) |
| 246 | fi |
| 247 | if test -z "$ac_cv_header_security_pam_misc_h$ac_cv_header_security_openpam_h" ; then |
| 248 | AC_MSG_WARN([*** pam support will not be built ***]) |
| 249 | with_libpam="no" |
| 250 | fi |
| 251 | fi |
| 252 | |
| 253 | if test "$with_libpam" = "yes"; then |
paul | 7ea487b | 2003-03-17 02:05:07 +0000 | [diff] [blame] | 254 | dnl took this test from proftpd's configure.in and suited to our needs |
| 255 | dnl ------------------------------------------------------------------------- |
| 256 | dnl |
| 257 | dnl This next check looks funky due to a linker problem with some versions |
| 258 | dnl of the PAM library. Prior to 0.72 release, the Linux PAM shared library |
| 259 | dnl omitted requiring libdl linking information. PAM-0.72 or better ships |
| 260 | dnl with RedHat 6.2 and Debian 2.2 or better. |
| 261 | AC_CHECK_LIB(pam, pam_start, |
paul | 24cd435 | 2003-05-06 12:16:27 +0000 | [diff] [blame] | 262 | [AC_CHECK_LIB(pam, $pam_conv_func, |
paul | 7ea487b | 2003-03-17 02:05:07 +0000 | [diff] [blame] | 263 | [AC_DEFINE(USE_PAM,,Use PAM for authentication) |
| 264 | LIBPAM="-lpam"], |
| 265 | [AC_DEFINE(USE_PAM,,Use PAM for authentication) |
| 266 | LIBPAM="-lpam -lpam_misc"] |
| 267 | ) |
| 268 | ], |
| 269 | |
| 270 | [AC_CHECK_LIB(pam, pam_end, |
paul | 24cd435 | 2003-05-06 12:16:27 +0000 | [diff] [blame] | 271 | [AC_CHECK_LIB(pam, $pam_conv_func, |
paul | 7ea487b | 2003-03-17 02:05:07 +0000 | [diff] [blame] | 272 | [AC_DEFINE(USE_PAM) |
| 273 | LIBPAM="-lpam -ldl"], |
| 274 | [AC_DEFINE(USE_PAM) |
| 275 | LIBPAM="-lpam -ldl -lpam_misc"] |
| 276 | ) |
| 277 | ],AC_MSG_WARN([*** pam support will not be built ***]), |
| 278 | [-ldl]) |
| 279 | ] |
| 280 | ) |
| 281 | fi |
| 282 | AC_SUBST(LIBPAM) |
| 283 | |
| 284 | dnl ------------------------------- |
| 285 | dnl Endian-ness check |
| 286 | dnl ------------------------------- |
| 287 | AC_WORDS_BIGENDIAN |
| 288 | |
| 289 | dnl ------------------------------- |
| 290 | dnl check the size in byte of the C |
| 291 | dnl ------------------------------- |
| 292 | dnl AC_CHECK_SIZEOF(char) |
| 293 | dnl AC_CHECK_SIZEOF(int) |
| 294 | dnl AC_CHECK_SIZEOF(short) |
| 295 | dnl AC_CHECK_SIZEOF(long) |
| 296 | |
| 297 | dnl ---------------------------- |
| 298 | dnl check existance of functions |
| 299 | dnl ---------------------------- |
| 300 | AC_CHECK_FUNCS(bcopy bzero strerror inet_aton daemon snprintf vsnprintf strlcat strlcpy if_nametoindex if_indextoname getifaddrs) |
| 301 | AC_CHECK_FUNCS(setproctitle, ,[AC_CHECK_LIB(util, setproctitle, [LIBS="$LIBS -lutil"; AC_DEFINE(HAVE_SETPROCTITLE)])]) |
| 302 | |
| 303 | dnl ------------------------------------ |
| 304 | dnl Determine routing get and set method |
| 305 | dnl ------------------------------------ |
| 306 | AC_MSG_CHECKING(zebra between kernel interface method) |
| 307 | if test x"$opsys" = x"gnu-linux"; then |
| 308 | if test "${enable_netlink}" = "yes";then |
| 309 | AC_MSG_RESULT(netlink) |
| 310 | RT_METHOD=rt_netlink.o |
| 311 | AC_DEFINE(HAVE_NETLINK,,netlink) |
| 312 | netlink=yes |
| 313 | elif test "${enable_netlink}" = "no"; then |
| 314 | AC_MSG_RESULT(ioctl) |
| 315 | RT_METHOD=rt_ioctl.o |
| 316 | netlink=no |
| 317 | else |
| 318 | AC_MSG_RESULT(netlink) |
| 319 | RT_METHOD=rt_netlink.o |
| 320 | AC_DEFINE(HAVE_NETLINK,,netlink) |
| 321 | netlink=yes |
| 322 | fi |
| 323 | else |
| 324 | if test "$opsys" = "sol2-6";then |
| 325 | AC_MSG_RESULT(solaris) |
| 326 | KERNEL_METHOD="kernel_socket.o" |
| 327 | RT_METHOD="rt_socket.o" |
| 328 | else |
| 329 | AC_TRY_RUN([#include <errno.h> |
| 330 | #include <sys/types.h> |
| 331 | #include <sys/socket.h> |
| 332 | |
| 333 | main () |
| 334 | { |
| 335 | int ac_sock; |
| 336 | |
| 337 | ac_sock = socket (AF_ROUTE, SOCK_RAW, 0); |
| 338 | if (ac_sock < 0 && errno == EINVAL) |
| 339 | exit (1); |
| 340 | exit (0); |
| 341 | }], |
| 342 | [KERNEL_METHOD=kernel_socket.o |
| 343 | RT_METHOD=rt_socket.o |
| 344 | AC_MSG_RESULT(socket)], |
| 345 | [RT_METHOD=rt_ioctl.o |
| 346 | AC_MSG_RESULT(ioctl)], |
| 347 | [KERNEL_METHOD=kernel_socket.o |
| 348 | RT_METHOD=rt_socket.o |
| 349 | AC_MSG_RESULT(socket)]) |
| 350 | fi |
| 351 | fi |
| 352 | AC_SUBST(RT_METHOD) |
| 353 | AC_SUBST(KERNEL_METHOD) |
| 354 | AC_SUBST(OTHER_METHOD) |
| 355 | |
| 356 | dnl ------------------------------ |
| 357 | dnl check kernel route read method |
| 358 | dnl ------------------------------ |
| 359 | AC_CACHE_CHECK(route read method check, zebra_rtread, |
| 360 | [if test "$netlink" = yes; then |
| 361 | RTREAD_METHOD="rtread_netlink.o" |
| 362 | zebra_rtread="netlink" |
| 363 | else |
| 364 | for zebra_rtread in /proc/net/route /dev/ip /dev/null; |
| 365 | do |
| 366 | test x`ls $zebra_rtread 2>/dev/null` = x"$zebra_rtread" && break |
| 367 | done |
| 368 | case $zebra_rtread in |
| 369 | "/proc/net/route") RTREAD_METHOD="rtread_proc.o" |
| 370 | zebra_rtread="proc";; |
| 371 | "/dev/ip") RTREAD_METHOD="rtread_getmsg.o" |
| 372 | zebra_rtread="getmsg";; |
| 373 | *) RTREAD_METHOD="rtread_sysctl.o" |
| 374 | zebra_rtread="sysctl";; |
| 375 | esac |
| 376 | fi]) |
| 377 | AC_SUBST(RTREAD_METHOD) |
| 378 | |
| 379 | dnl ----------------------------- |
| 380 | dnl check interface lookup method |
| 381 | dnl ----------------------------- |
| 382 | AC_MSG_CHECKING(interface looking up method) |
| 383 | if test "$netlink" = yes; then |
| 384 | AC_MSG_RESULT(netlink) |
| 385 | IF_METHOD=if_netlink.o |
| 386 | else |
| 387 | if test "$opsys" = "sol2-6";then |
| 388 | AC_MSG_RESULT(solaris) |
| 389 | IF_METHOD=if_ioctl.o |
| 390 | elif test "$opsys" = "openbsd";then |
| 391 | AC_MSG_RESULT(openbsd) |
| 392 | IF_METHOD=if_ioctl.o |
| 393 | elif grep NET_RT_IFLIST /usr/include/sys/socket.h >/dev/null 2>&1; then |
| 394 | AC_MSG_RESULT(sysctl) |
| 395 | IF_METHOD=if_sysctl.o |
| 396 | AC_DEFINE(HAVE_NET_RT_IFLIST,,NET_RT_IFLIST) |
| 397 | else |
| 398 | AC_MSG_RESULT(ioctl) |
| 399 | IF_METHOD=if_ioctl.o |
| 400 | fi |
| 401 | fi |
| 402 | AC_SUBST(IF_METHOD) |
| 403 | |
| 404 | dnl ----------------------- |
| 405 | dnl check proc file system. |
| 406 | dnl ----------------------- |
| 407 | if test -r /proc/net/dev; then |
| 408 | AC_DEFINE(HAVE_PROC_NET_DEV,,/proc/net/dev) |
| 409 | IF_PROC=if_proc.o |
| 410 | fi |
| 411 | |
| 412 | if test -r /proc/net/if_inet6; then |
| 413 | AC_DEFINE(HAVE_PROC_NET_IF_INET6,,/proc/net/if_inet6) |
| 414 | IF_PROC=if_proc.o |
| 415 | fi |
| 416 | AC_SUBST(IF_PROC) |
| 417 | |
| 418 | dnl ----------------------------- |
| 419 | dnl check ipforward detect method |
| 420 | dnl ----------------------------- |
| 421 | AC_CACHE_CHECK(ipforward method check, zebra_ipforward_path, |
| 422 | [for zebra_ipforward_path in /proc/net/snmp /dev/ip /dev/null; |
| 423 | do |
| 424 | test x`ls $zebra_ipforward_path 2>/dev/null` = x"$zebra_ipforward_path" && break |
| 425 | done |
| 426 | case $zebra_ipforward_path in |
| 427 | "/proc/net/snmp") IPFORWARD=ipforward_proc.o |
| 428 | zebra_ipforward_path="proc";; |
| 429 | "/dev/ip") |
| 430 | case "$host" in |
| 431 | *-nec-sysv4*) IPFORWARD=ipforward_ews.o |
| 432 | zebra_ipforward_path="ews";; |
| 433 | *) IPFORWARD=ipforward_solaris.o |
| 434 | zebra_ipforward_path="solaris";; |
| 435 | esac;; |
| 436 | *) IPFORWARD=ipforward_sysctl.o |
| 437 | zebra_ipforward_path="sysctl";; |
| 438 | esac]) |
| 439 | AC_SUBST(IPFORWARD) |
| 440 | |
| 441 | AC_CHECK_FUNCS(getaddrinfo, [have_getaddrinfo=yes], [have_getaddrinfo=no]) |
| 442 | |
| 443 | dnl ---------- |
| 444 | dnl IPv6 check |
| 445 | dnl ---------- |
| 446 | AC_MSG_CHECKING(whether does this OS have IPv6 stack) |
| 447 | if test "${enable_ipv6}" = "no"; then |
| 448 | AC_MSG_RESULT(disabled) |
| 449 | else |
| 450 | dnl ---------- |
| 451 | dnl INRIA IPv6 |
| 452 | dnl ---------- |
| 453 | if grep IPV6_INRIA_VERSION /usr/include/netinet/in.h >/dev/null 2>&1; then |
| 454 | zebra_cv_ipv6=yes |
| 455 | AC_DEFINE(HAVE_IPV6,,IPv6) |
| 456 | AC_DEFINE(INRIA_IPV6,,Inria IPv6) |
| 457 | RIPNGD="ripngd" |
| 458 | OSPF6D="ospf6d" |
| 459 | LIB_IPV6="" |
| 460 | AC_MSG_RESULT(INRIA IPv6) |
| 461 | fi |
| 462 | dnl --------- |
| 463 | dnl KAME IPv6 |
| 464 | dnl --------- |
| 465 | if grep WIDE /usr/include/netinet6/in6.h >/dev/null 2>&1; then |
| 466 | zebra_cv_ipv6=yes |
| 467 | AC_DEFINE(HAVE_IPV6,,IPv6) |
| 468 | AC_DEFINE(KAME,,KAME IPv6) |
| 469 | RIPNGD="ripngd" |
| 470 | OSPF6D="ospf6d" |
| 471 | if test -d /usr/local/v6/lib -a -f /usr/local/v6/lib/libinet6.a; then |
| 472 | LIB_IPV6="-L/usr/local/v6/lib -linet6" |
| 473 | fi |
| 474 | AC_MSG_RESULT(KAME) |
| 475 | fi |
| 476 | dnl --------- |
| 477 | dnl NRL check |
| 478 | dnl --------- |
| 479 | if grep NRL /usr/include/netinet6/in6.h >/dev/null 2>&1; then |
| 480 | zebra_cv_ipv6=yes |
| 481 | AC_DEFINE(HAVE_IPV6,,IPv6) |
| 482 | AC_DEFINE(NRL,,NRL) |
| 483 | RIPNGD="ripngd" |
| 484 | OSPF6D="ospf6d" |
| 485 | if test x"$opsys" = x"bsdi";then |
| 486 | AC_DEFINE(BSDI_NRL,,BSDI) |
| 487 | AC_MSG_RESULT(BSDI_NRL) |
| 488 | else |
| 489 | AC_MSG_RESULT(NRL) |
| 490 | fi |
| 491 | fi |
| 492 | |
| 493 | dnl ---------- |
| 494 | dnl Linux IPv6 |
| 495 | dnl ---------- |
| 496 | if test "${enable_ipv6}" = "yes"; then |
| 497 | AC_EGREP_CPP(yes, [ |
| 498 | #include <linux/version.h> |
| 499 | /* 2.1.128 or later */ |
| 500 | #if LINUX_VERSION_CODE >= 0x020180 |
| 501 | yes |
| 502 | #endif], |
| 503 | [zebra_cv_ipv6=yes; zebra_cv_linux_ipv6=yes;AC_MSG_RESULT(Linux IPv6)]) |
| 504 | else |
| 505 | if test x`ls /proc/net/ipv6_route 2>/dev/null` = x"/proc/net/ipv6_route" |
| 506 | then |
| 507 | zebra_cv_ipv6=yes |
| 508 | zebra_cv_linux_ipv6=yes |
| 509 | AC_MSG_RESULT(Linux IPv6) |
| 510 | fi |
| 511 | fi |
| 512 | |
| 513 | if test "$zebra_cv_linux_ipv6" = "yes";then |
| 514 | AC_DEFINE(HAVE_IPV6) |
| 515 | AC_MSG_CHECKING(for GNU libc 2.1) |
| 516 | AC_EGREP_CPP(yes, [ |
| 517 | #include <features.h> |
| 518 | #if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 |
| 519 | yes |
| 520 | #endif], [glibc=yes; AC_MSG_RESULT(yes)], AC_MSG_RESULT(no)) |
| 521 | AC_DEFINE(LINUX_IPV6,,Linux IPv6) |
| 522 | RIPNGD="ripngd" |
| 523 | OSPF6D="ospf6d" |
| 524 | if test "$glibc" != "yes"; then |
| 525 | INCLUDES="-I/usr/inet6/include" |
| 526 | if test x`ls /usr/inet6/lib/libinet6.a 2>/dev/null` != x;then |
| 527 | LIB_IPV6="-L/usr/inet6/lib -linet6" |
| 528 | fi |
| 529 | fi |
| 530 | fi |
| 531 | |
| 532 | dnl ----------------------- |
| 533 | dnl Set IPv6 related values |
| 534 | dnl ----------------------- |
| 535 | LIBS="$LIB_IPV6 $LIBS" |
| 536 | AC_SUBST(LIB_IPV6) |
| 537 | |
| 538 | if test x"$RIPNGD" = x""; then |
| 539 | AC_MSG_RESULT(IPv4 only) |
| 540 | fi |
| 541 | fi |
| 542 | |
| 543 | dnl -------------------- |
| 544 | dnl Daemon disable check |
| 545 | dnl -------------------- |
| 546 | if test "${enable_zebra}" = "no";then |
| 547 | ZEBRA="" |
| 548 | else |
| 549 | ZEBRA="zebra" |
| 550 | fi |
| 551 | |
| 552 | if test "${enable_bgpd}" = "no";then |
| 553 | BGPD="" |
| 554 | else |
| 555 | BGPD="bgpd" |
| 556 | fi |
| 557 | |
| 558 | if test "${enable_ripd}" = "no";then |
| 559 | RIPD="" |
| 560 | else |
| 561 | RIPD="ripd" |
| 562 | fi |
| 563 | |
| 564 | if test "${enable_ospfd}" = "no";then |
| 565 | OSPFD="" |
| 566 | else |
| 567 | OSPFD="ospfd" |
| 568 | fi |
| 569 | |
paul | 1ef74ef | 2003-03-21 15:16:05 +0000 | [diff] [blame] | 570 | OSPFCLIENT="" |
| 571 | if test "${enable_opaque_lsa}" = "yes"; then |
| 572 | if test "${enable_ospfapi}" != "no";then |
paul | 9a56984 | 2003-03-28 01:45:13 +0000 | [diff] [blame] | 573 | AC_DEFINE(SUPPORT_OSPF_API,,OSPFAPI) |
paul | 1ef74ef | 2003-03-21 15:16:05 +0000 | [diff] [blame] | 574 | |
| 575 | if test "${enable_ospfclient}" != "no";then |
| 576 | OSPFCLIENT="ospfclient" |
| 577 | fi |
| 578 | fi |
| 579 | |
paul | 7ea487b | 2003-03-17 02:05:07 +0000 | [diff] [blame] | 580 | fi |
| 581 | |
| 582 | case "${enable_ripngd}" in |
| 583 | "yes") RIPNGD="ripngd";; |
| 584 | "no" ) RIPNGD="";; |
| 585 | * ) ;; |
| 586 | esac |
| 587 | |
| 588 | case "${enable_ospf6d}" in |
| 589 | "yes") OSPF6D="ospf6d";; |
| 590 | "no" ) OSPF6D="";; |
| 591 | * ) ;; |
| 592 | esac |
| 593 | |
| 594 | if test "${enable_bgp_announce}" = "no";then |
| 595 | AC_DEFINE(DISABLE_BGP_ANNOUNCE,,Disable BGP installation to zebra) |
| 596 | fi |
| 597 | |
| 598 | AC_SUBST(ZEBRA) |
| 599 | AC_SUBST(BGPD) |
| 600 | AC_SUBST(RIPD) |
| 601 | AC_SUBST(RIPNGD) |
| 602 | AC_SUBST(OSPFD) |
| 603 | AC_SUBST(OSPF6D) |
| 604 | AC_SUBST(VTYSH) |
| 605 | AC_SUBST(INCLUDES) |
| 606 | AC_SUBST(CURSES) |
| 607 | AC_SUBST(OSPFCLIENT) |
paul | 1ef74ef | 2003-03-21 15:16:05 +0000 | [diff] [blame] | 608 | AC_SUBST(OSPFAPI) |
paul | 7ea487b | 2003-03-17 02:05:07 +0000 | [diff] [blame] | 609 | AC_CHECK_LIB(c, inet_ntop, [AC_DEFINE(HAVE_INET_NTOP,,inet_ntop)]) |
| 610 | AC_CHECK_LIB(c, inet_pton, [AC_DEFINE(HAVE_INET_PTON,,inet_pton)]) |
| 611 | AC_CHECK_LIB(crypt, crypt) |
| 612 | AC_CHECK_LIB(resolv, res_init) |
| 613 | AC_CHECK_LIB(m, main) |
| 614 | |
| 615 | dnl --------------------------------------------------- |
| 616 | dnl BSD/OS 4.1 define inet_XtoY function as __inet_XtoY |
| 617 | dnl --------------------------------------------------- |
| 618 | AC_CHECK_FUNC(__inet_ntop, AC_DEFINE(HAVE_INET_NTOP)) |
| 619 | AC_CHECK_FUNC(__inet_pton, AC_DEFINE(HAVE_INET_PTON)) |
| 620 | AC_CHECK_FUNC(__inet_aton, AC_DEFINE(HAVE_INET_ATON)) |
| 621 | |
| 622 | dnl --------------------------- |
| 623 | dnl check system has GNU regexp |
| 624 | dnl --------------------------- |
| 625 | dnl AC_MSG_CHECKING(whether system has GNU regex) |
| 626 | AC_CHECK_LIB(c, regexec, |
| 627 | [AC_DEFINE(HAVE_GNU_REGEX,,GNU regexp library) |
| 628 | LIB_REGEX=""], |
| 629 | [LIB_REGEX="regex.o"]) |
| 630 | AC_SUBST(LIB_REGEX) |
| 631 | |
| 632 | dnl ------------------ |
| 633 | dnl check SNMP library |
| 634 | dnl ------------------ |
| 635 | if test "${enable_snmp}" = "yes";then |
| 636 | dnl AC_CHECK_LIB(snmp, asn_parse_int, HAVE_SNMP=yes) |
paul | 7ea487b | 2003-03-17 02:05:07 +0000 | [diff] [blame] | 637 | if test "${HAVE_SNMP}" = ""; then |
paul | 1ef74ef | 2003-03-21 15:16:05 +0000 | [diff] [blame] | 638 | old_libs="${LIBS}" |
| 639 | LIBS="-L/usr/lib" |
paul | 7ea487b | 2003-03-17 02:05:07 +0000 | [diff] [blame] | 640 | unset ac_cv_lib_snmp_asn_parse_int |
paul | 1ef74ef | 2003-03-21 15:16:05 +0000 | [diff] [blame] | 641 | AC_CHECK_LIB(crypto, main, NEED_CRYPTO=yes, ) |
| 642 | if test "${NEED_CRYPTO}" = ""; then |
| 643 | AC_CHECK_LIB(netsnmp, asn_parse_int, [HAVE_NETSNMP=yes; HAVE_SNMP=yes ]) |
| 644 | else |
| 645 | AC_CHECK_LIB(netsnmp, asn_parse_int, [HAVE_NETSNMP=yes; HAVE_SNMP=yes; NEED_CRYPTO=yes;LIBS="$LIBS -lcrypto" ],,"-lcrypto") |
| 646 | fi |
| 647 | LIBS="${old_libs}" |
paul | 7ea487b | 2003-03-17 02:05:07 +0000 | [diff] [blame] | 648 | fi |
paul | 1ef74ef | 2003-03-21 15:16:05 +0000 | [diff] [blame] | 649 | if test "${HAVE_SNMP}" = ""; then |
| 650 | old_libs="${LIBS}" |
| 651 | LIBS="-L/usr/lib" |
| 652 | unset ac_cv_lib_snmp_asn_parse_int |
| 653 | AC_CHECK_LIB(snmp, asn_parse_int, HAVE_SNMP=yes, ) |
| 654 | if test "${HAVE_SNMP}" = ""; then |
| 655 | unset ac_cv_lib_snmp_asn_parse_int |
| 656 | AC_CHECK_LIB(crypto, main, NEED_CRYPTO=yes, ) |
| 657 | if test "${NEED_CRYPTO}" = "yes"; then |
| 658 | AC_CHECK_LIB(snmp, asn_parse_int, [HAVE_SNMP=yes; NEED_CRYPTO=yes; LIBS="$LIBS -lcrypto" ],,"-lcrypto") |
| 659 | fi |
| 660 | fi |
| 661 | LIBS="${old_libs}" |
| 662 | fi |
paul | 7ea487b | 2003-03-17 02:05:07 +0000 | [diff] [blame] | 663 | |
| 664 | if test "${HAVE_SNMP}" = ""; then |
paul | 1ef74ef | 2003-03-21 15:16:05 +0000 | [diff] [blame] | 665 | old_libs="${LIBS}" |
| 666 | LIBS="-L/usr/local/lib" |
| 667 | unset ac_cv_lib_snmp_asn_parse_int |
| 668 | AC_CHECK_LIB(snmp, asn_parse_int, HAVE_SNMP=yes) |
| 669 | if test "${HAVE_SNMP}" = ""; then |
| 670 | unset ac_cv_lib_snmp_asn_parse_int |
| 671 | AC_CHECK_LIB(crypto, main, NEED_CRYPTO=yes, ) |
| 672 | if test "${NEED_CRYPTO}" = "yes"; then |
| 673 | AC_CHECK_LIB(snmp, asn_parse_int, [HAVE_SNMP=yes; NEED_CRYPTO=yes; LIBS="$LIBS -lcrypto" ],,"-lcrypto") |
| 674 | fi |
| 675 | fi |
| 676 | LIBS="${old_libs}" |
paul | 7ea487b | 2003-03-17 02:05:07 +0000 | [diff] [blame] | 677 | fi |
paul | 1ef74ef | 2003-03-21 15:16:05 +0000 | [diff] [blame] | 678 | |
paul | 7ea487b | 2003-03-17 02:05:07 +0000 | [diff] [blame] | 679 | if test "${HAVE_SNMP}" = "yes"; then |
| 680 | 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 |
| 681 | do |
| 682 | test -f "${ac_snmp}" && break |
| 683 | done |
paul | 1ef74ef | 2003-03-21 15:16:05 +0000 | [diff] [blame] | 684 | |
paul | 7ea487b | 2003-03-17 02:05:07 +0000 | [diff] [blame] | 685 | case ${ac_snmp} in |
| 686 | /usr/include/net-snmp/*) |
| 687 | AC_DEFINE(HAVE_SNMP,,SNMP) |
paul | 1ef74ef | 2003-03-21 15:16:05 +0000 | [diff] [blame] | 688 | AC_DEFINE(HAVE_NETSNMP,,SNMP) |
paul | 7ea487b | 2003-03-17 02:05:07 +0000 | [diff] [blame] | 689 | AC_DEFINE(UCD_COMPATIBLE,,SNMP) |
paul | ac7c4bb | 2003-03-19 04:25:08 +0000 | [diff] [blame] | 690 | CFLAGS="${CFLAGS} -I/usr/include/net-snmp -I/usr/include/net-snmp/library" |
| 691 | if test "${HAVE_NETSNMP}" = "yes"; then |
paul | 1ef74ef | 2003-03-21 15:16:05 +0000 | [diff] [blame] | 692 | LIBS="${LIBS} -lnetsnmp" |
paul | ac7c4bb | 2003-03-19 04:25:08 +0000 | [diff] [blame] | 693 | else |
paul | 1ef74ef | 2003-03-21 15:16:05 +0000 | [diff] [blame] | 694 | LIBS="${LIBS} -lsnmp" |
paul | ac7c4bb | 2003-03-19 04:25:08 +0000 | [diff] [blame] | 695 | fi |
paul | 7ea487b | 2003-03-17 02:05:07 +0000 | [diff] [blame] | 696 | ;; |
| 697 | /usr/include/ucd-snmp/*) |
| 698 | AC_DEFINE(HAVE_SNMP,,SNMP) |
| 699 | CFLAGS="${CFLAGS} -I/usr/include/ucd-snmp" |
| 700 | LIBS="${LIBS} -lsnmp" |
| 701 | ;; |
| 702 | /usr/local/include/ucd-snmp/*) |
| 703 | AC_DEFINE(HAVE_SNMP,,SNMP) |
| 704 | CFLAGS="${CFLAGS} -I/usr/local/include/ucd-snmp" |
| 705 | LIBS="${LIBS} -L/usr/local/lib -lsnmp" |
| 706 | ;; |
| 707 | esac |
| 708 | if test "${NEED_CRYPTO}" = "yes"; then |
| 709 | LIBS="${LIBS} -lcrypto" |
| 710 | fi |
| 711 | fi |
| 712 | fi |
| 713 | |
| 714 | dnl ---------------------------- |
| 715 | dnl check sa_len of sockaddr |
| 716 | dnl ---------------------------- |
| 717 | AC_MSG_CHECKING(whether struct sockaddr has a sa_len field) |
| 718 | AC_TRY_COMPILE([#include <sys/types.h> |
| 719 | #include <sys/socket.h> |
| 720 | ],[static struct sockaddr ac_i;int ac_j = sizeof (ac_i.sa_len);], |
| 721 | [AC_MSG_RESULT(yes) |
| 722 | AC_DEFINE(HAVE_SA_LEN,,sa_len)], |
| 723 | AC_MSG_RESULT(no)) |
| 724 | |
| 725 | dnl ---------------------------- |
| 726 | dnl check sin_len of sockaddr_in |
| 727 | dnl ---------------------------- |
| 728 | AC_MSG_CHECKING(whether struct sockaddr_in has a sin_len field) |
| 729 | AC_TRY_COMPILE([#include <sys/types.h> |
| 730 | #include <netinet/in.h> |
| 731 | ],[static struct sockaddr_in ac_i;int ac_j = sizeof (ac_i.sin_len);], |
| 732 | [AC_MSG_RESULT(yes) |
| 733 | AC_DEFINE(HAVE_SIN_LEN,,sin_len)], |
| 734 | AC_MSG_RESULT(no)) |
| 735 | |
| 736 | dnl ---------------------------- |
| 737 | dnl check sun_len of sockaddr_un |
| 738 | dnl ---------------------------- |
| 739 | AC_MSG_CHECKING(whether struct sockaddr_un has a sun_len field) |
| 740 | AC_TRY_COMPILE([#include <sys/types.h> |
| 741 | #include <sys/un.h> |
| 742 | ],[static struct sockaddr_un ac_i;int ac_j = sizeof (ac_i.sun_len);], |
| 743 | [AC_MSG_RESULT(yes) |
| 744 | AC_DEFINE(HAVE_SUN_LEN,,sun_len)], |
| 745 | AC_MSG_RESULT(no)) |
| 746 | |
| 747 | dnl ----------------------------------- |
| 748 | dnl check sin6_scope_id of sockaddr_in6 |
| 749 | dnl ----------------------------------- |
| 750 | if test "$zebra_cv_ipv6" = yes; then |
| 751 | AC_MSG_CHECKING(whether struct sockaddr_in6 has a sin6_scope_id field) |
| 752 | AC_TRY_COMPILE([#include <sys/types.h> |
| 753 | #include <netinet/in.h> |
| 754 | ],[static struct sockaddr_in6 ac_i;int ac_j = sizeof (ac_i.sin6_scope_id);], |
| 755 | [AC_MSG_RESULT(yes) |
| 756 | AC_DEFINE(HAVE_SIN6_SCOPE_ID,,scope id)], |
| 757 | AC_MSG_RESULT(no)) |
| 758 | fi |
| 759 | |
| 760 | dnl ---------------------------- |
| 761 | dnl check socklen_t exist or not |
| 762 | dnl ---------------------------- |
| 763 | AC_MSG_CHECKING(whther socklen_t is defined) |
| 764 | AC_TRY_COMPILE([#include <sys/types.h> |
| 765 | #include <sys/socket.h> |
| 766 | #include <netinet/in.h> |
| 767 | ],[socklen_t ac_x;], |
| 768 | [AC_MSG_RESULT(yes) |
| 769 | AC_DEFINE(HAVE_SOCKLEN_T,,socklen_t)], |
| 770 | AC_MSG_RESULT(no)) |
| 771 | |
| 772 | dnl ------------------------ |
| 773 | dnl check struct sockaddr_dl |
| 774 | dnl ------------------------ |
| 775 | AC_MSG_CHECKING(whether struct sockaddr_dl exist) |
| 776 | AC_EGREP_HEADER(sockaddr_dl, |
| 777 | net/if_dl.h, |
| 778 | [AC_MSG_RESULT(yes) |
| 779 | AC_DEFINE(HAVE_SOCKADDR_DL,,sockaddr_dl)], |
| 780 | AC_MSG_RESULT(no)) |
| 781 | |
| 782 | dnl -------------------------- |
| 783 | dnl check structure ifaliasreq |
| 784 | dnl -------------------------- |
| 785 | AC_MSG_CHECKING(whether struct ifaliasreq exist) |
| 786 | AC_EGREP_HEADER(ifaliasreq, |
| 787 | net/if.h, |
| 788 | [AC_MSG_RESULT(yes) |
| 789 | AC_DEFINE(HAVE_IFALIASREQ,,ifaliasreq)], |
| 790 | AC_MSG_RESULT(no)) |
| 791 | |
| 792 | dnl ---------------------------- |
| 793 | dnl check structure in6_aliasreq |
| 794 | dnl ---------------------------- |
| 795 | AC_MSG_CHECKING(whether struct if6_aliasreq exist) |
| 796 | AC_EGREP_HEADER(in6_aliasreq, |
| 797 | netinet6/in6_var.h, |
| 798 | [AC_MSG_RESULT(yes) |
| 799 | AC_DEFINE(HAVE_IN6_ALIASREQ,,in6_aliasreq)], |
| 800 | AC_MSG_RESULT(no)) |
| 801 | |
| 802 | dnl --------------------------- |
| 803 | dnl check structure rt_addrinfo |
| 804 | dnl --------------------------- |
| 805 | AC_MSG_CHECKING(whether struct rt_addrinfo exist) |
| 806 | AC_EGREP_HEADER(rt_addrinfo, |
| 807 | net/route.h, |
| 808 | [AC_MSG_RESULT(yes) |
| 809 | AC_DEFINE(HAVE_RT_ADDRINFO,,rt_addrinfo)], |
| 810 | AC_MSG_RESULT(no)) |
| 811 | |
| 812 | dnl -------------------------- |
| 813 | dnl check structure in_pktinfo |
| 814 | dnl -------------------------- |
| 815 | AC_MSG_CHECKING(whether struct in_pktinfo exist) |
| 816 | AC_TRY_COMPILE([#include <netinet/in.h> |
| 817 | ],[struct in_pktinfo ac_x;], |
| 818 | [AC_MSG_RESULT(yes) |
| 819 | AC_DEFINE(HAVE_INPKTINFO,,in_pktinfo)], |
| 820 | AC_MSG_RESULT(no)) |
| 821 | |
| 822 | dnl -------------------------------------- |
| 823 | dnl checking for getrusage struct and call |
| 824 | dnl -------------------------------------- |
| 825 | AC_MSG_CHECKING(whether getrusage is available) |
| 826 | AC_TRY_COMPILE([#include <sys/resource.h> |
| 827 | ],[struct rusage ac_x; getrusage (RUSAGE_SELF, &ac_x);], |
| 828 | [AC_MSG_RESULT(yes) |
| 829 | AC_DEFINE(HAVE_RUSAGE,,rusage)], |
| 830 | AC_MSG_RESULT(no)) |
| 831 | |
| 832 | dnl ------------- |
| 833 | dnl check version |
| 834 | dnl ------------- |
| 835 | file="${srcdir}/lib/version.h" |
| 836 | VERSION=`sed -ne 's/^#.*ZEBRA_VERSION.*\"\([^\"]*\)\"$/\1/p' $file` |
| 837 | AC_SUBST(VERSION) |
| 838 | |
| 839 | dnl ------------------------------ |
| 840 | dnl set paths for process id files |
| 841 | dnl ------------------------------ |
| 842 | AC_CACHE_CHECK(pid file directory,ac_piddir, |
| 843 | [for ZEBRA_PID_DIR in /var/run dnl |
| 844 | /var/adm dnl |
| 845 | /etc dnl |
| 846 | /dev/null; |
| 847 | do |
| 848 | test -d $ZEBRA_PID_DIR && break |
| 849 | done |
| 850 | ac_piddir=$ZEBRA_PID_DIR |
| 851 | if test $ZEBRA_PID_DIR = "/dev/null"; then |
| 852 | echo "PID DIRECTORY NOT FOUND!" |
| 853 | fi]) |
| 854 | AC_DEFINE_UNQUOTED(PATH_ZEBRA_PID, "$ac_piddir/zebra.pid",zebra PID) |
| 855 | AC_DEFINE_UNQUOTED(PATH_RIPD_PID, "$ac_piddir/ripd.pid",ripd PID) |
| 856 | AC_DEFINE_UNQUOTED(PATH_RIPNGD_PID, "$ac_piddir/ripngd.pid",ripngd PID) |
| 857 | AC_DEFINE_UNQUOTED(PATH_BGPD_PID, "$ac_piddir/bgpd.pid",bgpd PID) |
| 858 | AC_DEFINE_UNQUOTED(PATH_OSPFD_PID, "$ac_piddir/ospfd.pid",ospfd PID) |
| 859 | AC_DEFINE_UNQUOTED(PATH_OSPF6D_PID, "$ac_piddir/ospf6d.pid",ospf6d PID) |
| 860 | |
paul | 23bd12c | 2003-04-07 06:11:09 +0000 | [diff] [blame] | 861 | dnl ------------------------------ |
| 862 | dnl set paths for socket files |
| 863 | dnl ------------------------------ |
| 864 | if test "${prefix}" = "NONE"; then |
| 865 | ac_sock_prefix=""; |
| 866 | else |
| 867 | ac_sock_prefix=${prefix} |
| 868 | fi |
| 869 | if test "${localstatedir}" = '${prefix}/var'; then |
| 870 | AC_CACHE_CHECK(socket directory,ac_sockdir, |
| 871 | [for ZEBRA_SOCK_DIR in ${ac_sock_prefix}/var/run/zebra dnl |
| 872 | ${ac_sock_prefix}/var/run dnl |
| 873 | ${ac_sock_prefix}/var/adm dnl |
| 874 | ${ac_sock_prefix}/tmp; dnl |
| 875 | do |
| 876 | test -d $ZEBRA_SOCK_DIR && break |
| 877 | done |
| 878 | ac_sockdir=$ZEBRA_SOCK_DIR |
| 879 | if test ! -d $ZEBRA_SOCK_DIR ; then |
| 880 | echo "SOCKET DIRECTORY NOT FOUND!" |
| 881 | fi]) |
| 882 | else |
| 883 | ac_sockdir="`eval echo ${localstatedir}`" |
| 884 | fi |
| 885 | AC_DEFINE_UNQUOTED(ZEBRA_SERV_PATH, "$ac_sockdir/zserv.api",zebra api socket) |
| 886 | AC_DEFINE_UNQUOTED(ZEBRA_VTYSH_PATH, "$ac_sockdir/zebra.vty",zebra vty socket) |
| 887 | AC_DEFINE_UNQUOTED(RIP_VTYSH_PATH, "$ac_sockdir/ripd.vty",rip vty socket) |
| 888 | AC_DEFINE_UNQUOTED(RIPNG_VTYSH_PATH, "$ac_sockdir/ripngd.vty",ripng vty socket) |
| 889 | AC_DEFINE_UNQUOTED(BGP_VTYSH_PATH, "$ac_sockdir/bgpd.vty",bgpd vty socket) |
| 890 | AC_DEFINE_UNQUOTED(OSPF_VTYSH_PATH, "$ac_sockdir/ospfd.vty",ospfd vty socket) |
| 891 | AC_DEFINE_UNQUOTED(OSPF6_VTYSH_PATH, "$ac_sockdir/ospf6d.vty",ospf6d vty socket) |
paul | 7ea487b | 2003-03-17 02:05:07 +0000 | [diff] [blame] | 892 | |
| 893 | dnl --------------------------- |
| 894 | dnl Check htonl works correctly |
| 895 | dnl --------------------------- |
| 896 | AC_MSG_CHECKING(for working htonl) |
| 897 | AC_CACHE_VAL(ac_cv_htonl_works, [ |
| 898 | AC_TRY_LINK([#ifdef HAVE_SYS_TYPES_H |
| 899 | #include <sys/types.h> |
| 900 | #endif |
| 901 | #ifdef HAVE_NETDB_H |
| 902 | #include <netdb.h> |
| 903 | #endif |
| 904 | #ifdef HAVE_NETINET_IN_H |
| 905 | #include <netinet/in.h> |
| 906 | #endif], |
| 907 | [htonl (0);], |
| 908 | ac_cv_htonl_works=yes, |
| 909 | ac_cv_htonl_works=no)]) |
| 910 | AC_MSG_RESULT($ac_cv_htonl_works) |
| 911 | |
| 912 | AC_OUTPUT(Makefile lib/Makefile zebra/Makefile ripd/Makefile ripngd/Makefile bgpd/Makefile ospfd/Makefile ospf6d/Makefile vtysh/Makefile doc/Makefile ospfclient/Makefile) |
| 913 | |
| 914 | echo " |
| 915 | zebra configuration |
| 916 | ------------------- |
| 917 | zebra version : ${VERSION} |
| 918 | host operationg system : ${host_os} |
| 919 | source code location : ${srcdir} |
| 920 | compiler : ${CC} |
| 921 | compiler flags : ${CFLAGS} |
| 922 | directory for pid files : ${ac_piddir} |
| 923 | " |