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