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