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