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