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