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