X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=configure.ac;h=1e414d09489e5b16dba42794231fbcc9531b8b75;hb=a616ea5f24374e412b34d88bdd51e5d0165e329b;hp=6661f45d7c673d249a3ddc7c33696fd039f71432;hpb=e878f5cd6750c724ffc197ce7a3b8b8d64712833;p=mirror_frr.git diff --git a/configure.ac b/configure.ac index 6661f45d7..1e414d094 100755 --- a/configure.ac +++ b/configure.ac @@ -7,7 +7,7 @@ ## AC_PREREQ(2.60) -AC_INIT(frr, 3.0, [https://github.com/frrouting/frr/issues]) +AC_INIT(frr, 3.1-dev, [https://github.com/frrouting/frr/issues]) PACKAGE_URL="https://frrouting.org/" PACKAGE_FULLNAME="FRRouting" AC_SUBST(PACKAGE_FULLNAME) @@ -73,6 +73,10 @@ LIBS="$LIBS -ltcmalloc_minimal" 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 -------------------- @@ -85,6 +89,7 @@ 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 @@ -96,7 +101,7 @@ AC_CHECK_PROG([SED],[sed],[sed],[/bin/false]) dnl try and enable CFLAGS that are useful for Quagga dnl - specifically, options to control warnings -AC_USE_SYSTEM_EXTENSIONS() +AC_USE_SYSTEM_EXTENSIONS AC_DEFUN([AC_C_FLAG], [{ AC_LANG_PUSH(C) ac_c_flag_save="$CFLAGS" @@ -122,6 +127,13 @@ 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 specified any CFLAGS, we don't add "-g -Os/-O2" here if test "z$orig_cflags" = "z"; then AC_C_FLAG([-g]) @@ -177,6 +189,18 @@ AC_LINK_IFELSE( ]) AC_LANG_POP(C) +dnl ---------- +dnl Essentials +dnl ---------- + +AX_PTHREAD([ + CC="$PTHREAD_CC" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + LIBS="$PTHREAD_LIBS $LIBS" +], [ + AC_MSG_FAILURE([This Quagga version needs pthreads]) +]) + dnl -------------- dnl Check programs dnl -------------- @@ -204,6 +228,9 @@ AC_ARG_WITH(pkg-extra-version, 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") AC_ARG_ENABLE(vtysh, AS_HELP_STRING([--disable-vtysh], [do not build integrated vty shell for Quagga])) AC_ARG_ENABLE(doc, @@ -224,6 +251,10 @@ 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(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, @@ -289,12 +320,14 @@ 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(rr-semantics, 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-old-vpn-commands], [Keep old vpn 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") @@ -334,7 +367,7 @@ if test "${enable_rr_semantics}" != "no" ; then 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 ---------- @@ -343,11 +376,11 @@ dnl ---------- AC_MSG_CHECKING(whether this OS has MPLS stack) case "$host" in *-linux*) - MPLS_METHOD="zebra_mpls_netlink.o" + MPLS_METHOD="zebra_mpls_netlink.o zebra_mpls.o" AC_MSG_RESULT(Linux MPLS) ;; *-openbsd*) - MPLS_METHOD="zebra_mpls_openbsd.o" + MPLS_METHOD="zebra_mpls_openbsd.o zebra_mpls.o" AC_MSG_RESULT(OpenBSD MPLS) ;; *) @@ -357,12 +390,17 @@ case "$host" in esac AC_SUBST(MPLS_METHOD) -if test "${enable_cumulus}" = "yes" ; then - AC_DEFINE(HAVE_CUMULUS,,Compile Special Cumulus Code in) +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_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) @@ -406,7 +444,7 @@ fi # # Logic for old vpn commans support. # -if test "$enable_old_vpn_commands" = "yes"; then +if test "$enable_oldvpn_commands" = "yes"; then AC_DEFINE(KEEP_OLD_VPN_COMMANDS,, [Define for compiling with old vpn commands]) fi @@ -499,6 +537,8 @@ esac AC_DEFINE_UNQUOTED(MULTIPATH_NUM, $MPATH_NUM, Maximum number of paths for a route) +AC_DEFINE_UNQUOTED(VTYSH_PAGER, "$VTYSH_PAGER", [What pager to use]) + dnl ----------------------------------- dnl Add extra version string to package dnl name, string and version fields. @@ -539,6 +579,72 @@ 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 +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]) + ]) + ]) +]) + dnl Utility macro to avoid retyping includes all the time m4_define([FRR_INCLUDES], [#ifdef SUNOS_5 @@ -1210,6 +1316,13 @@ else fi AM_CONDITIONAL(NHRPD, test "x$NHRPD" = "xnhrpd") +if test "${enable_eigrpd}" = "no";then + EIGRPD="" +else + EIGRPD="eigrpd" +fi +AM_CONDITIONAL(EIGRPD, test "x$EIGRPD" = "xeigrpd") + if test "${enable_watchfrr}" = "no";then WATCHFRR="" else @@ -1234,6 +1347,12 @@ case "${enable_ripngd}" in esac AM_CONDITIONAL(RIPNGD, test "x$RIPNGD" = "xripngd") +case "${enable_babeld}" in + "no" ) BABELD="";; + * ) BABELD="babeld";; +esac +AM_CONDITIONAL(BABELD, test "x$BABELD" = "xbabeld") + case "${enable_ospf6d}" in "no" ) OSPF6D="";; * ) OSPF6D="ospf6d";; @@ -1284,6 +1403,7 @@ AC_SUBST(ZEBRA) AC_SUBST(RFPTEST) AC_SUBST(LIBRFP) AC_SUBST(RFPINC) +AC_SUBST(BABELD) AC_SUBST(BGPD) AC_SUBST(RIPD) AC_SUBST(RIPNGD) @@ -1291,6 +1411,7 @@ AC_SUBST(OSPFD) AC_SUBST(OSPF6D) AC_SUBST(LDPD) AC_SUBST(NHRPD) +AC_SUBST(EIGRPD) AC_SUBST(WATCHFRR) AC_SUBST(ISISD) AC_SUBST(PIMD) @@ -1403,6 +1524,8 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([[ ]) +AM_CONDITIONAL(SNMP, test "x$SNMP_METHOD" = "xagentx") + dnl --------------------------- dnl sockaddr and netinet checks dnl --------------------------- @@ -1502,6 +1625,12 @@ AC_TRY_COMPILE([#include ], [ AC_MSG_RESULT(no) ]) +dnl -------------------------------------- +dnl checking for be32dec existence or not +dnl -------------------------------------- +AC_CHECK_DECLS([be32enc, be32dec], [], [], + [#include ]) + dnl -------------------------------------- dnl checking for clock_time monotonic struct and call dnl -------------------------------------- @@ -1730,11 +1859,12 @@ AC_CONFIG_FILES([Makefile lib/Makefile qpb/Makefile zebra/Makefile ripd/Makefile ripngd/Makefile bgpd/Makefile ospfd/Makefile watchfrr/Makefile ospf6d/Makefile ldpd/Makefile isisd/Makefile vtysh/Makefile doc/Makefile ospfclient/Makefile tests/Makefile m4/Makefile + babeld/Makefile pimd/Makefile + eigrpd/Makefile nhrpd/Makefile redhat/Makefile tools/Makefile - cumulus/Makefile pkgsrc/Makefile fpm/Makefile redhat/frr.spec @@ -1750,6 +1880,7 @@ AC_CONFIG_FILES([Makefile lib/Makefile qpb/Makefile zebra/Makefile ripd/Makefile doc/ospfd.8 doc/ldpd.8 doc/ripd.8 + doc/eigrpd.8 doc/ripngd.8 doc/pimd.8 doc/nhrpd.8 @@ -1758,7 +1889,8 @@ AC_CONFIG_FILES([Makefile lib/Makefile qpb/Makefile zebra/Makefile ripd/Makefile doc/zebra.8 doc/frr.1 pkgsrc/bgpd.sh pkgsrc/ospf6d.sh pkgsrc/ospfd.sh - pkgsrc/ripd.sh pkgsrc/ripngd.sh pkgsrc/zebra.sh]) + pkgsrc/ripd.sh pkgsrc/ripngd.sh pkgsrc/zebra.sh + pkgsrc/eigrpd.sh]) if test "${enable_bgp_vnc}" != "no"; then if test "${with_rfp_path}" = "bgpd/rfp-example" ; then