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