##
-## Configure template file for FreeRangeRouting.
+## Configure template file for FRRouting.
## autoconf will generate configure script.
##
## Copyright (c) 1996, 97, 98, 99, 2000 Kunihiro Ishiguro <kunihiro@zebra.org>
##
AC_PREREQ(2.60)
-AC_INIT(frr, 2.0-rc1, [https://github.com/freerangerouting/frr/issues])
-PACKAGE_URL="https://freerangerouting.org/"
-PACKAGE_FULLNAME="FreeRangeRouting"
+AC_INIT(frr, 3.0-rc2, [https://github.com/frrouting/frr/issues])
+PACKAGE_URL="https://frrouting.org/"
+PACKAGE_FULLNAME="FRRouting"
AC_SUBST(PACKAGE_FULLNAME)
CONFIG_ARGS="$ac_configure_args"
# Disable portability warnings -- our automake code (in particular
# common.am) uses some constructs specific to gmake.
-AM_INIT_AUTOMAKE([1.6 -Wno-portability])
+AM_INIT_AUTOMAKE([1.12 -Wno-portability])
m4_ifndef([AM_SILENT_RULES], [m4_define([AM_SILENT_RULES],[])])
AM_SILENT_RULES([yes])
AC_CONFIG_HEADERS(config.h)
AC_PATH_PROG(PERL, perl)
+PKG_PROG_PKG_CONFIG
dnl default is to match previous behavior
exampledir=${sysconfdir}
AC_SUBST(pkgsrcdir)
AC_SUBST(pkgsrcrcdir)
+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_ENABLE(tcmalloc,
AS_HELP_STRING([--enable-tcmalloc], [Turn on tcmalloc]),
[case "${enableval}" in
AC_PROG_CC_C99
AC_PROG_EGREP
+PKG_PROG_PKG_CONFIG
dnl autoconf 2.59 appears not to support AC_PROG_SED
dnl AC_PROG_SED
AS_HELP_STRING([--disable-ospf6d], [do not build ospf6d]))
AC_ARG_ENABLE(ldpd,
AS_HELP_STRING([--enable-ldpd], [build ldpd]))
+AC_ARG_ENABLE(nhrpd,
+ AS_HELP_STRING([--disable-nhrpd], [do not build nhrpd]))
AC_ARG_ENABLE(watchfrr,
AS_HELP_STRING([--disable-watchfrr], [do not build watchfrr]))
AC_ARG_ENABLE(isisd,
AS_HELP_STRING([--enable-snmp=ARG], [enable SNMP support (smux or agentx)]))
AC_ARG_WITH(libpam,
AS_HELP_STRING([--with-libpam], [use libpam for PAM support in vtysh]))
-AC_ARG_ENABLE(tcp-zebra,
- AS_HELP_STRING([--enable-tcp-zebra], [enable TCP/IP socket connection between zebra and protocol daemon]))
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-rr-semantics], [disable the v6 Route Replace semantics]))
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_CHECK_HEADERS(json-c/json.h)
AC_CHECK_LIB(json-c, json_object_get, LIBS="$LIBS -ljson-c")
fi
if test "${enable_poll}" = "yes" ; then
- AC_DEFINE(HAVE_POLL,,Compile systemd support in)
+ AC_DEFINE(HAVE_POLL_CALL,,Compile systemd support in)
fi
dnl ----------
if test "${enable_cumulus}" = "yes" ; then
AC_DEFINE(HAVE_CUMULUS,,Compile Special Cumulus Code in)
+ DFLT_NAME="datacenter"
+else
+ DFLT_NAME="traditional"
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
-if test "${enable_fpm}" = "yes"; then
- AC_DEFINE(HAVE_FPM,,Forwarding Plane Manager support)
-fi
+AM_CONDITIONAL([FPM], [test "x$enable_fpm" = "xyes"])
if test "x${enable_dev_build}" = "xyes"; then
AC_DEFINE(DEV_BUILD,,Build for development)
fi
fi
+#
+# 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
+
# Fail if the user explicity enabled protobuf support and we couldn't
# find the compiler or libraries.
if test "x$have_protobuf" = "xno" && test "x$enable_protobuf" = "xyes"; then
# End of logic for protobuf support.
#
-if test "${enable_tcp_zebra}" = "yes"; then
- AC_DEFINE(HAVE_TCP_ZEBRA,,Use TCP for zebra communication)
-fi
-
if test "${enable_linux24_tcp_md5}" = "yes"; then
AC_DEFINE(HAVE_TCP_MD5_LINUX24,,Old Linux 2.4 TCP MD5 Signature Patch)
fi
[AC_CHECK_LIB([m], [pow],
[LIBM="-lm"
LIBS="$LIBS $LIBM"
- AC_DEFINE(HAVE_LIBM,, Have libm)
AC_CHECK_FUNCS(pow,[],[LIBM=""])
])
])
dnl ---------------
AC_CHECK_FUNCS([ \
strlcat strlcpy \
- getgrouplist \
- pledge])
+ getgrouplist])
AC_CHECK_HEADER([asm-generic/unistd.h],
[AC_CHECK_DECL(__NR_setns,
AC_MSG_ERROR([Failed to detect IPv6 stack])
fi
-dnl this is unconditial, for compatibility
-AC_DEFINE(HAVE_IPV6,1,IPv6)
-
dnl ------------------
dnl IPv6 header checks
dnl ------------------
fi
AM_CONDITIONAL(OSPFD, test "x$OSPFD" = "xospfd")
-if test "${enable_ldpd}" = "yes";then
+if test "${enable_ldpd}" = "no";then
+ LDPD=""
+else
+ AX_PROG_PERL_MODULES(XML::LibXML, , [
+ if test -f "${srcdir}/ldpd/ldp_vty_cmds.c"; then
+ AC_MSG_WARN([XML::LibXML perl module not found, using pregenerated ldp_vty_cmds.c])
+ else
+ AC_MSG_ERROR([XML::LibXML perl module not found and pregenerated ldp_vty_cmds.c missing])
+ fi
+ ])
+
LDPD="ldpd"
AC_DEFINE(HAVE_LDPD, 1, ldpd)
-else
- LDPD=""
fi
AM_CONDITIONAL(LDPD, test "x$LDPD" = "xldpd")
+NHRPD=""
+if test "$opsys" = "gnu-linux"; then
+ if test "${enable_nhrpd}" != "no"; then
+ NHRPD="nhrpd"
+ fi
+else
+ if test "${enable_nhrpd}" = "yes"; then
+ AC_MSG_ERROR([nhrpd requires kernel APIs that are only present on Linux.])
+ fi
+fi
+AM_CONDITIONAL(NHRPD, test "x$NHRPD" = "xnhrpd")
+
if test "${enable_watchfrr}" = "no";then
WATCHFRR=""
else
AC_SUBST(OSPFD)
AC_SUBST(OSPF6D)
AC_SUBST(LDPD)
+AC_SUBST(NHRPD)
AC_SUBST(WATCHFRR)
AC_SUBST(ISISD)
AC_SUBST(PIMD)
fi
AC_SUBST(HAVE_LIBPCREPOSIX)
+dnl ------------------
+dnl check C-Ares library
+dnl ------------------
+if test "${NHRPD}" != ""; then
+ PKG_CHECK_MODULES([CARES], [libcares])
+fi
+
+
dnl ------------------
dnl check Net-SNMP library
dnl ------------------
-if test "${enable_snmp}" != ""; then
+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
- LIBS="$LIBS `${NETSNMP_CONFIG} --agent-libs`"
- CFLAGS="`${NETSNMP_CONFIG} --base-cflags` $CFLAGS"
+ SNMP_LIBS="`${NETSNMP_CONFIG} --agent-libs`"
+ SNMP_CFLAGS="`${NETSNMP_CONFIG} --base-cflags`"
AC_MSG_CHECKING([whether we can link to Net-SNMP])
AC_LINK_IFELSE([AC_LANG_PROGRAM([
int main(void);
])],[AC_MSG_RESULT(yes)],[
AC_MSG_RESULT(no)
AC_MSG_ERROR([--enable-snmp given but not usable])])
- AC_DEFINE(HAVE_SNMP,,SNMP)
case "${enable_snmp}" in
yes)
SNMP_METHOD=agentx
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 dlopen & dlinfo
+dnl ---------------
+AC_SEARCH_LIBS(dlopen, [dl dld], [], [
+ AC_MSG_ERROR([unable to find the dlopen()])
+])
+
+AC_CHECK_HEADERS([link.h])
+
+AC_MSG_CHECKING([for dlinfo(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);
+]])], [
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_DLINFO_ORIGIN, 1, [Have dlinfo RTLD_DI_ORIGIN])
+], [
+ AC_MSG_RESULT(no)
+])
+
+AC_MSG_CHECKING([for dlinfo(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);
+]])], [
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_DLINFO_LINKMAP, 1, [Have dlinfo RTLD_DI_LINKMAP])
+], [
+ AC_MSG_RESULT(no)
+])
+
dnl ---------------------------
dnl sockaddr and netinet checks
AC_DEFINE(HAVE_CLOCK_MONOTONIC,, Have monotonic clock)
], [AC_MSG_RESULT(no)], [FRR_INCLUDES])
+dnl --------------------------------------
+dnl checking for flex and bison
+dnl --------------------------------------
+
+AM_PROG_LEX
+AC_MSG_CHECKING(version of flex)
+quagga_ac_flex_version="$(eval $LEX -V | grep flex | head -n 1)"
+quagga_ac_flex_version="${quagga_ac_flex_version##* }"
+AC_MSG_RESULT([$quagga_ac_flex_version])
+AX_COMPARE_VERSION([$quagga_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)
+quagga_ac_bison_version="$(eval $YACC -V | grep bison | head -n 1)"
+quagga_ac_bison_version="${quagga_ac_bison_version##* }"
+quagga_ac_bison_missing="false"
+case "x${quagga_ac_bison_version}" in
+ x2.7*)
+ BISON_OPENBRACE='"'
+ BISON_CLOSEBRACE='"'
+ BISON_VERBOSE=''
+ AC_MSG_RESULT([$quagga_ac_bison_version - 2.7 or older])
+ ;;
+ x2.*|x1.*)
+ AC_MSG_RESULT([$quagga_ac_bison_version])
+ AC_MSG_WARN([installed bison is too old. Please install GNU bison 2.7.x or newer.])
+ quagga_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.])
+ quagga_ac_bison_missing="true"
+ ;;
+ *)
+ BISON_OPENBRACE='{'
+ BISON_CLOSEBRACE='}'
+ BISON_VERBOSE='-Dparse.error=verbose'
+ AC_MSG_RESULT([$quagga_ac_bison_version - 3.0 or newer])
+ ;;
+esac
+AC_SUBST(BISON_OPENBRACE)
+AC_SUBST(BISON_CLOSEBRACE)
+AC_SUBST(BISON_VERBOSE)
+
+if $quagga_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 -------------------
CONFDATE=`date '+%Y%m%d'`
AC_SUBST(CONFDATE)
-dnl -------
-dnl DejaGNU
-dnl -------
-if test x"$DEJAGNU" = x
-then
- DEJAGNU="\$(top_srcdir)/tests/global-conf.exp"
-fi
-RUNTESTDEFAULTFLAGS="-x --tool \$\$tool"
-
-AC_SUBST(DEJAGNU)
-AC_SUBST(RUNTESTDEFAULTFLAGS)
-
dnl ------------------------------
dnl set paths for state directory
dnl ------------------------------
AC_MSG_RESULT(${frr_statedir})
AC_SUBST(frr_statedir)
-AC_DEFINE_UNQUOTED(PATH_ZEBRA_PID, "$frr_statedir/zebra.pid",zebra PID)
-AC_DEFINE_UNQUOTED(PATH_RIPD_PID, "$frr_statedir/ripd.pid",ripd PID)
-AC_DEFINE_UNQUOTED(PATH_RIPNGD_PID, "$frr_statedir/ripngd.pid",ripngd PID)
-AC_DEFINE_UNQUOTED(PATH_BGPD_PID, "$frr_statedir/bgpd.pid",bgpd PID)
-AC_DEFINE_UNQUOTED(PATH_OSPFD_PID, "$frr_statedir/ospfd.pid",ospfd PID)
-AC_DEFINE_UNQUOTED(PATH_OSPF6D_PID, "$frr_statedir/ospf6d.pid",ospf6d PID)
-AC_DEFINE_UNQUOTED(PATH_LDPD_PID, "$frr_statedir/ldpd.pid",ldpd PID)
AC_DEFINE_UNQUOTED(LDPD_SOCKET, "$frr_statedir/ldpd.sock",ldpd control socket)
-AC_DEFINE_UNQUOTED(PATH_ISISD_PID, "$frr_statedir/isisd.pid",isisd PID)
-AC_DEFINE_UNQUOTED(PATH_PIMD_PID, "$frr_statedir/pimd.pid",pimd PID)
-AC_DEFINE_UNQUOTED(PATH_WATCHFRR_PID, "$frr_statedir/watchfrr.pid",watchfrr PID)
AC_DEFINE_UNQUOTED(ZEBRA_SERV_PATH, "$frr_statedir/zserv.api",zebra api socket)
-AC_DEFINE_UNQUOTED(ZEBRA_VTYSH_PATH, "$frr_statedir/zebra.vty",zebra vty socket)
-AC_DEFINE_UNQUOTED(RIP_VTYSH_PATH, "$frr_statedir/ripd.vty",rip vty socket)
-AC_DEFINE_UNQUOTED(RIPNG_VTYSH_PATH, "$frr_statedir/ripngd.vty",ripng vty socket)
-AC_DEFINE_UNQUOTED(BGP_VTYSH_PATH, "$frr_statedir/bgpd.vty",bgpd vty socket)
-AC_DEFINE_UNQUOTED(OSPF_VTYSH_PATH, "$frr_statedir/ospfd.vty",ospfd vty socket)
-AC_DEFINE_UNQUOTED(OSPF6_VTYSH_PATH, "$frr_statedir/ospf6d.vty",ospf6d vty socket)
-AC_DEFINE_UNQUOTED(LDP_VTYSH_PATH, "$frr_statedir/ldpd.vty",ldpd vty socket)
-AC_DEFINE_UNQUOTED(ISIS_VTYSH_PATH, "$frr_statedir/isisd.vty",isisd vty socket)
-AC_DEFINE_UNQUOTED(PIM_VTYSH_PATH, "$frr_statedir/pimd.vty",pimd vty socket)
-AC_DEFINE_UNQUOTED(WATCHFRR_VTYSH_PATH, "$frr_statedir/watchfrr.vty",watchfrr vty socket)
AC_DEFINE_UNQUOTED(DAEMON_VTY_DIR, "$frr_statedir",daemon vty directory)
dnl autoconf does this, but it does it too late...
CFG_SYSCONF="$sysconfdir"
CFG_SBIN="$sbindir"
CFG_STATE="$frr_statedir"
+CFG_MODULE="$moduledir"
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\""
done
AC_SUBST(CFG_SYSCONF)
AC_SUBST(CFG_SBIN)
AC_SUBST(CFG_STATE)
-
-dnl -------------------------------
-dnl Quagga sources should always be
-dnl current wrt interfaces. Dont
-dnl allow deprecated interfaces to
-dnl be exposed.
-dnl -------------------------------
-AC_DEFINE(QUAGGA_NO_DEPRECATED_INTERFACES, 1, Hide deprecated interfaces)
+AC_SUBST(CFG_MODULE)
+AC_DEFINE_UNQUOTED(MODULE_PATH, "$CFG_MODULE", path to modules)
dnl ---------------------------
dnl Check htonl works correctly
ospf6d/Makefile ldpd/Makefile isisd/Makefile vtysh/Makefile
doc/Makefile ospfclient/Makefile tests/Makefile m4/Makefile
pimd/Makefile
- tests/bgpd.tests/Makefile
- tests/libfrr.tests/Makefile
+ nhrpd/Makefile
redhat/Makefile
tools/Makefile
+ debian/Makefile
cumulus/Makefile
pkgsrc/Makefile
fpm/Makefile
snapcraft/Makefile
snapcraft/snapcraft.yaml
lib/version.h
+ tests/lib/cli/test_cli.refout
doc/defines.texi
doc/bgpd.8
doc/isisd.8
doc/ripd.8
doc/ripngd.8
doc/pimd.8
+ doc/nhrpd.8
doc/vtysh.1
doc/watchfrr.8
doc/zebra.8
AC_OUTPUT
echo "
-FreeRangeRouting configuration
+FRRouting configuration
------------------------------
FRR version : ${PACKAGE_VERSION}
host operating system : ${host_os}
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}