frr/configure.ac

2238 lines
66 KiB
Plaintext
Raw Normal View History

2003-03-17 03:05:07 +01:00
##
## Configure template file for FRRouting.
2003-03-17 03:05:07 +01:00
## autoconf will generate configure script.
##
## Copyright (c) 1996, 97, 98, 99, 2000 Kunihiro Ishiguro <kunihiro@zebra.org>
## Portions Copyright (c) 2003 Paul Jakma <paul@dishone.st>
2003-03-17 03:05:07 +01:00
##
AC_PREREQ(2.60)
2003-03-17 03:05:07 +01:00
AC_INIT(frr, 6.1-dev, [https://github.com/frrouting/frr/issues])
PACKAGE_URL="https://frrouting.org/"
AC_SUBST(PACKAGE_URL)
PACKAGE_FULLNAME="FRRouting"
AC_SUBST(PACKAGE_FULLNAME)
CONFIG_ARGS="$ac_configure_args"
AC_SUBST(CONFIG_ARGS)
AC_CONFIG_SRCDIR(lib/zebra.h)
AC_CONFIG_MACRO_DIR([m4])
dnl -----------------------------------
dnl Get hostname and other information.
dnl -----------------------------------
AC_CANONICAL_BUILD()
AC_CANONICAL_HOST()
AS_IF([test "$host" != "$build"], [
if test "$srcdir" = "."; then
AC_MSG_ERROR([cross-compilation is only possible with builddir separate from srcdir. create a separate directory and run as .../path-to-frr/configure.])
fi
test -d hosttools || mkdir hosttools
abssrc="`cd \"${srcdir}\"; pwd`"
AC_MSG_NOTICE([...])
AC_MSG_NOTICE([... cross-compilation: creating hosttools directory and self-configuring for build platform tools])
AC_MSG_NOTICE([... use HOST_CPPFLAGS / HOST_CFLAGS / HOST_LDFLAGS if neccessary])
AC_MSG_NOTICE([...])
( CPPFLAGS="$HOST_CPPFLAGS"; \
CFLAGS="$HOST_CFLAGS"; \
LDFLAGS="$HOST_LDFLAGS"; \
cd hosttools; "${abssrc}/configure" "--host=$build" "--build=$build" "--enable-clippy-only" "--disable-nhrpd" "--disable-vtysh"; )
AC_MSG_NOTICE([...])
AC_MSG_NOTICE([... cross-compilation: finished self-configuring for build platform tools])
AC_MSG_NOTICE([...])
build_clippy="false"
HOSTTOOLS="hosttools/"
], [
build_clippy="true"
HOSTTOOLS=""
])
AC_SUBST(HOSTTOOLS)
AM_CONDITIONAL([BUILD_CLIPPY], [$build_clippy])
# Disable portability warnings -- our automake code (in particular
# common.am) uses some constructs specific to gmake.
AM_INIT_AUTOMAKE([1.12 -Wno-portability foreign])
m4_ifndef([AM_SILENT_RULES], [m4_define([AM_SILENT_RULES],[])])
AM_SILENT_RULES([yes])
AC_CONFIG_HEADERS(config.h)
2003-03-17 03:05:07 +01:00
AC_PATH_PROG(PERL, perl)
PKG_PROG_PKG_CONFIG
dnl default is to match previous behavior
exampledir=${sysconfdir}
AC_ARG_ENABLE([exampledir],
AS_HELP_STRING([--enable-exampledir],
[specify alternate directory for examples]),
exampledir="$enableval",)
dnl XXX add --exampledir to autoconf standard directory list somehow
AC_SUBST(exampledir)
dnl default is to match previous behavior
pkgsrcrcdir=""
AC_ARG_ENABLE([pkgsrcrcdir],
AS_HELP_STRING([--enable-pkgsrcrcdir],
[specify directory for rc.d scripts]),
pkgsrcrcdir="$enableval",)
dnl XXX add --pkgsrcrcdir to autoconf standard directory list somehow
AC_SUBST(pkgsrcrcdir)
AM_CONDITIONAL([PKGSRC], [test "x$pkgsrcrcdir" != "x"])
AC_ARG_WITH([moduledir], [AS_HELP_STRING([--with-moduledir=DIR], [module directory (${libdir}/frr/modules)])], [
moduledir="$withval"
], [
moduledir="\${libdir}/frr/modules"
])
AC_SUBST([moduledir], [$moduledir])
AC_ARG_WITH([yangmodelsdir], [AS_HELP_STRING([--with-yangmodelsdir=DIR], [yang models directory (${datarootdir}/yang)])], [
yangmodelsdir="$withval"
], [
yangmodelsdir="\${datarootdir}/yang"
])
AC_SUBST(yangmodelsdir)
AC_ARG_WITH([libyang_pluginsdir], [AS_HELP_STRING([--with-libyang-pluginsdir=DIR], [yangmodule plugins directory (${libdir}/frr/libyang_plugins)])], [
libyang_pluginsdir="$withval"
], [
libyang_pluginsdir="\${libdir}/frr/libyang_plugins"
])
AC_SUBST(libyang_pluginsdir)
AC_ARG_ENABLE(tcmalloc,
AS_HELP_STRING([--enable-tcmalloc], [Turn on tcmalloc]),
[case "${enableval}" in
yes) tcmalloc_enabled=true
LIBS="$LIBS -ltcmalloc_minimal"
;;
no) tcmalloc_enabled=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-tcmalloc) ;;
esac],[tcmalloc_enabled=false])
dnl Thanks autoconf, but we don't want a default -g -O2. We have our own
dnl flag determination logic.
CFLAGS="${CFLAGS:-}"
dnl --------------------
dnl Check CC and friends
dnl --------------------
dnl note orig_cflags is also used further down
orig_cflags="$CFLAGS"
AC_LANG([C])
2003-03-17 03:05:07 +01:00
AC_PROG_CC
AC_PROG_CPP
AM_PROG_CC_C_O
dnl remove autoconf default "-g -O2"
CFLAGS="$orig_cflags"
AC_PROG_CC_C99
dnl NB: see C11 below
AC_PROG_EGREP
PKG_PROG_PKG_CONFIG
dnl autoconf 2.59 appears not to support AC_PROG_SED
dnl AC_PROG_SED
AC_CHECK_PROG([SED],[sed],[sed],[/bin/false])
dnl try and enable CFLAGS that are useful for FRR
dnl - specifically, options to control warnings
AC_USE_SYSTEM_EXTENSIONS
AC_DEFUN([AC_C_FLAG], [{
m4_pushdef([cachename],[m4_translit([frr_cv_$1],[ =-],[___])])
AC_CACHE_CHECK([[whether $CC supports $1]], cachename, [
AC_LANG_PUSH(C)
ac_c_flag_save="$CFLAGS"
CFLAGS="$CFLAGS $1"
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[]])],
[
cachename=yes
], [
cachename=no
])
CFLAGS="$ac_c_flag_save"
AC_LANG_POP(C)
])
if test "${cachename}" = yes; then
m4_if([$3], [], [CFLAGS="$CFLAGS $1"], [$3])
else
:
$2
fi
m4_popdef([cachename])
}])
AC_DEFUN([AC_LINK_IFELSE_FLAGS], [{
AC_LANG_PUSH(C)
ac_cflags_save="$CFLAGS"
ac_libs_save="$LIBS"
CFLAGS="$CFLAGS $1"
LIBS="$LIBS $2"
AC_LINK_IFELSE(
[$3],
[
AC_MSG_RESULT([yes])
CFLAGS="$ac_cflags_save"
LIBS="$ac_libs_save"
$5
], [
AC_MSG_RESULT([no])
CFLAGS="$ac_cflags_save"
LIBS="$ac_libs_save"
$4
])
AC_LANG_POP(C)
}])
dnl ICC won't bail on unknown options without -diag-error 10006
dnl need to do this first so we get useful results for the other options
AC_C_FLAG([-diag-error 10006])
dnl AC_PROG_CC_C99 may change CC to include -std=gnu99 or something
ac_cc="$CC"
CC="${CC% -std=gnu99}"
CC="${CC% -std=c99}"
AC_C_FLAG([-std=gnu11], [CC="$ac_cc"], [CC="$CC -std=gnu11"])
dnl if the user has specified any CFLAGS, override our settings
if test "x${enable_gcov}" = "xyes"; then
if test "z$orig_cflags" = "z"; then
AC_C_FLAG([-coverage])
AC_C_FLAG([-O0])
fi
LDFLAGS="${LDFLAGS} -lgcov"
elif test "x${enable_dev_build}" = "xyes"; then
AC_DEFINE(DEV_BUILD,,Build for development)
if test "z$orig_cflags" = "z"; then
AC_C_FLAG([-g3])
AC_C_FLAG([-O0])
fi
if test "x${enable_lua}" = "xyes"; then
AC_CHECK_LIB([lua], [lua_newstate],
[LIBS="$LIBS -llua"])
AC_DEFINE(HAVE_LUA,,Lua enabled for development)
fi
else
if test "x${enable_lua}" = "xyes"; then
AC_MSG_ERROR([Lua is not meant to be built/used outside of development at this time])
fi
if test "z$orig_cflags" = "z"; then
AC_C_FLAG([-g])
AC_C_FLAG([-Os], [
AC_C_FLAG([-O2])
])
fi
fi
AM_CONDITIONAL([DEV_BUILD], [test "x$enable_dev_build" = "xyes"])
dnl always want these CFLAGS
AC_C_FLAG([-fno-omit-frame-pointer])
AC_C_FLAG([-funwind-tables])
AC_C_FLAG([-Wall])
AC_C_FLAG([-Wextra])
AC_C_FLAG([-Wmissing-prototypes])
AC_C_FLAG([-Wmissing-declarations])
AC_C_FLAG([-Wpointer-arith])
AC_C_FLAG([-Wbad-function-cast])
AC_C_FLAG([-Wwrite-strings])
if test x"${enable_gcc_ultra_verbose}" = x"yes" ; then
AC_C_FLAG([-Wcast-qual])
AC_C_FLAG([-Wstrict-prototypes])
AC_C_FLAG([-Wmissing-noreturn])
AC_C_FLAG([-Wmissing-format-attribute])
AC_C_FLAG([-Wunreachable-code])
AC_C_FLAG([-Wpacked])
AC_C_FLAG([-Wpadded])
AC_C_FLAG([-Wshadow])
else
AC_C_FLAG([-Wno-unused-result])
fi
AC_C_FLAG([-Wno-unused-parameter])
AC_C_FLAG([-Wno-missing-field-initializers])
dnl ICC emits a broken warning for const char *x = a ? "b" : "c";
dnl for some reason the string consts get 'promoted' to char *,
dnl triggering a const to non-const conversion warning.
AC_C_FLAG([-diag-disable 3179])
2015-07-26 01:05:56 +02:00
if test x"${enable_werror}" = x"yes" ; then
WERROR="-Werror"
fi
AC_SUBST(WERROR)
SAN_FLAGS=""
if test "$enable_address_sanitizer" = "yes"; then
AC_C_FLAG([-fsanitize=address], [
AC_MSG_ERROR([$CC does not support Address Sanitizer.])
], [
SAN_FLAGS="$SAN_FLAGS -fsanitize=address"
])
fi
if test "$enable_thread_sanitizer" = "yes"; then
AC_C_FLAG([-fsanitize=thread], [
AC_MSG_ERROR([$CC does not support Thread Sanitizer.])
], [
SAN_FLAGS="$SAN_FLAGS -fsanitize=thread"
])
fi
if test "$enable_memory_sanitizer" = "yes"; then
AC_C_FLAG([-fsanitize=thread -fPIE -pie], [
AC_MSG_ERROR([$CC does not support Thread Sanitizer.])
], [
SAN_FLAGS="-fsanitize=memory -fPIE -pie"
])
fi
AC_SUBST([SAN_FLAGS])
dnl ----------
dnl Essentials
dnl ----------
AX_PTHREAD([
CC="$PTHREAD_CC"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
LIBS="$PTHREAD_LIBS $LIBS"
], [
AC_MSG_FAILURE([This FRR version needs pthreads])
])
AC_SEARCH_LIBS([pthread_condattr_setclock], [],
[frr_cv_pthread_condattr_setclock=yes],
[frr_cv_pthread_condattr_setclock=no])
if test "$frr_cv_pthread_condattr_setclock" = yes; then
AC_DEFINE(HAVE_PTHREAD_CONDATTR_SETCLOCK, 1, [Have pthread.h pthread_condattr_setclock])
fi
2003-03-17 03:05:07 +01:00
dnl --------------
dnl Check programs
dnl --------------
AC_PROG_INSTALL
AC_PROG_LN_S
2003-03-17 03:05:07 +01:00
AC_PROG_MAKE_SET
AC_CHECK_TOOL(AR, ar)
dnl -------
dnl libtool
dnl -------
AC_ARG_ENABLE(static-bin,
AS_HELP_STRING([--enable-static-bin], [link binaries statically]))
LT_INIT
_LT_CONFIG_LIBTOOL([
patch -N -i "${srcdir}/m4/libtool-whole-archive.patch" libtool >&AS_MESSAGE_LOG_FD || \
AC_MSG_WARN([Could not patch libtool for static linking support. Loading modules into a statically linked daemon will fail.])
])
if test "$enable_static_bin" = "yes"; then
AC_LDFLAGS="-static"
fi
AC_SUBST(AC_LDFLAGS)
AM_CONDITIONAL([STATIC_BIN], [test "x$enable_static_bin" = "xyes"])
dnl $AR and $RANLIB are set by LT_INIT above
AC_MSG_CHECKING([whether $AR supports D option])
if $AR crD conftest.a; then
AC_MSG_RESULT([yes])
dnl ARFLAGS is for automake, AR_FLAGS for libtool m-(
ARFLAGS="crD"
AR_FLAGS="crD"
else
AC_MSG_RESULT([no])
ARFLAGS="cru"
AR_FLAGS="cru"
fi
AC_SUBST(ARFLAGS)
AC_SUBST(AR_FLAGS)
AC_MSG_CHECKING([whether $RANLIB supports D option])
if $RANLIB -D conftest.a; then
AC_MSG_RESULT([yes])
RANLIB="$RANLIB -D"
else
AC_MSG_RESULT([no])
fi
AC_SUBST(RANLIB)
test -f conftest.a && rm conftest.a
2003-03-17 03:05:07 +01:00
dnl ----------------------
dnl Packages configuration
dnl ----------------------
if test -f config.version; then
. ./config.version
elif test -f "${srcdir}/config.version"; then
. "${srcdir}/config.version"
fi
AC_ARG_WITH(pkg-extra-version,
AS_HELP_STRING([--with-pkg-extra-version=VER], [add extra version field, for packagers/distributions]), [
if test "$withval" = "no"; then
EXTRAVERSION=
else
EXTRAVERSION=$withval
fi
], [])
AC_ARG_WITH(pkg-git-version,
AS_HELP_STRING([--with-pkg-git-version], [add git information to MOTD and build version string]),
[ test "x$withval" != "xno" && with_pkg_git_version="yes" ])
AC_ARG_WITH(vtysh_pager,
AS_HELP_STRING([--with-vtysh-pager=PAGER], [control what pager is compiled in as default]),
VTYSH_PAGER=$withval, VTYSH_PAGER="more")
2003-03-17 03:05:07 +01:00
AC_ARG_ENABLE(vtysh,
AS_HELP_STRING([--disable-vtysh], [do not build integrated vty shell for FRR]))
AC_ARG_ENABLE(doc,
AS_HELP_STRING([--disable-doc], [do not build docs]))
AC_ARG_ENABLE(doc-html,
AS_HELP_STRING([--enable-doc-html], [build HTML docs]))
2003-03-17 03:05:07 +01:00
AC_ARG_ENABLE(zebra,
AS_HELP_STRING([--disable-zebra], [do not build zebra daemon]))
2003-03-17 03:05:07 +01:00
AC_ARG_ENABLE(bgpd,
AS_HELP_STRING([--disable-bgpd], [do not build bgpd]))
2003-03-17 03:05:07 +01:00
AC_ARG_ENABLE(ripd,
AS_HELP_STRING([--disable-ripd], [do not build ripd]))
2003-03-17 03:05:07 +01:00
AC_ARG_ENABLE(ripngd,
AS_HELP_STRING([--disable-ripngd], [do not build ripngd]))
2003-03-17 03:05:07 +01:00
AC_ARG_ENABLE(ospfd,
AS_HELP_STRING([--disable-ospfd], [do not build ospfd]))
2003-03-17 03:05:07 +01:00
AC_ARG_ENABLE(ospf6d,
AS_HELP_STRING([--disable-ospf6d], [do not build ospf6d]))
AC_ARG_ENABLE(ldpd,
AS_HELP_STRING([--disable-ldpd], [do not build ldpd]))
AC_ARG_ENABLE(nhrpd,
AS_HELP_STRING([--disable-nhrpd], [do not build nhrpd]))
AC_ARG_ENABLE(eigrpd,
AS_HELP_STRING([--disable-eigrpd], [do not build eigrpd]))
AC_ARG_ENABLE(babeld,
AS_HELP_STRING([--disable-babeld], [do not build babeld]))
AC_ARG_ENABLE(watchfrr,
AS_HELP_STRING([--disable-watchfrr], [do not build watchfrr]))
AC_ARG_ENABLE(isisd,
AS_HELP_STRING([--disable-isisd], [do not build isisd]))
AC_ARG_ENABLE(pimd,
AS_HELP_STRING([--disable-pimd], [do not build pimd]))
AC_ARG_ENABLE(pbrd,
AS_HELP_STRING([--disable-pbrd], [do not build pbrd]))
AC_ARG_ENABLE(sharpd,
AS_HELP_STRING([--enable-sharpd], [build sharpd]))
AC_ARG_ENABLE(staticd,
AS_HELP_STRING([--disable-staticd], [do not build staticd]))
AC_ARG_ENABLE(fabricd,
AS_HELP_STRING([--disable-fabricd], [do not build fabricd]))
2003-03-17 03:05:07 +01:00
AC_ARG_ENABLE(bgp-announce,
AS_HELP_STRING([--disable-bgp-announce,], [turn off BGP route announcement]))
bgpd: add L3/L2VPN Virtual Network Control feature This feature adds an L3 & L2 VPN application that makes use of the VPN and Encap SAFIs. This code is currently used to support IETF NVO3 style operation. In NVO3 terminology it provides the Network Virtualization Authority (NVA) and the ability to import/export IP prefixes and MAC addresses from Network Virtualization Edges (NVEs). The code supports per-NVE tables. The NVE-NVA protocol used to communicate routing and Ethernet / Layer 2 (L2) forwarding information between NVAs and NVEs is referred to as the Remote Forwarder Protocol (RFP). OpenFlow is an example RFP. For general background on NVO3 and RFP concepts see [1]. For information on Openflow see [2]. RFPs are integrated with BGP via the RF API contained in the new "rfapi" BGP sub-directory. Currently, only a simple example RFP is included in Quagga. Developers may use this example as a starting point to integrate Quagga with an RFP of their choosing, e.g., OpenFlow. The RFAPI code also supports the ability import/export of routing information between VNC and customer edge routers (CEs) operating within a virtual network. Import/export may take place between BGP views or to the default zebera VRF. BGP, with IP VPNs and Tunnel Encapsulation, is used to distribute VPN information between NVAs. BGP based IP VPN support is defined in RFC4364, BGP/MPLS IP Virtual Private Networks (VPNs), and RFC4659, BGP-MPLS IP Virtual Private Network (VPN) Extension for IPv6 VPN . Use of both the Encapsulation Subsequent Address Family Identifier (SAFI) and the Tunnel Encapsulation Attribute, RFC5512, The BGP Encapsulation Subsequent Address Family Identifier (SAFI) and the BGP Tunnel Encapsulation Attribute, are supported. MAC address distribution does not follow any standard BGB encoding, although it was inspired by the early IETF EVPN concepts. The feature is conditionally compiled and disabled by default. Use the --enable-bgp-vnc configure option to enable. The majority of this code was authored by G. Paul Ziemba <paulz@labn.net>. [1] http://tools.ietf.org/html/draft-ietf-nvo3-nve-nva-cp-req [2] https://www.opennetworking.org/sdn-resources/technical-library Now includes changes needed to merge with cmaster-next.
2016-05-07 20:18:56 +02:00
AC_ARG_ENABLE(bgp-vnc,
2016-09-29 00:16:25 +02:00
AS_HELP_STRING([--disable-bgp-vnc],[turn off BGP VNC support]))
2003-03-17 03:05:07 +01:00
AC_ARG_ENABLE(snmp,
AS_HELP_STRING([--enable-snmp], [enable SNMP support for agentx]))
AC_ARG_ENABLE(config_rollbacks,
AS_HELP_STRING([--enable-config-rollbacks], [enable configuration rollbacks (requires sqlite3)]))
lib: add a new northbound plugin for ConfD This plugin leverages the northbound API to integrate FRR with the ConfD management agent. The plugin is linked to the libconfd library and communicates with the confd daemon using local TCP sockets. The integration consists mostly of glue code that calls the appropriate FRR northbound callbacks in response to events triggered by the confd daemon (e.g. request to change the configuration or to fetch operational data). By integrating FRR with the libconfd library, FRR can be managed using all northbound interfaces provided by ConfD, including NETCONF, RESTCONF and their Web API. The ConfD CDB API is used to handle configuration changes and the ConfD Data Provider API is used to provide operational data, process RPCs and send notifications. Support for configuration management using the ConfD Data Provider API is not available at this point. The ConfD optional 'get_object()' and 'get_next_object()' callbacks were implemented for optimal performance when fetching operational data. This plugins requires ConfD 6.5 or later since it uses the new leaf-list API introduced in ConfD 6.5. To install the plugin, the --enable-confd option should be given to the configure script, specifying the location where ConfD is installed. Example: ./configure --enable-confd=/root/confd-6.6 When installed, the confd plugin will be available for all FRR daemons and can be loaded using the -M (or --module) command line option. Example: zebra -M confd. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-05-24 01:11:59 +02:00
AC_ARG_ENABLE(confd,
AS_HELP_STRING([--enable-confd=ARG], [enable confd integration]))
AC_ARG_ENABLE(sysrepo,
AS_HELP_STRING([--enable-sysrepo], [enable sysrepo integration]))
AC_ARG_ENABLE(zeromq,
AS_HELP_STRING([--enable-zeromq], [enable ZeroMQ handler (libfrrzmq)]))
2003-03-17 03:05:07 +01:00
AC_ARG_WITH(libpam,
AS_HELP_STRING([--with-libpam], [use libpam for PAM support in vtysh]))
AC_ARG_ENABLE(ospfapi,
AS_HELP_STRING([--disable-ospfapi], [do not build OSPFAPI to access the OSPF LSA Database]))
AC_ARG_ENABLE(ospfclient,
AS_HELP_STRING([--disable-ospfclient], [do not build OSPFAPI client for OSPFAPI,
(this is the default if --disable-ospfapi is set)]))
2003-03-17 03:05:07 +01:00
AC_ARG_ENABLE(multipath,
AS_HELP_STRING([--enable-multipath=ARG], [enable multipath function, ARG must be digit]))
AC_ARG_ENABLE(user,
AS_HELP_STRING([--enable-user=USER], [user to run FRR suite as (default frr)]))
AC_ARG_ENABLE(group,
AS_HELP_STRING([--enable-group=GROUP], [group to run FRR suite as (default frr)]))
AC_ARG_ENABLE(vty_group,
AS_HELP_STRING([--enable-vty-group=ARG], [set vty sockets to have specified group as owner]))
AC_ARG_ENABLE(configfile_mask,
AS_HELP_STRING([--enable-configfile-mask=ARG], [set mask for config files]))
AC_ARG_ENABLE(logfile_mask,
AS_HELP_STRING([--enable-logfile-mask=ARG], [set mask for log files]))
AC_ARG_ENABLE(shell_access,
AS_HELP_STRING([--enable-shell-access], [Allow users to access shell/telnet/ssh]))
AC_ARG_ENABLE(realms,
AS_HELP_STRING([--enable-realms], [enable REALMS support under Linux]))
2003-05-25 22:18:13 +02:00
AC_ARG_ENABLE(rtadv,
AS_HELP_STRING([--disable-rtadv], [disable IPV6 router advertisement feature]))
AC_ARG_ENABLE(irdp,
AS_HELP_STRING([--disable-irdp], [enable IRDP server support in zebra (default if supported)]))
AC_ARG_ENABLE(capabilities,
AS_HELP_STRING([--disable-capabilities], [disable using POSIX capabilities]))
AC_ARG_ENABLE(rusage,
AS_HELP_STRING([--disable-rusage], [disable using getrusage]))
AC_ARG_ENABLE(gcc_ultra_verbose,
AS_HELP_STRING([--enable-gcc-ultra-verbose], [enable ultra verbose GCC warnings]))
AC_ARG_ENABLE(backtrace,
AS_HELP_STRING([--disable-backtrace,], [disable crash backtraces (default autodetect)]))
AC_ARG_ENABLE(time-check,
AS_HELP_STRING([--disable-time-check], [disable slow thread warning messages]))
AC_ARG_ENABLE(pcreposix,
AS_HELP_STRING([--enable-pcreposix], [enable using PCRE Posix libs for regex functions]))
zebra: add module to communicate routes to FPM Enhance zebra to send routes to the (optional) Forwarding Path Manager component using the interface defined by fpm/fpm.h. * configure.ac - Add --enable-fpm flag. The FPM-related code in zebra is activated only if the build is configured with '--enable-fpm'. - Add HAVE_NETLINK automake conditional. This allows us to conditionally build netlink-dependent C code. * zebra/{rib.h,zebra_rib.c} - Add the 'fpm_q_entries' field to the rib_dest_t structure. This allows dests to be placed on the fpm queue. - Define a couple new rib_dest_t flags that hold FPM-related state. - Invoke the zfpm_trigger_update() function for a route_node whenever the information to be sent to the FPM changes. - rib_can_delete_dest(): Return FALSE if we have to update the FPM about the given dest. This ensures that the dest is not deleted even if there are no ribs hanging off of it. * zebra/zebra_fpm.c This file holds most of the code for interacting with the FPM. - If quagga was configured with '--enable-fpm', periodically try to connect to the FPM. - When the connection comes up, enqueue all relevent dests to the FPM queue. - When the FPM socket is readable, dequeue the next rib_dest_t from the FPM queue, encode it in to a message and send the message to the FPM. - When the connection to the FPM goes down, remove all dests from the FPM queue, and then start trying to connect to the FPM again. - Expose the following new operational commands: show zebra fpm stats clear zebra fpm stats * zebra/zebra_fpm_netlink.c - zfpm_netlink_encode_route(): Function to encode information about a rib_dest_t in netlink format. * zebra/zebra_fpm_private.h Private header file for the zebra FPM module. * zebra/zebra_fpm.h Header file exported by zebra FPM module to the rest of zebra. * zebra/debug.c Add the 'debug zebra fpm' command. * zebra/main.c Initialize the zebra-FPM code on startup. * zebra/misc_null.c Add stub for zfpm_trigger_update(). * zebra/Makefile.am - Include new file zebra_fpm.c in build. - Include zebra_fpm_netlink.c in build if HAVE_NETLINK is defined. * vtysh/Makefile.am Include zebra_fpm.c in list of files that define cli commands. Signed-off-by: Avneesh Sachdev <avneesh@opensourcerouting.org> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2012-11-13 23:48:59 +01:00
AC_ARG_ENABLE(fpm,
AS_HELP_STRING([--enable-fpm], [enable Forwarding Plane Manager support]))
AC_ARG_ENABLE(systemd,
AS_HELP_STRING([--enable-systemd], [enable Systemd support]))
2015-07-26 01:05:56 +02:00
AC_ARG_ENABLE(werror,
AS_HELP_STRING([--enable-werror], [enable -Werror (recommended for developers only)]))
AC_ARG_ENABLE(cumulus,
AS_HELP_STRING([--enable-cumulus], [enable Cumulus Switch Special Extensions]))
AC_ARG_ENABLE(datacenter,
AS_HELP_STRING([--enable-datacenter], [enable Compilation for Data Center Extensions]))
AC_ARG_ENABLE(fuzzing,
AS_HELP_STRING([--enable-fuzzing], [enable ability to fuzz various parts of FRR]))
AC_ARG_ENABLE(netlink_fuzzing,
AS_HELP_STRING([--enable-netlink-fuzzing], [enable ability to fuzz netlink listening socket in zebra]))
AC_ARG_ENABLE(rr-semantics,
AS_HELP_STRING([--disable-rr-semantics], [disable the v6 Route Replace semantics]))
qpb: Add support for protobuf. Infrastructure that allows protocol buffers to be used in Quagga. The changes below comprise of: - Build hooks - Protobuf definitions for common types. - Library routines for working with protobuf, including functions that help translate between common quagga types and their protobuf equivalents. Changes: * qpb/{Makefile.am,README.txt,qpb.h,.gitignore} Add the qpb library, which provides shared code and definitions for using protocol buffers in quagga code. * qpb/qpb.proto Protobuf definitions that can be shared by all of quagga. * qpb/linear_allocator.h An allocator that allocates memory by walking down towards the end of a buffer. This is used to cheaply allocate/deallocate memory on the stack for protobuf operations. * qpb/qpb_allocator.[ch] Thin layer that allows a linear allocator to be used with the protobuf-c library. * common.am This is an automake fragment that is intended to be shared by Makefile.am files in the tree. It currently includes definitions related to protobuf. * configure.ac - Add logic to optionally build protobuf code. By default, protobuf support is enabled if the protobuf C compiler (protoc-c) is available, and the associated header files/library can be found. The user can choose to override this behavior via the new --disable-protobuf/--enable-protobuf flags. - Include the quagga protobuf library (qpb) in the build. * .gitignore Ignore source code generated by protobuf compiler. * Makefile.am Add 'qpb' to the list of subdirectories. Signed-off-by: Avneesh Sachdev <avneesh@sproute.com> Edited: Paul Jakma <paul.jakma@hpe.com>: Change the sense of the configure enable option to require explicit specifying, as an experimental feature.
2016-04-04 19:54:55 +02:00
AC_ARG_ENABLE([protobuf],
AS_HELP_STRING([--enable-protobuf], [Enable experimental protobuf support]))
AC_ARG_ENABLE([oldvpn_commands],
AS_HELP_STRING([--enable-oldvpn-commands], [Keep old vpn commands]))
AC_ARG_ENABLE(rpki,
AS_HELP_STRING([--enable-rpki], [enable RPKI prefix validation support]))
AC_ARG_ENABLE([clippy-only],
AS_HELP_STRING([--enable-clippy-only], [Only build clippy]))
AC_ARG_ENABLE([numeric_version],
AS_HELP_STRING([--enable-numeric-version], [Only numeric digits allowed in version (for Alpine)]))
AC_ARG_ENABLE([gcov],
AS_HELP_STRING([--enable-gcov], [Add code coverage information]))
AC_ARG_ENABLE(bfdd,
AS_HELP_STRING([--disable-bfdd], [do not build bfdd]))
AC_ARG_ENABLE([address-sanitizer],
AS_HELP_STRING([--enable-address-sanitizer], [enable AddressSanitizer support for detecting a wide variety of memory allocation and deallocation errors]))
AC_ARG_ENABLE([thread-sanitizer],
AS_HELP_STRING([--enable-thread-sanitizer], [enable ThreadSanitizer support for detecting data races]))
AC_ARG_ENABLE([memory-sanitizer],
AS_HELP_STRING([--enable-memory-sanitizer], [enable MemorySanitizer support for detecting uninitialized memory reads]))
AS_IF([test "${enable_clippy_only}" != "yes"], [
AC_CHECK_HEADERS(json-c/json.h)
AC_CHECK_LIB(json-c, json_object_get, LIBS="$LIBS -ljson-c", [], [-lm])
if test "$ac_cv_lib_json_c_json_object_get" = no; then
AC_CHECK_LIB(json, json_object_get, LIBS="$LIBS -ljson")
if test "$ac_cv_lib_json_json_object_get" = no; then
AC_MSG_ERROR([lib json is needed to compile])
fi
fi
])
AC_ARG_ENABLE([dev_build],
AS_HELP_STRING([--enable-dev-build], [build for development]))
AC_ARG_ENABLE([lua],
AS_HELP_STRING([--enable-lua], [Build Lua scripting]))
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
case "${enable_systemd}" in
"no") ;;
"yes")
AC_CHECK_LIB(systemd, sd_notify, LIBS="$LIBS -lsystemd")
if test $ac_cv_lib_systemd_sd_notify = no; then
AC_MSG_ERROR([enable systemd has been specified but systemd development env not found on your system])
else
AC_DEFINE(HAVE_SYSTEMD,,Compile systemd support in)
fi
;;
"*") ;;
esac
if test "${enable_rr_semantics}" != "no" ; then
AC_DEFINE(HAVE_V6_RR_SEMANTICS,, Compile in v6 Route Replacement Semantics)
fi
if test "${enable_datacenter}" = "yes" ; then
AC_DEFINE(HAVE_DATACENTER,,Compile extensions for a DataCenter)
DFLT_NAME="datacenter"
else
DFLT_NAME="traditional"
fi
if test "${enable_fuzzing}" = "yes" ; then
AC_DEFINE(HANDLE_ZAPI_FUZZING,,Compile extensions to use with a fuzzer)
fi
if test "${enable_netlink_fuzzing}" = "yes" ; then
AC_DEFINE(HANDLE_NETLINK_FUZZING,,Compile extensions to use with a fuzzer for netlink)
fi
if test "${enable_cumulus}" = "yes" ; then
AC_DEFINE(HAVE_CUMULUS,,Compile Special Cumulus Code in)
fi
AC_SUBST(DFLT_NAME)
AC_DEFINE_UNQUOTED(DFLT_NAME,["$DFLT_NAME"], Name of the configuration default set)
if test "${enable_shell_access}" = "yes"; then
AC_DEFINE(HAVE_SHELL_ACCESS,,Allow user to use ssh/telnet/bash)
fi
AM_CONDITIONAL([FPM], [test "x$enable_fpm" = "xyes"])
zebra: add module to communicate routes to FPM Enhance zebra to send routes to the (optional) Forwarding Path Manager component using the interface defined by fpm/fpm.h. * configure.ac - Add --enable-fpm flag. The FPM-related code in zebra is activated only if the build is configured with '--enable-fpm'. - Add HAVE_NETLINK automake conditional. This allows us to conditionally build netlink-dependent C code. * zebra/{rib.h,zebra_rib.c} - Add the 'fpm_q_entries' field to the rib_dest_t structure. This allows dests to be placed on the fpm queue. - Define a couple new rib_dest_t flags that hold FPM-related state. - Invoke the zfpm_trigger_update() function for a route_node whenever the information to be sent to the FPM changes. - rib_can_delete_dest(): Return FALSE if we have to update the FPM about the given dest. This ensures that the dest is not deleted even if there are no ribs hanging off of it. * zebra/zebra_fpm.c This file holds most of the code for interacting with the FPM. - If quagga was configured with '--enable-fpm', periodically try to connect to the FPM. - When the connection comes up, enqueue all relevent dests to the FPM queue. - When the FPM socket is readable, dequeue the next rib_dest_t from the FPM queue, encode it in to a message and send the message to the FPM. - When the connection to the FPM goes down, remove all dests from the FPM queue, and then start trying to connect to the FPM again. - Expose the following new operational commands: show zebra fpm stats clear zebra fpm stats * zebra/zebra_fpm_netlink.c - zfpm_netlink_encode_route(): Function to encode information about a rib_dest_t in netlink format. * zebra/zebra_fpm_private.h Private header file for the zebra FPM module. * zebra/zebra_fpm.h Header file exported by zebra FPM module to the rest of zebra. * zebra/debug.c Add the 'debug zebra fpm' command. * zebra/main.c Initialize the zebra-FPM code on startup. * zebra/misc_null.c Add stub for zfpm_trigger_update(). * zebra/Makefile.am - Include new file zebra_fpm.c in build. - Include zebra_fpm_netlink.c in build if HAVE_NETLINK is defined. * vtysh/Makefile.am Include zebra_fpm.c in list of files that define cli commands. Signed-off-by: Avneesh Sachdev <avneesh@opensourcerouting.org> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2012-11-13 23:48:59 +01:00
#
# Python for clippy
#
AC_DEFUN([FRR_PYTHON_CHECK_WORKING], [
AC_MSG_CHECKING([whether we found a working Python version])
AC_LINK_IFELSE_FLAGS([$PYTHON_CFLAGS], [$PYTHON_LIBS], [AC_LANG_PROGRAM([
#include <Python.h>
#if PY_VERSION_HEX < 0x02070000
#error python too old
#endif
int main(void);
],
[
{
Py_Initialize();
return 0;
}
])], [
# some python installs are missing the zlib dependency...
PYTHON_LIBS="${PYTHON_LIBS} -lz"
AC_LINK_IFELSE_FLAGS([$PYTHON_CFLAGS], [$PYTHON_LIBS], [AC_LANG_PROGRAM([
#include <Python.h>
#if PY_VERSION_HEX < 0x02070000
#error python too old
#endif
int main(void);
],
[
{
Py_Initialize();
return 0;
}
])], [
m4_if([$1], [], [
PYTHONCONFIG=""
unset PYTHON_LIBS
unset PYTHON_CFLAGS
], [$1])
])
])
])
AS_IF([test "$host" = "$build"], [
PYTHONCONFIG=""
# ordering:
# 1. try python3, but respect the user's preference on which minor ver
# 2. try python, which might be py3 or py2 again on the user's preference
# 3. try python2 (can really only be 2.7 but eh)
# 4. try 3.6 > 3.5 > 3.4 > 3.3 > 3.2 > 2.7 through pkg-config (no user pref)
#
# (AX_PYTHON_DEVEL has no clue about py3 vs py2)
# (AX_PYTHON does not do what we need)
AC_CHECK_TOOLS([PYTHONCONFIG], [ \
python3-config \
python-config \
python2-config \
python3.6-config \
python3.5-config \
python3.4-config \
python3.3-config \
python3.2-config \
python2.7-config ])
if test -n "$PYTHONCONFIG"; then
PYTHON_CFLAGS="`\"${PYTHONCONFIG}\" --includes`"
PYTHON_LIBS="`\"${PYTHONCONFIG}\" --ldflags`"
FRR_PYTHON_CHECK_WORKING([])
fi
if test -z "$PYTHONCONFIG"; then
PKG_CHECK_MODULES([PYTHON], python-3.6, [], [
PKG_CHECK_MODULES([PYTHON], python-3.5, [], [
PKG_CHECK_MODULES([PYTHON], python-3.4, [], [
PKG_CHECK_MODULES([PYTHON], python-3.3, [], [
PKG_CHECK_MODULES([PYTHON], python-3.2, [], [
PKG_CHECK_MODULES([PYTHON], python-2.7, [], [
AC_MSG_FAILURE([could not find python-config or pkg-config python, please install Python development files from libpython-dev or similar])
])])])])])])
FRR_PYTHON_CHECK_WORKING([
AC_MSG_FAILURE([could not find python-config or pkg-config python, please install Python development files from libpython-dev or similar])
])
fi
])
AC_SUBST(PYTHON_CFLAGS)
AC_SUBST(PYTHON_LIBS)
qpb: Add support for protobuf. Infrastructure that allows protocol buffers to be used in Quagga. The changes below comprise of: - Build hooks - Protobuf definitions for common types. - Library routines for working with protobuf, including functions that help translate between common quagga types and their protobuf equivalents. Changes: * qpb/{Makefile.am,README.txt,qpb.h,.gitignore} Add the qpb library, which provides shared code and definitions for using protocol buffers in quagga code. * qpb/qpb.proto Protobuf definitions that can be shared by all of quagga. * qpb/linear_allocator.h An allocator that allocates memory by walking down towards the end of a buffer. This is used to cheaply allocate/deallocate memory on the stack for protobuf operations. * qpb/qpb_allocator.[ch] Thin layer that allows a linear allocator to be used with the protobuf-c library. * common.am This is an automake fragment that is intended to be shared by Makefile.am files in the tree. It currently includes definitions related to protobuf. * configure.ac - Add logic to optionally build protobuf code. By default, protobuf support is enabled if the protobuf C compiler (protoc-c) is available, and the associated header files/library can be found. The user can choose to override this behavior via the new --disable-protobuf/--enable-protobuf flags. - Include the quagga protobuf library (qpb) in the build. * .gitignore Ignore source code generated by protobuf compiler. * Makefile.am Add 'qpb' to the list of subdirectories. Signed-off-by: Avneesh Sachdev <avneesh@sproute.com> Edited: Paul Jakma <paul.jakma@hpe.com>: Change the sense of the configure enable option to require explicit specifying, as an experimental feature.
2016-04-04 19:54:55 +02:00
#
# Logic for protobuf support.
#
if test "$enable_protobuf" = "yes"; then
# Check for protoc & protoc-c
# protoc is not required, it's only for a "be nice" helper target
AC_CHECK_PROGS([PROTOC], [protoc], [/bin/false])
AC_CHECK_PROGS([PROTOC_C], [protoc-c], [/bin/false])
if test "$PROTOC_C" = "/bin/false"; then
AC_MSG_FAILURE([protobuf requested but protoc-c not found. Install protobuf-c.])
fi
PKG_CHECK_MODULES([PROTOBUF_C], [libprotobuf-c >= 0.14],, [
AC_MSG_FAILURE([protobuf requested but libprotobuf-c not found. Install protobuf-c.])
])
AC_CHECK_HEADER([google/protobuf-c/protobuf-c.h], [], [
AC_MSG_FAILURE([protobuf requested but protobuf-c.h not found. Install protobuf-c.])
])
AC_DEFINE(HAVE_PROTOBUF,, protobuf)
qpb: Add support for protobuf. Infrastructure that allows protocol buffers to be used in Quagga. The changes below comprise of: - Build hooks - Protobuf definitions for common types. - Library routines for working with protobuf, including functions that help translate between common quagga types and their protobuf equivalents. Changes: * qpb/{Makefile.am,README.txt,qpb.h,.gitignore} Add the qpb library, which provides shared code and definitions for using protocol buffers in quagga code. * qpb/qpb.proto Protobuf definitions that can be shared by all of quagga. * qpb/linear_allocator.h An allocator that allocates memory by walking down towards the end of a buffer. This is used to cheaply allocate/deallocate memory on the stack for protobuf operations. * qpb/qpb_allocator.[ch] Thin layer that allows a linear allocator to be used with the protobuf-c library. * common.am This is an automake fragment that is intended to be shared by Makefile.am files in the tree. It currently includes definitions related to protobuf. * configure.ac - Add logic to optionally build protobuf code. By default, protobuf support is enabled if the protobuf C compiler (protoc-c) is available, and the associated header files/library can be found. The user can choose to override this behavior via the new --disable-protobuf/--enable-protobuf flags. - Include the quagga protobuf library (qpb) in the build. * .gitignore Ignore source code generated by protobuf compiler. * Makefile.am Add 'qpb' to the list of subdirectories. Signed-off-by: Avneesh Sachdev <avneesh@sproute.com> Edited: Paul Jakma <paul.jakma@hpe.com>: Change the sense of the configure enable option to require explicit specifying, as an experimental feature.
2016-04-04 19:54:55 +02:00
fi
AM_CONDITIONAL([HAVE_PROTOBUF], [test "x$enable_protobuf" = "xyes"])
qpb: Add support for protobuf. Infrastructure that allows protocol buffers to be used in Quagga. The changes below comprise of: - Build hooks - Protobuf definitions for common types. - Library routines for working with protobuf, including functions that help translate between common quagga types and their protobuf equivalents. Changes: * qpb/{Makefile.am,README.txt,qpb.h,.gitignore} Add the qpb library, which provides shared code and definitions for using protocol buffers in quagga code. * qpb/qpb.proto Protobuf definitions that can be shared by all of quagga. * qpb/linear_allocator.h An allocator that allocates memory by walking down towards the end of a buffer. This is used to cheaply allocate/deallocate memory on the stack for protobuf operations. * qpb/qpb_allocator.[ch] Thin layer that allows a linear allocator to be used with the protobuf-c library. * common.am This is an automake fragment that is intended to be shared by Makefile.am files in the tree. It currently includes definitions related to protobuf. * configure.ac - Add logic to optionally build protobuf code. By default, protobuf support is enabled if the protobuf C compiler (protoc-c) is available, and the associated header files/library can be found. The user can choose to override this behavior via the new --disable-protobuf/--enable-protobuf flags. - Include the quagga protobuf library (qpb) in the build. * .gitignore Ignore source code generated by protobuf compiler. * Makefile.am Add 'qpb' to the list of subdirectories. Signed-off-by: Avneesh Sachdev <avneesh@sproute.com> Edited: Paul Jakma <paul.jakma@hpe.com>: Change the sense of the configure enable option to require explicit specifying, as an experimental feature.
2016-04-04 19:54:55 +02:00
#
# Logic for old vpn commans support.
#
if test "$enable_oldvpn_commands" = "yes"; then
AC_DEFINE(KEEP_OLD_VPN_COMMANDS,, [Define for compiling with old vpn commands])
fi
qpb: Add support for protobuf. Infrastructure that allows protocol buffers to be used in Quagga. The changes below comprise of: - Build hooks - Protobuf definitions for common types. - Library routines for working with protobuf, including functions that help translate between common quagga types and their protobuf equivalents. Changes: * qpb/{Makefile.am,README.txt,qpb.h,.gitignore} Add the qpb library, which provides shared code and definitions for using protocol buffers in quagga code. * qpb/qpb.proto Protobuf definitions that can be shared by all of quagga. * qpb/linear_allocator.h An allocator that allocates memory by walking down towards the end of a buffer. This is used to cheaply allocate/deallocate memory on the stack for protobuf operations. * qpb/qpb_allocator.[ch] Thin layer that allows a linear allocator to be used with the protobuf-c library. * common.am This is an automake fragment that is intended to be shared by Makefile.am files in the tree. It currently includes definitions related to protobuf. * configure.ac - Add logic to optionally build protobuf code. By default, protobuf support is enabled if the protobuf C compiler (protoc-c) is available, and the associated header files/library can be found. The user can choose to override this behavior via the new --disable-protobuf/--enable-protobuf flags. - Include the quagga protobuf library (qpb) in the build. * .gitignore Ignore source code generated by protobuf compiler. * Makefile.am Add 'qpb' to the list of subdirectories. Signed-off-by: Avneesh Sachdev <avneesh@sproute.com> Edited: Paul Jakma <paul.jakma@hpe.com>: Change the sense of the configure enable option to require explicit specifying, as an experimental feature.
2016-04-04 19:54:55 +02:00
#
# End of logic for protobuf support.
#
AC_MSG_CHECKING(if zebra should be configurable to send Route Advertisements)
if test "${enable_rtadv}" != "no"; then
2003-05-25 22:18:13 +02:00
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_RTADV,,Enable IPv6 Routing Advertisement support)
2003-05-26 01:51:31 +02:00
else
AC_MSG_RESULT(no)
2003-05-25 22:18:13 +02:00
fi
2003-03-17 03:05:07 +01:00
if test x"${enable_user}" = x"no"; then
enable_user=""
else
if test x"${enable_user}" = x"yes" || test x"${enable_user}" = x""; then
enable_user="frr"
fi
AC_DEFINE_UNQUOTED(FRR_USER, "${enable_user}", frr User)
fi
if test x"${enable_group}" = x"no"; then
enable_group=""
else
if test x"${enable_group}" = x"yes" || test x"${enable_group}" = x""; then
enable_group="frr"
fi
AC_DEFINE_UNQUOTED(FRR_GROUP, "${enable_group}", frr Group)
fi
if test x"${enable_vty_group}" = x"yes" ; then
AC_MSG_ERROR([--enable-vty-group requires a group as argument, not yes])
elif test x"${enable_vty_group}" != x""; then
if test x"${enable_vty_group}" != x"no"; then
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])
enable_configfile_mask=${enable_configfile_mask:-0600}
AC_DEFINE_UNQUOTED(CONFIGFILE_MASK, ${enable_configfile_mask}, Mask for config files)
enable_logfile_mask=${enable_logfile_mask:-0600}
AC_DEFINE_UNQUOTED(LOGFILE_MASK, ${enable_logfile_mask}, Mask for log files)
MPATH_NUM=1
2003-03-17 03:05:07 +01:00
case "${enable_multipath}" in
0)
MPATH_NUM=64
;;
[[1-9]|[1-9][0-9]|[1-9][0-9][0-9]])
MPATH_NUM="${enable_multipath}"
2003-03-17 03:05:07 +01:00
;;
"")
;;
*)
AC_MSG_FAILURE([Please specify digit to enable multipath ARG])
2003-03-17 03:05:07 +01:00
;;
esac
AC_DEFINE_UNQUOTED(MULTIPATH_NUM, $MPATH_NUM, Maximum number of paths for a route)
2003-03-17 03:05:07 +01:00
AC_DEFINE_UNQUOTED(VTYSH_PAGER, "$VTYSH_PAGER", [What pager to use])
dnl --------------------
dnl Enable code coverage
dnl --------------------
AM_CONDITIONAL([HAVE_GCOV],[test '!' "$enable_gcov" = no])
dnl ------------------------------------
dnl Alpine only accepts numeric versions
dnl ------------------------------------
if test "x${enable_numeric_version}" != "x" ; then
VERSION="`echo ${VERSION} | tr -c -d '[[.0-9]]'`"
PACKAGE_VERSION="`echo ${PACKAGE_VERSION} | tr -c -d '[[.0-9]]'`"
fi
dnl -----------------------------------
dnl Add extra version string to package
dnl name, string and version fields.
dnl -----------------------------------
if test "x${EXTRAVERSION}" != "x" ; then
VERSION="${VERSION}${EXTRAVERSION}"
PACKAGE_VERSION="${PACKAGE_VERSION}${EXTRAVERSION}"
AC_SUBST(PACKAGE_EXTRAVERSION, ["${EXTRAVERSION}"])
PACKAGE_STRING="${PACKAGE_STRING}${EXTRAVERSION}"
fi
AC_SUBST(EXTRAVERSION)
if test "x$with_pkg_git_version" = "xyes"; then
if test -d "${srcdir}/.git"; then
AC_DEFINE(GIT_VERSION, [1], [include git version info])
else with_pkg_git_version="no"
AC_MSG_WARN([--with-pkg-git-version given, but this is not a git checkout])
fi
fi
AM_CONDITIONAL([GIT_VERSION], [test "x$with_pkg_git_version" = "xyes"])
AC_CHECK_TOOL([OBJCOPY], [objcopy], [:])
AC_CACHE_CHECK([for .interp value to use], [frr_cv_interp], [
frr_cv_interp=""
AC_LINK_IFELSE([AC_LANG_SOURCE([[int main() { return 0; }]])], [
if $OBJCOPY -j.interp -Obinary conftest conftest.interp; then
frr_cv_interp="`xargs -0 echo < conftest.interp`"
fi
test -f conftest.interp && rm conftest.interp
])
])
if test -n "$frr_cv_interp"; then
AC_DEFINE_UNQUOTED(INTERP, ["$frr_cv_interp"], [.interp value])
fi
dnl ------------------------------------
dnl Check C keywords and standard types
dnl ------------------------------------
AC_C_CONST
AC_C_INLINE
AC_C_VOLATILE
AC_HEADER_STDC
dnl AC_TYPE_PID_T
AC_TYPE_UID_T
AC_TYPE_MODE_T
AC_TYPE_SIZE_T
AC_STRUCT_TM
dnl -------------------------
dnl Check other header files.
dnl -------------------------
AC_CHECK_HEADERS([stropts.h sys/ksym.h \
linux/version.h asm/types.h \
sys/cdefs.h])
ac_stdatomic_ok=false
AC_DEFINE(FRR_AUTOCONF_ATOMIC, 1, [did autoconf checks for atomic funcs])
AC_CHECK_HEADER([stdatomic.h],[
AC_MSG_CHECKING([whether _Atomic qualifier works])
AC_LINK_IFELSE([AC_LANG_SOURCE([[
#include <stdatomic.h>
int main(int argc, char **argv) {
_Atomic int i = 0;
return i;
}
]])], [
AC_DEFINE(HAVE_STDATOMIC_H, 1, [found stdatomic.h])
AC_MSG_RESULT([yes])
ac_stdatomic_ok=true
], [
AC_MSG_RESULT([no])
])
])
AS_IF([$ac_stdatomic_ok], [true], [
AC_MSG_CHECKING([for __atomic_* builtins])
AC_LINK_IFELSE([AC_LANG_SOURCE([[
int main(int argc, char **argv) {
volatile int i = 1;
__atomic_store_n (&i, 0, __ATOMIC_RELEASE);
return __atomic_load_n (&i, __ATOMIC_ACQUIRE);
}
]])], [
AC_DEFINE(HAVE___ATOMIC, 1, [found __atomic builtins])
AC_MSG_RESULT([yes])
], [
AC_MSG_RESULT([no])
dnl FreeBSD 9 has a broken stdatomic.h where _Atomic doesn't work
AC_MSG_CHECKING([for __sync_* builtins])
AC_LINK_IFELSE([AC_LANG_SOURCE([[
int main(int argc, char **argv) {
volatile int i = 1;
__sync_fetch_and_sub (&i, 1);
return __sync_val_compare_and_swap (&i, 0, 1);
}
]])], [
AC_DEFINE(HAVE___SYNC, 1, [found __sync builtins])
AC_MSG_RESULT([yes])
AC_MSG_CHECKING([for __sync_swap builtin])
AC_LINK_IFELSE([AC_LANG_SOURCE([[
int main(int argc, char **argv) {
volatile int i = 1;
return __sync_swap (&i, 2);
}
]])], [
AC_DEFINE(HAVE___SYNC_SWAP, 1, [found __sync_swap builtin])
AC_MSG_RESULT([yes])
], [
AC_MSG_RESULT([no])
])
], [
AC_MSG_RESULT([no])
AC_MSG_FAILURE([stdatomic.h unavailable and $CC has neither __atomic nor __sync builtins])
])
])
])
AC_CHECK_HEADERS([pthread_np.h],,, [
#include <pthread.h>
])
AC_CHECK_FUNCS([pthread_setname_np pthread_set_name_np])
dnl Utility macro to avoid retyping includes all the time
2016-12-14 20:22:59 +01:00
m4_define([FRR_INCLUDES],
[#ifdef SUNOS_5
#define _POSIX_C_SOURCE 200809L
#define __EXTENSIONS__
#endif
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <sys/types.h>
/* sys/conf.h depends on param.h on FBSD at least */
#include <sys/param.h>
/* Required for MAXSIG */
#include <signal.h>
#include <sys/socket.h>
#ifdef __APPLE__
# define __APPLE_USE_RFC_3542
#endif
#include <netinet/in.h>
#include <sys/time.h>
#include <time.h>
#include <net/if.h>
])dnl
dnl Same applies for HAVE_NET_IF_VAR_H, which HAVE_NETINET6_ND6_H and
dnl HAVE_NETINET_IN_VAR_H depend upon. But if_var.h depends on if.h, hence
dnl an additional round for it.
2016-12-14 20:22:59 +01:00
AC_CHECK_HEADERS([net/if_var.h], [], [], FRR_INCLUDES)
2016-12-14 20:22:59 +01:00
m4_define([FRR_INCLUDES],
FRR_INCLUDES
[#if HAVE_NET_IF_VAR_H
# include <net/if_var.h>
#endif
])dnl
AC_CHECK_HEADERS([netinet/in_var.h \
net/if_dl.h net/netopt.h \
inet/nd.h netinet/ip_icmp.h \
sys/sysctl.h sys/sockio.h kvm.h sys/conf.h],
2016-12-14 20:22:59 +01:00
[], [], FRR_INCLUDES)
AC_CHECK_HEADERS([ucontext.h], [], [],
[#ifndef __USE_GNU
#define __USE_GNU
#endif /* __USE_GNU */
2016-12-14 20:22:59 +01:00
FRR_INCLUDES
])
m4_define([UCONTEXT_INCLUDES],
[#include <ucontext.h>])dnl
AC_CHECK_MEMBERS([ucontext_t.uc_mcontext.uc_regs],
[], [], [UCONTEXT_INCLUDES])
AC_CHECK_MEMBERS([ucontext_t.uc_mcontext.regs],
[AC_CHECK_MEMBERS([ucontext_t.uc_mcontext.regs.nip],
[], [], [UCONTEXT_INCLUDES])],
[], [UCONTEXT_INCLUDES])
AC_CHECK_MEMBERS([ucontext_t.uc_mcontext.gregs],
[], [], [UCONTEXT_INCLUDES])
2016-12-14 20:22:59 +01:00
m4_define([FRR_INCLUDES],
FRR_INCLUDES
[
#include <sys/un.h>
#include <netinet/in_systm.h>
#if HAVE_NETINET_IN_VAR_H
# include <netinet/in_var.h>
#endif
#if HAVE_NET_IF_DL_H
# include <net/if_dl.h>
#endif
#if HAVE_NET_NETOPT_H
# include <net/netopt.h>
#endif
#include <net/route.h>
#if HAVE_INET_ND_H
# include <inet/nd.h>
#endif
#include <arpa/inet.h>
/* Required for IDRP */
#if HAVE_NETINET_IP_ICMP_H
# include <netinet/ip_icmp.h>
#endif
])dnl
dnl V6 headers are checked below, after we check for v6
2003-03-17 03:05:07 +01:00
AC_MSG_CHECKING([which operating system interface to use])
case "$host_os" in
sunos* | solaris2*)
AC_MSG_RESULT([Solaris])
AC_DEFINE(SUNOS_5, 1, [SunOS 5])
AC_DEFINE(SOLARIS_IPV6, 1, Solaris IPv6)
AC_DEFINE(_POSIX_C_SOURCE, 200809L, [enable POSIX.1-2008 and XPG7/SUSv4])
AC_CHECK_LIB(socket, main)
AC_CHECK_LIB(nsl, main)
AC_CHECK_LIB(umem, main)
SOLARIS="solaris"
;;
linux*)
AC_MSG_RESULT([Linux])
AC_DEFINE(GNU_LINUX,,GNU Linux)
AC_DEFINE(HAVE_NETLINK,,netlink)
AC_DEFINE(LINUX_IPV6,1,Linux IPv6 stack)
dnl Linux has a compilation problem with mixing
dnl netinet/in.h and linux/in6.h they are not
dnl compatible. There has been discussion on
dnl how to fix it but no real progress on implementation
dnl when they fix it, remove this
AC_DEFINE(IPV6_MINHOPCOUNT, 73, Linux ipv6 Min Hop Count)
;;
openbsd*)
AC_MSG_RESULT([OpenBSD])
AC_DEFINE(OPEN_BSD,,OpenBSD)
AC_DEFINE(KAME,1,KAME IPv6)
AC_DEFINE(BSD_V6_SYSCTL,1,BSD v6 sysctl to turn on and off forwarding)
if test "x${enable_pimd}" != "xno"; then
case "$host_os" in
openbsd6.0)
;;
openbsd[6-9]*)
AC_MSG_FAILURE([pimd cannot be enabled as PIM support has been removed from OpenBSD 6.1])
;;
esac
fi
;;
*)
AC_MSG_RESULT([BSD])
AC_DEFINE(HAVE_NET_RT_IFLIST,,NET_RT_IFLIST)
AC_DEFINE(KAME,1,KAME IPv6)
AC_DEFINE(BSD_V6_SYSCTL,1,BSD v6 sysctl to turn on and off forwarding)
;;
2003-03-17 03:05:07 +01:00
esac
2017-08-31 22:45:01 +02:00
AM_CONDITIONAL(SOLARIS, test "${SOLARIS}" = "solaris")
2003-03-17 03:05:07 +01:00
AC_SYS_LARGEFILE
dnl ------------------------
dnl Integrated REALMS option
dnl ------------------------
if test "${enable_realms}" = "yes"; then
case "$host_os" in
linux*)
AC_DEFINE(SUPPORT_REALMS,, Realms support)
;;
*)
echo "Sorry, only Linux has REALMS support"
exit 1
;;
esac
fi
AM_CONDITIONAL([SUPPORT_REALMS], [test "${enable_realms}" = "yes"])
2003-03-17 03:05:07 +01:00
dnl ---------------------
dnl Integrated VTY option
dnl ---------------------
case "${enable_vtysh}" in
"no")
VTYSH="";;
*)
VTYSH="vtysh";
AC_DEFINE(VTYSH,,VTY shell)
prev_libs="$LIBS"
AC_CHECK_LIB(readline, main, [
LIBREADLINE="-lreadline"
], [
dnl readline failed - it might be incorrectly linked and missing its
dnl termcap/tinfo/curses dependency. see if we can fix that...
AC_SEARCH_LIBS(tputs, [termcap tinfo curses ncurses], [
LIBREADLINE="$ac_cv_search_tputs"
], [
AC_MSG_ERROR([libreadline (needed for vtysh) not found and/or missing dependencies])
])
dnl re-try with the lib we found above
unset ac_cv_lib_readline_main
AC_CHECK_LIB(readline, main, [
LIBREADLINE="-lreadline $LIBREADLINE"
], [
AC_MSG_ERROR([libreadline (needed for vtysh) not found and/or missing dependencies])
], [$LIBREADLINE])
], [])
LIBS="$prev_libs"
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, [true], [], [$LIBREADLINE])
if test $ac_cv_lib_readline_rl_completion_matches = no; then
AC_DEFINE(rl_completion_matches,completion_matches,Old readline)
fi
AC_CHECK_LIB(readline, [append_history], [frr_cv_append_history=yes], [frr_cv_append_history=no], [$LIBREADLINE])
if test "$frr_cv_append_history" = yes; then
AC_DEFINE(HAVE_APPEND_HISTORY, 1, [Have history.h append_history])
fi
;;
2003-03-17 03:05:07 +01:00
esac
AC_SUBST(LIBREADLINE)
AM_CONDITIONAL(VTYSH, test "x$VTYSH" = "xvtysh")
2003-03-17 03:05:07 +01:00
dnl ----------
dnl PAM module
2011-07-14 22:24:15 +02:00
dnl
dnl FRR detects the PAM library it is built against by checking for a
2011-07-14 22:24:15 +02:00
dnl functional pam_misc.h (Linux-PAM) or openpam.h (OpenPAM) header. pam_misc.h
dnl is known to #include pam_appl.h, the standard header of a PAM library, and
dnl openpam.h doesn't do that, although depends on the header too. Hence a
dnl little assistance to AC_CHECK_HEADER is necessary for the proper detection
dnl of OpenPAM.
2003-03-17 03:05:07 +01:00
dnl ----------
if test "$with_libpam" = "yes"; then
AC_CHECK_HEADER([security/pam_misc.h],
[AC_DEFINE(HAVE_PAM_MISC_H,,Have pam_misc.h)
AC_DEFINE(PAM_CONV_FUNC,misc_conv,Have misc_conv)
pam_conv_func="misc_conv"
],
2016-12-14 20:22:59 +01:00
[], FRR_INCLUDES)
AC_CHECK_HEADER([security/openpam.h],
[AC_DEFINE(HAVE_OPENPAM_H,,Have openpam.h)
AC_DEFINE(PAM_CONV_FUNC,openpam_ttyconv,Have openpam_ttyconv)
pam_conv_func="openpam_ttyconv"
],
2016-12-14 20:22:59 +01:00
[], FRR_INCLUDES[#include <security/pam_appl.h>])
if test -z "$ac_cv_header_security_pam_misc_h$ac_cv_header_security_openpam_h" ; then
AC_MSG_WARN([*** pam support will not be built ***])
with_libpam="no"
fi
fi
2003-03-17 03:05:07 +01:00
if test "$with_libpam" = "yes"; then
dnl took this test from proftpds configure.in and suited to our needs
2003-03-17 03:05:07 +01:00
dnl -------------------------------------------------------------------------
dnl
dnl This next check looks funky due to a linker problem with some versions
dnl of the PAM library. Prior to 0.72 release, the Linux PAM shared library
dnl omitted requiring libdl linking information. PAM-0.72 or better ships
dnl with RedHat 6.2 and Debian 2.2 or better.
AC_CHECK_LIB(pam, pam_start,
[AC_CHECK_LIB(pam, $pam_conv_func,
2003-03-17 03:05:07 +01:00
[AC_DEFINE(USE_PAM,,Use PAM for authentication)
LIBPAM="-lpam"],
[AC_DEFINE(USE_PAM,,Use PAM for authentication)
LIBPAM="-lpam -lpam_misc"]
)
],
[AC_CHECK_LIB(pam, pam_end,
[AC_CHECK_LIB(pam, $pam_conv_func,
[AC_DEFINE(USE_PAM,,Use PAM for authentication)
2003-03-17 03:05:07 +01:00
LIBPAM="-lpam -ldl"],
[AC_DEFINE(USE_PAM,,Use PAM for authentication)
2003-03-17 03:05:07 +01:00
LIBPAM="-lpam -ldl -lpam_misc"]
)
],AC_MSG_WARN([*** pam support will not be built ***]),
[-ldl])
]
)
fi
AC_SUBST(LIBPAM)
dnl -------------------------------
dnl Endian-ness check
dnl -------------------------------
AC_WORDS_BIGENDIAN
dnl -------------------------------
dnl check the size in byte of the C
dnl -------------------------------
dnl AC_CHECK_SIZEOF(char)
dnl AC_CHECK_SIZEOF(int)
dnl AC_CHECK_SIZEOF(short)
dnl AC_CHECK_SIZEOF(long)
dnl ----------------------------
dnl check existance of functions
dnl ----------------------------
AC_FUNC_FNMATCH
AC_FUNC_FORK
AC_FUNC_MKTIME
AC_FUNC_STAT
dnl -------------------------------
dnl bgpd needs pow() and hence libm
dnl -------------------------------
TMPLIBS="$LIBS"
AC_CHECK_HEADER([math.h],
[AC_CHECK_LIB([m], [pow],
[LIBM="-lm"
LIBS="$LIBS $LIBM"
AC_CHECK_FUNCS(pow,[],[LIBM=""])
])
])
if test x"$LIBM" = x ; then
AC_MSG_WARN([Unable to find working pow function - bgpd may not link])
fi
LIBS="$TMPLIBS"
AC_SUBST(LIBM)
AC_CHECK_FUNCS([ppoll], [
AC_DEFINE([HAVE_PPOLL], 1, [have Linux/BSD ppoll()])
])
AC_CHECK_FUNCS([pollts], [
AC_DEFINE([HAVE_POLLTS], 1, [have NetBSD pollts()])
])
dnl ---------------
dnl other functions
dnl ---------------
AC_CHECK_FUNCS([ \
strlcat strlcpy \
getgrouplist])
AC_CHECK_HEADER([asm-generic/unistd.h],
[AC_CHECK_DECL(__NR_setns,
AC_DEFINE(HAVE_NETNS,, Have netns),,
2016-12-14 20:22:59 +01:00
FRR_INCLUDES [#include <asm-generic/unistd.h>
])
AC_CHECK_FUNCS(setns)]
)
dnl --------------------------
dnl Determine IS-IS I/O method
dnl --------------------------
AC_DEFINE(ISIS_METHOD_PFPACKET, 1, [ constant value for isis method pfpacket ])
AC_DEFINE(ISIS_METHOD_DLPI, 2, [ constant value for isis method dlpi ])
AC_DEFINE(ISIS_METHOD_BPF, 3, [ constant value for isis method bpf ])
AC_CHECK_HEADER(net/bpf.h)
AC_CHECK_HEADER(sys/dlpi.h)
AC_MSG_CHECKING(zebra IS-IS I/O method)
case "$host_os" in
linux*)
AC_MSG_RESULT(pfpacket)
ISIS_METHOD_MACRO="ISIS_METHOD_PFPACKET"
;;
solaris* | sunos*)
AC_MSG_RESULT(DLPI)
ISIS_METHOD_MACRO="ISIS_METHOD_DLPI"
;;
*)
if test $ac_cv_header_net_bpf_h = no; then
if test $ac_cv_header_sys_dlpi_h = no; then
AC_MSG_RESULT(none)
if test "${enable_isisd}" = yes -o "${enable_fabricd}" = yes; then
AC_MSG_FAILURE([IS-IS support requested but no packet backend found])
fi
AC_MSG_WARN([*** IS-IS support will not be built ***])
enable_isisd="no"
enable_fabricd="no"
else
AC_MSG_RESULT(DLPI)
fi
ISIS_METHOD_MACRO="ISIS_METHOD_DLPI"
else
AC_MSG_RESULT(BPF)
ISIS_METHOD_MACRO="ISIS_METHOD_BPF"
fi
;;
esac
AC_DEFINE_UNQUOTED(ISIS_METHOD, $ISIS_METHOD_MACRO, [ selected method for isis, == one of the constants ])
dnl ---------------------------------------------------------------
dnl figure out how to specify an interface in multicast sockets API
dnl ---------------------------------------------------------------
2016-12-14 20:22:59 +01:00
AC_CHECK_MEMBERS([struct ip_mreqn.imr_ifindex], [], [], FRR_INCLUDES)
AC_CHECK_HEADERS([linux/mroute.h], [], [],[
#include <sys/socket.h>
#include <netinet/in.h>
#define _LINUX_IN_H /* For Linux <= 2.6.25 */
#include <linux/types.h>
])
2016-12-14 20:22:59 +01:00
m4_define([FRR_INCLUDES],
FRR_INCLUDES
[#if HAVE_LINUX_MROUTE_H
# include <linux/mroute.h>
#endif
])dnl
AC_CHECK_HEADERS([netinet/ip_mroute.h], [], [],[
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <net/route.h>
])
2016-12-14 20:22:59 +01:00
m4_define([FRR_INCLUDES],
FRR_INCLUDES
[#if HAVE_NETINET_IP_MROUTE_H
# include <netinet/ip_mroute.h>
#endif
])dnl
AC_MSG_CHECKING([for BSD struct ip_mreq hack])
AC_TRY_COMPILE([#include <sys/param.h>],
[#if (defined(__FreeBSD__) && ((__FreeBSD_version >= 500022 && __FreeBSD_version < 700000) || (__FreeBSD_version < 500000 && __FreeBSD_version >= 440000))) || (defined(__NetBSD__) && defined(__NetBSD_Version__) && __NetBSD_Version__ >= 106010000) || defined(__OpenBSD__) || defined(__APPLE__) || defined(__DragonFly__) || defined(__sun)
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))
AC_MSG_CHECKING([for RFC3678 protocol-independed API])
AC_TRY_COMPILE([
#include <sys/types.h>
#include <netinet/in.h>
], [struct group_req gr; int sock; setsockopt(sock, IPPROTO_IP, MCAST_JOIN_GROUP, (void*)&gr, sizeof(gr));
], [AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_RFC3678,1,[Have RFC3678 protocol-independed API])],
AC_MSG_RESULT(no))
dnl ---------------------------------------------------------------
dnl figure out how to check link-state
dnl ---------------------------------------------------------------
AC_CHECK_HEADER( [net/if_media.h],
[m4_define([LINK_DETECT_INCLUDES],
2016-12-14 20:22:59 +01:00
FRR_INCLUDES
[#include <net/if_media.h>
])
AC_CHECK_MEMBERS( [struct ifmediareq.ifm_status],
AC_DEFINE(HAVE_BSD_LINK_DETECT,,[BSD link-detect]),
[], LINK_DETECT_INCLUDES)],
[],
2016-12-14 20:22:59 +01:00
FRR_INCLUDES)
dnl ---------------------------------------------------------------
dnl Additional, newer way to check link-state using ifi_link_state.
dnl Not available in all BSD's when ifmediareq available
dnl ---------------------------------------------------------------
AC_CHECK_MEMBERS([struct if_data.ifi_link_state],
AC_DEFINE(HAVE_BSD_IFI_LINK_STATE,,[BSD ifi_link_state available]),
2016-12-14 20:22:59 +01:00
[], FRR_INCLUDES)
[bgpd] TCP-MD5: password vty configuration and initial Linux support 2008-07-21 Paul Jakma <paul.jakma@sun.com> * bgp_packet.c: (bgp_open_receive) fix warning in a zlog call * bgp_vty.c: (bgp_vty_return) add return code * bgpd.c: (bgp_master_init) setup the socket list. * bgp_network.c: Remove the dual IPv4/6 socket thing for now, which was implemented by Michael, until such time as its clear its required for Linux (see sockopt comments). IPv6 support, including IPv4 sessions on AF_INET6 sockets, therefore is broken, and the '-l 0.0.0.0' arguments would need to be given to bgpd to make things work here. 2008-07-21 Michael H. Warfield <mhw@wittsend.com> YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Tomohiko Kusuda <kusuda@inetcore.com> Leigh Brown <leigh@solinno.co.uk> * bgp_network.c: (bgp_md5_set_one) shim between libzebra tcp-md5 sockopt and bgpd. (bgp_md5_set_socket) Helper for bgp_connect (bgp_md5_set) setup TCP-MD5SIG for the given peer. (bgp_connect) call out to bgp_md5_set_socket for the outgoing connect socket. (bgp_socket) save references to the listen sockets, needed if TCP-MD5SIG is applied later or changed. * bgp_vty.c: (*neighbor_password_cmd) New 'neighbor ... password' commands. * bgpd.c: (peer_{new,delete) manage TCP-MD5 password (peer_group2peer_config_copy) inherit TCP-MD5 password (peer_password_{un,}set) orchestrate the whole add/remove of TCP-MD5 passwords: applying checks, stopping peers, and trying to return errors to UI, etc. (bgp_config_write_peer) save password. Fix missing newline in writeout of neighbor ... port. 2008-07-21 Paul Jakma <paul.jakma@sun.com> * sockunion.c: ifdef out various places that converted v4mapped sockets to pure v4. Doesn't seem necessary at all, presumably a workaround for now historical inet_ntop bugs (?) 2008-07-21 Michael H. Warfield <mhw@wittsend.com> YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> * sockopt.{c,h}: (sockopt_tcp_signature) Add TCP-MD5SIG support.
2008-07-21 23:02:49 +02:00
dnl ------------------------
dnl TCP_MD5SIG socket option
dnl ------------------------
AC_CHECK_HEADER([netinet/tcp.h],
[m4_define([MD5_INCLUDES],
2016-12-14 20:22:59 +01:00
FRR_INCLUDES
[bgpd] TCP-MD5: password vty configuration and initial Linux support 2008-07-21 Paul Jakma <paul.jakma@sun.com> * bgp_packet.c: (bgp_open_receive) fix warning in a zlog call * bgp_vty.c: (bgp_vty_return) add return code * bgpd.c: (bgp_master_init) setup the socket list. * bgp_network.c: Remove the dual IPv4/6 socket thing for now, which was implemented by Michael, until such time as its clear its required for Linux (see sockopt comments). IPv6 support, including IPv4 sessions on AF_INET6 sockets, therefore is broken, and the '-l 0.0.0.0' arguments would need to be given to bgpd to make things work here. 2008-07-21 Michael H. Warfield <mhw@wittsend.com> YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Tomohiko Kusuda <kusuda@inetcore.com> Leigh Brown <leigh@solinno.co.uk> * bgp_network.c: (bgp_md5_set_one) shim between libzebra tcp-md5 sockopt and bgpd. (bgp_md5_set_socket) Helper for bgp_connect (bgp_md5_set) setup TCP-MD5SIG for the given peer. (bgp_connect) call out to bgp_md5_set_socket for the outgoing connect socket. (bgp_socket) save references to the listen sockets, needed if TCP-MD5SIG is applied later or changed. * bgp_vty.c: (*neighbor_password_cmd) New 'neighbor ... password' commands. * bgpd.c: (peer_{new,delete) manage TCP-MD5 password (peer_group2peer_config_copy) inherit TCP-MD5 password (peer_password_{un,}set) orchestrate the whole add/remove of TCP-MD5 passwords: applying checks, stopping peers, and trying to return errors to UI, etc. (bgp_config_write_peer) save password. Fix missing newline in writeout of neighbor ... port. 2008-07-21 Paul Jakma <paul.jakma@sun.com> * sockunion.c: ifdef out various places that converted v4mapped sockets to pure v4. Doesn't seem necessary at all, presumably a workaround for now historical inet_ntop bugs (?) 2008-07-21 Michael H. Warfield <mhw@wittsend.com> YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> * sockopt.{c,h}: (sockopt_tcp_signature) Add TCP-MD5SIG support.
2008-07-21 23:02:49 +02:00
[#include <netinet/tcp.h>
])
AC_CHECK_DECLS([TCP_MD5SIG], [], [], MD5_INCLUDES)],
[],
2016-12-14 20:22:59 +01:00
FRR_INCLUDES)
[bgpd] TCP-MD5: password vty configuration and initial Linux support 2008-07-21 Paul Jakma <paul.jakma@sun.com> * bgp_packet.c: (bgp_open_receive) fix warning in a zlog call * bgp_vty.c: (bgp_vty_return) add return code * bgpd.c: (bgp_master_init) setup the socket list. * bgp_network.c: Remove the dual IPv4/6 socket thing for now, which was implemented by Michael, until such time as its clear its required for Linux (see sockopt comments). IPv6 support, including IPv4 sessions on AF_INET6 sockets, therefore is broken, and the '-l 0.0.0.0' arguments would need to be given to bgpd to make things work here. 2008-07-21 Michael H. Warfield <mhw@wittsend.com> YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Tomohiko Kusuda <kusuda@inetcore.com> Leigh Brown <leigh@solinno.co.uk> * bgp_network.c: (bgp_md5_set_one) shim between libzebra tcp-md5 sockopt and bgpd. (bgp_md5_set_socket) Helper for bgp_connect (bgp_md5_set) setup TCP-MD5SIG for the given peer. (bgp_connect) call out to bgp_md5_set_socket for the outgoing connect socket. (bgp_socket) save references to the listen sockets, needed if TCP-MD5SIG is applied later or changed. * bgp_vty.c: (*neighbor_password_cmd) New 'neighbor ... password' commands. * bgpd.c: (peer_{new,delete) manage TCP-MD5 password (peer_group2peer_config_copy) inherit TCP-MD5 password (peer_password_{un,}set) orchestrate the whole add/remove of TCP-MD5 passwords: applying checks, stopping peers, and trying to return errors to UI, etc. (bgp_config_write_peer) save password. Fix missing newline in writeout of neighbor ... port. 2008-07-21 Paul Jakma <paul.jakma@sun.com> * sockunion.c: ifdef out various places that converted v4mapped sockets to pure v4. Doesn't seem necessary at all, presumably a workaround for now historical inet_ntop bugs (?) 2008-07-21 Michael H. Warfield <mhw@wittsend.com> YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> * sockopt.{c,h}: (sockopt_tcp_signature) Add TCP-MD5SIG support.
2008-07-21 23:02:49 +02:00
if test $ac_cv_have_decl_TCP_MD5SIG = no; then
AC_CHECK_HEADER([linux/tcp.h],
[m4_define([MD5_INCLUDES],
2016-12-14 20:22:59 +01:00
FRR_INCLUDES
[bgpd] TCP-MD5: password vty configuration and initial Linux support 2008-07-21 Paul Jakma <paul.jakma@sun.com> * bgp_packet.c: (bgp_open_receive) fix warning in a zlog call * bgp_vty.c: (bgp_vty_return) add return code * bgpd.c: (bgp_master_init) setup the socket list. * bgp_network.c: Remove the dual IPv4/6 socket thing for now, which was implemented by Michael, until such time as its clear its required for Linux (see sockopt comments). IPv6 support, including IPv4 sessions on AF_INET6 sockets, therefore is broken, and the '-l 0.0.0.0' arguments would need to be given to bgpd to make things work here. 2008-07-21 Michael H. Warfield <mhw@wittsend.com> YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Tomohiko Kusuda <kusuda@inetcore.com> Leigh Brown <leigh@solinno.co.uk> * bgp_network.c: (bgp_md5_set_one) shim between libzebra tcp-md5 sockopt and bgpd. (bgp_md5_set_socket) Helper for bgp_connect (bgp_md5_set) setup TCP-MD5SIG for the given peer. (bgp_connect) call out to bgp_md5_set_socket for the outgoing connect socket. (bgp_socket) save references to the listen sockets, needed if TCP-MD5SIG is applied later or changed. * bgp_vty.c: (*neighbor_password_cmd) New 'neighbor ... password' commands. * bgpd.c: (peer_{new,delete) manage TCP-MD5 password (peer_group2peer_config_copy) inherit TCP-MD5 password (peer_password_{un,}set) orchestrate the whole add/remove of TCP-MD5 passwords: applying checks, stopping peers, and trying to return errors to UI, etc. (bgp_config_write_peer) save password. Fix missing newline in writeout of neighbor ... port. 2008-07-21 Paul Jakma <paul.jakma@sun.com> * sockunion.c: ifdef out various places that converted v4mapped sockets to pure v4. Doesn't seem necessary at all, presumably a workaround for now historical inet_ntop bugs (?) 2008-07-21 Michael H. Warfield <mhw@wittsend.com> YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> * sockopt.{c,h}: (sockopt_tcp_signature) Add TCP-MD5SIG support.
2008-07-21 23:02:49 +02:00
[#include <linux/tcp.h>
])
AC_CHECK_DECLS([TCP_MD5SIG], [], [], MD5_INCLUDES)])
fi
dnl ----------------------------------------------------------------------------
dnl figure out if domainname is available in the utsname struct (GNU extension).
dnl ----------------------------------------------------------------------------
AC_CHECK_MEMBERS([struct utsname.domainname], [], [], [#include <sys/utsname.h>])
dnl ------------------
dnl IPv6 header checks
dnl ------------------
AC_CHECK_HEADERS([netinet6/in6.h netinet/in6_var.h \
netinet6/in6_var.h netinet6/nd6.h], [], [],
2016-12-14 20:22:59 +01:00
FRR_INCLUDES)
2016-12-14 20:22:59 +01:00
m4_define([FRR_INCLUDES],dnl
FRR_INCLUDES
[#if HAVE_NETINET6_IN6_H
#include <netinet6/in6.h>
#endif
#if HAVE_NETINET_IN6_VAR_H
#include <netinet/in6_var.h>
#endif
#include <netinet/icmp6.h>
#if HAVE_NETINET6_IN6_VAR_H
# include <netinet6/in6_var.h>
#endif
#if HAVE_NETINET6_ND6_H
# include <netinet6/nd6.h>
#endif
])dnl
dnl disable doc check
AC_CHECK_PROGS([SPHINXBUILD], [sphinx-build sphinx-build3 sphinx-build2], [/bin/false])
if test "$SPHINXBUILD" = "/bin/false"; then
if test "${enable_doc}" = "yes"; then
AC_MSG_ERROR([Documentation was explicitly requested with --enable-doc but sphinx-build is not available. Please disable docs or install sphinx.])
fi
fi
AM_CONDITIONAL(DOC, test "${enable_doc}" != "no" -a "$SPHINXBUILD" != "/bin/false")
AM_CONDITIONAL(DOC_HTML, test "${enable_doc_html}" = "yes")
2003-03-17 03:05:07 +01:00
dnl --------------------
dnl Daemon disable check
dnl --------------------
AM_CONDITIONAL(ZEBRA, test "${enable_zebra}" != "no")
2003-03-17 03:05:07 +01:00
if test "${enable_bgpd}" = "no";then
BGPD=""
else
BGPD="bgpd"
fi
AM_CONDITIONAL(BGPD, test "x$BGPD" = "xbgpd")
2003-03-17 03:05:07 +01:00
AM_CONDITIONAL(RIPD, test "${enable_ripd}" != "no")
AM_CONDITIONAL(OSPFD, test "${enable_ospfd}" != "no")
AM_CONDITIONAL(LDPD, test "${enable_ldpd}" != "no")
2003-03-17 03:05:07 +01:00
AS_IF([test "${enable_ldpd}" != "no"], [
AC_DEFINE(HAVE_LDPD, 1, ldpd)
])
if test "$enable_bfdd" = "no"; then
AC_DEFINE(HAVE_BFDD, 0, bfdd)
BFDD=""
else
AC_DEFINE(HAVE_BFDD, 1, bfdd)
BFDD="bfdd"
case $host_os in
linux*)
AC_DEFINE(BFD_LINUX, 1, bfdd)
;;
*)
AC_DEFINE(BFD_BSD, 1, bfdd)
;;
esac
fi
AM_CONDITIONAL(BFDD, [test "x$BFDD" = "xbfdd"])
if test "$ac_cv_lib_json_c_json_object_get" = no -a "x$BFDD" = "xbfdd"; then
AC_MSG_ERROR(["you must use json-c library to use bfdd"])
fi
NHRPD=""
case "$host_os" in
linux*)
if test "${enable_nhrpd}" != "no"; then
NHRPD="nhrpd"
fi
;;
*)
if test "${enable_nhrpd}" = "yes"; then
AC_MSG_ERROR([nhrpd requires kernel APIs that are only present on Linux.])
fi
;;
esac
AM_CONDITIONAL(NHRPD, test "x$NHRPD" = "xnhrpd")
AM_CONDITIONAL(EIGRPD, test "${enable_eigrpd}" != "no")
if test "${enable_watchfrr}" = "no";then
WATCHFRR=""
else
WATCHFRR="watchfrr"
fi
AM_CONDITIONAL(WATCHFRR, test "x$WATCHFRR" = "xwatchfrr")
OSPFCLIENT=""
if test "${enable_ospfapi}" != "no";then
2003-03-28 02:45:13 +01:00
AC_DEFINE(SUPPORT_OSPF_API,,OSPFAPI)
if test "${enable_ospfclient}" != "no";then
OSPFCLIENT="ospfclient"
fi
2003-03-17 03:05:07 +01:00
fi
AM_CONDITIONAL(OSPFCLIENT, test "x$OSPFCLIENT" = "xospfclient")
AM_CONDITIONAL(RIPNGD, test "${enable_ripngd}" != "no")
AM_CONDITIONAL(BABELD, test "${enable_babeld}" != "no")
AM_CONDITIONAL(OSPF6D, test "${enable_ospf6d}" != "no")
AM_CONDITIONAL(ISISD, test "${enable_isisd}" != "no")
AM_CONDITIONAL(PIMD, test "${enable_pimd}" != "no")
pbrd: Add PBR to FRR This is an implementation of PBR for FRR. This implemenation uses a combination of rules and tables to determine how packets will flow. PBR introduces a new concept of 'nexthop-groups' to specify a group of nexthops that will be used for ecmp. Nexthop-groups are specified on the cli via: nexthop-group DONNA nexthop 192.168.208.1 nexthop 192.168.209.1 nexthop 192.168.210.1 ! PBR sees the nexthop-group and installs these as a default route with these nexthops starting at table 10000 robot# show pbr nexthop-groups Nexthop-Group: DONNA Table: 10001 Valid: 1 Installed: 1 Valid: 1 nexthop 192.168.209.1 Valid: 1 nexthop 192.168.210.1 Valid: 1 nexthop 192.168.208.1 I have also introduced the ability to specify a table in a 'show ip route table XXX' to see the specified tables. robot# show ip route table 10001 Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF, I - IS-IS, B - BGP, P - PIM, E - EIGRP, N - NHRP, T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP, F - PBR, > - selected route, * - FIB route F>* 0.0.0.0/0 [0/0] via 192.168.208.1, enp0s8, 00:14:25 * via 192.168.209.1, enp0s9, 00:14:25 * via 192.168.210.1, enp0s10, 00:14:25 PBR tracks PBR-MAPS via the pbr-map command: ! pbr-map EVA seq 10 match src-ip 4.3.4.0/24 set nexthop-group DONNA ! pbr-map EVA seq 20 match dst-ip 4.3.5.0/24 set nexthop-group DONNA ! pbr-maps can have 'match src-ip <prefix>' and 'match dst-ip <prefix>' to affect decisions about incoming packets. Additionally if you only have one nexthop to use for a pbr-map you do not need to setup a nexthop-group and can specify 'set nexthop XXXX'. To apply the pbr-map to an incoming interface you do this: interface enp0s10 pbr-policy EVA ! When a pbr-map is applied to interfaces it can be installed into the kernel as a rule: [sharpd@robot frr1]$ ip rule show 0: from all lookup local 309: from 4.3.4.0/24 iif enp0s10 lookup 10001 319: from all to 4.3.5.0/24 iif enp0s10 lookup 10001 1000: from all lookup [l3mdev-table] 32766: from all lookup main 32767: from all lookup default [sharpd@robot frr1]$ ip route show table 10001 default proto pbr metric 20 nexthop via 192.168.208.1 dev enp0s8 weight 1 nexthop via 192.168.209.1 dev enp0s9 weight 1 nexthop via 192.168.210.1 dev enp0s10 weight 1 The linux kernel now will use the rules and tables to properly apply these policies. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> Signed-off-by: Don Slice <dslice@cumulusnetworks.com> Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-01-23 19:11:36 +01:00
AM_CONDITIONAL(PBRD, test "${enable_pbrd}" != "no")
AM_CONDITIONAL(SHARPD, test "${enable_sharpd}" = "yes")
AM_CONDITIONAL(STATICD, test "${enable_staticd}" != "no")
AM_CONDITIONAL(FABRICD, test "${enable_fabricd}" != "no")
2003-03-17 03:05:07 +01:00
if test "${enable_bgp_announce}" = "no";then
AC_DEFINE(DISABLE_BGP_ANNOUNCE,1,Disable BGP installation to zebra)
else
AC_DEFINE(DISABLE_BGP_ANNOUNCE,0,Disable BGP installation to zebra)
2003-03-17 03:05:07 +01:00
fi
2016-09-29 00:16:25 +02:00
if test "${enable_bgp_vnc}" != "no";then
bgpd: add L3/L2VPN Virtual Network Control feature This feature adds an L3 & L2 VPN application that makes use of the VPN and Encap SAFIs. This code is currently used to support IETF NVO3 style operation. In NVO3 terminology it provides the Network Virtualization Authority (NVA) and the ability to import/export IP prefixes and MAC addresses from Network Virtualization Edges (NVEs). The code supports per-NVE tables. The NVE-NVA protocol used to communicate routing and Ethernet / Layer 2 (L2) forwarding information between NVAs and NVEs is referred to as the Remote Forwarder Protocol (RFP). OpenFlow is an example RFP. For general background on NVO3 and RFP concepts see [1]. For information on Openflow see [2]. RFPs are integrated with BGP via the RF API contained in the new "rfapi" BGP sub-directory. Currently, only a simple example RFP is included in Quagga. Developers may use this example as a starting point to integrate Quagga with an RFP of their choosing, e.g., OpenFlow. The RFAPI code also supports the ability import/export of routing information between VNC and customer edge routers (CEs) operating within a virtual network. Import/export may take place between BGP views or to the default zebera VRF. BGP, with IP VPNs and Tunnel Encapsulation, is used to distribute VPN information between NVAs. BGP based IP VPN support is defined in RFC4364, BGP/MPLS IP Virtual Private Networks (VPNs), and RFC4659, BGP-MPLS IP Virtual Private Network (VPN) Extension for IPv6 VPN . Use of both the Encapsulation Subsequent Address Family Identifier (SAFI) and the Tunnel Encapsulation Attribute, RFC5512, The BGP Encapsulation Subsequent Address Family Identifier (SAFI) and the BGP Tunnel Encapsulation Attribute, are supported. MAC address distribution does not follow any standard BGB encoding, although it was inspired by the early IETF EVPN concepts. The feature is conditionally compiled and disabled by default. Use the --enable-bgp-vnc configure option to enable. The majority of this code was authored by G. Paul Ziemba <paulz@labn.net>. [1] http://tools.ietf.org/html/draft-ietf-nvo3-nve-nva-cp-req [2] https://www.opennetworking.org/sdn-resources/technical-library Now includes changes needed to merge with cmaster-next.
2016-05-07 20:18:56 +02:00
AC_DEFINE(ENABLE_BGP_VNC,1,Enable BGP VNC support)
fi
2016-09-29 00:16:25 +02:00
AM_CONDITIONAL([ENABLE_BGP_VNC], [test x${enable_bgp_vnc} != xno])
bgpd: add L3/L2VPN Virtual Network Control feature This feature adds an L3 & L2 VPN application that makes use of the VPN and Encap SAFIs. This code is currently used to support IETF NVO3 style operation. In NVO3 terminology it provides the Network Virtualization Authority (NVA) and the ability to import/export IP prefixes and MAC addresses from Network Virtualization Edges (NVEs). The code supports per-NVE tables. The NVE-NVA protocol used to communicate routing and Ethernet / Layer 2 (L2) forwarding information between NVAs and NVEs is referred to as the Remote Forwarder Protocol (RFP). OpenFlow is an example RFP. For general background on NVO3 and RFP concepts see [1]. For information on Openflow see [2]. RFPs are integrated with BGP via the RF API contained in the new "rfapi" BGP sub-directory. Currently, only a simple example RFP is included in Quagga. Developers may use this example as a starting point to integrate Quagga with an RFP of their choosing, e.g., OpenFlow. The RFAPI code also supports the ability import/export of routing information between VNC and customer edge routers (CEs) operating within a virtual network. Import/export may take place between BGP views or to the default zebera VRF. BGP, with IP VPNs and Tunnel Encapsulation, is used to distribute VPN information between NVAs. BGP based IP VPN support is defined in RFC4364, BGP/MPLS IP Virtual Private Networks (VPNs), and RFC4659, BGP-MPLS IP Virtual Private Network (VPN) Extension for IPv6 VPN . Use of both the Encapsulation Subsequent Address Family Identifier (SAFI) and the Tunnel Encapsulation Attribute, RFC5512, The BGP Encapsulation Subsequent Address Family Identifier (SAFI) and the BGP Tunnel Encapsulation Attribute, are supported. MAC address distribution does not follow any standard BGB encoding, although it was inspired by the early IETF EVPN concepts. The feature is conditionally compiled and disabled by default. Use the --enable-bgp-vnc configure option to enable. The majority of this code was authored by G. Paul Ziemba <paulz@labn.net>. [1] http://tools.ietf.org/html/draft-ietf-nvo3-nve-nva-cp-req [2] https://www.opennetworking.org/sdn-resources/technical-library Now includes changes needed to merge with cmaster-next.
2016-05-07 20:18:56 +02:00
AC_SUBST(SOLARIS)
AC_CHECK_LIB(crypt, crypt, [],
[AC_CHECK_LIB(crypto, DES_crypt)])
2003-03-17 03:05:07 +01:00
AC_CHECK_LIB(resolv, res_init)
dnl ---------------------------
dnl check system has PCRE regexp
dnl ---------------------------
if test "x$enable_pcreposix" = "xyes"; then
AC_CHECK_LIB(pcreposix, regexec, [], [
AC_MSG_ERROR([--enable-pcreposix given but unable to find libpcreposix])
])
fi
AC_SUBST(HAVE_LIBPCREPOSIX)
2003-03-17 03:05:07 +01:00
dnl ------------------
dnl check C-Ares library
dnl ------------------
if test "${NHRPD}" != ""; then
PKG_CHECK_MODULES([CARES], [libcares], , [
AC_MSG_ERROR([trying to build nhrpd, but libcares not found. install c-ares and its -dev headers.])
])
fi
2003-03-17 03:05:07 +01:00
dnl ------------------
dnl check Net-SNMP library
2003-03-17 03:05:07 +01:00
dnl ------------------
if test "${enable_snmp}" != "" -a "${enable_snmp}" != "no"; then
AC_PATH_TOOL([NETSNMP_CONFIG], [net-snmp-config], [no])
if test x"$NETSNMP_CONFIG" = x"no"; then
AC_MSG_ERROR([--enable-snmp given but unable to find net-snmp-config])
fi
SNMP_LIBS="`${NETSNMP_CONFIG} --agent-libs`"
SNMP_CFLAGS="`${NETSNMP_CONFIG} --base-cflags`"
# net-snmp lists all of its own dependencies. we absolutely do not want that
# among other things we avoid a GPL vs. OpenSSL license conflict here
for removelib in crypto ssl sensors pci wrap; do
SNMP_LIBS="`echo $SNMP_LIBS | sed -e 's/\(^\|\s\)-l'$removelib'\b/ /g' -e 's/\(^\|\s\)\([^\s]*\/\)\?lib'$removelib'\.[^\s]\+\b/ /g'`"
done
AC_MSG_CHECKING([whether we can link to Net-SNMP])
AC_LINK_IFELSE_FLAGS([$SNMP_CFLAGS], [$SNMP_LIBS], [AC_LANG_PROGRAM([
int main(void);
],
[
{
return 0;
}
])], [
AC_MSG_ERROR([--enable-snmp given but not usable])])
case "${enable_snmp}" in
yes)
SNMP_METHOD=agentx
;;
agentx)
SNMP_METHOD="${enable_snmp}"
;;
*)
AC_MSG_ERROR([--enable-snmp given with an unknown method (${enable_snmp}). Use yes or agentx])
;;
esac
AH_TEMPLATE([SNMP_AGENTX], [Use SNMP AgentX to interface with snmpd])
AC_DEFINE_UNQUOTED(AS_TR_CPP(SNMP_${SNMP_METHOD}),,SNMP method to interface with snmpd)
fi
AM_CONDITIONAL([SNMP], [test "x${SNMP_METHOD}" != "x"])
AC_SUBST(SNMP_LIBS)
AC_SUBST(SNMP_CFLAGS)
dnl ---------------
dnl libyang
dnl ---------------
PKG_CHECK_MODULES(libyang, [libyang >= 0.16.7], , [
AC_MSG_ERROR([libyang (>= 0.16.7) was not found on your system.])
])
AC_CHECK_MEMBER([struct lyd_node.priv], [], [
AC_MSG_ERROR([m4_normalize([
libyang needs to be compiled with ENABLE_LYD_PRIV=ON.
See http://docs.frrouting.org/projects/dev-guide/en/latest/building-libyang.html for details.])
])
], [[#include <libyang/libyang.h>]])
dnl ---------------
dnl configuration rollbacks
dnl ---------------
SQLITE3=false
if test "$enable_config_rollbacks" = "yes"; then
PKG_CHECK_MODULES(sqlite3,[sqlite3], [
AC_DEFINE(HAVE_CONFIG_ROLLBACKS,1,Enable configuration rollbacks)
AC_DEFINE(HAVE_SQLITE3,1,Enable sqlite3 database)
SQLITE3=true
], [
AC_MSG_ERROR([--enable-config-rollbacks given but sqlite3 was not found on your system.])
])
fi
AM_CONDITIONAL(SQLITE3, $SQLITE3)
lib: add a new northbound plugin for ConfD This plugin leverages the northbound API to integrate FRR with the ConfD management agent. The plugin is linked to the libconfd library and communicates with the confd daemon using local TCP sockets. The integration consists mostly of glue code that calls the appropriate FRR northbound callbacks in response to events triggered by the confd daemon (e.g. request to change the configuration or to fetch operational data). By integrating FRR with the libconfd library, FRR can be managed using all northbound interfaces provided by ConfD, including NETCONF, RESTCONF and their Web API. The ConfD CDB API is used to handle configuration changes and the ConfD Data Provider API is used to provide operational data, process RPCs and send notifications. Support for configuration management using the ConfD Data Provider API is not available at this point. The ConfD optional 'get_object()' and 'get_next_object()' callbacks were implemented for optimal performance when fetching operational data. This plugins requires ConfD 6.5 or later since it uses the new leaf-list API introduced in ConfD 6.5. To install the plugin, the --enable-confd option should be given to the configure script, specifying the location where ConfD is installed. Example: ./configure --enable-confd=/root/confd-6.6 When installed, the confd plugin will be available for all FRR daemons and can be loaded using the -M (or --module) command line option. Example: zebra -M confd. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-05-24 01:11:59 +02:00
dnl ---------------
dnl confd
dnl ---------------
if test "$enable_confd" != "" -a "$enable_confd" != "no"; then
AC_CHECK_PROG([CONFD], [confd], [confd], [/bin/false])
if test "x$CONFD" = "x/bin/false"; then
AC_MSG_ERROR([confd was not found on your system.])]
fi
CONFD_CFLAGS="-I${enable_confd}/include -L${enable_confd}/lib"
AC_SUBST(CONFD_CFLAGS)
AC_DEFINE(HAVE_CONFD,1,Enable confd integration)
fi
AM_CONDITIONAL([CONFD], [test "x$enable_confd" != "x"])
dnl ---------------
dnl sysrepo
dnl ---------------
if test "$enable_sysrepo" = "yes"; then
PKG_CHECK_MODULES(sysrepo,[libsysrepo],
[AC_DEFINE(HAVE_SYSREPO,1,Enable sysrepo integration)
SYSREPO=true],
[SYSREPO=false
AC_MSG_ERROR([sysrepo was not found on your system.])]
)
fi
AM_CONDITIONAL([SYSREPO], [test "x$enable_sysrepo" = "xyes"])
dnl ---------------
dnl math
dnl ---------------
AC_SEARCH_LIBS([sqrt], [m])
dnl ---------------
dnl dlopen & dlinfo
dnl ---------------
AC_SEARCH_LIBS(dlopen, [dl dld], [], [
AC_MSG_ERROR([unable to find the dlopen()])
])
AC_CHECK_HEADERS([link.h])
AC_CACHE_CHECK([for dlinfo(RTLD_DI_ORIGIN)], [frr_cv_rtld_di_origin], [
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <stdlib.h>
#ifdef HAVE_LINK_H
#include <link.h>
#endif
#include <dlfcn.h>
]], [[
char origin[1];
dlinfo (NULL, RTLD_DI_ORIGIN, &origin);
]])], [
frr_cv_rtld_di_origin=yes
], [
frr_cv_rtld_di_origin=no
])
])
if test "$frr_cv_rtld_di_origin" = yes; then
AC_DEFINE(HAVE_DLINFO_ORIGIN, 1, [Have dlinfo RTLD_DI_ORIGIN])
fi
AC_CACHE_CHECK([for dlinfo(RTLD_DI_LINKMAP)], [frr_cv_rtld_di_linkmap], [
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <stdlib.h>
#ifdef HAVE_LINK_H
#include <link.h>
#endif
#include <dlfcn.h>
]], [[
struct link_map *lm = NULL;
dlinfo (NULL, RTLD_DI_LINKMAP, &lm);
]])], [
frr_cv_rtld_di_linkmap=yes
], [
frr_cv_rtld_di_linkmap=no
])
])
if test "$frr_cv_rtld_di_linkmap" = yes; then
AC_DEFINE(HAVE_DLINFO_LINKMAP, 1, [Have dlinfo RTLD_DI_LINKMAP])
fi
AM_CONDITIONAL(SNMP, test "x$SNMP_METHOD" = "xagentx")
2003-03-17 03:05:07 +01:00
dnl ---------------------------
dnl sockaddr and netinet checks
2003-03-17 03:05:07 +01:00
dnl ---------------------------
AC_CHECK_TYPES([
struct sockaddr_dl,
struct vifctl, struct mfcctl, struct sioc_sg_req,
vifi_t, struct sioc_vif_req, struct igmpmsg,
struct ifaliasreq, struct if6_aliasreq, struct in6_aliasreq,
struct nd_opt_adv_interval, struct rt_addrinfo,
struct nd_opt_homeagent_info, struct nd_opt_adv_interval],
2016-12-14 20:22:59 +01:00
[], [], FRR_INCLUDES)
AC_CHECK_MEMBERS([struct sockaddr.sa_len,
struct sockaddr_in.sin_len, struct sockaddr_un.sun_len,
struct sockaddr_dl.sdl_len,
struct if6_aliasreq.ifra_lifetime,
struct nd_opt_adv_interval.nd_opt_ai_type],
2016-12-14 20:22:59 +01:00
[], [], FRR_INCLUDES)
dnl ---------------------------
dnl IRDP/pktinfo/icmphdr checks
dnl ---------------------------
AC_CHECK_TYPES([struct in_pktinfo], [
AC_CHECK_TYPES([struct icmphdr], [
IRDP=true
], [
IRDP=false
], [FRR_INCLUDES])
], [
IRDP=false
], [FRR_INCLUDES])
case "${enable_irdp}" in
yes)
$IRDP || AC_MSG_ERROR(['IRDP requires in_pktinfo at the moment!'])
;;
no)
IRDP=false
;;
esac
AM_CONDITIONAL(IRDP, $IRDP)
dnl -----------------------
dnl checking for IP_PKTINFO
dnl -----------------------
AC_MSG_CHECKING(for IP_PKTINFO)
AC_TRY_COMPILE([#include <netdb.h>], [
int opt = IP_PKTINFO;
], [
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_IP_PKTINFO, 1, [Have IP_PKTINFO])
], [
AC_MSG_RESULT(no)
])
dnl ---------------------------
dnl checking for IP_RECVDSTADDR
dnl ---------------------------
AC_MSG_CHECKING(for IP_RECVDSTADDR)
AC_TRY_COMPILE([#include <netinet/in.h>], [
int opt = IP_RECVDSTADDR;
], [
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_IP_RECVDSTADDR, 1, [Have IP_RECVDSTADDR])
], [
AC_MSG_RESULT(no)
])
dnl ----------------------
dnl checking for IP_RECVIF
dnl ----------------------
AC_MSG_CHECKING(for IP_RECVIF)
AC_TRY_COMPILE([#include <netinet/in.h>], [
int opt = IP_RECVIF;
], [
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_IP_RECVIF, 1, [Have IP_RECVIF])
], [
AC_MSG_RESULT(no)
])
dnl ----------------------
dnl checking for SO_BINDANY
dnl ----------------------
AC_MSG_CHECKING(for SO_BINDANY)
AC_TRY_COMPILE([#include <sys/socket.h>], [
int opt = SO_BINDANY;
], [
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_SO_BINDANY, 1, [Have SO_BINDANY])
], [
AC_MSG_RESULT(no)
])
dnl ----------------------
dnl checking for IP_FREEBIND
dnl ----------------------
AC_MSG_CHECKING(for IP_FREEBIND)
AC_TRY_COMPILE([#include <netinet/in.h>], [
int opt = IP_FREEBIND;
], [
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_IP_FREEBIND, 1, [Have IP_FREEBIND])
], [
AC_MSG_RESULT(no)
])
dnl --------------------------------------
dnl checking for be32dec existence or not
dnl --------------------------------------
AC_CHECK_DECLS([be32enc, be32dec], [], [],
[#include <sys/endian.h>])
dnl --------------------------------------
dnl checking for clock_time monotonic struct and call
dnl --------------------------------------
AC_CHECK_DECL(CLOCK_MONOTONIC,
[AC_CHECK_LIB(rt, clock_gettime, [LIBS="$LIBS -lrt"])
AC_DEFINE(HAVE_CLOCK_MONOTONIC,, Have monotonic clock)
2016-12-14 20:22:59 +01:00
], [AC_MSG_RESULT(no)], [FRR_INCLUDES])
dnl --------------------------------------
dnl checking for flex and bison
dnl --------------------------------------
AM_PROG_LEX
AC_MSG_CHECKING(version of flex)
frr_ac_flex_version="$(eval $LEX -V | grep flex | head -n 1)"
frr_ac_flex_version="${frr_ac_flex_version##* }"
AC_MSG_RESULT([$frr_ac_flex_version])
AX_COMPARE_VERSION([$frr_ac_flex_version], [lt], [2.5.20], [
LEX="$SHELL $missing_dir/missing flex"
if test -f "${srcdir}/lib/command_lex.c" -a -f "${srcdir}/lib/command_lex.h"; then
AC_MSG_WARN([using pregenerated flex output files])
else
AC_MSG_ERROR([flex failure and pregenerated files not included (probably a git build)])
fi
AC_SUBST([LEX_OUTPUT_ROOT], [lex.yy])
AC_SUBST([LEXLIB], [''])
])
AC_PROG_YACC
dnl thanks GNU bison for this b*llshit...
AC_MSG_CHECKING(version of bison)
frr_ac_bison_version="$(eval $YACC -V | grep bison | head -n 1)"
frr_ac_bison_version="${frr_ac_bison_version##* }"
frr_ac_bison_missing="false"
case "x${frr_ac_bison_version}" in
x2.7*)
BISON_OPENBRACE='"'
BISON_CLOSEBRACE='"'
BISON_VERBOSE=''
AC_MSG_RESULT([$frr_ac_bison_version - 2.7 or older])
;;
x2.*|x1.*)
AC_MSG_RESULT([$frr_ac_bison_version])
AC_MSG_WARN([installed bison is too old. Please install GNU bison 2.7.x or newer.])
frr_ac_bison_missing="true"
;;
x)
AC_MSG_RESULT([none])
AC_MSG_WARN([could not determine bison version. Please install GNU bison 2.7.x or newer.])
frr_ac_bison_missing="true"
;;
*)
BISON_OPENBRACE='{'
BISON_CLOSEBRACE='}'
BISON_VERBOSE='-Dparse.error=verbose'
AC_MSG_RESULT([$frr_ac_bison_version - 3.0 or newer])
;;
esac
AC_SUBST(BISON_OPENBRACE)
AC_SUBST(BISON_CLOSEBRACE)
AC_SUBST(BISON_VERBOSE)
if $frr_ac_bison_missing; then
YACC="$SHELL $missing_dir/missing bison -y"
if test -f "${srcdir}/lib/command_parse.c" -a -f "${srcdir}/lib/command_parse.h"; then
AC_MSG_WARN([using pregenerated bison output files])
else
AC_MSG_ERROR([bison failure and pregenerated files not included (probably a git build)])
fi
fi
dnl -------------------
dnl capabilities checks
dnl -------------------
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)
2016-12-14 20:22:59 +01:00
frr_ac_keepcaps="yes"],
AC_MSG_RESULT(no)
)
2016-12-14 20:22:59 +01:00
if test x"${frr_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"
2016-12-14 20:22:59 +01:00
frr_ac_lcaps="yes"]
)
2005-09-29 Paul Jakma <paul.jakma@sun.com> * configure.ac: Add the test for Solaris least-privileges. Set defines for whether capabilities are supported and whether of the linux or solaris variety. Add missing-prototypes, missing-declarations, char-subscripts and cast-qual warnings to default cflags, cause Hasso enjoys warnings, and we really should clean the remaining ones up. (ie isisd..). * (*/*main.c) Update the zebra_capabilities_t arrays in the various daemons to match the changes made in lib/privs.h. * zebra.h: Solaris capabilities requires priv.h to be included. * privs.{c,h}: Add support for Solaris Least-Privileges. privs.h: Reduce some of the abstract capabilities, which do not have rough equivalents on both systems. Rename the net related caps to _NET, as they should have been in first place. (zprivs_terminate) should take the zebra_privs_t as argument so that it can update change pointer. Add an additional privilege state, ZPRIVS_UNKNOWN. * privs.c: (various capability functions) Add Solaris privileges variants. (zprivs_state) Use privs.c specific generic types to represent various capability/privilege related types, so that each can be typedef'd as appropriate on each platform. (zprivs_null_state) static added, to hold the state the null method should report (should be raised by default, and LOWERED if zprivs_terminate has been called) (zprivs_state_null) Report back the zprivs_null_state. (cap_map) Make it able to map abstract capability to multiple system capabilities. (zcaps2sys) Map to abstract capabilities to multiple system privileges/capabilities. (zprivs_init) move capability related init to seperate function, zprivs_caps_init. (zprivs_terminate) ditto, moved to zprivs_caps_terminate. Set the change_state callback to the NULL state, so the user can continue to run and use the callbacks.
2005-09-29 16:39:32 +02:00
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)
2016-12-14 20:22:59 +01:00
frr_ac_scaps="yes"],
2005-09-29 Paul Jakma <paul.jakma@sun.com> * configure.ac: Add the test for Solaris least-privileges. Set defines for whether capabilities are supported and whether of the linux or solaris variety. Add missing-prototypes, missing-declarations, char-subscripts and cast-qual warnings to default cflags, cause Hasso enjoys warnings, and we really should clean the remaining ones up. (ie isisd..). * (*/*main.c) Update the zebra_capabilities_t arrays in the various daemons to match the changes made in lib/privs.h. * zebra.h: Solaris capabilities requires priv.h to be included. * privs.{c,h}: Add support for Solaris Least-Privileges. privs.h: Reduce some of the abstract capabilities, which do not have rough equivalents on both systems. Rename the net related caps to _NET, as they should have been in first place. (zprivs_terminate) should take the zebra_privs_t as argument so that it can update change pointer. Add an additional privilege state, ZPRIVS_UNKNOWN. * privs.c: (various capability functions) Add Solaris privileges variants. (zprivs_state) Use privs.c specific generic types to represent various capability/privilege related types, so that each can be typedef'd as appropriate on each platform. (zprivs_null_state) static added, to hold the state the null method should report (should be raised by default, and LOWERED if zprivs_terminate has been called) (zprivs_state_null) Report back the zprivs_null_state. (cap_map) Make it able to map abstract capability to multiple system capabilities. (zcaps2sys) Map to abstract capabilities to multiple system privileges/capabilities. (zprivs_init) move capability related init to seperate function, zprivs_caps_init. (zprivs_terminate) ditto, moved to zprivs_caps_terminate. Set the change_state callback to the NULL state, so the user can continue to run and use the callbacks.
2005-09-29 16:39:32 +02:00
AC_MSG_RESULT(no)
)
]
)
fi
2016-12-14 20:22:59 +01:00
if test x"${frr_ac_scaps}" = x"yes" \
-o x"${frr_ac_lcaps}" = x"yes"; then
2005-09-29 Paul Jakma <paul.jakma@sun.com> * configure.ac: Add the test for Solaris least-privileges. Set defines for whether capabilities are supported and whether of the linux or solaris variety. Add missing-prototypes, missing-declarations, char-subscripts and cast-qual warnings to default cflags, cause Hasso enjoys warnings, and we really should clean the remaining ones up. (ie isisd..). * (*/*main.c) Update the zebra_capabilities_t arrays in the various daemons to match the changes made in lib/privs.h. * zebra.h: Solaris capabilities requires priv.h to be included. * privs.{c,h}: Add support for Solaris Least-Privileges. privs.h: Reduce some of the abstract capabilities, which do not have rough equivalents on both systems. Rename the net related caps to _NET, as they should have been in first place. (zprivs_terminate) should take the zebra_privs_t as argument so that it can update change pointer. Add an additional privilege state, ZPRIVS_UNKNOWN. * privs.c: (various capability functions) Add Solaris privileges variants. (zprivs_state) Use privs.c specific generic types to represent various capability/privilege related types, so that each can be typedef'd as appropriate on each platform. (zprivs_null_state) static added, to hold the state the null method should report (should be raised by default, and LOWERED if zprivs_terminate has been called) (zprivs_state_null) Report back the zprivs_null_state. (cap_map) Make it able to map abstract capability to multiple system capabilities. (zcaps2sys) Map to abstract capabilities to multiple system privileges/capabilities. (zprivs_init) move capability related init to seperate function, zprivs_caps_init. (zprivs_terminate) ditto, moved to zprivs_caps_terminate. Set the change_state callback to the NULL state, so the user can continue to run and use the callbacks.
2005-09-29 16:39:32 +02:00
AC_DEFINE(HAVE_CAPABILITIES,1,capabilities)
fi
fi
AC_SUBST(LIBCAP)
dnl ---------------------------
dnl check for glibc 'backtrace'
dnl ---------------------------
if test x"${enable_backtrace}" != x"no" ; then
backtrace_ok=no
PKG_CHECK_MODULES([UNWIND], [libunwind], [
AC_DEFINE(HAVE_LIBUNWIND, 1, [libunwind])
backtrace_ok=yes
], [
case "$host_os" in
sunos* | solaris2*)
AC_CHECK_FUNCS([printstack], [
AC_DEFINE([HAVE_PRINTSTACK], 1, [Solaris printstack])
backtrace_ok=yes
])
;;
esac
if test "$backtrace_ok" = no; then
AC_CHECK_HEADER([execinfo.h], [
AC_SEARCH_LIBS([backtrace], [execinfo], [
AC_DEFINE(HAVE_GLIBC_BACKTRACE, 1, [Glibc backtrace])
backtrace_ok=yes
],, [-lm])
])
fi
])
if test x"${enable_backtrace}" = x"yes" -a x"${backtrace_ok}" = x"no"; then
dnl user explicitly requested backtrace but we failed to find support
AC_MSG_FAILURE([failed to find backtrace or libunwind support])
fi
fi
dnl -----------------------------------------
dnl check for malloc mallinfo struct and call
dnl this must try and link using LIBS, in
dnl order to check no alternative allocator
dnl has been specified, which might not provide
dnl mallinfo, e.g. such as Umem on Solaris.
dnl -----------------------------------------
AC_CHECK_HEADERS([malloc.h malloc_np.h malloc/malloc.h],,, [FRR_INCLUDES])
AC_CACHE_CHECK([whether mallinfo is available], [frr_cv_mallinfo], [
AC_LINK_IFELSE([AC_LANG_PROGRAM([FRR_INCLUDES [
#ifdef HAVE_MALLOC_H
#include <malloc.h>
#endif
#ifdef HAVE_MALLOC_NP_H
#include <malloc_np.h>
#endif
#ifdef HAVE_MALLOC_MALLOC_H
#include <malloc/malloc.h>
#endif
]], [[
struct mallinfo ac_x; ac_x = mallinfo ();
]])], [
frr_cv_mallinfo=yes
], [
frr_cv_mallinfo=no
])
])
if test "$frr_cv_mallinfo" = yes; then
AC_DEFINE(HAVE_MALLINFO,,mallinfo)
fi
AC_MSG_CHECKING(whether malloc_usable_size is available)
AC_LINK_IFELSE([AC_LANG_PROGRAM([FRR_INCLUDES [
#ifdef HAVE_MALLOC_H
#include <malloc.h>
#endif
#ifdef HAVE_MALLOC_MALLOC_H
#include <malloc/malloc.h>
#endif
]], [[
size_t ac_x; ac_x = malloc_usable_size(NULL);
]])], [
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_MALLOC_USABLE_SIZE,,malloc_usable_size)
], [
AC_MSG_RESULT(no)
AC_MSG_CHECKING(whether malloc_size is available)
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#ifdef HAVE_MALLOC_H
#include <malloc.h>
#endif
#ifdef HAVE_MALLOC_MALLOC_H
#include <malloc/malloc.h>
#endif
]], [[
size_t ac_x; ac_x = malloc_size(NULL);
]])], [
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_MALLOC_SIZE,,malloc_size)
], [
AC_MSG_RESULT(no)
])
])
dnl ------
dnl ZeroMQ
dnl ------
if test "x$enable_zeromq" != "xno"; then
PKG_CHECK_MODULES(ZEROMQ, [libzmq >= 4.0.0], [
AC_DEFINE(HAVE_ZEROMQ, 1, [Enable ZeroMQ support])
ZEROMQ=true
], [
if test "x$enable_zeromq" = "xyes"; then
AC_MSG_ERROR([configuration specifies --enable-zeromq but libzmq was not found])
fi
])
fi
AM_CONDITIONAL([ZEROMQ], test "x$ZEROMQ" = "xtrue")
dnl ----------
dnl configure date
dnl ----------
dev_version=`echo $VERSION | grep dev`
#don't expire deprecated code in non 'dev' branch
if test "${dev_version}" = ""; then
CONFDATE=0
else
CONFDATE=`date '+%Y%m%d'`
fi
AC_SUBST(CONFDATE)
2003-03-17 03:05:07 +01:00
dnl ------------------------------
dnl set paths for state directory
dnl ------------------------------
AC_MSG_CHECKING(directory to use for state file)
if test "${prefix}" = "NONE"; then
frr_statedir_prefix="";
else
frr_statedir_prefix=${prefix}
fi
if test "${localstatedir}" = '${prefix}/var'; then
2016-12-14 20:22:59 +01:00
for FRR_STATE_DIR in ${frr_statedir_prefix}/var/run dnl
${frr_statedir_prefix}/var/adm dnl
${frr_statedir_prefix}/etc dnl
/var/run dnl
/var/adm dnl
/etc dnl
/dev/null;
do
2016-12-14 20:22:59 +01:00
test -d $FRR_STATE_DIR && break
done
2016-12-14 20:22:59 +01:00
frr_statedir=$FRR_STATE_DIR
else
frr_statedir=${localstatedir}
fi
if test $frr_statedir = "/dev/null"; then
AC_MSG_ERROR('STATE DIRECTORY NOT FOUND! FIX OR SPECIFY --localstatedir!')
fi
AC_MSG_RESULT(${frr_statedir})
AC_SUBST(frr_statedir)
AC_DEFINE_UNQUOTED(LDPD_SOCKET, "$frr_statedir/ldpd.sock",ldpd control socket)
AC_DEFINE_UNQUOTED(ZEBRA_SERV_PATH, "$frr_statedir/zserv.api",zebra api socket)
AC_DEFINE_UNQUOTED(BFDD_CONTROL_SOCKET, "$frr_statedir/bfdd.sock", bfdd control socket)
AC_DEFINE_UNQUOTED(DAEMON_VTY_DIR, "$frr_statedir",daemon vty directory)
AC_DEFINE_UNQUOTED(DAEMON_DB_DIR, "$frr_statedir",daemon database directory)
2003-03-17 03:05:07 +01:00
dnl autoconf does this, but it does it too late...
test "x$prefix" = xNONE && prefix=$ac_default_prefix
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
dnl get the full path, recursing through variables...
vtysh_bin="$bindir/vtysh"
for I in 1 2 3 4 5 6 7 8 9 10; do
eval vtysh_bin="\"$vtysh_bin\""
done
AC_DEFINE_UNQUOTED(VTYSH_BIN_PATH, "$vtysh_bin",path to vtysh binary)
AC_SUBST(vtysh_bin)
CFG_SYSCONF="$sysconfdir"
CFG_SBIN="$sbindir"
CFG_STATE="$frr_statedir"
CFG_MODULE="$moduledir"
CFG_YANGMODELS="$yangmodelsdir"
CFG_LIBYANG_PLUGINS="$libyang_pluginsdir"
for I in 1 2 3 4 5 6 7 8 9 10; do
eval CFG_SYSCONF="\"$CFG_SYSCONF\""
eval CFG_SBIN="\"$CFG_SBIN\""
eval CFG_STATE="\"$CFG_STATE\""
eval CFG_MODULE="\"$CFG_MODULE\""
eval CFG_YANGMODELS="\"$CFG_YANGMODELS\""
eval CFG_LIBYANG_PLUGINS="\"$CFG_LIBYANG_PLUGINS\""
done
AC_SUBST(CFG_SYSCONF)
AC_SUBST(CFG_SBIN)
AC_SUBST(CFG_STATE)
AC_SUBST(CFG_MODULE)
AC_SUBST(CFG_YANGMODELS)
AC_SUBST(CFG_LIBYANG_PLUGINS)
AC_DEFINE_UNQUOTED(MODULE_PATH, "$CFG_MODULE", path to modules)
AC_DEFINE_UNQUOTED(YANG_MODELS_PATH, "$CFG_YANGMODELS", path to YANG data models)
AC_DEFINE_UNQUOTED(LIBYANG_PLUGINS_PATH, "$CFG_LIBYANG_PLUGINS", path to libyang plugins)
dnl ------------------------------------
dnl Enable RPKI and add librtr to libs
dnl ------------------------------------
if test "${enable_rpki}" = "yes"; then
PKG_CHECK_MODULES(RTRLIB,[rtrlib >= 0.5.0],
[RPKI=true],
[RPKI=false
AC_MSG_ERROR([rtrlib was not found on your system or is too old.])]
)
fi
AM_CONDITIONAL([RPKI], test "x$RPKI" = "xtrue")
dnl ------------------------------------------
dnl Check whether rtrlib was build with ssh support
dnl ------------------------------------------
AC_MSG_CHECKING([whether the RTR Library is compiled with SSH])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "rtrlib/rtrlib.h"]],
[[struct tr_ssh_config config;]])],
[AC_MSG_RESULT(yes)
AC_DEFINE(FOUND_SSH,,found_ssh)],
AC_MSG_RESULT(no)
)
2003-03-17 03:05:07 +01:00
dnl ---------------------------
dnl Check htonl works correctly
dnl ---------------------------
AC_MSG_CHECKING(for working htonl)
AC_CACHE_VAL(ac_cv_htonl_works,
2016-12-14 20:22:59 +01:00
[AC_LINK_IFELSE([AC_LANG_PROGRAM([FRR_INCLUDES],[htonl (0);])],
[ac_cv_htonl_works=yes], [ac_cv_htonl_works=no])
]
)
2003-03-17 03:05:07 +01:00
AC_MSG_RESULT($ac_cv_htonl_works)
AC_CONFIG_FILES([Makefile],[sed -e 's/^#AUTODERP# //' -i Makefile])
AC_CONFIG_FILES([
config.version
redhat/frr.spec
solaris/Makefile
debianpkg/changelog
alpine/APKBUILD
snapcraft/snapcraft.yaml
lib/version.h
tests/lib/cli/test_cli.refout
pkgsrc/bgpd.sh pkgsrc/ospf6d.sh pkgsrc/ospfd.sh
pkgsrc/ripd.sh pkgsrc/ripngd.sh pkgsrc/zebra.sh
pkgsrc/eigrpd.sh])
bgpd: add L3/L2VPN Virtual Network Control feature This feature adds an L3 & L2 VPN application that makes use of the VPN and Encap SAFIs. This code is currently used to support IETF NVO3 style operation. In NVO3 terminology it provides the Network Virtualization Authority (NVA) and the ability to import/export IP prefixes and MAC addresses from Network Virtualization Edges (NVEs). The code supports per-NVE tables. The NVE-NVA protocol used to communicate routing and Ethernet / Layer 2 (L2) forwarding information between NVAs and NVEs is referred to as the Remote Forwarder Protocol (RFP). OpenFlow is an example RFP. For general background on NVO3 and RFP concepts see [1]. For information on Openflow see [2]. RFPs are integrated with BGP via the RF API contained in the new "rfapi" BGP sub-directory. Currently, only a simple example RFP is included in Quagga. Developers may use this example as a starting point to integrate Quagga with an RFP of their choosing, e.g., OpenFlow. The RFAPI code also supports the ability import/export of routing information between VNC and customer edge routers (CEs) operating within a virtual network. Import/export may take place between BGP views or to the default zebera VRF. BGP, with IP VPNs and Tunnel Encapsulation, is used to distribute VPN information between NVAs. BGP based IP VPN support is defined in RFC4364, BGP/MPLS IP Virtual Private Networks (VPNs), and RFC4659, BGP-MPLS IP Virtual Private Network (VPN) Extension for IPv6 VPN . Use of both the Encapsulation Subsequent Address Family Identifier (SAFI) and the Tunnel Encapsulation Attribute, RFC5512, The BGP Encapsulation Subsequent Address Family Identifier (SAFI) and the BGP Tunnel Encapsulation Attribute, are supported. MAC address distribution does not follow any standard BGB encoding, although it was inspired by the early IETF EVPN concepts. The feature is conditionally compiled and disabled by default. Use the --enable-bgp-vnc configure option to enable. The majority of this code was authored by G. Paul Ziemba <paulz@labn.net>. [1] http://tools.ietf.org/html/draft-ietf-nvo3-nve-nva-cp-req [2] https://www.opennetworking.org/sdn-resources/technical-library Now includes changes needed to merge with cmaster-next.
2016-05-07 20:18:56 +02:00
AC_CONFIG_FILES([vtysh/extract.pl],[chmod +x vtysh/extract.pl])
AC_CONFIG_FILES([tools/frr],[chmod +x tools/frr])
bgpd: add L3/L2VPN Virtual Network Control feature This feature adds an L3 & L2 VPN application that makes use of the VPN and Encap SAFIs. This code is currently used to support IETF NVO3 style operation. In NVO3 terminology it provides the Network Virtualization Authority (NVA) and the ability to import/export IP prefixes and MAC addresses from Network Virtualization Edges (NVEs). The code supports per-NVE tables. The NVE-NVA protocol used to communicate routing and Ethernet / Layer 2 (L2) forwarding information between NVAs and NVEs is referred to as the Remote Forwarder Protocol (RFP). OpenFlow is an example RFP. For general background on NVO3 and RFP concepts see [1]. For information on Openflow see [2]. RFPs are integrated with BGP via the RF API contained in the new "rfapi" BGP sub-directory. Currently, only a simple example RFP is included in Quagga. Developers may use this example as a starting point to integrate Quagga with an RFP of their choosing, e.g., OpenFlow. The RFAPI code also supports the ability import/export of routing information between VNC and customer edge routers (CEs) operating within a virtual network. Import/export may take place between BGP views or to the default zebera VRF. BGP, with IP VPNs and Tunnel Encapsulation, is used to distribute VPN information between NVAs. BGP based IP VPN support is defined in RFC4364, BGP/MPLS IP Virtual Private Networks (VPNs), and RFC4659, BGP-MPLS IP Virtual Private Network (VPN) Extension for IPv6 VPN . Use of both the Encapsulation Subsequent Address Family Identifier (SAFI) and the Tunnel Encapsulation Attribute, RFC5512, The BGP Encapsulation Subsequent Address Family Identifier (SAFI) and the BGP Tunnel Encapsulation Attribute, are supported. MAC address distribution does not follow any standard BGB encoding, although it was inspired by the early IETF EVPN concepts. The feature is conditionally compiled and disabled by default. Use the --enable-bgp-vnc configure option to enable. The majority of this code was authored by G. Paul Ziemba <paulz@labn.net>. [1] http://tools.ietf.org/html/draft-ietf-nvo3-nve-nva-cp-req [2] https://www.opennetworking.org/sdn-resources/technical-library Now includes changes needed to merge with cmaster-next.
2016-05-07 20:18:56 +02:00
AC_CONFIG_COMMANDS([lib/route_types.h], [
dst="${ac_abs_top_builddir}/lib/route_types.h"
${PERL} "${ac_abs_top_srcdir}/lib/route_types.pl" \
< "${ac_abs_top_srcdir}/lib/route_types.txt" \
> "${dst}.tmp"
test -f "${dst}" \
&& diff "${dst}.tmp" "${dst}" >/dev/null 2>/dev/null \
&& rm "${dst}.tmp" \
|| mv "${dst}.tmp" "${dst}"
], [
PERL="$PERL"
])
AS_IF([test "x$with_pkg_git_version" = "xyes"], [
AC_CONFIG_COMMANDS([lib/gitversion.h], [
dst="${ac_abs_top_builddir}/lib/gitversion.h"
${PERL} "${ac_abs_top_srcdir}/lib/gitversion.pl" \
"${ac_abs_top_srcdir}" \
> "${dst}.tmp"
test -f "${dst}" \
&& diff "${dst}.tmp" "${dst}" >/dev/null 2>/dev/null \
&& rm "${dst}.tmp" \
|| mv "${dst}.tmp" "${dst}"
], [
PERL="$PERL"
])
])
## Hack, but working solution to avoid rebuilding of frr.info.
## It's already in CVS until texinfo 4.7 is more common.
AC_OUTPUT
2003-03-17 03:05:07 +01:00
echo "
FRRouting configuration
------------------------------
FRR version : ${PACKAGE_VERSION}
host operating system : ${host_os}
2003-03-17 03:05:07 +01:00
source code location : ${srcdir}
compiler : ${CC}
compiler flags : ${CFLAGS} ${SAN_FLAGS}
make : ${MAKE-make}
linker flags : ${LDFLAGS} ${SAN_FLAGS} ${LIBS} ${LIBCAP} ${LIBREADLINE} ${LIBM}
state file directory : ${frr_statedir}
config file directory : `eval echo \`echo ${sysconfdir}\``
example directory : `eval echo \`echo ${exampledir}\``
module directory : ${CFG_MODULE}
user to run as : ${enable_user}
group to run as : ${enable_group}
group for vty sockets : ${enable_vty_group}
config file mask : ${enable_configfile_mask}
log file mask : ${enable_logfile_mask}
zebra protobuf enabled : ${enable_protobuf:-no}
The above user and group must have read/write access to the state file
directory and to the config files in the config file directory."
if test "${enable_doc}" != "no";then
AS_IF([test "$SPHINXBUILD" = /bin/false],
AC_MSG_WARN(sphinx-build is missing but required to build documentation))
fi