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