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