## Copyright (c) 1996, 97, 98, 99, 2000 Kunihiro Ishiguro <kunihiro@zebra.org>
## Portions Copyright (c) 2003 Paul Jakma <paul@dishone.st>
##
+## $Id: configure.ac,v 1.113 2005/09/29 14:39:32 paul Exp $
AC_PREREQ(2.53)
-AC_INIT(quagga, 0.96.4, [bug-zebra@gnu.org])
+AC_INIT(Quagga, 0.99.1, [http://bugzilla.quagga.net])
AC_CONFIG_SRCDIR(lib/zebra.h)
-AM_INIT_AUTOMAKE()
+
+dnl -----------------------------------
+dnl Get hostname and other information.
+dnl -----------------------------------
+AC_CANONICAL_BUILD()
+AC_CANONICAL_HOST()
+AC_CANONICAL_TARGET()
+
+AM_INIT_AUTOMAKE(1.6)
AM_CONFIG_HEADER(config.h)
+dnl we need gawk for memtypes.awk
+AC_CHECK_PROG([GAWK],[gawk],[gawk],[/bin/false])
+AC_ARG_VAR([GAWK],[GNU AWK])
+
dnl default is to match previous behavior
exampledir=${sysconfdir}
AC_ARG_ENABLE([exampledir],
dnl XXX add --exampledir to autoconf standard directory list somehow
AC_SUBST(exampledir)
-dnl -----------------------------------
-dnl Get hostname and other information.
-dnl -----------------------------------
-AC_CANONICAL_HOST
+dnl default is to match previous behavior
+pkgsrcrcdir=""
+pkgsrcdir=""
+AC_ARG_ENABLE([pkgsrcrcdir],
+ AC_HELP_STRING([--enable-pkgsrcrcdir],
+ [specify directory for rc.d scripts]),
+ pkgsrcrcdir="$enableval"; pkgsrcdir="pkgsrc",)
+dnl XXX add --pkgsrcrcdir to autoconf standard directory list somehow
+AC_SUBST(pkgsrcdir)
+AC_SUBST(pkgsrcrcdir)
dnl ------------
dnl Check CFLAGS
cflags_specified=yes ;
fi
-dnl --------
-dnl Check CC
-dnl --------
+dnl --------------------
+dnl Check CC and friends
+dnl --------------------
AC_PROG_CC
+AC_PROG_CPP
+AC_PROG_EGREP
+
+dnl ------------------------------------------------------------------
+dnl Intel compiler check. Although Intel tries really hard to make icc
+dnl look like gcc, there are some differences. It's very verbose with
+dnl -Wall and it doesn't support the individual -W options.
+dnl ------------------------------------------------------------------
+AC_MSG_CHECKING([whether we are using the Intel compiler])
+AC_EGREP_CPP([^__INTEL_COMPILER], [__INTEL_COMPILER],
+ ICC="no"
+ AC_MSG_RESULT([no]),
+ ICC="yes"
+ AC_MSG_RESULT([yes])
+)
-dnl -----------------------------------------
+dnl ---------------------------------------------
dnl If CLFAGS doesn\'t exist set default value
-dnl -----------------------------------------
+dnl AC_PROG_CC will have set minimal default
+dnl already, eg "-O2 -g" for gcc, "-g" for others
+dnl (Wall is gcc specific... have to make sure
+dnl gcc is being used before setting it)
+dnl Intel icc 8.0 also sets __GNUC__, but
+dnl doesn't support all these fancy -W options.
+dnl ---------------------------------------------
+dnl
if test "x$cflags_specified" = "x" ; then
- CFLAGS="$CFLAGS -Wall"
+ if test "x${GCC}" = "xyes" && test "x${ICC}" = "xno"; then
+ CFLAGS="-Os -fno-omit-frame-pointer -g -Wall"
+ CFLAGS="${CFLAGS} -Wsign-compare -Wpointer-arith"
+ CFLAGS="${CFLAGS} -Wbad-function-cast -Wwrite-strings"
+ CFLAGS="${CFLAGS} -Wmissing-prototypes -Wmissing-declarations"
+ CFLAGS="${CFLAGS} -Wchar-subscripts -Wcast-qual"
+ fi
+ # TODO: conditionally addd -Wpacked if handled
+fi
+
+dnl ---------------------------------------------------------------------
+dnl Intel compiler warnings we ignore:
+dnl 279: controlling expression is constant.
+dnl 869: parameter "xxx" was never referenced - to avoid massive warnings
+dnl about "self", "vty", "argc" and "argv" never referenced in DEFUN
+dnl macro.
+dnl 981: operands are evaluated in unspecified order.
+dnl ---------------------------------------------------------------------
+
+if test "$ICC" = "yes"; then
+ CFLAGS="-Os -g -Wall -wd 279,869,981"
fi
dnl --------------
dnl Check programs
dnl --------------
-AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_CHECK_TOOL(AR, ar)
dnl ---------
AC_AIX
+dnl -------
+dnl libtool
+dnl -------
+AC_PROG_LIBTOOL
+
dnl ----------------------
dnl Packages configuration
dnl ----------------------
AC_ARG_ENABLE(vtysh,
-[ --enable-vtysh, Make integrated vty shell for Quagga])
+[ --enable-vtysh include integrated vty shell for Quagga])
AC_ARG_ENABLE(ipv6,
[ --disable-ipv6 turn off IPv6 related features and daemons])
AC_ARG_ENABLE(zebra,
[ --disable-ospfd do not build ospfd])
AC_ARG_ENABLE(ospf6d,
[ --disable-ospf6d do not build ospf6d])
+AC_ARG_ENABLE(watchquagga,
+[ --disable-watchquagga do not build watchquagga])
AC_ARG_ENABLE(isisd,
-[ --disable-isisd do not build isisd])
+[ --enable-isisd build isisd])
AC_ARG_ENABLE(bgp-announce,
[ --disable-bgp-announce, turn off BGP route announcement])
AC_ARG_ENABLE(netlink,
[ --with-libpam use libpam for PAM support in vtysh])
AC_ARG_ENABLE(tcp-zebra,
[ --enable-tcp-zebra enable TCP/IP socket connection between zebra and protocol daemon])
-dnl Temporary option until OSPF NSSA implementation complete
-AC_ARG_ENABLE(nssa,
-[ --enable-nssa enable OSPF NSSA option])
AC_ARG_ENABLE(opaque-lsa,
[ --enable-opaque-lsa enable OSPF Opaque-LSA with OSPFAPI support (RFC2370)])
AC_ARG_ENABLE(ospfapi,
AC_ARG_ENABLE(quagga_group,
[ --enable-group=ARG group to run Quagga suite as (default quagga)])
AC_ARG_ENABLE(vty_group,
-[ --enable-vty-group=ARG set vty sockets to have specified group as owner])
+[ --enable-vty-group=ARG set vty sockets to have specified group as owner])
AC_ARG_ENABLE(configfile_mask,
[ --enable-configfile-mask=ARG set mask for config files])
AC_ARG_ENABLE(logfile_mask,
[ --enable-logfile-mask=ARG set mask for log files])
AC_ARG_ENABLE(rtadv,
-[ --disable-rtadv disable IPV6 router advertisement feature])
+[ --disable-rtadv disable IPV6 router advertisement feature])
+AC_ARG_ENABLE(irdp,
+[ --enable-irdp enable IRDP server support in zebra])
+AC_ARG_ENABLE(isis_topology,
+[ --enable-isis-topology enable IS-IS topology generator])
+AC_ARG_ENABLE(capabilities,
+[ --disable-capabilities disable using POSIX capabilities])
+AC_ARG_ENABLE(gcc_ultra_verbose,
+[ --enable-gcc-ultra-verbose enable ultra verbose GCC warnings])
+AC_ARG_ENABLE(gcc-rdynamic,
+[ --enable-gcc-rdynamic enable gcc linking with -rdynamic for better backtraces])
+AC_ARG_ENABLE(time-check,
+[ --disable-time-check disable slow thread warning messages])
+
+if test x"${enable_gcc_ultra_verbose}" = x"yes" ; then
+ CFLAGS="${CFLAGS} -W -Wcast-qual -Wstrict-prototypes"
+ CFLAGS="${CFLAGS} -Wmissing-declarations -Wmissing-noreturn"
+ CFLAGS="${CFLAGS} -Wmissing-format-attribute -Wunreachable-code"
+ CFLAGS="${CFLAGS} -Wpacked -Wpadded"
+fi
+
+if test x"${enable_gcc_rdynamic}" = x"yes" ; then
+ LDFLAGS="${LDFLAGS} -rdynamic"
+fi
+
+if test x"${enable_time_check}" != x"no" ; then
+ if test x"${enable_time_check}" = x"yes" -o x"${enable_time_check}" = x ; then
+ AC_DEFINE(CONSUMED_TIME_CHECK,5000000,Consumed Time Check)
+ else
+ AC_DEFINE_UNQUOTED(CONSUMED_TIME_CHECK,$enable_time_check,Consumed Time Check)
+ fi
+fi
if test "${enable_broken_aliases}" = "yes"; then
if test "${enable_netlink}" = "yes"
AC_DEFINE(HAVE_TCP_ZEBRA,,Use TCP for zebra communication)
fi
-if test "${enable_nssa}" = "yes"; then
- AC_DEFINE(HAVE_NSSA,,OSPF NSSA)
-fi
-
if test "${enable_opaque_lsa}" = "yes"; then
AC_DEFINE(HAVE_OPAQUE_LSA,,OSPF Opaque LSA)
fi
AC_MSG_RESULT(no)
fi
+if test "${enable_irdp}" = "yes"; then
+ AC_DEFINE(HAVE_IRDP,, IRDP )
+fi
+
+if test "${enable_isisd}" = "yes" && test "${enable_isis_topology}" = yes; then
+ AC_DEFINE(TOPOLOGY_GENERATE,,Enable IS-IS topology generator code)
+ ISIS_TOPOLOGY_INCLUDES="-I./topology"
+ ISIS_TOPOLOGY_DIR="topology"
+ ISIS_TOPOLOGY_LIB="./topology/libtopology.a"
+fi
+
+AC_SUBST(ISIS_TOPOLOGY_INCLUDES)
+AC_SUBST(ISIS_TOPOLOGY_DIR)
+AC_SUBST(ISIS_TOPOLOGY_LIB)
+
if test "${enable_user}" = "yes" || test x"${enable_user}" = x""; then
enable_user="quagga"
elif test "${enable_user}" = "no"; then
enable_user="root"
fi
-AC_DEFINE_UNQUOTED(QUAGGA_USER, "${enable_user}", Quagga User)
if test "${enable_group}" = "yes" || test x"${enable_group}" = x""; then
enable_group="quagga"
elif test "${enable_group}" = "no"; then
enable_group="root"
fi
-AC_DEFINE_UNQUOTED(QUAGGA_GROUP, "${enable_group}", Quagga Group)
if test x"${enable_vty_group}" = x"yes" ; then
AC_MSG_ERROR([--enable-vty-group requires a group as argument, not yes])
AC_DEFINE_UNQUOTED(VTY_GROUP, "${enable_vty_group}", VTY Sockets Group)
fi
fi
+AC_SUBST([enable_user])
+AC_SUBST([enable_group])
+AC_SUBST([enable_vty_group])
+AC_DEFINE_UNQUOTED(QUAGGA_USER, "${enable_user}", Quagga User)
+AC_DEFINE_UNQUOTED(QUAGGA_GROUP, "${enable_group}", Quagga Group)
enable_configfile_mask=${enable_configfile_mask:-0600}
AC_DEFINE_UNQUOTED(CONFIGFILE_MASK, ${enable_configfile_mask}, Mask for config files)
AC_CHECK_HEADERS([string.h stropts.h sys/conf.h sys/ksym.h sys/time.h \
sys/times.h sys/select.h sys/sysctl.h sys/sockio.h \
sys/types.h linux/version.h kvm.h netdb.h asm/types.h \
- libutil.h limits.h])
+ sys/param.h libutil.h limits.h])
AC_CHECK_HEADERS([sys/socket.h netinet/in_systm.h netinet/in.h \
net/if_dl.h net/netopt.h inet/nd.h net/route.h \
dnl Some systems (Solaris 2.x) require libnsl (Network Services Library)
case "$host" in
- *-sunos5.6* | *-solaris2.6*)
+ [*-sunos5.[6-7]*] | [*-solaris2.[6-7]*])
opsys=sol2-6
- AC_DEFINE(SUNOS_5,,SunOS 5)
+ AC_DEFINE(SUNOS_56, 1, SunOS 5.6 to 5.7)
+ AC_DEFINE(SUNOS_5, 1, SunOS 5)
AC_CHECK_LIB(xnet, main)
CURSES=-lcurses
;;
+ [*-sunos5.[8-9]] \
+ | [*-sunos5.1[0-9]] \
+ | [*-sunos5.1[0-9].[0-9]] \
+ | [*-solaris2.[8-9]] \
+ | [*-solaris2.1[0-9]] \
+ | [*-solaris2.1[0-9].[0-9]])
+ opsys=sol8
+ AC_DEFINE(SUNOS_59,,SunOS 5.8 up)
+ AC_DEFINE(SUNOS_5, 1, SunOS 5)
+ AC_CHECK_LIB(socket, main)
+ AC_CHECK_LIB(nsl, main)
+ AC_CHECK_LIB(umem, main)
+ CURSES=-lcurses
+ ;;
*-sunos5* | *-solaris2*)
- AC_DEFINE(SUNOS_5,,SunOS 5)
+ AC_DEFINE(SUNOS_5,,SunOS 5, Unknown SunOS)
AC_CHECK_LIB(socket, main)
AC_CHECK_LIB(nsl, main)
CURSES=-lcurses
;;
- *-linux-*)
+ *-linux*)
opsys=gnu-linux
AC_DEFINE(GNU_LINUX,,GNU Linux)
;;
AC_CHECK_LIB(nsl, gethostbyname)
AC_CHECK_LIB(socket, socket)
;;
- *-freebsd3.2)
- AC_DEFINE(FREEBSD_32,,FreeBSD 3.2)
- ;;
*-openbsd*)
opsys=openbsd
AC_DEFINE(OPEN_BSD,,OpenBSD)
case "${enable_vtysh}" in
"yes") VTYSH="vtysh";
AC_DEFINE(VTYSH,,VTY shell)
- AC_CHECK_LIB(tinfo, tputs, , AC_CHECK_LIB(ncurses, tputs))
- AC_CHECK_LIB(readline, main)
+ AC_PATH_PROG(PERL, perl)
+dnl Vtysh uses libreadline, which looks for termcap functions at
+dnl configure time. We follow readline's search order.
+dnl The required procedures are in libtermcap on NetBSD, in
+dnl [TODO] on Linux, and in [TODO] on Solaris.
+ AC_CHECK_LIB(termcap, tputs, LIBREADLINE="$LIBREADLINE -ltermcap",
+ [AC_CHECK_LIB(tinfo, tputs, LIBREADLINE="$LIBREADLINE -ltinfo",
+ [AC_CHECK_LIB(curses, tputs, LIBREADLINE="$LIBREADLINE -lcurses",
+ [AC_CHECK_LIB(ncurses, tputs,
+ LIBREADLINE="$LIBREADLINE -lncurses")]
+ )]
+ )]
+ )
+ AC_CHECK_LIB(readline, main, LIBREADLINE="$LIBREADLINE -lreadline",,
+ "$LIBREADLINE")
if test $ac_cv_lib_readline_main = no; then
- AC_MSG_ERROR([vtysh needs libreadline but was not found on your system.])
+ AC_MSG_ERROR([vtysh needs libreadline but was not found and usable on your system.])
fi
AC_CHECK_HEADER(readline/history.h)
if test $ac_cv_header_readline_history_h = no;then
AC_MSG_ERROR([readline is too old to have readline/history.h, please update to the latest readline library.])
fi
- AC_CHECK_LIB(readline, rl_completion_matches)
+ AC_CHECK_LIB(readline, rl_completion_matches,
+ LIBREADLINE="$LIBREADLINE",, "$LIBREADLINE")
if test $ac_cv_lib_readline_rl_completion_matches = no; then
AC_DEFINE(rl_completion_matches,completion_matches,Old readline)
fi
"no" ) VTYSH="";;
* ) ;;
esac
+AC_SUBST(LIBREADLINE)
dnl ----------
dnl PAM module
dnl ----------------------------
AC_CHECK_FUNCS(memset memcpy strerror inet_aton daemon snprintf vsnprintf \
strlcat strlcpy if_nametoindex if_indextoname getifaddrs \
- fcntl)
+ fcntl strnlen strndup)
AC_CHECK_FUNCS(setproctitle, ,
[AC_CHECK_LIB(util, setproctitle,
[LIBS="$LIBS -lutil"
AC_DEFINE(HAVE_NETLINK,,netlink)
netlink=yes
fi
+elif test x"$opsys" = x"sol2-6";then
+ AC_MSG_RESULT(Route socket)
+ KERNEL_METHOD="kernel_socket.o"
+ RT_METHOD="rt_socket.o"
+elif test x"$opsys" = x"sol8";then
+ AC_MSG_RESULT(Route socket)
+ KERNEL_METHOD="kernel_socket.o"
+ RT_METHOD="rt_socket.o"
+elif test "$opsys" = "irix" ; then
+ AC_MSG_RESULT(Route socket)
+ KERNEL_METHOD="kernel_socket.o"
+ RT_METHOD="rt_socket.o"
else
- if test "$opsys" = "sol2-6";then
- AC_MSG_RESULT(solaris)
- KERNEL_METHOD="kernel_socket.o"
- RT_METHOD="rt_socket.o"
- elif test "$opsys" = "irix" ; then
- AC_MSG_RESULT(irix)
- KERNEL_METHOD="kernel_socket.o"
- RT_METHOD="rt_socket.o"
- else
- AC_TRY_RUN([#include <errno.h>
+ AC_TRY_RUN([#include <errno.h>
#include <sys/types.h>
#include <sys/socket.h>
[KERNEL_METHOD=kernel_socket.o
RT_METHOD=rt_socket.o
AC_MSG_RESULT(socket)])
- fi
fi
AC_SUBST(RT_METHOD)
AC_SUBST(KERNEL_METHOD)
AC_SUBST(OTHER_METHOD)
+dnl ------------------------------------
+dnl check for broken CMSG_FIRSTHDR macro
+dnl ------------------------------------
+AC_MSG_CHECKING(for broken CMSG_FIRSTHDR)
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#ifdef SUNOS_5
+#define _XPG4_2
+#define __EXTENSIONS__
+#endif
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+
+main()
+{
+ struct msghdr msg;
+ char buf[4];
+
+ msg.msg_control = buf;
+ msg.msg_controllen = 0;
+
+ if (CMSG_FIRSTHDR(&msg) != NULL)
+ exit(0);
+ exit (1);
+}]])],[AC_MSG_RESULT(yes - using workaround) AC_DEFINE(HAVE_BROKEN_CMSG_FIRSTHDR,,Broken CMSG_FIRSTHDR)],
+[AC_MSG_RESULT(no)],[AC_MSG_RESULT(no)])
+
dnl ------------------------------
dnl check kernel route read method
dnl ------------------------------
dnl -----------------------------
dnl check interface lookup method
dnl -----------------------------
+IOCTL_METHOD=ioctl.o
AC_MSG_CHECKING(interface looking up method)
if test "$netlink" = yes; then
AC_MSG_RESULT(netlink)
IF_METHOD=if_netlink.o
-else
- if test "$opsys" = "sol2-6";then
- AC_MSG_RESULT(solaris)
- IF_METHOD=if_ioctl.o
- elif test "$opsys" = "irix" ; then
- AC_MSG_RESULT(irix)
- IF_METHOD=if_ioctl.o
- elif test "$opsys" = "openbsd";then
- AC_MSG_RESULT(openbsd)
- IF_METHOD=if_ioctl.o
- elif grep NET_RT_IFLIST /usr/include/sys/socket.h >/dev/null 2>&1; then
- AC_MSG_RESULT(sysctl)
+elif test "$opsys" = "sol2-6";then
+ AC_MSG_RESULT(Solaris GIF)
+ IF_METHOD=if_ioctl.o
+elif test "$opsys" = "sol8";then
+ AC_MSG_RESULT(Solaris GLIF)
+ IF_METHOD=if_ioctl_solaris.o
+ IOCTL_METHOD=ioctl_solaris.o
+elif test "$opsys" = "irix" ; then
+ AC_MSG_RESULT(IRIX)
+ IF_METHOD=if_ioctl.o
+elif test "$opsys" = "openbsd";then
+ AC_MSG_RESULT(openbsd)
+ IF_METHOD=if_ioctl.o
+elif grep NET_RT_IFLIST /usr/include/sys/socket.h >/dev/null 2>&1; then
+ AC_MSG_RESULT(sysctl)
IF_METHOD=if_sysctl.o
AC_DEFINE(HAVE_NET_RT_IFLIST,,NET_RT_IFLIST)
- else
+else
AC_MSG_RESULT(ioctl)
IF_METHOD=if_ioctl.o
- fi
fi
AC_SUBST(IF_METHOD)
+AC_SUBST(IOCTL_METHOD)
+
+dnl ---------------------------------------------------------------
+dnl figure out how to specify an interface in multicast sockets API
+dnl ---------------------------------------------------------------
+AC_CHECK_MEMBERS([struct ip_mreqn.imr_ifindex],,,[#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif])
+
+AC_MSG_CHECKING([for BSD struct ip_mreq hack])
+AC_TRY_COMPILE([#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif],[#if (defined(__FreeBSD__) && (__FreeBSD_version >= 500022 || (__FreeBSD_version < 500000 && __FreeBSD_version >= 440000))) || (defined(__NetBSD__) && defined(__NetBSD_Version__) && __NetBSD_Version__ >= 106010000)
+ return (0);
+#else
+ #error No support for BSD struct ip_mreq hack detected
+#endif],[AC_MSG_RESULT(yes)
+AC_DEFINE(HAVE_BSD_STRUCT_IP_MREQ_HACK,,[Can pass ifindex in struct ip_mreq])],
+AC_MSG_RESULT(no))
dnl -----------------------
dnl check proc file system.
else
AC_MSG_RESULT(NRL)
fi
+dnl ------------------------------------
+dnl Solaris 9, 10 and potentially higher
+dnl ------------------------------------
+ elif test x"$opsys" = x"sol8"; then
+ zebra_cv_ipv6=yes;
+ AC_DEFINE(HAVE_IPV6, 1, IPv6)
+ AC_DEFINE(SOLARIS_IPV6, 1, Solaris IPv6)
+ RIPNGD="ripngd"
+ OSPF6D="ospf6d"
+ AC_MSG_RESULT(Solaris IPv6)
dnl ----------
dnl Linux IPv6
dnl ----------
fi
fi
+ if test "$zebra_cv_linux_ipv6" = "yes";then
+ AC_MSG_CHECKING(whether libc has IPv6 support)
+ AC_TRY_LINK([#include <netinet/in.h>
+ ],[ int a; a = (int) in6addr_any.s6_addr[0]; if (a != 12345) return a; ],
+ [AC_MSG_RESULT(yes)
+ zebra_cv_ipv6=yes
+ zebra_cv_linux_ipv6=yes],
+ [AC_MSG_RESULT(no)
+ zebra_cv_ipv6=no
+ zebra_cv_linux_ipv6=no])
+ fi
+
if test "$zebra_cv_linux_ipv6" = "yes";then
AC_MSG_CHECKING(for GNU libc >= 2.1)
AC_DEFINE(HAVE_IPV6,1,Linux IPv6)
OSPFD="ospfd"
fi
+if test "${enable_watchquagga}" = "no";then
+ WATCHQUAGGA=""
+else
+ WATCHQUAGGA="watchquagga"
+fi
+
OSPFCLIENT=""
if test "${enable_opaque_lsa}" = "yes"; then
if test "${enable_ospfapi}" != "no";then
case "${enable_isisd}" in
"yes") ISISD="isisd";;
"no" ) ISISD="";;
- * ) ISISD="isisd";;
+ * ) ;;
esac
if test "${enable_bgp_announce}" = "no";then
AC_SUBST(RIPNGD)
AC_SUBST(OSPFD)
AC_SUBST(OSPF6D)
+AC_SUBST(WATCHQUAGGA)
AC_SUBST(ISISD)
AC_SUBST(VTYSH)
AC_SUBST(INCLUDES)
AC_DEFINE(HAVE_SNMP,,SNMP)
AC_DEFINE(HAVE_NETSNMP,,SNMP)
AC_DEFINE(UCD_COMPATIBLE,,SNMP)
- CFLAGS="${CFLAGS} -I/usr/include/net-snmp -I/usr/include/net-snmp/library"
+ SNMP_INCLUDES="${SNMP_INCLUDES} -I/usr/include/net-snmp -I/usr/include/net-snmp/library"
if test "${HAVE_NETSNMP}" = "yes"; then
LIBS="${LIBS} -lnetsnmp"
else
;;
/usr/include/ucd-snmp/*)
AC_DEFINE(HAVE_SNMP,,SNMP)
- CFLAGS="${CFLAGS} -I/usr/include/ucd-snmp"
+ SNMP_INCLUDES="${SNMP_INCLUDES} -I/usr/include/ucd-snmp"
LIBS="${LIBS} -lsnmp"
;;
/usr/local/include/ucd-snmp/*)
AC_DEFINE(HAVE_SNMP,,SNMP)
- CFLAGS="${CFLAGS} -I/usr/local/include/ucd-snmp"
+ SNMP_INCLUDES="${SNMP_INCLUDES} -I/usr/local/include/ucd-snmp"
LIBS="${LIBS} -L/usr/local/lib -lsnmp"
;;
/usr/local/include/net-snmp/*)
AC_DEFINE(HAVE_SNMP,,SNMP)
AC_DEFINE(HAVE_NET_SNMP,,SNMP)
AC_DEFINE(UCD_COMPATIBLE,,SNMP)
- CFLAGS="${CFLAGS} -I/usr/local/include/net-snmp"
+ SNMP_INCLUDES="${SNMP_INCLUDES} -I/usr/local/include/net-snmp"
LIBS="${LIBS} -L/usr/local/lib -lnetsnmp"
;;
esac
fi
fi
+if test "${enable_snmp}" = "yes" -a "${HAVE_SNMP}" != "yes"; then
+ AC_MSG_ERROR([--enable-snmp given, but cannot find support for SNMP])
+fi
+
+AC_SUBST(SNMP_INCLUDES)
+
dnl ----------------------------
dnl check sa_len of sockaddr
dnl ----------------------------
AC_DEFINE(HAVE_INPKTINFO,,in_pktinfo)],
AC_MSG_RESULT(no))
+dnl ----------------------------------
+dnl check struct nd_opt_homeagent_info
+dnl ----------------------------------
+AC_MSG_CHECKING(whether struct nd_opt_homeagent_info exist)
+AC_EGREP_HEADER(nd_opt_homeagent_info,
+netinet/icmp6.h,
+[AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_ND_OPT_HOMEAGENT_INFO,,nd_opt_homeagent_info)],
+ AC_MSG_RESULT(no))
+
+dnl --------------------------------
+dnl check struct nd_opt_adv_interval
+dnl --------------------------------
+AC_MSG_CHECKING(whether struct nd_opt_adv_interval exist)
+AC_EGREP_HEADER(nd_opt_adv_interval,
+netinet/icmp6.h,
+[AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_ND_OPT_ADV_INTERVAL,,nd_opt_adv_interval)],
+ AC_MSG_RESULT(no))
+
+dnl ------------------------------------
+dnl check fields in nd_opt_adv_interval
+dnl ------------------------------------
+AC_MSG_CHECKING(whether nd_opt_ai_type field exist)
+AC_EGREP_HEADER(nd_opt_ai_type,
+netinet/icmp6.h,
+[AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_ND_OPT_ADV_INTERVAL_AI_FIELDS,,nd_opt_ai_type)],
+ AC_MSG_RESULT(no))
+
dnl --------------------------------------
dnl checking for getrusage struct and call
dnl --------------------------------------
dnl -------------------
dnl capabilities checks
dnl -------------------
-AC_MSG_CHECKING(whether prctl PR_SET_KEEPCAPS is available)
-AC_TRY_COMPILE([#include <sys/prctl.h>],[prctl(PR_SET_KEEPCAPS, 1, 0, 0, 0);],
- [AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_PR_SET_KEEPCAPS,,prctl)
- quagga_ac_keepcaps="yes"],
- AC_MSG_RESULT(no)
-)
-if test x"${quagga_ac_keepcaps}" = x"yes"; then
- AC_CHECK_HEADERS(sys/capability.h)
-fi
-if test x"${ac_cv_header_sys_capability_h}" = x"yes"; then
- AC_CHECK_LIB(cap, cap_init,
- [AC_DEFINE(HAVE_LCAPS,1,Capabilities)
- LIBCAP="-lcap"
- ]
+if test "${enable_capabilities}" != "no"; then
+ AC_MSG_CHECKING(whether prctl PR_SET_KEEPCAPS is available)
+ AC_TRY_COMPILE([#include <sys/prctl.h>],[prctl(PR_SET_KEEPCAPS, 1, 0, 0, 0);],
+ [AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_PR_SET_KEEPCAPS,,prctl)
+ quagga_ac_keepcaps="yes"],
+ AC_MSG_RESULT(no)
)
+ if test x"${quagga_ac_keepcaps}" = x"yes"; then
+ AC_CHECK_HEADERS(sys/capability.h)
+ fi
+ if test x"${ac_cv_header_sys_capability_h}" = x"yes"; then
+ AC_CHECK_LIB(cap, cap_init,
+ [AC_DEFINE(HAVE_LCAPS,1,Capabilities)
+ LIBCAP="-lcap"
+ quagga_ac_lcaps="yes"]
+ )
+ else
+ AC_CHECK_HEADERS(priv.h,
+ [AC_MSG_CHECKING(Solaris style privileges are available)
+ AC_TRY_COMPILE([#include <priv.h>],[getpflags(PRIV_AWARE);],
+ [AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_SOLARIS_CAPABILITIES,1,getpflags)
+ quagga_ac_scaps="yes"],
+ AC_MSG_RESULT(no)
+ )
+ ]
+ )
+ fi
+ if test x"${quagga_ac_scaps}" = x"yes" \
+ -o x"${quagga_ac_lcaps}" = x"yes"; then
+ AC_DEFINE(HAVE_CAPABILITIES,1,capabilities)
+ fi
fi
AC_SUBST(LIBCAP)
+dnl -------------------
+dnl test for ucontext.h
+dnl -------------------
+AC_CHECK_HEADERS(ucontext.h)
+
dnl ---------------------------
dnl check for glibc 'backtrace'
dnl ---------------------------
quagga_statedir=${localstatedir}
AC_MSG_CHECKING(directory to use for state file)
AC_MSG_RESULT(${quagga_statedir})
+ AC_SUBST(quagga_statedir)
fi
if test $quagga_statedir = "/dev/null"; then
AC_MSG_ERROR('STATE DIRECTORY NOT FOUND! FIX OR SPECIFY --localstatedir!')
AC_DEFINE_UNQUOTED(PATH_OSPFD_PID, "$quagga_statedir/ospfd.pid",ospfd PID)
AC_DEFINE_UNQUOTED(PATH_OSPF6D_PID, "$quagga_statedir/ospf6d.pid",ospf6d PID)
AC_DEFINE_UNQUOTED(PATH_ISISD_PID, "$quagga_statedir/isisd.pid",isisd PID)
+AC_DEFINE_UNQUOTED(PATH_WATCHQUAGGA_PID, "$quagga_statedir/watchquagga.pid",watchquagga PID)
AC_DEFINE_UNQUOTED(ZEBRA_SERV_PATH, "$quagga_statedir/zserv.api",zebra api socket)
AC_DEFINE_UNQUOTED(ZEBRA_VTYSH_PATH, "$quagga_statedir/zebra.vty",zebra vty socket)
AC_DEFINE_UNQUOTED(RIP_VTYSH_PATH, "$quagga_statedir/ripd.vty",rip vty socket)
AC_DEFINE_UNQUOTED(OSPF_VTYSH_PATH, "$quagga_statedir/ospfd.vty",ospfd vty socket)
AC_DEFINE_UNQUOTED(OSPF6_VTYSH_PATH, "$quagga_statedir/ospf6d.vty",ospf6d vty socket)
AC_DEFINE_UNQUOTED(ISIS_VTYSH_PATH, "$quagga_statedir/isisd.vty",isisd vty socket)
+AC_DEFINE_UNQUOTED(DAEMON_VTY_DIR, "$quagga_statedir",daemon vty directory)
+
+dnl -------------------------------
+dnl Quagga sources should always be
+dnl current wrt interfaces. Dont
+dnl allow deprecated interfaces to
+dnl be exposed.
+dnl -------------------------------
+AC_DEFINE(QUAGGA_NO_DEPRECATED_INTERFACES, 1, Hide deprecated interfaces)
dnl ---------------------------
dnl Check htonl works correctly
ac_cv_htonl_works=no)])
AC_MSG_RESULT($ac_cv_htonl_works)
-AC_OUTPUT(Makefile lib/Makefile zebra/Makefile ripd/Makefile
- ripngd/Makefile bgpd/Makefile ospfd/Makefile
+AC_CONFIG_FILES([Makefile lib/Makefile zebra/Makefile ripd/Makefile
+ ripngd/Makefile bgpd/Makefile ospfd/Makefile watchquagga/Makefile
ospf6d/Makefile isisd/Makefile vtysh/Makefile doc/Makefile
- ospfclient/Makefile
- redhat/Makefile redhat/quagga.spec
- lib/version.h)
+ ospfclient/Makefile tests/Makefile m4/Makefile redhat/Makefile
+ pkgsrc/Makefile
+ redhat/quagga.spec
+ lib/version.h
+ doc/defines.texi
+ isisd/topology/Makefile
+ pkgsrc/bgpd.sh pkgsrc/ospf6d.sh pkgsrc/ospfd.sh
+ pkgsrc/ripd.sh pkgsrc/ripngd.sh pkgsrc/zebra.sh])
+AC_CONFIG_FILES([solaris/Makefile])
+
+AC_CONFIG_FILES([vtysh/extract.pl],[chmod +x vtysh/extract.pl])
+## Hack, but working solution to avoid rebuilding of quagga.info.
+## It's already in CVS until texinfo 4.7 is more common.
+AC_CONFIG_COMMANDS([info-time],[touch doc/quagga.info])
+AC_OUTPUT
echo "
-zebra configuration
--------------------
-quagga version : ${PACKAGE_VERSION}
+Quagga configuration
+--------------------
+quagga version : ${PACKAGE_VERSION}
host operationg system : ${host_os}
source code location : ${srcdir}
compiler : ${CC}
compiler flags : ${CFLAGS}
-linker flags : ${LDFLAGS} ${LIBS}
+includes : ${INCLUDES} ${SNMP_INCLUDES}
+linker flags : ${LDFLAGS} ${LIBS} ${LIBCAP} ${LIBREADLINE}
state file directory : ${quagga_statedir}
config file directory : `eval echo \`echo ${sysconfdir}\``
example directory : `eval echo \`echo ${exampledir}\``