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