##
AC_PREREQ(2.60)
-AC_INIT(frr, 5.1-dev, [https://github.com/frrouting/frr/issues])
+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_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_MSG_CHECKING([[whether $CC supports $1]])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[]])],
[
- AC_MSG_RESULT([yes])
- m4_if([$3], [], [], [
- CFLAGS="$ac_c_flag_save"
- $3
- ])
+ cachename=yes
], [
- CFLAGS="$ac_c_flag_save"
- AC_MSG_RESULT([no])
- $2
+ 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)
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]))
AC_ARG_ENABLE(zebra,
AS_HELP_STRING([--disable-zebra], [do not build zebra daemon]))
AC_ARG_ENABLE(bgpd,
AC_ARG_ENABLE(ospf6d,
AS_HELP_STRING([--disable-ospf6d], [do not build ospf6d]))
AC_ARG_ENABLE(ldpd,
- AS_HELP_STRING([--enable-ldpd], [build 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,
AC_ARG_ENABLE(pbrd,
AS_HELP_STRING([--disable-pbrd], [do not build pbrd]))
AC_ARG_ENABLE(sharpd,
- AS_HELP_STRING([--enable-sharpd], [do not build sharpd]))
+ AS_HELP_STRING([--enable-sharpd], [build sharpd]))
+AC_ARG_ENABLE(staticd,
+ AS_HELP_STRING([--disable-staticd], [do not build staticd]))
AC_ARG_ENABLE(bgp-announce,
AS_HELP_STRING([--disable-bgp-announce,], [turn off BGP route announcement]))
AC_ARG_ENABLE(bgp-vnc,
AC_ARG_WITH(rfp-path,
AS_HELP_STRING([--with-rfp-path[=DIR]],[path to replaced stub RFP used with BGP VNC]))
AC_ARG_ENABLE(snmp,
- AS_HELP_STRING([--enable-snmp=ARG], [enable SNMP support (smux or agentx)]))
+ AS_HELP_STRING([--enable-snmp], [enable SNMP support for agentx]))
AC_ARG_ENABLE(zeromq,
AS_HELP_STRING([--enable-zeromq], [enable ZeroMQ handler (libfrrzmq)]))
AC_ARG_WITH(libpam,
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(linux24_tcp_md5,
- AS_HELP_STRING([--enable-linux24-tcp-md5], [enable support for old, Linux-2.4 RFC2385 patch]))
AC_ARG_ENABLE(backtrace,
AS_HELP_STRING([--disable-backtrace,], [disable crash backtraces (default autodetect)]))
AC_ARG_ENABLE(time-check,
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]))
AC_ARG_ENABLE([protobuf],
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]))
AS_IF([test "${enable_clippy_only}" != "yes"], [
AC_CHECK_HEADERS(json-c/json.h)
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
#
# Python for clippy
#
-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.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])
- if test -n "$PYTHONCONFIG"; then
- PYTHON_CFLAGS="`\"${PYTHONCONFIG}\" --includes`"
- PYTHON_LIBS="`\"${PYTHONCONFIG}\" --libs`"
- AC_MSG_CHECKING([whether we found a working Python version])
- AC_LINK_IFELSE_FLAGS([$PYTHON_CFLAGS], [$PYTHON_LIBS], [AC_LANG_PROGRAM([
+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
return 0;
}
])], [
- PYTHONCONFIG=""
- unset PYTHON_LIBS
- unset PYTHON_CFLAGS
- ])
- fi
-
- if test -z "$PYTHONCONFIG"; then
- 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])
- ])])])])])
-
-
- AC_MSG_CHECKING([whether we found a working Python version])
+ # 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
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
# End of logic for protobuf support.
#
-if test "${enable_linux24_tcp_md5}" = "yes"; then
- AC_DEFINE(HAVE_TCP_MD5_LINUX24,,Old Linux 2.4 TCP MD5 Signature Patch)
-fi
-
AC_MSG_CHECKING(if zebra should be configurable to send Route Advertisements)
if test "${enable_rtadv}" != "no"; then
AC_MSG_RESULT(yes)
esac
AC_DEFINE_UNQUOTED(ISIS_METHOD, $ISIS_METHOD_MACRO, [ selected method for isis, == one of the constants ])
-dnl ------------------------------------
-dnl check for broken CMSG_FIRSTHDR macro
-dnl ------------------------------------
-AC_MSG_CHECKING(for broken CMSG_FIRSTHDR)
-AC_RUN_IFELSE([AC_LANG_SOURCE([[
-#ifdef SUNOS_5
-#define _XPG4_2
-#define __EXTENSIONS__
-#endif
-#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-
-main()
-{
- struct msghdr msg;
- char buf[4];
-
- msg.msg_control = buf;
- msg.msg_controllen = 0;
-
- if (CMSG_FIRSTHDR(&msg) != NULL)
- exit(0);
- exit (1);
-}]])],[AC_MSG_RESULT(yes - using workaround) AC_DEFINE(HAVE_BROKEN_CMSG_FIRSTHDR,,Broken CMSG_FIRSTHDR)],
-[AC_MSG_RESULT(no)],[AC_MSG_RESULT(no)])
-
dnl ---------------------------------------------------------------
dnl figure out how to specify an interface in multicast sockets API
dnl ---------------------------------------------------------------
])dnl
dnl disable doc check
-if test "${enable_doc}" = "no";then
- DOC=""
-else
- DOC="doc"
-fi
+AC_CHECK_PROGS([SPHINXBUILD], [sphinx-build sphinx-build3 sphinx-build2], [no])
+AM_CONDITIONAL(DOC, test "${enable_doc}" != "no")
+AM_CONDITIONAL(DOC_HTML, test "${enable_doc_html}" = "yes")
dnl --------------------
dnl Daemon disable check
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*)
AM_CONDITIONAL(PIMD, test "${enable_pimd}" != "no")
AM_CONDITIONAL(PBRD, test "${enable_pbrd}" != "no")
AM_CONDITIONAL(SHARPD, test "${enable_sharpd}" = "yes")
+AM_CONDITIONAL(STATICD, test "${enable_staticd}" != "no")
if test "${enable_bgp_announce}" = "no";then
AC_DEFINE(DISABLE_BGP_ANNOUNCE,1,Disable BGP installation to zebra)
# set
AM_CONDITIONAL([ENABLE_BGP_VNC], [test x${enable_bgp_vnc} != xno])
-AC_SUBST(DOC)
AC_SUBST(RFPTEST)
AC_SUBST(LIBRFP)
AC_SUBST(RFPINC)
yes)
SNMP_METHOD=agentx
;;
- smux|agentx)
+ agentx)
SNMP_METHOD="${enable_snmp}"
;;
*)
- AC_MSG_ERROR([--enable-snmp given with an unknown method (${enable_snmp}). Use smux or agentx])
+ AC_MSG_ERROR([--enable-snmp given with an unknown method (${enable_snmp}). Use yes or agentx])
;;
esac
- AH_TEMPLATE([SNMP_SMUX], [Use SNMP SMUX to interface with snmpd])
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
AC_CHECK_HEADERS([link.h])
-AC_MSG_CHECKING([for dlinfo(RTLD_DI_ORIGIN)])
-AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+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>
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)
+ 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_MSG_CHECKING([for dlinfo(RTLD_DI_LINKMAP)])
-AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+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>
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)
+ 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")
dnl has been specified, which might not provide
dnl mallinfo, e.g. such as Umem on Solaris.
dnl -----------------------------------------
-AC_CHECK_HEADER([malloc.h],
- [AC_MSG_CHECKING(whether mallinfo is available)
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <malloc.h>]],
- [[struct mallinfo ac_x; ac_x = mallinfo ();]])],
- [AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_MALLINFO,,mallinfo)],
- AC_MSG_RESULT(no)
- )
- ], [], FRR_INCLUDES)
+AC_CHECK_HEADERS([malloc.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_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 ----------
dnl configure date
dnl ----------
-CONFDATE=`date '+%Y%m%d'`
+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)
dnl ------------------------------
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)
dnl autoconf does this, but it does it too late...
)
AC_MSG_RESULT($ac_cv_htonl_works)
-AC_CONFIG_FILES([Makefile
+AC_CONFIG_FILES([Makefile],[sed -e 's/^#AUTODERP# //' -i Makefile])
+
+AC_CONFIG_FILES([
bgpd/Makefile
vtysh/Makefile
- doc/Makefile
- doc/user/Makefile
- doc/manpages/Makefile
- doc/developer/Makefile
tests/Makefile
bgpd/rfp-example/rfptest/Makefile
bgpd/rfp-example/librfp/Makefile
redhat/frr.spec
- debianpkg/Makefile
+ solaris/Makefile
debianpkg/changelog
alpine/APKBUILD
snapcraft/snapcraft.yaml
fi
fi
-AC_CONFIG_FILES([solaris/Makefile])
-
AC_CONFIG_FILES([vtysh/extract.pl],[chmod +x vtysh/extract.pl])
AC_CONFIG_COMMANDS([lib/route_types.h], [
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 "x$SPHINXBUILD" = xno],
+ AC_MSG_WARN(sphinx-build is missing but required to build documentation))
+fi