2003-03-17 03:05:07 +01:00
##
2017-03-30 20:22:35 +02:00
## Configure template file for FRRouting.
2018-11-14 12:23:49 +01:00
## autoconf will generate a configure script.
2003-03-17 03:05:07 +01:00
##
## Copyright (c) 1996, 97, 98, 99, 2000 Kunihiro Ishiguro <kunihiro@zebra.org>
2003-08-12 15:08:31 +02:00
## Portions Copyright (c) 2003 Paul Jakma <paul@dishone.st>
2003-03-17 03:05:07 +01:00
##
2021-04-21 12:33:47 +02:00
AC_PREREQ([2.69])
2003-03-17 03:05:07 +01:00
2021-05-18 20:41:39 +02:00
AC_INIT([frr], [8.1-dev], [https://github.com/frrouting/frr/issues])
2017-03-30 20:24:05 +02:00
PACKAGE_URL="https://frrouting.org/"
2018-11-14 12:23:49 +01:00
AC_SUBST([PACKAGE_URL])
2017-03-30 20:22:35 +02:00
PACKAGE_FULLNAME="FRRouting"
2018-11-14 12:23:49 +01:00
AC_SUBST([PACKAGE_FULLNAME])
2016-12-14 20:22:25 +01:00
2018-10-30 02:02:00 +01:00
CONFIG_ARGS="`echo $ac_configure_args | sed -e \"s% '[[A-Z]]*FLAGS=[[^']]\+'%%g\"`"
2018-11-14 12:23:49 +01:00
AC_SUBST([CONFIG_ARGS])
2016-12-14 20:22:25 +01:00
2018-11-14 12:23:49 +01:00
AC_CONFIG_SRCDIR([lib/zebra.h])
2009-07-19 18:33:21 +02:00
AC_CONFIG_MACRO_DIR([m4])
2021-04-21 11:59:24 +02:00
AC_CONFIG_AUX_DIR([m4/ac])
2005-04-11 16:55:55 +02:00
dnl -----------------------------------
dnl Get hostname and other information.
dnl -----------------------------------
AC_CANONICAL_BUILD()
AC_CANONICAL_HOST()
2016-11-11 17:10:02 +01:00
build: add more precious variables for cross-compilation
Using AC_ARG_VAR function, it's possible to add LD, AR, OBJCOPY,
OBJDUMP, RANLIB and STRIP to the list of precious variables in
$ac_precious_vars for configure tool.
Doing this, we are enabling a new set of variables (HOST_LD, HOST_AR,
HOST_OBJCOPY, HOST_OBJDUMP, HOST_RANLIB and HOST_STRIP) useful for
cross-compiling when the target toolchain is prepending a prefix
to these tools.
Signed-off-by: Emanuele Bovisio <emanuele.bovisio@eolo.it>
2020-10-30 18:39:00 +01:00
AC_ARG_VAR([AR],[archiver command])
AC_ARG_VAR([LD],[linker command])
AC_ARG_VAR([OBJCOPY],[objcopy command])
AC_ARG_VAR([OBJDUMP],[objdump command])
AC_ARG_VAR([RANLIB],[ranlib command])
AC_ARG_VAR([STRIP],[strip command])
2019-06-04 15:35:16 +02:00
hosttools_clippy="false"
build_clippy="true"
dnl case 1: external clippy
if test -n "$with_clippy" -a "$with_clippy" != "no" -a "$with_clippy" != "yes"; then
2020-01-16 20:23:23 +01:00
if test "$enable_clippy_only" = "yes"; then
2019-06-04 15:35:16 +02:00
AC_MSG_ERROR([--enable-clippy-only does not make sense with --with-clippy])
fi
CLIPPY="$with_clippy"
build_clippy="false"
if test ! -x "$with_clippy"; then
AC_MSG_ERROR([clippy tool ($with_clippy) is not executable])
fi
dnl case 2: cross-compiling internal clippy
elif test "$host" != "$build"; then
2016-11-11 17:10:02 +01:00
if test "$srcdir" = "."; then
2019-06-04 15:35:16 +02:00
AC_MSG_ERROR([cross-compilation is only possible with builddir separate from srcdir or by building clippy separately and using the --with-clippy option. create a separate directory and run as .../path-to-frr/configure.])
2016-11-11 17:10:02 +01:00
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([...])
2019-06-04 16:20:20 +02:00
(
for var in $ac_precious_vars; do
dnl special cases
case "$var" in
YACC|YFLAGS) continue;;
PYTHON*) retain=true;;
*) retain=false;
esac
eval "hostvar=\"\${HOST_$var}\""
eval "targetvar=\"\${$var}\""
if test -n "$hostvar"; then
eval "$var='$hostvar'"
_AS_ECHO_LOG([host $var='$hostvar'])
elif $retain; then
_AS_ECHO_LOG([host retain $var='$targetvar'])
else
eval "unset $var"
_AS_ECHO_LOG([host unset $var])
fi
done
cd hosttools
"${abssrc}/configure" "--host=$build" "--build=$build" "--enable-clippy-only" "--disable-nhrpd" "--disable-vtysh"
) || exit 1
2016-11-11 17:10:02 +01:00
AC_MSG_NOTICE([...])
AC_MSG_NOTICE([... cross-compilation: finished self-configuring for build platform tools])
AC_MSG_NOTICE([...])
build_clippy="false"
2019-06-04 15:35:16 +02:00
hosttools_clippy="true"
CLIPPY="hosttools/lib/clippy"
dnl case 3: normal build internal clippy
else
CLIPPY="lib/clippy\$(EXEEXT)"
fi
AC_SUBST([CLIPPY])
2016-11-11 17:10:02 +01:00
AM_CONDITIONAL([BUILD_CLIPPY], [$build_clippy])
2019-06-04 15:35:16 +02:00
AM_CONDITIONAL([HOSTTOOLS_CLIPPY], [$hosttools_clippy])
AM_CONDITIONAL([ONLY_CLIPPY], [test "$enable_clippy_only" = "yes"])
2005-04-11 16:55:55 +02:00
2016-04-04 19:54:56 +02:00
# Disable portability warnings -- our automake code (in particular
# common.am) uses some constructs specific to gmake.
2018-09-04 22:27:54 +02:00
AM_INIT_AUTOMAKE([1.12 -Wno-portability foreign])
2016-04-01 12:54:38 +02:00
m4_ifndef([AM_SILENT_RULES], [m4_define([AM_SILENT_RULES],[])])
2015-02-10 11:39:39 +01:00
AM_SILENT_RULES([yes])
2018-11-14 12:23:49 +01:00
AC_CONFIG_HEADERS([config.h])
2003-03-17 03:05:07 +01:00
2018-11-14 12:23:49 +01:00
AC_PATH_PROG([PERL], [perl])
2017-01-18 18:01:53 +01:00
PKG_PROG_PKG_CONFIG
2005-04-16 17:38:23 +02:00
2004-08-31 20:16:36 +02:00
dnl default is to match previous behavior
pkgsrcrcdir=""
AC_ARG_ENABLE([pkgsrcrcdir],
2014-06-28 22:15:59 +02:00
AS_HELP_STRING([--enable-pkgsrcrcdir],
2004-08-31 20:16:36 +02:00
[specify directory for rc.d scripts]),
2017-07-31 22:05:56 +02:00
pkgsrcrcdir="$enableval",)
2004-08-31 20:16:36 +02:00
dnl XXX add --pkgsrcrcdir to autoconf standard directory list somehow
2018-11-14 12:23:49 +01:00
AC_SUBST([pkgsrcrcdir])
2020-03-11 12:09:13 +01:00
AM_CONDITIONAL([PKGSRC], [test "$pkgsrcrcdir" != ""])
2004-08-31 20:16:36 +02:00
2016-05-31 19:25:46 +02:00
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])
2020-12-02 00:42:24 +01:00
AC_ARG_WITH([scriptdir], [AS_HELP_STRING([--with-scriptdir=DIR], [script directory (${sysconfdir}/scripts)])], [
2020-11-30 23:37:18 +01:00
scriptdir="$withval"
], [
scriptdir="\${sysconfdir}/scripts"
])
AC_SUBST([scriptdir], [$scriptdir])
2017-12-07 20:31:48 +01:00
2018-10-30 22:39:47 +01:00
AC_ARG_WITH([yangmodelsdir], [AS_HELP_STRING([--with-yangmodelsdir=DIR], [yang models directory (${datarootdir}/yang)])], [
yangmodelsdir="$withval"
], [
yangmodelsdir="\${datarootdir}/yang"
])
2018-11-14 12:23:49 +01:00
AC_SUBST([yangmodelsdir])
2018-10-30 22:39:47 +01:00
2020-01-25 19:38:39 +01:00
AC_ARG_WITH([vici-socket], [AS_HELP_STRING([--with-vici-socket=PATH], [vici-socket (/var/run/charon.vici)])], [
vici_socket="$withval"
], [
vici_socket="/var/run/charon.vici"
])
AC_DEFINE_UNQUOTED([VICI_SOCKET], ["$vici_socket"], [StrongSWAN vici socket path])
2015-05-20 03:03:47 +02:00
AC_ARG_ENABLE(tcmalloc,
2016-11-10 13:14:48 +01:00
AS_HELP_STRING([--enable-tcmalloc], [Turn on tcmalloc]),
2015-05-20 03:03:47 +02:00
[case "${enableval}" in
yes) tcmalloc_enabled=true
LIBS="$LIBS -ltcmalloc_minimal"
;;
no) tcmalloc_enabled=false ;;
2018-11-14 12:23:49 +01:00
*) AC_MSG_ERROR([bad value ${enableval} for --enable-tcmalloc]) ;;
2015-05-20 03:03:47 +02:00
esac],[tcmalloc_enabled=false])
2015-05-29 02:22:48 +02:00
dnl Thanks autoconf, but we don't want a default -g -O2. We have our own
dnl flag determination logic.
CFLAGS="${CFLAGS:-}"
2005-03-27 15:07:23 +02:00
dnl --------------------
dnl Check CC and friends
dnl --------------------
2016-11-15 03:18:43 +01:00
dnl note orig_cflags is also used further down
orig_cflags="$CFLAGS"
2019-01-25 21:54:16 +01:00
orig_cxxflags="$CXXFLAGS"
2008-08-13 17:17:04 +02:00
AC_LANG([C])
2003-03-17 03:05:07 +01:00
AC_PROG_CC
2005-03-27 15:07:23 +02:00
AC_PROG_CPP
2019-01-25 21:54:16 +01:00
AC_PROG_CXX
2008-08-13 17:17:04 +02:00
AM_PROG_CC_C_O
2016-11-15 03:18:43 +01:00
dnl remove autoconf default "-g -O2"
CFLAGS="$orig_cflags"
2019-01-25 21:54:16 +01:00
CXXFLAGS="$orig_cxxflags"
2016-10-21 08:55:10 +02:00
AC_PROG_CC_C99
2017-01-29 00:51:45 +01:00
dnl NB: see C11 below
2007-02-06 21:10:35 +01:00
2021-02-15 19:59:02 +01:00
dnl Some special handling for ICC later on
if test "$CC" = "icc"; then
cc_is_icc="yes"
fi
2017-01-19 16:27:01 +01:00
PKG_PROG_PKG_CONFIG
2016-11-15 03:18:43 +01:00
2019-06-04 14:12:30 +02:00
dnl it's 2019, sed is sed.
SED=sed
AC_SUBST([SED])
2005-03-27 15:07:23 +02:00
2017-07-12 18:25:33 +02:00
dnl try and enable CFLAGS that are useful for FRR
2016-11-15 03:18:43 +01:00
dnl - specifically, options to control warnings
2005-03-27 15:07:23 +02:00
2021-04-21 11:54:48 +02:00
AC_SUBST([AC_CFLAGS])
2015-04-25 13:10:36 +02:00
AC_USE_SYSTEM_EXTENSIONS
2015-03-03 09:55:51 +01:00
AC_DEFUN([AC_C_FLAG], [{
2020-03-29 07:58:59 +02:00
m4_pushdef([cachename],[m4_translit([frr_cv_$1],[ =-+/{}$],[________])])
2018-08-18 08:03:02 +02:00
AC_CACHE_CHECK([[whether $CC supports $1]], cachename, [
2018-11-14 12:23:49 +01:00
AC_LANG_PUSH([C])
2015-03-03 09:55:51 +01:00
ac_c_flag_save="$CFLAGS"
CFLAGS="$CFLAGS $1"
AC_COMPILE_IFELSE(
2020-03-29 07:58:59 +02:00
[AC_LANG_PROGRAM([[$4]])],
2015-03-03 09:55:51 +01:00
[
2018-08-18 08:03:02 +02:00
cachename=yes
2015-03-03 09:55:51 +01:00
], [
2018-08-18 08:03:02 +02:00
cachename=no
2015-03-03 09:55:51 +01:00
])
2018-08-18 08:03:02 +02:00
CFLAGS="$ac_c_flag_save"
2018-11-14 12:23:49 +01:00
AC_LANG_POP([C])
2018-08-18 08:03:02 +02:00
])
2020-03-11 12:30:47 +01:00
if test "$cachename" = "yes"; then
2021-04-21 11:54:48 +02:00
m4_if([$3], [], [AC_CFLAGS="$AC_CFLAGS $1"], [$3])
2018-08-18 08:03:02 +02:00
else
:
$2
fi
m4_popdef([cachename])
}])
2015-03-03 09:55:51 +01:00
2017-06-14 10:26:07 +02:00
AC_DEFUN([AC_LINK_IFELSE_FLAGS], [{
2018-11-14 12:23:49 +01:00
AC_LANG_PUSH([C])
2017-06-14 10:26:07 +02:00
ac_cflags_save="$CFLAGS"
ac_libs_save="$LIBS"
CFLAGS="$CFLAGS $1"
LIBS="$LIBS $2"
AC_LINK_IFELSE(
[$3],
[
CFLAGS="$ac_cflags_save"
LIBS="$ac_libs_save"
2019-05-28 00:35:24 +02:00
m4_default([$5], [
AC_MSG_RESULT([yes])
])
2017-06-14 10:26:07 +02:00
], [
CFLAGS="$ac_cflags_save"
LIBS="$ac_libs_save"
2019-05-28 00:35:24 +02:00
m4_default([$4], [
AC_MSG_RESULT([no])
])
2017-06-14 10:26:07 +02:00
])
2018-11-14 12:23:49 +01:00
AC_LANG_POP([C])
2017-06-14 10:26:07 +02:00
}])
2016-11-15 03:18:43 +01:00
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
2021-02-15 19:59:02 +01:00
if test "$cc_is_icc" = "yes"; then
AC_C_FLAG([-diag-error 10006])
fi
2016-11-15 03:18:43 +01:00
2017-01-29 00:51:45 +01:00
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"])
2017-09-07 15:39:15 +02:00
dnl if the user has specified any CFLAGS, override our settings
2020-03-11 12:30:47 +01:00
if test "$enable_gcov" = "yes"; then
2020-03-11 12:09:13 +01:00
if test "$orig_cflags" = ""; then
2021-07-21 11:23:23 +02:00
AC_C_FLAG([--coverage])
2018-06-14 15:44:38 +02:00
AC_C_FLAG([-O0])
fi
2021-07-21 11:23:23 +02:00
AC_LDFLAGS="${AC_LDFLAGS} --coverage"
2020-01-16 22:25:59 +01:00
fi
2020-03-11 12:30:47 +01:00
if test "$enable_clang_coverage" = "yes"; then
2020-01-16 22:25:59 +01:00
AC_C_FLAG([-fprofile-instr-generate], [
AC_MSG_ERROR([$CC does not support -fprofile-instr-generate.])
])
AC_C_FLAG([-fcoverage-mapping], [
AC_MSG_ERROR([$CC does not support -fcoverage-mapping.])
])
fi
2021-06-22 18:31:02 +02:00
AM_CONDITIONAL([SCRIPTING], [test "$enable_scripting" = "yes"])
2020-11-30 23:01:03 +01:00
if test "$enable_scripting" = "yes"; then
2021-03-23 20:20:38 +01:00
AX_PROG_LUA([5.3], [5.4], [], [
AC_MSG_ERROR([Lua 5.3 is required to build with Lua support. No other version is supported.])
])
AX_LUA_HEADERS([], [
AC_MSG_ERROR([Lua 5.3 headers are required to build with Lua support. No other version is supported.])
])
2020-11-30 23:01:03 +01:00
AX_LUA_LIBS([
2021-03-23 20:20:38 +01:00
AC_DEFINE([HAVE_SCRIPTING], [1], [Have support for scripting])
LIBS="$LIBS $LUA_LIB"
2021-06-22 18:31:02 +02:00
SCRIPTING=true
2021-03-23 20:20:38 +01:00
], [
2021-06-22 18:31:02 +02:00
SCRIPTING=false
2021-03-23 20:20:38 +01:00
AC_MSG_ERROR([Lua 5.3 libraries are required to build with Lua support. No other version is supported.])
2020-11-30 23:01:03 +01:00
])
fi
2021-04-21 11:54:48 +02:00
dnl the following flags go in CFLAGS rather than AC_CFLAGS since they make
dnl sense to be overridden by the user
2020-03-11 12:30:47 +01:00
if test "$enable_dev_build" = "yes"; then
2018-11-14 12:23:49 +01:00
AC_DEFINE([DEV_BUILD], [1], [Build for development])
2020-03-11 12:09:13 +01:00
if test "$orig_cflags" = ""; then
2021-04-21 11:54:48 +02:00
AC_C_FLAG([-O0],,[CFLAGS="$CFLAGS -O0"])
AC_C_FLAG([-g3],,[CFLAGS="$CFLAGS -g3"])
AC_C_FLAG([-ggdb3],,[CFLAGS="$CFLAGS -ggdb3"])
2017-09-07 15:39:15 +02:00
fi
else
2020-03-11 12:09:13 +01:00
if test "$orig_cflags" = ""; then
2021-04-21 11:54:48 +02:00
AC_C_FLAG([-g],,[CFLAGS="$CFLAGS -g"])
AC_C_FLAG([-O2],,[CFLAGS="$CFLAGS -O2"])
2017-09-07 15:39:15 +02:00
fi
fi
2021-03-18 16:27:36 +01:00
2020-03-11 12:09:13 +01:00
AM_CONDITIONAL([DEV_BUILD], [test "$enable_dev_build" = "yes"])
2017-09-07 15:39:15 +02:00
2016-11-15 03:18:43 +01:00
dnl always want these CFLAGS
AC_C_FLAG([-fno-omit-frame-pointer])
2017-08-24 18:16:24 +02:00
AC_C_FLAG([-funwind-tables])
2016-11-15 03:18:43 +01:00
AC_C_FLAG([-Wall])
AC_C_FLAG([-Wextra])
2021-09-01 17:12:15 +02:00
AC_C_FLAG([-Wstrict-prototypes])
2016-11-15 03:18:43 +01:00
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])
2020-03-11 11:05:34 +01:00
AC_C_FLAG([-Wundef])
2020-03-11 12:30:47 +01:00
if test "$enable_gcc_ultra_verbose" = "yes" ; then
2016-11-15 03:18:43 +01:00
AC_C_FLAG([-Wcast-qual])
AC_C_FLAG([-Wmissing-noreturn])
AC_C_FLAG([-Wmissing-format-attribute])
AC_C_FLAG([-Wunreachable-code])
AC_C_FLAG([-Wpacked])
AC_C_FLAG([-Wpadded])
2018-09-13 16:42:30 +02:00
AC_C_FLAG([-Wshadow])
2005-11-26 09:28:00 +01:00
else
2016-11-15 03:18:43 +01:00
AC_C_FLAG([-Wno-unused-result])
2005-03-27 15:07:23 +02:00
fi
2016-11-15 03:18:43 +01:00
AC_C_FLAG([-Wno-unused-parameter])
AC_C_FLAG([-Wno-missing-field-initializers])
2019-02-11 13:22:49 +01:00
AC_C_FLAG([-Wc++-compat], [], [CXX_COMPAT_CFLAGS="-Wc++-compat"])
AC_SUBST([CXX_COMPAT_CFLAGS])
2016-11-15 03:18:43 +01:00
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.
2021-02-15 19:59:02 +01:00
if test "$cc_is_icc" = "yes"; then
AC_C_FLAG([-diag-disable 3179])
fi
2005-03-27 15:07:23 +02:00
2020-03-11 12:30:47 +01:00
if test "$enable_werror" = "yes" ; then
2015-07-26 01:05:56 +02:00
WERROR="-Werror"
fi
2018-11-14 12:23:49 +01:00
AC_SUBST([WERROR])
2015-07-26 01:05:56 +02:00
2018-09-02 20:36:20 +02:00
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
2019-10-09 01:47:38 +02:00
AC_C_FLAG([-fsanitize=memory -fPIE -pie], [
AC_MSG_ERROR([$CC does not support Memory Sanitizer.])
2018-09-02 20:36:20 +02:00
], [
2020-01-03 21:03:37 +01:00
SAN_FLAGS="$SAN_FLAGS -fsanitize=memory -fPIE -pie"
2018-09-02 20:36:20 +02:00
])
fi
2020-01-02 03:05:02 +01:00
if test "$enable_undefined_sanitizer" = "yes"; then
AC_C_FLAG([-fsanitize=undefined], [
AC_MSG_ERROR([$CC does not support UndefinedBehaviorSanitizer.])
], [
2020-01-03 21:03:37 +01:00
SAN_FLAGS="$SAN_FLAGS -fsanitize=undefined"
2020-01-02 03:05:02 +01:00
])
fi
2018-09-02 20:36:20 +02:00
AC_SUBST([SAN_FLAGS])
2020-03-29 07:58:59 +02:00
dnl frr-format.so
if test "$with_frr_format" != "no" -a "$with_frr_format" != "yes" -a -n "$with_frr_format"; then
AC_C_FLAG([-fplugin=${with_frr_format}], [
AC_MSG_ERROR([specified frr-format plugin ($with_frr_format) does not work])
],,[
#ifndef _FRR_ATTRIBUTE_PRINTFRR
#error plugin not loaded
#endif
#if _FRR_ATTRIBUTE_PRINTFRR < 0x10000
#error plugin too old
#endif
])
elif test "$with_frr_format" = "no"; then
: #nothing
else
AC_C_FLAG([-fplugin=tools/gcc-plugins/frr-format.so],[
AC_C_FLAG([-fplugin=frr-format],[
if test "$with_frr_format" = "yes"; then
AC_MSG_ERROR([frr-format plugin requested but not found])
fi
],,[
#ifndef _FRR_ATTRIBUTE_PRINTFRR
#error plugin not loaded
#endif
#if _FRR_ATTRIBUTE_PRINTFRR < 0x10000
#error plugin too old
#endif
])
],,[
#ifndef _FRR_ATTRIBUTE_PRINTFRR
#error plugin not loaded
#endif
#if _FRR_ATTRIBUTE_PRINTFRR < 0x10000
#error plugin too old
#endif
])
fi
2018-08-09 22:50:19 +02:00
AC_MSG_CHECKING([whether linker supports __start/stop_section symbols])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <stdio.h>
int __attribute__((section("secttest"))) var = 1;
extern int __start_secttest, __stop_secttest;
]], [[
void *a = &var, *b = &__start_secttest, *c = &__stop_secttest;
printf("%p %p %p\n", a, b, c);
]])], [
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_SECTION_SYMS, 1, [have __start/stop_section symbols])
], [
AC_MSG_RESULT(no)
])
2015-04-25 13:10:36 +02:00
dnl ----------
dnl Essentials
dnl ----------
AX_PTHREAD([
CC="$PTHREAD_CC"
2021-04-21 11:54:48 +02:00
AC_CFLAGS="$AC_CFLAGS $PTHREAD_CFLAGS"
2015-04-25 13:10:36 +02:00
LIBS="$PTHREAD_LIBS $LIBS"
], [
2017-07-12 18:25:33 +02:00
AC_MSG_FAILURE([This FRR version needs pthreads])
2015-04-25 13:10:36 +02:00
])
2021-04-27 15:11:33 +02:00
orig_cflags="$CFLAGS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
2018-09-07 19:11:02 +02:00
AC_SEARCH_LIBS([pthread_condattr_setclock], [],
[frr_cv_pthread_condattr_setclock=yes],
[frr_cv_pthread_condattr_setclock=no])
2020-03-11 11:53:15 +01:00
if test "$frr_cv_pthread_condattr_setclock" = "yes"; then
2018-11-14 12:23:49 +01:00
AC_DEFINE([HAVE_PTHREAD_CONDATTR_SETCLOCK], [1], [Have pthread.h pthread_condattr_setclock])
2018-09-07 19:11:02 +02:00
fi
2021-04-27 15:11:33 +02:00
AC_CHECK_HEADERS([pthread_np.h],,, [
#include <pthread.h>
])
AC_CHECK_FUNCS([pthread_setname_np pthread_set_name_np pthread_getthreadid_np])
CFLAGS="$orig_cflags"
2003-03-17 03:05:07 +01:00
dnl --------------
dnl Check programs
dnl --------------
AC_PROG_INSTALL
[autoconf] bugs 162,303,178: Fix 'present but can not be compiled' warnings
2007-05-09 Paul Jakma <paul.jakma@sun.com>
* configure.ac: sys/conf.h depends on sys/param.h, at least on
FBSD 6.2.
(bug #363) Should check for in_pktinfo for IRDP
2006-05-27 Paul Jakma <paul.jakma@sun.com>
* configure.ac: General cleanup of header and type checks, introducing
an internal define, QUAGGA_INCLUDES, to build up a list of
stuff to include so as to avoid 'present but cant be compiled'
warnings.
Misc additional checks of things missing according to autoscan.
Add LIBM, for bgpd's use of libm, so as to avoid burdening
LIBS, and all the binaries, with libm linkage.
Remove the bad practice of using m4 changequote(), just
quote the []'s in the case statements properly.
This should fix bugs 162, 303 and 178.
* */*.{c,h}: Update all HAVE_* to the standard autoconf namespaced
HAVE_* defines. I.e. HAVE_SA_LEN -> HAVE_STRUCT_SOCKADDR_SA_LEN,
* bgpd/Makefile.am: Add LIBM to bgpd's LDADD, for pow().
2007-05-10 04:38:51 +02:00
AC_PROG_LN_S
2018-11-14 12:23:49 +01:00
AC_CHECK_TOOL([AR], [ar])
2003-03-17 03:05:07 +01:00
2004-06-30 19:36:11 +02:00
dnl -------
dnl libtool
dnl -------
2018-11-14 12:23:49 +01:00
AC_ARG_ENABLE([static-bin],
2018-09-10 20:10:19 +02:00
AS_HELP_STRING([--enable-static-bin], [link binaries statically]))
2015-08-20 22:30:17 +02:00
LT_INIT
2018-09-10 20:10:19 +02:00
_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.])
2021-09-02 12:19:59 +02:00
dnl the -i option is not POSIX sed and the BSDs implement it differently
dnl cat'ing the output back instead of mv/cp keeps permissions on libtool intact
sed -e 's%func_warning "relinking%true #\0%' libtool > libtool.sed && cat libtool.sed > libtool
sed -e 's%func_warning "remember to run%true #\0%' libtool > libtool.sed && cat libtool.sed > libtool
sed -e 's%func_warning ".*has not been installed in%true #\0%' libtool > libtool.sed && cat libtool.sed > libtool
test -f libtool.sed && rm libtool.sed
2018-09-10 20:10:19 +02:00
])
if test "$enable_static_bin" = "yes"; then
2021-07-21 11:04:23 +02:00
AC_LDFLAGS_EXEC="-static"
2018-11-19 16:32:14 +01:00
if test "$enable_static" != "yes"; then
AC_MSG_ERROR([The --enable-static-bin option must be combined with --enable-static.])
fi
fi
if test "$enable_shared" != "yes"; then
AC_MSG_ERROR([FRR cannot be built with --disable-shared. If you want statically linked daemons, use --enable-shared --enable-static --enable-static-bin])
2018-09-10 20:10:19 +02:00
fi
2018-11-14 12:23:49 +01:00
AC_SUBST([AC_LDFLAGS])
2021-07-21 11:04:23 +02:00
AC_SUBST([AC_LDFLAGS_EXEC])
2020-03-11 12:09:13 +01:00
AM_CONDITIONAL([STATIC_BIN], [test "$enable_static_bin" = "yes"])
2004-06-30 19:36:11 +02:00
2020-10-22 16:24:02 +02:00
AC_ARG_ENABLE([rpath],
[AS_HELP_STRING([--enable-rpath], [set hardcoded rpaths in the executable @<:@default=yes@:>@])],
[],
[enable_rpath=yes])
2018-10-07 02:49:20 +02:00
dnl $AR and $RANLIB are set by LT_INIT above
AC_MSG_CHECKING([whether $AR supports D option])
2019-01-22 18:29:29 +01:00
if $AR crD conftest.a >/dev/null 2>/dev/null; then
2018-10-07 02:49:20 +02:00
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
2018-11-14 12:23:49 +01:00
AC_SUBST([ARFLAGS])
AC_SUBST([AR_FLAGS])
2018-10-07 02:49:20 +02:00
AC_MSG_CHECKING([whether $RANLIB supports D option])
2019-06-12 20:43:31 +02:00
if $RANLIB -D conftest.a >conftest.err 2>&1; then
if grep -q -- '-D' conftest.err; then
AC_MSG_RESULT([no])
else
AC_MSG_RESULT([yes])
RANLIB="$RANLIB -D"
fi
2018-10-07 02:49:20 +02:00
else
AC_MSG_RESULT([no])
fi
2018-11-14 12:23:49 +01:00
AC_SUBST([RANLIB])
2018-10-07 02:49:20 +02:00
2019-06-12 20:43:31 +02:00
test -f conftest.err && rm conftest.err
2018-10-07 02:49:20 +02:00
test -f conftest.a && rm conftest.a
2003-03-17 03:05:07 +01:00
dnl ----------------------
dnl Packages configuration
dnl ----------------------
2018-10-23 14:06:25 +02:00
if test -f config.version; then
. ./config.version
elif test -f "${srcdir}/config.version"; then
. "${srcdir}/config.version"
fi
2018-11-14 12:23:49 +01:00
AC_ARG_WITH([pkg-extra-version],
2018-10-23 14:06:25 +02:00
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
], [])
2018-11-14 12:23:49 +01:00
AC_ARG_WITH([pkg-git-version],
2012-11-27 02:34:56 +01:00
AS_HELP_STRING([--with-pkg-git-version], [add git information to MOTD and build version string]),
2020-03-11 12:09:13 +01:00
[ test "$withval" != "no" && with_pkg_git_version="yes" ])
2019-06-04 15:35:16 +02:00
AC_ARG_WITH([clippy],
AS_HELP_STRING([--with-clippy=PATH], [use external clippy helper program]))
2018-11-14 12:23:49 +01:00
AC_ARG_WITH([vtysh_pager],
2017-05-10 17:09:24 +02:00
AS_HELP_STRING([--with-vtysh-pager=PAGER], [control what pager is compiled in as default]),
VTYSH_PAGER=$withval, VTYSH_PAGER="more")
2018-11-14 12:23:49 +01:00
AC_ARG_ENABLE([vtysh],
2017-07-12 18:25:33 +02:00
AS_HELP_STRING([--disable-vtysh], [do not build integrated vty shell for FRR]))
2018-11-14 12:23:49 +01:00
AC_ARG_ENABLE([doc],
2014-06-28 22:15:59 +02:00
AS_HELP_STRING([--disable-doc], [do not build docs]))
2018-11-14 12:23:49 +01:00
AC_ARG_ENABLE([doc-html],
2018-08-18 17:06:22 +02:00
AS_HELP_STRING([--enable-doc-html], [build HTML docs]))
2018-11-14 12:23:49 +01:00
AC_ARG_ENABLE([zebra],
2014-06-28 22:15:59 +02:00
AS_HELP_STRING([--disable-zebra], [do not build zebra daemon]))
2018-11-14 12:23:49 +01:00
AC_ARG_ENABLE([bgpd],
2014-06-28 22:15:59 +02:00
AS_HELP_STRING([--disable-bgpd], [do not build bgpd]))
2018-11-14 12:23:49 +01:00
AC_ARG_ENABLE([ripd],
2014-06-28 22:15:59 +02:00
AS_HELP_STRING([--disable-ripd], [do not build ripd]))
2018-11-14 12:23:49 +01:00
AC_ARG_ENABLE([ripngd],
2014-06-28 22:15:59 +02:00
AS_HELP_STRING([--disable-ripngd], [do not build ripngd]))
2018-11-14 12:23:49 +01:00
AC_ARG_ENABLE([ospfd],
2014-06-28 22:15:59 +02:00
AS_HELP_STRING([--disable-ospfd], [do not build ospfd]))
2018-11-14 12:23:49 +01:00
AC_ARG_ENABLE([ospf6d],
2014-06-28 22:15:59 +02:00
AS_HELP_STRING([--disable-ospf6d], [do not build ospf6d]))
2018-11-14 12:23:49 +01:00
AC_ARG_ENABLE([ldpd],
2018-08-08 21:00:28 +02:00
AS_HELP_STRING([--disable-ldpd], [do not build ldpd]))
2018-11-14 12:23:49 +01:00
AC_ARG_ENABLE([nhrpd],
2017-01-19 16:27:01 +01:00
AS_HELP_STRING([--disable-nhrpd], [do not build nhrpd]))
2018-11-14 12:23:49 +01:00
AC_ARG_ENABLE([eigrpd],
2017-03-09 05:07:46 +01:00
AS_HELP_STRING([--disable-eigrpd], [do not build eigrpd]))
2018-11-14 12:23:49 +01:00
AC_ARG_ENABLE([babeld],
2017-05-13 20:59:41 +02:00
AS_HELP_STRING([--disable-babeld], [do not build babeld]))
2018-11-14 12:23:49 +01:00
AC_ARG_ENABLE([watchfrr],
2017-01-04 02:13:02 +01:00
AS_HELP_STRING([--disable-watchfrr], [do not build watchfrr]))
2018-11-14 12:23:49 +01:00
AC_ARG_ENABLE([isisd],
2015-02-09 11:36:10 +01:00
AS_HELP_STRING([--disable-isisd], [do not build isisd]))
2018-11-14 12:23:49 +01:00
AC_ARG_ENABLE([pimd],
2014-06-28 22:15:59 +02:00
AS_HELP_STRING([--disable-pimd], [do not build pimd]))
2018-11-14 12:23:49 +01:00
AC_ARG_ENABLE([pbrd],
2018-04-27 21:04:40 +02:00
AS_HELP_STRING([--disable-pbrd], [do not build pbrd]))
2018-11-14 12:23:49 +01:00
AC_ARG_ENABLE([sharpd],
2018-08-08 21:00:28 +02:00
AS_HELP_STRING([--enable-sharpd], [build sharpd]))
2018-11-14 12:23:49 +01:00
AC_ARG_ENABLE([staticd],
2018-08-08 21:00:28 +02:00
AS_HELP_STRING([--disable-staticd], [do not build staticd]))
2018-11-14 12:23:49 +01:00
AC_ARG_ENABLE([fabricd],
2018-03-22 15:01:08 +01:00
AS_HELP_STRING([--disable-fabricd], [do not build fabricd]))
2019-02-13 21:24:56 +01:00
AC_ARG_ENABLE([vrrpd],
AS_HELP_STRING([--disable-vrrpd], [do not build vrrpd]))
2020-07-31 18:04:20 +02:00
AC_ARG_ENABLE([pathd],
AS_HELP_STRING([--disable-pathd], [do not build pathd]))
2019-08-13 16:22:22 +02:00
AC_ARG_ENABLE([bgp-announce],
2020-09-27 18:22:02 +02:00
AS_HELP_STRING([--disable-bgp-announce], [turn off BGP route announcement]))
2018-11-14 12:23:49 +01: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]))
2019-08-13 16:22:22 +02:00
AC_ARG_ENABLE([bgp-bmp],
AS_HELP_STRING([--disable-bgp-bmp],[turn off BGP BMP support]))
2018-11-14 12:23:49 +01:00
AC_ARG_ENABLE([snmp],
2018-08-16 19:51:13 +02:00
AS_HELP_STRING([--enable-snmp], [enable SNMP support for agentx]))
2018-11-14 12:23:49 +01:00
AC_ARG_ENABLE([config_rollbacks],
2017-12-07 20:31:48 +01:00
AS_HELP_STRING([--enable-config-rollbacks], [enable configuration rollbacks (requires sqlite3)]))
2018-11-14 12:23:49 +01:00
AC_ARG_ENABLE([confd],
2018-05-24 01:11:59 +02:00
AS_HELP_STRING([--enable-confd=ARG], [enable confd integration]))
2018-11-14 12:23:49 +01:00
AC_ARG_ENABLE([sysrepo],
2018-05-24 01:12:29 +02:00
AS_HELP_STRING([--enable-sysrepo], [enable sysrepo integration]))
2019-01-25 21:54:16 +01:00
AC_ARG_ENABLE([grpc],
AS_HELP_STRING([--enable-grpc], [enable the gRPC northbound plugin]))
2018-11-14 12:23:49 +01:00
AC_ARG_ENABLE([zeromq],
2017-05-17 18:27:54 +02:00
AS_HELP_STRING([--enable-zeromq], [enable ZeroMQ handler (libfrrzmq)]))
2020-09-15 00:02:56 +02:00
AC_ARG_ENABLE([lttng],
AS_HELP_STRING([--enable-lttng], [enable LTTng tracing]))
2020-09-28 23:22:53 +02:00
AC_ARG_ENABLE([usdt],
AS_HELP_STRING([--enable-usdt], [enable USDT probes]))
2018-11-14 12:23:49 +01:00
AC_ARG_WITH([libpam],
2014-06-28 22:15:59 +02:00
AS_HELP_STRING([--with-libpam], [use libpam for PAM support in vtysh]))
2018-11-14 12:23:49 +01:00
AC_ARG_ENABLE([ospfapi],
2014-06-28 22:15:59 +02:00
AS_HELP_STRING([--disable-ospfapi], [do not build OSPFAPI to access the OSPF LSA Database]))
2018-11-14 12:23:49 +01:00
AC_ARG_ENABLE([ospfclient],
2014-06-28 22:15:59 +02:00
AS_HELP_STRING([--disable-ospfclient], [do not build OSPFAPI client for OSPFAPI,
(this is the default if --disable-ospfapi is set)]))
2018-11-14 12:23:49 +01:00
AC_ARG_ENABLE([multipath],
2014-06-28 22:15:59 +02:00
AS_HELP_STRING([--enable-multipath=ARG], [enable multipath function, ARG must be digit]))
2018-11-14 12:23:49 +01:00
AC_ARG_ENABLE([user],
2016-12-14 19:30:44 +01:00
AS_HELP_STRING([--enable-user=USER], [user to run FRR suite as (default frr)]))
2018-11-14 12:23:49 +01:00
AC_ARG_ENABLE([group],
2016-12-14 19:30:44 +01:00
AS_HELP_STRING([--enable-group=GROUP], [group to run FRR suite as (default frr)]))
2018-11-14 12:23:49 +01:00
AC_ARG_ENABLE([vty_group],
2014-06-28 22:15:59 +02:00
AS_HELP_STRING([--enable-vty-group=ARG], [set vty sockets to have specified group as owner]))
2018-11-14 12:23:49 +01:00
AC_ARG_ENABLE([configfile_mask],
2014-06-28 22:15:59 +02:00
AS_HELP_STRING([--enable-configfile-mask=ARG], [set mask for config files]))
2018-11-14 12:23:49 +01:00
AC_ARG_ENABLE([logfile_mask],
2014-06-28 22:15:59 +02:00
AS_HELP_STRING([--enable-logfile-mask=ARG], [set mask for log files]))
2018-11-14 12:23:49 +01:00
AC_ARG_ENABLE([shell_access],
2014-06-28 22:15:59 +02:00
AS_HELP_STRING([--enable-shell-access], [Allow users to access shell/telnet/ssh]))
2018-11-14 12:23:49 +01:00
AC_ARG_ENABLE([realms],
2017-12-08 20:44:15 +01:00
AS_HELP_STRING([--enable-realms], [enable REALMS support under Linux]))
2018-11-14 12:23:49 +01:00
AC_ARG_ENABLE([rtadv],
2014-06-28 22:15:59 +02:00
AS_HELP_STRING([--disable-rtadv], [disable IPV6 router advertisement feature]))
2018-11-14 12:23:49 +01:00
AC_ARG_ENABLE([irdp],
2020-02-16 20:39:49 +01:00
AS_HELP_STRING([--disable-irdp], [disable IRDP server support in zebra (enabled by default if supported)]))
2018-11-14 12:23:49 +01:00
AC_ARG_ENABLE([capabilities],
2014-06-28 22:15:59 +02:00
AS_HELP_STRING([--disable-capabilities], [disable using POSIX capabilities]))
2018-11-14 12:23:49 +01:00
AC_ARG_ENABLE([gcc_ultra_verbose],
2014-06-28 22:15:59 +02:00
AS_HELP_STRING([--enable-gcc-ultra-verbose], [enable ultra verbose GCC warnings]))
2018-11-14 12:23:49 +01:00
AC_ARG_ENABLE([backtrace],
2020-09-27 18:22:02 +02:00
AS_HELP_STRING([--disable-backtrace], [disable crash backtraces (default autodetect)]))
2018-11-14 12:23:49 +01:00
AC_ARG_ENABLE([time-check],
2014-06-28 22:15:59 +02:00
AS_HELP_STRING([--disable-time-check], [disable slow thread warning messages]))
2019-10-16 19:19:09 +02:00
AC_ARG_ENABLE([cpu-time],
AS_HELP_STRING([--disable-cpu-time], [disable cpu usage data gathering]))
2018-11-14 12:23:49 +01:00
AC_ARG_ENABLE([pcreposix],
2014-06-28 22:15:59 +02:00
AS_HELP_STRING([--enable-pcreposix], [enable using PCRE Posix libs for regex functions]))
2018-11-14 12:23:49 +01:00
AC_ARG_ENABLE([fpm],
2014-06-28 22:15:59 +02:00
AS_HELP_STRING([--enable-fpm], [enable Forwarding Plane Manager support]))
2020-10-16 16:55:51 +02:00
AC_ARG_ENABLE([pcep],
AS_HELP_STRING([--enable-pcep], [enable PCEP support for pathd]))
2018-11-14 12:23:49 +01:00
AC_ARG_ENABLE([werror],
2015-07-26 01:05:56 +02:00
AS_HELP_STRING([--enable-werror], [enable -Werror (recommended for developers only)]))
2018-11-14 12:23:49 +01:00
AC_ARG_ENABLE([cumulus],
2014-06-28 22:15:59 +02:00
AS_HELP_STRING([--enable-cumulus], [enable Cumulus Switch Special Extensions]))
2018-11-14 12:23:49 +01:00
AC_ARG_ENABLE([datacenter],
2017-05-04 17:26:22 +02:00
AS_HELP_STRING([--enable-datacenter], [enable Compilation for Data Center Extensions]))
2018-11-14 12:23:49 +01:00
AC_ARG_ENABLE([rr-semantics],
2016-06-20 14:21:00 +02:00
AS_HELP_STRING([--disable-rr-semantics], [disable the v6 Route Replace semantics]))
2016-04-04 19:54:55 +02:00
AC_ARG_ENABLE([protobuf],
AS_HELP_STRING([--enable-protobuf], [Enable experimental protobuf support]))
2017-01-18 11:15:24 +01:00
AC_ARG_ENABLE([oldvpn_commands],
2017-04-27 22:08:36 +02:00
AS_HELP_STRING([--enable-oldvpn-commands], [Keep old vpn commands]))
2018-11-14 12:23:49 +01:00
AC_ARG_ENABLE([rpki],
2017-11-10 13:56:24 +01:00
AS_HELP_STRING([--enable-rpki], [enable RPKI prefix validation support]))
2017-12-13 22:13:59 +01:00
AC_ARG_ENABLE([clippy-only],
AS_HELP_STRING([--enable-clippy-only], [Only build clippy]))
2018-03-11 18:32:24 +01:00
AC_ARG_ENABLE([numeric_version],
AS_HELP_STRING([--enable-numeric-version], [Only numeric digits allowed in version (for Alpine)]))
2018-06-14 15:44:38 +02:00
AC_ARG_ENABLE([gcov],
2020-01-16 22:25:59 +01:00
AS_HELP_STRING([--enable-gcov], [Collect coverage information with gcov]))
AC_ARG_ENABLE([clang_coverage],
AS_HELP_STRING([--enable-clang-coverage], [Collect coverage information with Clang Coverage]))
2018-11-14 12:23:49 +01:00
AC_ARG_ENABLE([bfdd],
2018-06-27 17:24:51 +02:00
AS_HELP_STRING([--disable-bfdd], [do not build bfdd]))
2018-09-02 20:36:20 +02:00
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]))
2020-01-02 03:05:02 +01:00
AC_ARG_ENABLE([undefined-sanitizer],
2021-07-15 19:10:14 +02:00
AS_HELP_STRING([--enable-undefined-sanitizer], [enable UndefinedBehaviorSanitizer support for detecting undefined behavior]))
2019-07-11 11:28:15 +02:00
AC_ARG_WITH([crypto],
AS_HELP_STRING([--with-crypto=<internal|openssl>], [choose between different implementations of cryptographic functions(default value is --with-crypto=internal)]))
2020-03-29 07:58:59 +02:00
AC_ARG_WITH([frr-format],
AS_HELP_STRING([--with-frr-format[=<.../frr-format.so>]], [use frr-format GCC plugin]))
2019-07-11 11:28:15 +02:00
2020-06-17 18:48:34 +02:00
AC_ARG_ENABLE([version-build-config],
AS_HELP_STRING([--disable-version-build-config], [do not include build configs in show version command]))
2019-07-11 11:28:15 +02:00
#if openssl, else use the internal
2020-03-11 12:30:47 +01:00
AS_IF([test "$with_crypto" = "openssl"], [
2019-07-11 11:28:15 +02:00
AC_CHECK_LIB([crypto], [EVP_DigestInit], [LIBS="$LIBS -lcrypto"], [], [])
2020-03-11 11:27:04 +01:00
if test "$ac_cv_lib_crypto_EVP_DigestInit" = "no"; then
2019-07-11 11:28:15 +02:00
AC_MSG_ERROR([build with openssl has been specified but openssl library was not found on your system])
else
AC_DEFINE([CRYPTO_OPENSSL], [1], [Compile with openssl support])
fi
2020-03-11 12:30:47 +01:00
], [test "$with_crypto" = "internal" || test "$with_crypto" = "" ], [AC_DEFINE([CRYPTO_INTERNAL], [1], [Compile with internal cryptographic implementation])
2019-07-11 11:28:15 +02:00
], [AC_MSG_ERROR([Unknown value for --with-crypto])]
)
2004-10-22 06:55:05 +02:00
2020-03-11 12:30:47 +01:00
AS_IF([test "$enable_clippy_only" != "yes"], [
2018-11-14 12:23:49 +01:00
AC_CHECK_HEADERS([json-c/json.h])
AC_CHECK_LIB([json-c], [json_object_get], [LIBS="$LIBS -ljson-c"], [], [-lm])
2020-03-11 12:09:13 +01:00
if test "$ac_cv_lib_json_c_json_object_get" = "no"; then
2018-11-14 12:23:49 +01:00
AC_CHECK_LIB([json], [json_object_get], [LIBS="$LIBS -ljson"])
2020-03-11 12:09:13 +01:00
if test "$ac_cv_lib_json_json_object_get" = "no"; then
2018-11-08 12:29:57 +01:00
AC_MSG_ERROR([libjson is needed to compile])
2016-06-05 01:55:22 +02:00
fi
2016-06-05 01:55:22 +02:00
fi
2017-12-13 22:13:59 +01:00
])
2016-06-05 01:55:22 +02:00
2016-03-11 21:21:24 +01:00
AC_ARG_ENABLE([dev_build],
AS_HELP_STRING([--enable-dev-build], [build for development]))
2020-11-30 23:01:03 +01:00
AC_ARG_ENABLE([scripting],
AS_HELP_STRING([--enable-scripting], [Build with scripting support]))
2017-10-25 21:06:30 +02:00
2020-09-23 16:11:08 +02:00
AC_ARG_ENABLE([netlink-debug],
AS_HELP_STRING([--disable-netlink-debug], [pretty print netlink debug messages]))
if test "$enable_netlink_debug" != "no" ; then
AC_DEFINE([NETLINK_DEBUG], [1], [Netlink extra debugging code])
fi
AM_CONDITIONAL([NETLINK_DEBUG], [test "$enable_netlink_debug" != "no"])
2020-03-11 12:30:47 +01:00
if test "$enable_time_check" != "no" ; then
if test "$enable_time_check" = "yes" -o "$enable_time_check" = "" ; then
2018-11-14 12:23:49 +01:00
AC_DEFINE([CONSUMED_TIME_CHECK], [5000000], [Consumed Time Check])
2005-04-16 19:11:24 +02:00
else
2018-11-14 12:23:49 +01:00
AC_DEFINE_UNQUOTED([CONSUMED_TIME_CHECK], [$enable_time_check], [Consumed Time Check])
2005-04-16 19:11:24 +02:00
fi
fi
2019-10-16 19:19:09 +02:00
case "${enable_cpu_time}" in
"no")
AC_DEFINE([EXCLUDE_CPU_TIME], [1], [Exclude getrusage data gathering])
;;
"*")
;;
esac
2020-03-11 12:30:47 +01:00
if test "$enable_rr_semantics" != "no" ; then
2018-11-14 12:23:49 +01:00
AC_DEFINE([HAVE_V6_RR_SEMANTICS], [1], [Compile in v6 Route Replacement Semantics])
2016-06-20 14:21:00 +02:00
fi
2020-03-11 12:30:47 +01:00
if test "$enable_datacenter" = "yes" ; then
2018-11-14 12:23:49 +01:00
AC_DEFINE([HAVE_DATACENTER], [1], [Compile extensions for a DataCenter])
2017-03-09 19:00:19 +01:00
DFLT_NAME="datacenter"
else
DFLT_NAME="traditional"
2016-02-21 18:43:50 +01:00
fi
2017-05-04 17:26:22 +02:00
2020-03-11 12:30:47 +01:00
if test "$enable_cumulus" = "yes" ; then
2018-11-14 12:23:49 +01:00
AC_DEFINE([HAVE_CUMULUS], [1], [Compile Special Cumulus Code in])
2017-05-04 17:26:22 +02:00
fi
2018-11-14 12:23:49 +01:00
AC_SUBST([DFLT_NAME])
AC_DEFINE_UNQUOTED([DFLT_NAME], ["$DFLT_NAME"], [Name of the configuration default set])
2016-02-21 18:43:50 +01:00
2020-03-11 12:30:47 +01:00
if test "$enable_shell_access" = "yes"; then
2019-01-05 01:43:40 +01:00
AC_DEFINE([HAVE_SHELL_ACCESS], [1], [Allow user to use ssh/telnet/bash, be aware this is considered insecure])
2015-08-13 01:11:07 +02:00
fi
2016-11-11 17:10:02 +01:00
#
# Python for clippy
#
2018-08-22 06:04:32 +02:00
AS_IF([test "$host" = "$build"], [
2018-08-09 19:11:53 +02:00
AC_CHECK_HEADER([gelf.h], [], [
AC_MSG_ERROR([libelf headers are required for building clippy. (Host only when cross-compiling.)])
])
AC_CHECK_LIB([elf], [elf_memory], [], [
AC_MSG_ERROR([libelf is required for building clippy. (Host only when cross-compiling.)])
])
AC_CHECK_LIB([elf], [elf_getdata_rawchunk], [
AC_DEFINE([HAVE_ELF_GETDATA_RAWCHUNK], [1], [Have elf_getdata_rawchunk()])
])
AC_CHECK_LIB([elf], [gelf_getnote], [
AC_DEFINE([HAVE_GELF_GETNOTE], [1], [Have gelf_getnote()])
])
2019-05-28 00:35:24 +02:00
FRR_PYTHON_DEV
], [
FRR_PYTHON
])
2018-08-22 06:04:32 +02:00
2019-05-28 00:35:24 +02:00
FRR_PYTHON_MODULES([pytest])
2018-08-22 06:04:32 +02:00
2020-03-11 12:30:47 +01:00
if test "$enable_doc" != "no"; then
2019-05-28 00:35:24 +02:00
FRR_PYTHON_MODULES([sphinx], , [
2020-03-11 12:30:47 +01:00
if test "$enable_doc" = "yes"; then
2019-05-28 00:35:24 +02:00
AC_MSG_ERROR([Documentation was explicitly requested with --enable-doc but sphinx is not available for $PYTHON. Please disable docs or install sphinx.])
fi
])
fi
2020-03-11 12:30:47 +01:00
AM_CONDITIONAL([DOC], [test "$enable_doc" != "no" -a "$frr_py_mod_sphinx" != "false"])
AM_CONDITIONAL([DOC_HTML], [test "$enable_doc_html" = "yes"])
2018-08-22 06:04:32 +02:00
2019-05-28 00:35:24 +02:00
FRR_PYTHON_MOD_EXEC([sphinx], [--version], [
PYSPHINX="-m sphinx"
], [
PYSPHINX="-c 'import sys; from sphinx import main; sys.exit(main(sys.argv))'"
2016-11-11 17:10:02 +01:00
])
2019-05-28 00:35:24 +02:00
AC_SUBST([PYSPHINX])
2016-11-11 17:10:02 +01:00
2017-01-18 11:15:24 +01:00
#
2018-11-14 12:23:49 +01:00
# Logic for old vpn commands support.
2017-01-18 11:15:24 +01:00
#
2017-04-27 22:08:36 +02:00
if test "$enable_oldvpn_commands" = "yes"; then
2018-11-14 12:23:49 +01:00
AC_DEFINE([KEEP_OLD_VPN_COMMANDS], [1], [Define for compiling with old vpn commands])
2017-01-18 11:15:24 +01:00
fi
2016-04-04 19:54:55 +02:00
#
# End of logic for protobuf support.
#
2018-11-14 12:23:49 +01:00
AC_MSG_CHECKING([if zebra should be configurable to send Route Advertisements])
2020-03-11 12:30:47 +01:00
if test "$enable_rtadv" != "no"; then
2018-11-14 12:23:49 +01:00
AC_MSG_RESULT([yes])
AC_DEFINE([HAVE_RTADV], [1], [Enable IPv6 Routing Advertisement support])
2003-05-26 01:51:31 +02:00
else
2018-11-14 12:23:49 +01:00
AC_MSG_RESULT([no])
2003-05-25 22:18:13 +02:00
fi
2003-03-17 03:05:07 +01:00
2020-03-11 12:30:47 +01:00
if test "$enable_user" = "no"; then
2016-07-28 21:41:20 +02:00
enable_user=""
else
2020-03-11 12:30:47 +01:00
if test "$enable_user" = "yes" || test "$enable_user" = ""; then
2016-12-14 19:30:44 +01:00
enable_user="frr"
2016-07-28 21:41:20 +02:00
fi
2018-11-14 12:23:49 +01:00
AC_DEFINE_UNQUOTED([FRR_USER], ["${enable_user}"], [frr User])
2003-06-04 15:59:38 +02:00
fi
2020-03-11 12:30:47 +01:00
if test "$enable_group" = "no"; then
2016-07-28 21:41:20 +02:00
enable_group=""
else
2020-03-11 12:30:47 +01:00
if test "$enable_group" = "yes" || test "$enable_group" = ""; then
2016-12-14 19:30:44 +01:00
enable_group="frr"
2016-07-28 21:41:20 +02:00
fi
2018-11-14 12:23:49 +01:00
AC_DEFINE_UNQUOTED([FRR_GROUP], ["${enable_group}"], [frr Group])
2003-06-04 15:59:38 +02:00
fi
2020-03-11 12:30:47 +01:00
if test "$enable_vty_group" = "yes" ; then
2003-06-06 02:30:35 +02:00
AC_MSG_ERROR([--enable-vty-group requires a group as argument, not yes])
2020-03-11 12:30:47 +01:00
elif test "$enable_vty_group" != ""; then
if test "$enable_vty_group" != "no"; then
2018-11-14 12:23:49 +01:00
AC_DEFINE_UNQUOTED([VTY_GROUP], ["${enable_vty_group}"], [VTY Sockets Group])
2003-06-04 15:59:38 +02:00
fi
fi
2005-04-11 09:10:47 +02:00
AC_SUBST([enable_user])
AC_SUBST([enable_group])
AC_SUBST([enable_vty_group])
2003-06-04 15:59:38 +02:00
2003-12-22 21:15:53 +01:00
enable_configfile_mask=${enable_configfile_mask:-0600}
2018-11-14 12:23:49 +01:00
AC_DEFINE_UNQUOTED([CONFIGFILE_MASK], [${enable_configfile_mask}], [Mask for config files])
2020-05-11 21:37:08 +02:00
AC_SUBST([enable_configfile_mask])
2003-12-22 21:15:53 +01:00
enable_logfile_mask=${enable_logfile_mask:-0600}
2018-11-14 12:23:49 +01:00
AC_DEFINE_UNQUOTED([LOGFILE_MASK], [${enable_logfile_mask}], [Mask for log files])
2003-12-22 21:15:53 +01:00
2019-03-06 16:44:34 +01:00
MPATH_NUM=16
2003-03-17 03:05:07 +01:00
case "${enable_multipath}" in
2015-11-17 17:13:23 +01:00
0)
2015-12-08 16:34:04 +01:00
MPATH_NUM=64
2015-11-17 17:13:23 +01:00
;;
2016-01-27 17:28:14 +01:00
[[1-9]|[1-9][0-9]|[1-9][0-9][0-9]])
2015-12-08 16:34:04 +01:00
MPATH_NUM="${enable_multipath}"
2003-03-17 03:05:07 +01:00
;;
"")
;;
2020-03-11 12:09:13 +01:00
*)
[autoconf] bugs 162,303,178: Fix 'present but can not be compiled' warnings
2007-05-09 Paul Jakma <paul.jakma@sun.com>
* configure.ac: sys/conf.h depends on sys/param.h, at least on
FBSD 6.2.
(bug #363) Should check for in_pktinfo for IRDP
2006-05-27 Paul Jakma <paul.jakma@sun.com>
* configure.ac: General cleanup of header and type checks, introducing
an internal define, QUAGGA_INCLUDES, to build up a list of
stuff to include so as to avoid 'present but cant be compiled'
warnings.
Misc additional checks of things missing according to autoscan.
Add LIBM, for bgpd's use of libm, so as to avoid burdening
LIBS, and all the binaries, with libm linkage.
Remove the bad practice of using m4 changequote(), just
quote the []'s in the case statements properly.
This should fix bugs 162, 303 and 178.
* */*.{c,h}: Update all HAVE_* to the standard autoconf namespaced
HAVE_* defines. I.e. HAVE_SA_LEN -> HAVE_STRUCT_SOCKADDR_SA_LEN,
* bgpd/Makefile.am: Add LIBM to bgpd's LDADD, for pow().
2007-05-10 04:38:51 +02:00
AC_MSG_FAILURE([Please specify digit to enable multipath ARG])
2003-03-17 03:05:07 +01:00
;;
esac
2018-11-14 12:23:49 +01:00
AC_DEFINE_UNQUOTED([MULTIPATH_NUM], [$MPATH_NUM], [Maximum number of paths for a route])
2003-03-17 03:05:07 +01:00
2018-11-14 12:23:49 +01:00
AC_DEFINE_UNQUOTED([VTYSH_PAGER], ["$VTYSH_PAGER"], [What pager to use])
2017-05-10 17:09:24 +02:00
2018-06-14 15:44:38 +02:00
dnl --------------------
dnl Enable code coverage
dnl --------------------
2020-03-11 12:09:13 +01:00
AM_CONDITIONAL([HAVE_GCOV], [test "$enable_gcov" != "no"])
2018-06-14 15:44:38 +02:00
2018-03-11 18:32:24 +01:00
dnl ------------------------------------
dnl Alpine only accepts numeric versions
dnl ------------------------------------
2020-03-11 12:30:47 +01:00
if test "$enable_numeric_version" != "" ; then
2018-03-11 18:32:24 +01:00
VERSION="`echo ${VERSION} | tr -c -d '[[.0-9]]'`"
PACKAGE_VERSION="`echo ${PACKAGE_VERSION} | tr -c -d '[[.0-9]]'`"
fi
2012-05-30 08:15:48 +02:00
dnl -----------------------------------
dnl Add extra version string to package
dnl name, string and version fields.
dnl -----------------------------------
2020-03-11 12:30:47 +01:00
if test "$EXTRAVERSION" != "" ; then
2012-11-27 02:34:56 +01:00
VERSION="${VERSION}${EXTRAVERSION}"
PACKAGE_VERSION="${PACKAGE_VERSION}${EXTRAVERSION}"
2017-01-25 22:23:43 +01:00
AC_SUBST(PACKAGE_EXTRAVERSION, ["${EXTRAVERSION}"])
2012-11-27 02:34:56 +01:00
PACKAGE_STRING="${PACKAGE_STRING}${EXTRAVERSION}"
2012-05-30 08:15:48 +02:00
fi
2018-11-14 12:23:49 +01:00
AC_SUBST([EXTRAVERSION])
2012-05-30 08:15:48 +02:00
2020-03-11 12:09:13 +01:00
if test "$with_pkg_git_version" = "yes"; then
2020-04-08 15:18:34 +02:00
if test -e "${srcdir}/.git"; then
2018-11-14 12:23:49 +01:00
AC_DEFINE([GIT_VERSION], [1], [include git version info])
2012-12-13 11:20:50 +01:00
else with_pkg_git_version="no"
AC_MSG_WARN([--with-pkg-git-version given, but this is not a git checkout])
fi
fi
2020-03-11 12:09:13 +01:00
AM_CONDITIONAL([GIT_VERSION], [test "$with_pkg_git_version" = "yes"])
2012-11-27 02:34:56 +01:00
2018-10-01 19:02:39 +02:00
AC_CHECK_TOOL([OBJCOPY], [objcopy], [:])
2020-03-11 12:30:47 +01:00
if test "$OBJCOPY" != ":"; then
2019-01-22 18:39:47 +01:00
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
])
2018-10-01 19:02:39 +02:00
])
2019-01-22 18:39:47 +01:00
fi
2018-10-01 19:02:39 +02:00
if test -n "$frr_cv_interp"; then
2018-11-14 12:23:49 +01:00
AC_DEFINE_UNQUOTED([INTERP], ["$frr_cv_interp"], [.interp value])
2018-10-01 19:02:39 +02:00
fi
[autoconf] bugs 162,303,178: Fix 'present but can not be compiled' warnings
2007-05-09 Paul Jakma <paul.jakma@sun.com>
* configure.ac: sys/conf.h depends on sys/param.h, at least on
FBSD 6.2.
(bug #363) Should check for in_pktinfo for IRDP
2006-05-27 Paul Jakma <paul.jakma@sun.com>
* configure.ac: General cleanup of header and type checks, introducing
an internal define, QUAGGA_INCLUDES, to build up a list of
stuff to include so as to avoid 'present but cant be compiled'
warnings.
Misc additional checks of things missing according to autoscan.
Add LIBM, for bgpd's use of libm, so as to avoid burdening
LIBS, and all the binaries, with libm linkage.
Remove the bad practice of using m4 changequote(), just
quote the []'s in the case statements properly.
This should fix bugs 162, 303 and 178.
* */*.{c,h}: Update all HAVE_* to the standard autoconf namespaced
HAVE_* defines. I.e. HAVE_SA_LEN -> HAVE_STRUCT_SOCKADDR_SA_LEN,
* bgpd/Makefile.am: Add LIBM to bgpd's LDADD, for pow().
2007-05-10 04:38:51 +02:00
dnl -------------------------
dnl Check other header files.
dnl -------------------------
2016-11-15 05:37:14 +01:00
AC_CHECK_HEADERS([stropts.h sys/ksym.h \
2021-04-21 12:23:14 +02:00
linux/version.h asm/types.h endian.h sys/endian.h])
[autoconf] bugs 162,303,178: Fix 'present but can not be compiled' warnings
2007-05-09 Paul Jakma <paul.jakma@sun.com>
* configure.ac: sys/conf.h depends on sys/param.h, at least on
FBSD 6.2.
(bug #363) Should check for in_pktinfo for IRDP
2006-05-27 Paul Jakma <paul.jakma@sun.com>
* configure.ac: General cleanup of header and type checks, introducing
an internal define, QUAGGA_INCLUDES, to build up a list of
stuff to include so as to avoid 'present but cant be compiled'
warnings.
Misc additional checks of things missing according to autoscan.
Add LIBM, for bgpd's use of libm, so as to avoid burdening
LIBS, and all the binaries, with libm linkage.
Remove the bad practice of using m4 changequote(), just
quote the []'s in the case statements properly.
This should fix bugs 162, 303 and 178.
* */*.{c,h}: Update all HAVE_* to the standard autoconf namespaced
HAVE_* defines. I.e. HAVE_SA_LEN -> HAVE_STRUCT_SOCKADDR_SA_LEN,
* bgpd/Makefile.am: Add LIBM to bgpd's LDADD, for pow().
2007-05-10 04:38:51 +02:00
2015-05-29 09:56:51 +02:00
ac_stdatomic_ok=false
2018-11-14 12:23:49 +01:00
AC_DEFINE([FRR_AUTOCONF_ATOMIC], [1], [did autoconf checks for atomic funcs])
2015-05-29 09:56:51 +02:00
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;
}
]])], [
2018-11-14 12:23:49 +01:00
AC_DEFINE([HAVE_STDATOMIC_H], [1], [found stdatomic.h])
2015-05-29 09:56:51 +02:00
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);
}
]])], [
2018-11-14 12:23:49 +01:00
AC_DEFINE([HAVE___ATOMIC], [1], [found __atomic builtins])
2015-05-29 09:56:51 +02:00
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);
}
]])], [
2018-11-14 12:23:49 +01:00
AC_DEFINE([HAVE___SYNC], [1], [found __sync builtins])
2015-05-29 09:56:51 +02:00
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);
}
]])], [
2018-11-14 12:23:49 +01:00
AC_DEFINE([HAVE___SYNC_SWAP], 1, [found __sync_swap builtin])
2015-05-29 09:56:51 +02:00
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])
])
])
])
2015-05-25 06:36:10 +02:00
needsync=true
AS_IF([$needsync], [
dnl Linux
AC_MSG_CHECKING([for Linux futex() support])
AC_LINK_IFELSE([AC_LANG_PROGRAM([
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include <unistd.h>
#include <limits.h>
#include <sys/time.h>
#include <sys/syscall.h>
#include <linux/futex.h>
int main(void);
],
[
{
return syscall(SYS_futex, NULL, FUTEX_WAIT, 0, NULL, NULL, 0);
}
])], [
AC_MSG_RESULT([yes])
AC_DEFINE(HAVE_SYNC_LINUX_FUTEX,,Have Linux futex support)
needsync=false
], [
AC_MSG_RESULT([no])
])
])
AS_IF([$needsync], [
dnl FreeBSD
AC_MSG_CHECKING([for FreeBSD _umtx_op() support])
AC_LINK_IFELSE([AC_LANG_PROGRAM([
#include <errno.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/umtx.h>
int main(void);
],
[
{
return _umtx_op(NULL, UMTX_OP_WAIT_UINT, 0, NULL, NULL);
}
])], [
AC_MSG_RESULT([yes])
AC_DEFINE(HAVE_SYNC_UMTX_OP,,Have FreeBSD _umtx_op() support)
needsync=false
], [
AC_MSG_RESULT([no])
])
])
AS_IF([$needsync], [
dnl OpenBSD patch (not upstream at the time of writing this)
dnl https://marc.info/?l=openbsd-tech&m=147299508409549&w=2
AC_MSG_CHECKING([for OpenBSD futex() support])
AC_LINK_IFELSE([AC_LANG_PROGRAM([
#include <sys/futex.h>
int main(void);
],
[
{
return futex(NULL, FUTEX_WAIT, 0, NULL, NULL, 0);
}
])], [
AC_MSG_RESULT([yes])
AC_DEFINE(HAVE_SYNC_OPENBSD_FUTEX,,Have OpenBSD futex support)
needsync=false
], [
AC_MSG_RESULT([no])
])
])
[autoconf] bugs 162,303,178: Fix 'present but can not be compiled' warnings
2007-05-09 Paul Jakma <paul.jakma@sun.com>
* configure.ac: sys/conf.h depends on sys/param.h, at least on
FBSD 6.2.
(bug #363) Should check for in_pktinfo for IRDP
2006-05-27 Paul Jakma <paul.jakma@sun.com>
* configure.ac: General cleanup of header and type checks, introducing
an internal define, QUAGGA_INCLUDES, to build up a list of
stuff to include so as to avoid 'present but cant be compiled'
warnings.
Misc additional checks of things missing according to autoscan.
Add LIBM, for bgpd's use of libm, so as to avoid burdening
LIBS, and all the binaries, with libm linkage.
Remove the bad practice of using m4 changequote(), just
quote the []'s in the case statements properly.
This should fix bugs 162, 303 and 178.
* */*.{c,h}: Update all HAVE_* to the standard autoconf namespaced
HAVE_* defines. I.e. HAVE_SA_LEN -> HAVE_STRUCT_SOCKADDR_SA_LEN,
* bgpd/Makefile.am: Add LIBM to bgpd's LDADD, for pow().
2007-05-10 04:38:51 +02:00
dnl Utility macro to avoid retyping includes all the time
2016-12-14 20:22:59 +01:00
m4_define([FRR_INCLUDES],
[autoconf] bugs 162,303,178: Fix 'present but can not be compiled' warnings
2007-05-09 Paul Jakma <paul.jakma@sun.com>
* configure.ac: sys/conf.h depends on sys/param.h, at least on
FBSD 6.2.
(bug #363) Should check for in_pktinfo for IRDP
2006-05-27 Paul Jakma <paul.jakma@sun.com>
* configure.ac: General cleanup of header and type checks, introducing
an internal define, QUAGGA_INCLUDES, to build up a list of
stuff to include so as to avoid 'present but cant be compiled'
warnings.
Misc additional checks of things missing according to autoscan.
Add LIBM, for bgpd's use of libm, so as to avoid burdening
LIBS, and all the binaries, with libm linkage.
Remove the bad practice of using m4 changequote(), just
quote the []'s in the case statements properly.
This should fix bugs 162, 303 and 178.
* */*.{c,h}: Update all HAVE_* to the standard autoconf namespaced
HAVE_* defines. I.e. HAVE_SA_LEN -> HAVE_STRUCT_SOCKADDR_SA_LEN,
* bgpd/Makefile.am: Add LIBM to bgpd's LDADD, for pow().
2007-05-10 04:38:51 +02:00
[#ifdef SUNOS_5
2018-08-28 11:40:57 +02:00
#define _POSIX_C_SOURCE 200809L
[autoconf] bugs 162,303,178: Fix 'present but can not be compiled' warnings
2007-05-09 Paul Jakma <paul.jakma@sun.com>
* configure.ac: sys/conf.h depends on sys/param.h, at least on
FBSD 6.2.
(bug #363) Should check for in_pktinfo for IRDP
2006-05-27 Paul Jakma <paul.jakma@sun.com>
* configure.ac: General cleanup of header and type checks, introducing
an internal define, QUAGGA_INCLUDES, to build up a list of
stuff to include so as to avoid 'present but cant be compiled'
warnings.
Misc additional checks of things missing according to autoscan.
Add LIBM, for bgpd's use of libm, so as to avoid burdening
LIBS, and all the binaries, with libm linkage.
Remove the bad practice of using m4 changequote(), just
quote the []'s in the case statements properly.
This should fix bugs 162, 303 and 178.
* */*.{c,h}: Update all HAVE_* to the standard autoconf namespaced
HAVE_* defines. I.e. HAVE_SA_LEN -> HAVE_STRUCT_SOCKADDR_SA_LEN,
* bgpd/Makefile.am: Add LIBM to bgpd's LDADD, for pow().
2007-05-10 04:38:51 +02:00
#define __EXTENSIONS__
#endif
#include <stdio.h>
2016-11-15 05:37:14 +01:00
#include <stdlib.h>
#include <stddef.h>
#include <sys/types.h>
[autoconf] bugs 162,303,178: Fix 'present but can not be compiled' warnings
2007-05-09 Paul Jakma <paul.jakma@sun.com>
* configure.ac: sys/conf.h depends on sys/param.h, at least on
FBSD 6.2.
(bug #363) Should check for in_pktinfo for IRDP
2006-05-27 Paul Jakma <paul.jakma@sun.com>
* configure.ac: General cleanup of header and type checks, introducing
an internal define, QUAGGA_INCLUDES, to build up a list of
stuff to include so as to avoid 'present but cant be compiled'
warnings.
Misc additional checks of things missing according to autoscan.
Add LIBM, for bgpd's use of libm, so as to avoid burdening
LIBS, and all the binaries, with libm linkage.
Remove the bad practice of using m4 changequote(), just
quote the []'s in the case statements properly.
This should fix bugs 162, 303 and 178.
* */*.{c,h}: Update all HAVE_* to the standard autoconf namespaced
HAVE_* defines. I.e. HAVE_SA_LEN -> HAVE_STRUCT_SOCKADDR_SA_LEN,
* bgpd/Makefile.am: Add LIBM to bgpd's LDADD, for pow().
2007-05-10 04:38:51 +02:00
/* sys/conf.h depends on param.h on FBSD at least */
2016-11-15 05:37:14 +01:00
#include <sys/param.h>
[autoconf] bugs 162,303,178: Fix 'present but can not be compiled' warnings
2007-05-09 Paul Jakma <paul.jakma@sun.com>
* configure.ac: sys/conf.h depends on sys/param.h, at least on
FBSD 6.2.
(bug #363) Should check for in_pktinfo for IRDP
2006-05-27 Paul Jakma <paul.jakma@sun.com>
* configure.ac: General cleanup of header and type checks, introducing
an internal define, QUAGGA_INCLUDES, to build up a list of
stuff to include so as to avoid 'present but cant be compiled'
warnings.
Misc additional checks of things missing according to autoscan.
Add LIBM, for bgpd's use of libm, so as to avoid burdening
LIBS, and all the binaries, with libm linkage.
Remove the bad practice of using m4 changequote(), just
quote the []'s in the case statements properly.
This should fix bugs 162, 303 and 178.
* */*.{c,h}: Update all HAVE_* to the standard autoconf namespaced
HAVE_* defines. I.e. HAVE_SA_LEN -> HAVE_STRUCT_SOCKADDR_SA_LEN,
* bgpd/Makefile.am: Add LIBM to bgpd's LDADD, for pow().
2007-05-10 04:38:51 +02:00
/* Required for MAXSIG */
2016-11-15 05:37:14 +01:00
#include <signal.h>
#include <sys/socket.h>
2013-01-13 18:45:29 +01:00
#ifdef __APPLE__
# define __APPLE_USE_RFC_3542
#endif
2016-11-15 05:37:14 +01:00
#include <netinet/in.h>
#include <sys/time.h>
#include <time.h>
#include <net/if.h>
2011-07-14 14:30:08 +02:00
])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.
2018-11-14 12:23:49 +01:00
AC_CHECK_HEADERS([net/if_var.h], [], [], [FRR_INCLUDES])
2011-07-14 14:30:08 +02:00
2016-12-14 20:22:59 +01:00
m4_define([FRR_INCLUDES],
FRR_INCLUDES
2020-03-10 16:27:50 +01:00
[#ifdef HAVE_NET_IF_VAR_H
2011-07-14 14:30:08 +02:00
# include <net/if_var.h>
#endif
])dnl
2016-11-15 05:37:14 +01:00
AC_CHECK_HEADERS([netinet/in_var.h \
net/if_dl.h net/netopt.h \
inet/nd.h netinet/ip_icmp.h \
2019-06-04 14:12:30 +02:00
sys/sysctl.h sys/sockio.h sys/conf.h],
2018-11-14 12:23:49 +01:00
[], [], [FRR_INCLUDES])
[autoconf] bugs 162,303,178: Fix 'present but can not be compiled' warnings
2007-05-09 Paul Jakma <paul.jakma@sun.com>
* configure.ac: sys/conf.h depends on sys/param.h, at least on
FBSD 6.2.
(bug #363) Should check for in_pktinfo for IRDP
2006-05-27 Paul Jakma <paul.jakma@sun.com>
* configure.ac: General cleanup of header and type checks, introducing
an internal define, QUAGGA_INCLUDES, to build up a list of
stuff to include so as to avoid 'present but cant be compiled'
warnings.
Misc additional checks of things missing according to autoscan.
Add LIBM, for bgpd's use of libm, so as to avoid burdening
LIBS, and all the binaries, with libm linkage.
Remove the bad practice of using m4 changequote(), just
quote the []'s in the case statements properly.
This should fix bugs 162, 303 and 178.
* */*.{c,h}: Update all HAVE_* to the standard autoconf namespaced
HAVE_* defines. I.e. HAVE_SA_LEN -> HAVE_STRUCT_SOCKADDR_SA_LEN,
* bgpd/Makefile.am: Add LIBM to bgpd's LDADD, for pow().
2007-05-10 04:38:51 +02:00
AC_CHECK_HEADERS([ucontext.h], [], [],
[#ifndef __USE_GNU
#define __USE_GNU
#endif /* __USE_GNU */
2016-12-14 20:22:59 +01:00
FRR_INCLUDES
[autoconf] bugs 162,303,178: Fix 'present but can not be compiled' warnings
2007-05-09 Paul Jakma <paul.jakma@sun.com>
* configure.ac: sys/conf.h depends on sys/param.h, at least on
FBSD 6.2.
(bug #363) Should check for in_pktinfo for IRDP
2006-05-27 Paul Jakma <paul.jakma@sun.com>
* configure.ac: General cleanup of header and type checks, introducing
an internal define, QUAGGA_INCLUDES, to build up a list of
stuff to include so as to avoid 'present but cant be compiled'
warnings.
Misc additional checks of things missing according to autoscan.
Add LIBM, for bgpd's use of libm, so as to avoid burdening
LIBS, and all the binaries, with libm linkage.
Remove the bad practice of using m4 changequote(), just
quote the []'s in the case statements properly.
This should fix bugs 162, 303 and 178.
* */*.{c,h}: Update all HAVE_* to the standard autoconf namespaced
HAVE_* defines. I.e. HAVE_SA_LEN -> HAVE_STRUCT_SOCKADDR_SA_LEN,
* bgpd/Makefile.am: Add LIBM to bgpd's LDADD, for pow().
2007-05-10 04:38:51 +02:00
])
2009-06-25 17:40:06 +02:00
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
2016-11-15 05:37:14 +01:00
[
#include <sys/un.h>
#include <netinet/in_systm.h>
2020-03-10 16:27:50 +01:00
#ifdef HAVE_NETINET_IN_VAR_H
[autoconf] bugs 162,303,178: Fix 'present but can not be compiled' warnings
2007-05-09 Paul Jakma <paul.jakma@sun.com>
* configure.ac: sys/conf.h depends on sys/param.h, at least on
FBSD 6.2.
(bug #363) Should check for in_pktinfo for IRDP
2006-05-27 Paul Jakma <paul.jakma@sun.com>
* configure.ac: General cleanup of header and type checks, introducing
an internal define, QUAGGA_INCLUDES, to build up a list of
stuff to include so as to avoid 'present but cant be compiled'
warnings.
Misc additional checks of things missing according to autoscan.
Add LIBM, for bgpd's use of libm, so as to avoid burdening
LIBS, and all the binaries, with libm linkage.
Remove the bad practice of using m4 changequote(), just
quote the []'s in the case statements properly.
This should fix bugs 162, 303 and 178.
* */*.{c,h}: Update all HAVE_* to the standard autoconf namespaced
HAVE_* defines. I.e. HAVE_SA_LEN -> HAVE_STRUCT_SOCKADDR_SA_LEN,
* bgpd/Makefile.am: Add LIBM to bgpd's LDADD, for pow().
2007-05-10 04:38:51 +02:00
# include <netinet/in_var.h>
#endif
2020-03-10 16:27:50 +01:00
#ifdef HAVE_NET_IF_DL_H
[autoconf] bugs 162,303,178: Fix 'present but can not be compiled' warnings
2007-05-09 Paul Jakma <paul.jakma@sun.com>
* configure.ac: sys/conf.h depends on sys/param.h, at least on
FBSD 6.2.
(bug #363) Should check for in_pktinfo for IRDP
2006-05-27 Paul Jakma <paul.jakma@sun.com>
* configure.ac: General cleanup of header and type checks, introducing
an internal define, QUAGGA_INCLUDES, to build up a list of
stuff to include so as to avoid 'present but cant be compiled'
warnings.
Misc additional checks of things missing according to autoscan.
Add LIBM, for bgpd's use of libm, so as to avoid burdening
LIBS, and all the binaries, with libm linkage.
Remove the bad practice of using m4 changequote(), just
quote the []'s in the case statements properly.
This should fix bugs 162, 303 and 178.
* */*.{c,h}: Update all HAVE_* to the standard autoconf namespaced
HAVE_* defines. I.e. HAVE_SA_LEN -> HAVE_STRUCT_SOCKADDR_SA_LEN,
* bgpd/Makefile.am: Add LIBM to bgpd's LDADD, for pow().
2007-05-10 04:38:51 +02:00
# include <net/if_dl.h>
#endif
2020-03-10 16:27:50 +01:00
#ifdef HAVE_NET_NETOPT_H
[autoconf] bugs 162,303,178: Fix 'present but can not be compiled' warnings
2007-05-09 Paul Jakma <paul.jakma@sun.com>
* configure.ac: sys/conf.h depends on sys/param.h, at least on
FBSD 6.2.
(bug #363) Should check for in_pktinfo for IRDP
2006-05-27 Paul Jakma <paul.jakma@sun.com>
* configure.ac: General cleanup of header and type checks, introducing
an internal define, QUAGGA_INCLUDES, to build up a list of
stuff to include so as to avoid 'present but cant be compiled'
warnings.
Misc additional checks of things missing according to autoscan.
Add LIBM, for bgpd's use of libm, so as to avoid burdening
LIBS, and all the binaries, with libm linkage.
Remove the bad practice of using m4 changequote(), just
quote the []'s in the case statements properly.
This should fix bugs 162, 303 and 178.
* */*.{c,h}: Update all HAVE_* to the standard autoconf namespaced
HAVE_* defines. I.e. HAVE_SA_LEN -> HAVE_STRUCT_SOCKADDR_SA_LEN,
* bgpd/Makefile.am: Add LIBM to bgpd's LDADD, for pow().
2007-05-10 04:38:51 +02:00
# include <net/netopt.h>
#endif
2016-11-15 05:37:14 +01:00
#include <net/route.h>
2020-03-10 16:27:50 +01:00
#ifdef HAVE_INET_ND_H
[autoconf] bugs 162,303,178: Fix 'present but can not be compiled' warnings
2007-05-09 Paul Jakma <paul.jakma@sun.com>
* configure.ac: sys/conf.h depends on sys/param.h, at least on
FBSD 6.2.
(bug #363) Should check for in_pktinfo for IRDP
2006-05-27 Paul Jakma <paul.jakma@sun.com>
* configure.ac: General cleanup of header and type checks, introducing
an internal define, QUAGGA_INCLUDES, to build up a list of
stuff to include so as to avoid 'present but cant be compiled'
warnings.
Misc additional checks of things missing according to autoscan.
Add LIBM, for bgpd's use of libm, so as to avoid burdening
LIBS, and all the binaries, with libm linkage.
Remove the bad practice of using m4 changequote(), just
quote the []'s in the case statements properly.
This should fix bugs 162, 303 and 178.
* */*.{c,h}: Update all HAVE_* to the standard autoconf namespaced
HAVE_* defines. I.e. HAVE_SA_LEN -> HAVE_STRUCT_SOCKADDR_SA_LEN,
* bgpd/Makefile.am: Add LIBM to bgpd's LDADD, for pow().
2007-05-10 04:38:51 +02:00
# include <inet/nd.h>
#endif
2016-11-15 05:37:14 +01:00
#include <arpa/inet.h>
2007-06-22 18:14:42 +02:00
/* Required for IDRP */
2020-03-10 16:27:50 +01:00
#ifdef HAVE_NETINET_IP_ICMP_H
2007-06-22 18:14:42 +02:00
# include <netinet/ip_icmp.h>
#endif
[autoconf] bugs 162,303,178: Fix 'present but can not be compiled' warnings
2007-05-09 Paul Jakma <paul.jakma@sun.com>
* configure.ac: sys/conf.h depends on sys/param.h, at least on
FBSD 6.2.
(bug #363) Should check for in_pktinfo for IRDP
2006-05-27 Paul Jakma <paul.jakma@sun.com>
* configure.ac: General cleanup of header and type checks, introducing
an internal define, QUAGGA_INCLUDES, to build up a list of
stuff to include so as to avoid 'present but cant be compiled'
warnings.
Misc additional checks of things missing according to autoscan.
Add LIBM, for bgpd's use of libm, so as to avoid burdening
LIBS, and all the binaries, with libm linkage.
Remove the bad practice of using m4 changequote(), just
quote the []'s in the case statements properly.
This should fix bugs 162, 303 and 178.
* */*.{c,h}: Update all HAVE_* to the standard autoconf namespaced
HAVE_* defines. I.e. HAVE_SA_LEN -> HAVE_STRUCT_SOCKADDR_SA_LEN,
* bgpd/Makefile.am: Add LIBM to bgpd's LDADD, for pow().
2007-05-10 04:38:51 +02:00
])dnl
2003-10-22 02:07:44 +02:00
2003-12-03 18:52:30 +01:00
dnl V6 headers are checked below, after we check for v6
2003-03-17 03:05:07 +01:00
2019-12-04 04:18:12 +01:00
is_linux=false
2017-07-26 19:49:15 +02:00
AC_MSG_CHECKING([which operating system interface to use])
case "$host_os" in
sunos* | solaris2*)
2020-09-09 06:09:38 +02:00
AC_MSG_FAILURE([Solaris support has been removed please see versions prior or equal to 7.5])
2017-07-26 19:49:15 +02:00
;;
linux*)
AC_MSG_RESULT([Linux])
2018-11-14 12:23:49 +01:00
AC_DEFINE([GNU_LINUX], [1], [GNU Linux])
AC_DEFINE([HAVE_NETLINK], [1], [netlink])
AC_DEFINE([LINUX_IPV6], [1], [Linux IPv6 stack])
2017-07-26 19:49:15 +02:00
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
2018-11-14 12:23:49 +01:00
AC_DEFINE([IPV6_MINHOPCOUNT], [73], [Linux ipv6 Min Hop Count])
2019-12-04 04:18:12 +01:00
is_linux=true
2017-07-26 19:49:15 +02:00
;;
openbsd*)
AC_MSG_RESULT([OpenBSD])
2018-11-14 12:23:49 +01:00
AC_DEFINE([OPEN_BSD], [1], [OpenBSD])
AC_DEFINE([KAME], [1], [KAME IPv6])
AC_DEFINE([BSD_V6_SYSCTL], [1], [BSD v6 sysctl to turn on and off forwarding])
2017-07-26 19:49:15 +02:00
;;
*)
AC_MSG_RESULT([BSD])
2018-11-14 12:23:49 +01:00
AC_DEFINE([HAVE_NET_RT_IFLIST], [1], [NET_RT_IFLIST])
AC_DEFINE([KAME], [1], [KAME IPv6])
AC_DEFINE([BSD_V6_SYSCTL], [1], [BSD v6 sysctl to turn on and off forwarding])
2017-07-26 19:49:15 +02:00
;;
2003-03-17 03:05:07 +01:00
esac
2019-12-04 04:18:12 +01:00
AM_CONDITIONAL([LINUX], [${is_linux}])
2003-03-17 03:05:07 +01:00
2009-07-19 18:33:21 +02:00
AC_SYS_LARGEFILE
2017-12-08 20:44:15 +01:00
dnl ------------------------
dnl Integrated REALMS option
dnl ------------------------
2020-03-11 12:30:47 +01:00
if test "$enable_realms" = "yes"; then
2017-12-08 20:44:15 +01:00
case "$host_os" in
linux*)
2018-11-14 12:23:49 +01:00
AC_DEFINE([SUPPORT_REALMS], [1], [Realms support])
2017-12-08 20:44:15 +01:00
;;
*)
echo "Sorry, only Linux has REALMS support"
exit 1
;;
esac
fi
2019-06-04 15:35:16 +02:00
dnl ---------------
dnl other functions
dnl ---------------
AC_CHECK_FUNCS([ \
strlcat strlcpy \
2017-05-06 06:40:17 +02:00
getgrouplist \
openat \
unlinkat \
posix_fallocate \
])
2019-06-04 15:35:16 +02:00
dnl ##########################################################################
dnl LARGE if block spans a lot of "configure"!
2020-03-11 12:30:47 +01:00
if test "$enable_clippy_only" != "yes"; then
2019-06-04 15:35:16 +02:00
dnl ##########################################################################
#
# Logic for protobuf support.
#
2019-12-10 20:06:33 +01:00
PROTO3=false
2019-06-04 15:35:16 +02:00
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.])
])
2019-12-10 20:06:33 +01:00
PROTO3=true
AC_CHECK_HEADER([google/protobuf-c/protobuf-c.h],
[AC_CHECK_DECLS(PROTOBUF_C_LABEL_NONE,
AC_DEFINE([HAVE_PROTOBUF_VERSION_3],
[1], [Have Protobuf version 3]),
[PROTO3=false],
[#include <google/protobuf-c/protobuf-c.h>])],
[PROTO3=false && AC_MSG_FAILURE([protobuf requested but protobuf-c.h not found. Install protobuf-c.])])
2019-06-04 15:35:16 +02:00
AC_DEFINE([HAVE_PROTOBUF], [1], [protobuf])
fi
2017-12-08 20:44:15 +01:00
2003-03-17 03:05:07 +01:00
dnl ---------------------
dnl Integrated VTY option
dnl ---------------------
case "${enable_vtysh}" in
2018-10-06 23:28:19 +02:00
"no")
VTYSH="";;
*)
VTYSH="vtysh";
2018-11-14 12:23:49 +01:00
AC_DEFINE([VTYSH], [1], [VTY shell])
2018-10-06 23:28:19 +02:00
prev_libs="$LIBS"
2018-11-14 12:23:49 +01:00
AC_CHECK_LIB([readline], [main], [
2018-10-06 23:28:19 +02:00
LIBREADLINE="-lreadline"
], [
dnl readline failed - it might be incorrectly linked and missing its
dnl termcap/tinfo/curses dependency. see if we can fix that...
2018-11-14 12:23:49 +01:00
AC_SEARCH_LIBS([tputs], [termcap tinfo curses ncurses], [
2018-10-06 23:28:19 +02:00
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
2018-11-14 12:23:49 +01:00
AC_CHECK_LIB([readline], [main], [
2018-10-06 23:28:19 +02:00
LIBREADLINE="-lreadline $LIBREADLINE"
], [
AC_MSG_ERROR([libreadline (needed for vtysh) not found and/or missing dependencies])
], [$LIBREADLINE])
], [])
LIBS="$prev_libs"
2018-11-14 12:23:49 +01:00
AC_CHECK_HEADER([readline/history.h])
2020-03-11 11:27:04 +01:00
if test "$ac_cv_header_readline_history_h" = "no"; then
2018-10-06 23:28:19 +02:00
AC_MSG_ERROR([readline is too old to have readline/history.h, please update to the latest readline library.])
fi
2018-11-14 12:23:49 +01:00
AC_CHECK_LIB([readline], [rl_completion_matches], [true], [], [$LIBREADLINE])
2020-03-11 11:27:04 +01:00
if test "$ac_cv_lib_readline_rl_completion_matches" = "no"; then
2018-11-14 12:23:49 +01:00
AC_DEFINE([rl_completion_matches], [completion_matches], [Old readline])
2018-10-06 23:28:19 +02:00
fi
2018-11-14 12:23:49 +01:00
AC_CHECK_LIB([readline], [append_history], [frr_cv_append_history=yes], [frr_cv_append_history=no], [$LIBREADLINE])
2020-03-11 11:53:15 +01:00
if test "$frr_cv_append_history" = "yes"; then
2018-11-14 12:23:49 +01:00
AC_DEFINE([HAVE_APPEND_HISTORY], [1], [Have history.h append_history])
2018-10-06 23:28:19 +02:00
fi
;;
2003-03-17 03:05:07 +01:00
esac
2018-11-14 12:23:49 +01:00
AC_SUBST([LIBREADLINE])
2003-03-17 03:05:07 +01:00
dnl ----------
dnl PAM module
2011-07-14 22:24:15 +02:00
dnl
2017-07-12 18:25:33 +02:00
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 ----------
2003-05-06 14:16:27 +02:00
if test "$with_libpam" = "yes"; then
[autoconf] bugs 162,303,178: Fix 'present but can not be compiled' warnings
2007-05-09 Paul Jakma <paul.jakma@sun.com>
* configure.ac: sys/conf.h depends on sys/param.h, at least on
FBSD 6.2.
(bug #363) Should check for in_pktinfo for IRDP
2006-05-27 Paul Jakma <paul.jakma@sun.com>
* configure.ac: General cleanup of header and type checks, introducing
an internal define, QUAGGA_INCLUDES, to build up a list of
stuff to include so as to avoid 'present but cant be compiled'
warnings.
Misc additional checks of things missing according to autoscan.
Add LIBM, for bgpd's use of libm, so as to avoid burdening
LIBS, and all the binaries, with libm linkage.
Remove the bad practice of using m4 changequote(), just
quote the []'s in the case statements properly.
This should fix bugs 162, 303 and 178.
* */*.{c,h}: Update all HAVE_* to the standard autoconf namespaced
HAVE_* defines. I.e. HAVE_SA_LEN -> HAVE_STRUCT_SOCKADDR_SA_LEN,
* bgpd/Makefile.am: Add LIBM to bgpd's LDADD, for pow().
2007-05-10 04:38:51 +02:00
AC_CHECK_HEADER([security/pam_misc.h],
2018-11-14 12:23:49 +01:00
[AC_DEFINE([HAVE_PAM_MISC_H], [1], [Have pam_misc.h])
AC_DEFINE([PAM_CONV_FUNC], [misc_conv], [Have misc_conv])
[autoconf] bugs 162,303,178: Fix 'present but can not be compiled' warnings
2007-05-09 Paul Jakma <paul.jakma@sun.com>
* configure.ac: sys/conf.h depends on sys/param.h, at least on
FBSD 6.2.
(bug #363) Should check for in_pktinfo for IRDP
2006-05-27 Paul Jakma <paul.jakma@sun.com>
* configure.ac: General cleanup of header and type checks, introducing
an internal define, QUAGGA_INCLUDES, to build up a list of
stuff to include so as to avoid 'present but cant be compiled'
warnings.
Misc additional checks of things missing according to autoscan.
Add LIBM, for bgpd's use of libm, so as to avoid burdening
LIBS, and all the binaries, with libm linkage.
Remove the bad practice of using m4 changequote(), just
quote the []'s in the case statements properly.
This should fix bugs 162, 303 and 178.
* */*.{c,h}: Update all HAVE_* to the standard autoconf namespaced
HAVE_* defines. I.e. HAVE_SA_LEN -> HAVE_STRUCT_SOCKADDR_SA_LEN,
* bgpd/Makefile.am: Add LIBM to bgpd's LDADD, for pow().
2007-05-10 04:38:51 +02:00
pam_conv_func="misc_conv"
],
2016-12-14 20:22:59 +01:00
[], FRR_INCLUDES)
[autoconf] bugs 162,303,178: Fix 'present but can not be compiled' warnings
2007-05-09 Paul Jakma <paul.jakma@sun.com>
* configure.ac: sys/conf.h depends on sys/param.h, at least on
FBSD 6.2.
(bug #363) Should check for in_pktinfo for IRDP
2006-05-27 Paul Jakma <paul.jakma@sun.com>
* configure.ac: General cleanup of header and type checks, introducing
an internal define, QUAGGA_INCLUDES, to build up a list of
stuff to include so as to avoid 'present but cant be compiled'
warnings.
Misc additional checks of things missing according to autoscan.
Add LIBM, for bgpd's use of libm, so as to avoid burdening
LIBS, and all the binaries, with libm linkage.
Remove the bad practice of using m4 changequote(), just
quote the []'s in the case statements properly.
This should fix bugs 162, 303 and 178.
* */*.{c,h}: Update all HAVE_* to the standard autoconf namespaced
HAVE_* defines. I.e. HAVE_SA_LEN -> HAVE_STRUCT_SOCKADDR_SA_LEN,
* bgpd/Makefile.am: Add LIBM to bgpd's LDADD, for pow().
2007-05-10 04:38:51 +02:00
AC_CHECK_HEADER([security/openpam.h],
2018-11-14 12:23:49 +01:00
[AC_DEFINE([HAVE_OPENPAM_H], [1], [Have openpam.h])
AC_DEFINE([PAM_CONV_FUNC], [openpam_ttyconv], [Have openpam_ttyconv])
[autoconf] bugs 162,303,178: Fix 'present but can not be compiled' warnings
2007-05-09 Paul Jakma <paul.jakma@sun.com>
* configure.ac: sys/conf.h depends on sys/param.h, at least on
FBSD 6.2.
(bug #363) Should check for in_pktinfo for IRDP
2006-05-27 Paul Jakma <paul.jakma@sun.com>
* configure.ac: General cleanup of header and type checks, introducing
an internal define, QUAGGA_INCLUDES, to build up a list of
stuff to include so as to avoid 'present but cant be compiled'
warnings.
Misc additional checks of things missing according to autoscan.
Add LIBM, for bgpd's use of libm, so as to avoid burdening
LIBS, and all the binaries, with libm linkage.
Remove the bad practice of using m4 changequote(), just
quote the []'s in the case statements properly.
This should fix bugs 162, 303 and 178.
* */*.{c,h}: Update all HAVE_* to the standard autoconf namespaced
HAVE_* defines. I.e. HAVE_SA_LEN -> HAVE_STRUCT_SOCKADDR_SA_LEN,
* bgpd/Makefile.am: Add LIBM to bgpd's LDADD, for pow().
2007-05-10 04:38:51 +02:00
pam_conv_func="openpam_ttyconv"
],
2016-12-14 20:22:59 +01:00
[], FRR_INCLUDES[#include <security/pam_appl.h>])
2003-05-06 14:16:27 +02:00
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
[autoconf] bugs 162,303,178: Fix 'present but can not be compiled' warnings
2007-05-09 Paul Jakma <paul.jakma@sun.com>
* configure.ac: sys/conf.h depends on sys/param.h, at least on
FBSD 6.2.
(bug #363) Should check for in_pktinfo for IRDP
2006-05-27 Paul Jakma <paul.jakma@sun.com>
* configure.ac: General cleanup of header and type checks, introducing
an internal define, QUAGGA_INCLUDES, to build up a list of
stuff to include so as to avoid 'present but cant be compiled'
warnings.
Misc additional checks of things missing according to autoscan.
Add LIBM, for bgpd's use of libm, so as to avoid burdening
LIBS, and all the binaries, with libm linkage.
Remove the bad practice of using m4 changequote(), just
quote the []'s in the case statements properly.
This should fix bugs 162, 303 and 178.
* */*.{c,h}: Update all HAVE_* to the standard autoconf namespaced
HAVE_* defines. I.e. HAVE_SA_LEN -> HAVE_STRUCT_SOCKADDR_SA_LEN,
* bgpd/Makefile.am: Add LIBM to bgpd's LDADD, for pow().
2007-05-10 04:38:51 +02:00
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.
2018-11-14 12:23:49 +01:00
AC_CHECK_LIB([pam], [pam_start],
[AC_CHECK_LIB([pam], [$pam_conv_func],
[AC_DEFINE([USE_PAM], [1], [Use PAM for authentication])
2003-03-17 03:05:07 +01:00
LIBPAM="-lpam"],
2018-11-14 12:23:49 +01:00
[AC_DEFINE([USE_PAM], [1], [Use PAM for authentication])
2003-03-17 03:05:07 +01:00
LIBPAM="-lpam -lpam_misc"]
)
],
2018-11-14 12:23:49 +01:00
[AC_CHECK_LIB([pam], [pam_end],
[AC_CHECK_LIB([pam], [$pam_conv_func],
[AC_DEFINE([USE_PAM], [1], [Use PAM for authentication])
2003-03-17 03:05:07 +01:00
LIBPAM="-lpam -ldl"],
2018-11-14 12:23:49 +01:00
[AC_DEFINE([USE_PAM], [1], [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
2018-11-14 12:23:49 +01:00
AC_SUBST([LIBPAM])
2003-03-17 03:05:07 +01:00
[autoconf] bugs 162,303,178: Fix 'present but can not be compiled' warnings
2007-05-09 Paul Jakma <paul.jakma@sun.com>
* configure.ac: sys/conf.h depends on sys/param.h, at least on
FBSD 6.2.
(bug #363) Should check for in_pktinfo for IRDP
2006-05-27 Paul Jakma <paul.jakma@sun.com>
* configure.ac: General cleanup of header and type checks, introducing
an internal define, QUAGGA_INCLUDES, to build up a list of
stuff to include so as to avoid 'present but cant be compiled'
warnings.
Misc additional checks of things missing according to autoscan.
Add LIBM, for bgpd's use of libm, so as to avoid burdening
LIBS, and all the binaries, with libm linkage.
Remove the bad practice of using m4 changequote(), just
quote the []'s in the case statements properly.
This should fix bugs 162, 303 and 178.
* */*.{c,h}: Update all HAVE_* to the standard autoconf namespaced
HAVE_* defines. I.e. HAVE_SA_LEN -> HAVE_STRUCT_SOCKADDR_SA_LEN,
* bgpd/Makefile.am: Add LIBM to bgpd's LDADD, for pow().
2007-05-10 04:38:51 +02:00
dnl -------------------------------
dnl bgpd needs pow() and hence libm
dnl -------------------------------
TMPLIBS="$LIBS"
2019-06-04 14:12:30 +02:00
LIBS=""
AC_SEARCH_LIBS([pow], [m], [
LIBM="$LIBS"
], [
[autoconf] bugs 162,303,178: Fix 'present but can not be compiled' warnings
2007-05-09 Paul Jakma <paul.jakma@sun.com>
* configure.ac: sys/conf.h depends on sys/param.h, at least on
FBSD 6.2.
(bug #363) Should check for in_pktinfo for IRDP
2006-05-27 Paul Jakma <paul.jakma@sun.com>
* configure.ac: General cleanup of header and type checks, introducing
an internal define, QUAGGA_INCLUDES, to build up a list of
stuff to include so as to avoid 'present but cant be compiled'
warnings.
Misc additional checks of things missing according to autoscan.
Add LIBM, for bgpd's use of libm, so as to avoid burdening
LIBS, and all the binaries, with libm linkage.
Remove the bad practice of using m4 changequote(), just
quote the []'s in the case statements properly.
This should fix bugs 162, 303 and 178.
* */*.{c,h}: Update all HAVE_* to the standard autoconf namespaced
HAVE_* defines. I.e. HAVE_SA_LEN -> HAVE_STRUCT_SOCKADDR_SA_LEN,
* bgpd/Makefile.am: Add LIBM to bgpd's LDADD, for pow().
2007-05-10 04:38:51 +02:00
AC_MSG_WARN([Unable to find working pow function - bgpd may not link])
2019-06-04 14:12:30 +02:00
])
[autoconf] bugs 162,303,178: Fix 'present but can not be compiled' warnings
2007-05-09 Paul Jakma <paul.jakma@sun.com>
* configure.ac: sys/conf.h depends on sys/param.h, at least on
FBSD 6.2.
(bug #363) Should check for in_pktinfo for IRDP
2006-05-27 Paul Jakma <paul.jakma@sun.com>
* configure.ac: General cleanup of header and type checks, introducing
an internal define, QUAGGA_INCLUDES, to build up a list of
stuff to include so as to avoid 'present but cant be compiled'
warnings.
Misc additional checks of things missing according to autoscan.
Add LIBM, for bgpd's use of libm, so as to avoid burdening
LIBS, and all the binaries, with libm linkage.
Remove the bad practice of using m4 changequote(), just
quote the []'s in the case statements properly.
This should fix bugs 162, 303 and 178.
* */*.{c,h}: Update all HAVE_* to the standard autoconf namespaced
HAVE_* defines. I.e. HAVE_SA_LEN -> HAVE_STRUCT_SOCKADDR_SA_LEN,
* bgpd/Makefile.am: Add LIBM to bgpd's LDADD, for pow().
2007-05-10 04:38:51 +02:00
LIBS="$TMPLIBS"
2018-11-14 12:23:49 +01:00
AC_SUBST([LIBM])
[autoconf] bugs 162,303,178: Fix 'present but can not be compiled' warnings
2007-05-09 Paul Jakma <paul.jakma@sun.com>
* configure.ac: sys/conf.h depends on sys/param.h, at least on
FBSD 6.2.
(bug #363) Should check for in_pktinfo for IRDP
2006-05-27 Paul Jakma <paul.jakma@sun.com>
* configure.ac: General cleanup of header and type checks, introducing
an internal define, QUAGGA_INCLUDES, to build up a list of
stuff to include so as to avoid 'present but cant be compiled'
warnings.
Misc additional checks of things missing according to autoscan.
Add LIBM, for bgpd's use of libm, so as to avoid burdening
LIBS, and all the binaries, with libm linkage.
Remove the bad practice of using m4 changequote(), just
quote the []'s in the case statements properly.
This should fix bugs 162, 303 and 178.
* */*.{c,h}: Update all HAVE_* to the standard autoconf namespaced
HAVE_* defines. I.e. HAVE_SA_LEN -> HAVE_STRUCT_SOCKADDR_SA_LEN,
* bgpd/Makefile.am: Add LIBM to bgpd's LDADD, for pow().
2007-05-10 04:38:51 +02:00
2017-06-01 16:02:23 +02:00
AC_CHECK_FUNCS([ppoll], [
2018-11-14 12:23:49 +01:00
AC_DEFINE([HAVE_PPOLL], [1], [have Linux/BSD ppoll()])
2017-06-01 16:02:23 +02:00
])
AC_CHECK_FUNCS([pollts], [
2018-11-14 12:23:49 +01:00
AC_DEFINE([HAVE_POLLTS], [1], [have NetBSD pollts()])
2017-06-01 16:02:23 +02:00
])
2014-07-03 12:24:34 +02:00
AC_CHECK_HEADER([asm-generic/unistd.h],
[AC_CHECK_DECL(__NR_setns,
2018-11-14 12:23:49 +01:00
AC_DEFINE([HAVE_NETNS], [1], [Have netns]),,
2016-12-14 20:22:59 +01:00
FRR_INCLUDES [#include <asm-generic/unistd.h>
2014-07-03 12:24:34 +02:00
])
2018-11-14 12:23:49 +01:00
AC_CHECK_FUNCS([setns])]
2014-07-03 12:24:34 +02:00
)
2007-08-07 20:49:18 +02:00
dnl --------------------------
dnl Determine IS-IS I/O method
dnl --------------------------
2018-11-14 12:23:49 +01:00
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])
2017-07-26 19:49:15 +02:00
case "$host_os" in
linux*)
2018-11-14 12:23:49 +01:00
AC_MSG_RESULT([pfpacket])
2017-07-26 19:49:15 +02:00
ISIS_METHOD_MACRO="ISIS_METHOD_PFPACKET"
;;
*)
2020-03-11 11:53:15 +01:00
if test "$ac_cv_header_net_bpf_h" = "no"; then
if test "$ac_cv_header_sys_dlpi_h" = "no"; then
2018-11-14 12:23:49 +01:00
AC_MSG_RESULT([none])
2020-03-11 12:30:47 +01:00
if test "$enable_isisd" = "yes" -o "$enable_fabricd" = "yes"; then
2017-08-03 13:42:11 +02:00
AC_MSG_FAILURE([IS-IS support requested but no packet backend found])
fi
2017-07-26 19:49:15 +02:00
AC_MSG_WARN([*** IS-IS support will not be built ***])
2017-08-03 13:42:11 +02:00
enable_isisd="no"
2018-03-22 15:01:08 +01:00
enable_fabricd="no"
2017-07-26 19:49:15 +02:00
else
2018-11-14 12:23:49 +01:00
AC_MSG_RESULT([DLPI])
2017-07-26 19:49:15 +02:00
fi
ISIS_METHOD_MACRO="ISIS_METHOD_DLPI"
2007-08-07 20:49:18 +02:00
else
2018-11-14 12:23:49 +01:00
AC_MSG_RESULT([BPF])
2017-07-26 19:49:15 +02:00
ISIS_METHOD_MACRO="ISIS_METHOD_BPF"
2007-08-07 20:49:18 +02:00
fi
2017-07-26 19:49:15 +02:00
;;
esac
2018-11-14 12:23:49 +01:00
AC_DEFINE_UNQUOTED([ISIS_METHOD], [$ISIS_METHOD_MACRO], [selected method for isis, == one of the constants])
2007-08-07 20:49:18 +02:00
2005-05-07 04:22:51 +02:00
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)
2005-05-07 04:22:51 +02:00
2016-08-04 15:07:30 +02:00
AC_CHECK_HEADERS([linux/mroute.h], [], [],[
2016-11-15 05:37:14 +01:00
#include <sys/socket.h>
#include <netinet/in.h>
2016-08-04 15:07:30 +02:00
#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
2020-03-10 16:27:50 +01:00
[#ifdef HAVE_LINUX_MROUTE_H
2016-08-04 15:07:30 +02:00
# include <linux/mroute.h>
#endif
])dnl
AC_CHECK_HEADERS([netinet/ip_mroute.h], [], [],[
2016-11-15 05:37:14 +01:00
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <net/route.h>
2016-08-04 15:07:30 +02:00
])
2016-12-14 20:22:59 +01:00
m4_define([FRR_INCLUDES],
FRR_INCLUDES
2020-03-10 16:27:50 +01:00
[#ifdef HAVE_NETINET_IP_MROUTE_H
2016-08-04 15:07:30 +02:00
# include <netinet/ip_mroute.h>
#endif
])dnl
2011-08-22 09:39:35 +02:00
AC_MSG_CHECKING([for RFC3678 protocol-independed API])
2021-04-21 12:33:47 +02:00
AC_COMPILE_IFELSE(
[ AC_LANG_PROGRAM([[
#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)
])
2011-08-22 09:39:35 +02:00
2008-01-10 16:24:32 +01:00
dnl ---------------------------------------------------------------
dnl figure out how to check link-state
dnl ---------------------------------------------------------------
2018-11-14 12:23:49 +01:00
AC_CHECK_HEADER([net/if_media.h],
2016-11-15 05:37:14 +01:00
[m4_define([LINK_DETECT_INCLUDES],
2016-12-14 20:22:59 +01:00
FRR_INCLUDES
2016-11-15 05:37:14 +01:00
[#include <net/if_media.h>
])
2018-11-14 12:23:49 +01:00
AC_CHECK_MEMBERS([struct ifmediareq.ifm_status],
AC_DEFINE([HAVE_BSD_LINK_DETECT], [1], [BSD link-detect]),
2016-11-15 05:37:14 +01:00
[], LINK_DETECT_INCLUDES)],
[],
2016-12-14 20:22:59 +01:00
FRR_INCLUDES)
2008-01-10 16:24:32 +01:00
2012-10-11 01:12:32 +02:00
dnl ---------------------------------------------------------------
dnl Additional, newer way to check link-state using ifi_link_state.
dnl Not available in all BSD's when ifmediareq available
dnl ---------------------------------------------------------------
2016-11-15 05:37:14 +01:00
AC_CHECK_MEMBERS([struct if_data.ifi_link_state],
2018-11-14 12:23:49 +01:00
AC_DEFINE([HAVE_BSD_IFI_LINK_STATE], [1], [BSD ifi_link_state available]),
2016-12-14 20:22:59 +01:00
[], FRR_INCLUDES)
2012-10-11 01:12:32 +02:00
[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)
2020-03-11 11:53:15 +01:00
if test "$ac_cv_have_decl_TCP_MD5SIG" = "no"; then
[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
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
2019-06-04 15:35:16 +02:00
AC_CHECK_LIB([crypt], [crypt], [],
[AC_CHECK_LIB([crypto], [DES_crypt])])
AC_CHECK_LIB([resolv], [res_init])
dnl ---------------------------
dnl check system has PCRE regexp
dnl ---------------------------
2020-03-11 12:09:13 +01:00
if test "$enable_pcreposix" = "yes"; then
2019-06-04 15:35:16 +02:00
AC_CHECK_LIB([pcreposix], [regexec], [], [
AC_MSG_ERROR([--enable-pcreposix given but unable to find libpcreposix])
])
fi
AC_SUBST([HAVE_LIBPCREPOSIX])
2019-09-13 06:12:34 +02:00
dnl ##########################################################################
2020-03-11 12:30:47 +01:00
dnl test "$enable_clippy_only" != "yes"
2019-09-13 06:12:34 +02:00
fi
dnl END OF LARGE if block
dnl ##########################################################################
2019-08-13 16:22:22 +02:00
dnl ------------------
dnl check C-Ares library
dnl ------------------
PKG_CHECK_MODULES([CARES], [libcares], [
c_ares_found=true
],[
c_ares_found=false
])
AM_CONDITIONAL([CARES], [$c_ares_found])
2019-06-04 15:35:16 +02:00
2016-08-04 15:07:28 +02:00
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>])
2003-12-03 18:52:30 +01:00
dnl ------------------
dnl IPv6 header checks
dnl ------------------
2016-11-15 05:37:14 +01:00
AC_CHECK_HEADERS([netinet6/in6.h netinet/in6_var.h \
[autoconf] bugs 162,303,178: Fix 'present but can not be compiled' warnings
2007-05-09 Paul Jakma <paul.jakma@sun.com>
* configure.ac: sys/conf.h depends on sys/param.h, at least on
FBSD 6.2.
(bug #363) Should check for in_pktinfo for IRDP
2006-05-27 Paul Jakma <paul.jakma@sun.com>
* configure.ac: General cleanup of header and type checks, introducing
an internal define, QUAGGA_INCLUDES, to build up a list of
stuff to include so as to avoid 'present but cant be compiled'
warnings.
Misc additional checks of things missing according to autoscan.
Add LIBM, for bgpd's use of libm, so as to avoid burdening
LIBS, and all the binaries, with libm linkage.
Remove the bad practice of using m4 changequote(), just
quote the []'s in the case statements properly.
This should fix bugs 162, 303 and 178.
* */*.{c,h}: Update all HAVE_* to the standard autoconf namespaced
HAVE_* defines. I.e. HAVE_SA_LEN -> HAVE_STRUCT_SOCKADDR_SA_LEN,
* bgpd/Makefile.am: Add LIBM to bgpd's LDADD, for pow().
2007-05-10 04:38:51 +02:00
netinet6/in6_var.h netinet6/nd6.h], [], [],
2016-12-14 20:22:59 +01:00
FRR_INCLUDES)
2003-12-03 18:52:30 +01:00
2016-12-14 20:22:59 +01:00
m4_define([FRR_INCLUDES],dnl
FRR_INCLUDES
2020-03-10 16:27:50 +01:00
[#ifdef HAVE_NETINET6_IN6_H
[autoconf] bugs 162,303,178: Fix 'present but can not be compiled' warnings
2007-05-09 Paul Jakma <paul.jakma@sun.com>
* configure.ac: sys/conf.h depends on sys/param.h, at least on
FBSD 6.2.
(bug #363) Should check for in_pktinfo for IRDP
2006-05-27 Paul Jakma <paul.jakma@sun.com>
* configure.ac: General cleanup of header and type checks, introducing
an internal define, QUAGGA_INCLUDES, to build up a list of
stuff to include so as to avoid 'present but cant be compiled'
warnings.
Misc additional checks of things missing according to autoscan.
Add LIBM, for bgpd's use of libm, so as to avoid burdening
LIBS, and all the binaries, with libm linkage.
Remove the bad practice of using m4 changequote(), just
quote the []'s in the case statements properly.
This should fix bugs 162, 303 and 178.
* */*.{c,h}: Update all HAVE_* to the standard autoconf namespaced
HAVE_* defines. I.e. HAVE_SA_LEN -> HAVE_STRUCT_SOCKADDR_SA_LEN,
* bgpd/Makefile.am: Add LIBM to bgpd's LDADD, for pow().
2007-05-10 04:38:51 +02:00
#include <netinet6/in6.h>
#endif
2020-03-10 16:27:50 +01:00
#ifdef HAVE_NETINET_IN6_VAR_H
[autoconf] bugs 162,303,178: Fix 'present but can not be compiled' warnings
2007-05-09 Paul Jakma <paul.jakma@sun.com>
* configure.ac: sys/conf.h depends on sys/param.h, at least on
FBSD 6.2.
(bug #363) Should check for in_pktinfo for IRDP
2006-05-27 Paul Jakma <paul.jakma@sun.com>
* configure.ac: General cleanup of header and type checks, introducing
an internal define, QUAGGA_INCLUDES, to build up a list of
stuff to include so as to avoid 'present but cant be compiled'
warnings.
Misc additional checks of things missing according to autoscan.
Add LIBM, for bgpd's use of libm, so as to avoid burdening
LIBS, and all the binaries, with libm linkage.
Remove the bad practice of using m4 changequote(), just
quote the []'s in the case statements properly.
This should fix bugs 162, 303 and 178.
* */*.{c,h}: Update all HAVE_* to the standard autoconf namespaced
HAVE_* defines. I.e. HAVE_SA_LEN -> HAVE_STRUCT_SOCKADDR_SA_LEN,
* bgpd/Makefile.am: Add LIBM to bgpd's LDADD, for pow().
2007-05-10 04:38:51 +02:00
#include <netinet/in6_var.h>
#endif
2016-11-15 05:37:14 +01:00
#include <netinet/icmp6.h>
2020-03-10 16:27:50 +01:00
#ifdef HAVE_NETINET6_IN6_VAR_H
[autoconf] bugs 162,303,178: Fix 'present but can not be compiled' warnings
2007-05-09 Paul Jakma <paul.jakma@sun.com>
* configure.ac: sys/conf.h depends on sys/param.h, at least on
FBSD 6.2.
(bug #363) Should check for in_pktinfo for IRDP
2006-05-27 Paul Jakma <paul.jakma@sun.com>
* configure.ac: General cleanup of header and type checks, introducing
an internal define, QUAGGA_INCLUDES, to build up a list of
stuff to include so as to avoid 'present but cant be compiled'
warnings.
Misc additional checks of things missing according to autoscan.
Add LIBM, for bgpd's use of libm, so as to avoid burdening
LIBS, and all the binaries, with libm linkage.
Remove the bad practice of using m4 changequote(), just
quote the []'s in the case statements properly.
This should fix bugs 162, 303 and 178.
* */*.{c,h}: Update all HAVE_* to the standard autoconf namespaced
HAVE_* defines. I.e. HAVE_SA_LEN -> HAVE_STRUCT_SOCKADDR_SA_LEN,
* bgpd/Makefile.am: Add LIBM to bgpd's LDADD, for pow().
2007-05-10 04:38:51 +02:00
# include <netinet6/in6_var.h>
#endif
2020-03-10 16:27:50 +01:00
#ifdef HAVE_NETINET6_ND6_H
2007-06-25 21:30:59 +02:00
# include <netinet6/nd6.h>
[autoconf] bugs 162,303,178: Fix 'present but can not be compiled' warnings
2007-05-09 Paul Jakma <paul.jakma@sun.com>
* configure.ac: sys/conf.h depends on sys/param.h, at least on
FBSD 6.2.
(bug #363) Should check for in_pktinfo for IRDP
2006-05-27 Paul Jakma <paul.jakma@sun.com>
* configure.ac: General cleanup of header and type checks, introducing
an internal define, QUAGGA_INCLUDES, to build up a list of
stuff to include so as to avoid 'present but cant be compiled'
warnings.
Misc additional checks of things missing according to autoscan.
Add LIBM, for bgpd's use of libm, so as to avoid burdening
LIBS, and all the binaries, with libm linkage.
Remove the bad practice of using m4 changequote(), just
quote the []'s in the case statements properly.
This should fix bugs 162, 303 and 178.
* */*.{c,h}: Update all HAVE_* to the standard autoconf namespaced
HAVE_* defines. I.e. HAVE_SA_LEN -> HAVE_STRUCT_SOCKADDR_SA_LEN,
* bgpd/Makefile.am: Add LIBM to bgpd's LDADD, for pow().
2007-05-10 04:38:51 +02:00
#endif
])dnl
2003-03-17 03:05:07 +01:00
dnl --------------------
dnl Daemon disable check
dnl --------------------
2020-09-29 12:12:55 +02:00
AS_IF([test "$enable_bgpd" != "no"], [
AC_DEFINE([HAVE_BGPD], [1], [bgpd])
])
AS_IF([test "$enable_ripd" != "no"], [
AC_DEFINE([HAVE_RIPD], [1], [ripd])
])
AS_IF([test "$enable_ripngd" != "no"], [
AC_DEFINE([HAVE_RIPNGD], [1], [ripngd])
])
AS_IF([test "$enable_ospfd" != "no"], [
AC_DEFINE([HAVE_OSPFD], [1], [ospfd])
])
AS_IF([test "$enable_ospf6d" != "no"], [
AC_DEFINE([HAVE_OSPF6D], [1], [ospf6d])
])
2020-03-11 12:30:47 +01:00
AS_IF([test "$enable_ldpd" != "no"], [
2018-11-14 12:23:49 +01:00
AC_DEFINE([HAVE_LDPD], [1], [ldpd])
2017-08-04 16:13:29 +02:00
])
2016-03-01 19:31:28 +01:00
2020-09-29 12:12:55 +02:00
AS_IF([test "$enable_nhrpd" != "no"], [
AC_DEFINE([HAVE_NHRPD], [1], [nhrpd])
])
AS_IF([test "$enable_eigrpd" != "no"], [
AC_DEFINE([HAVE_EIGRPD], [1], [eigrpd])
])
AS_IF([test "$enable_babeld" != "no"], [
AC_DEFINE([HAVE_BABELD], [1], [babeld])
])
AS_IF([test "$enable_isisd" != "no"], [
AC_DEFINE([HAVE_ISISD], [1], [isisd])
])
AS_IF([test "$enable_pimd" != "no"], [
AC_DEFINE([HAVE_PIMD], [1], [pimd])
])
AS_IF([test "$enable_pbrd" != "no"], [
AC_DEFINE([HAVE_PBRD], [1], [pbrd])
])
AS_IF([test "$enable_sharpd" = "yes"], [
AC_DEFINE([HAVE_SHARPD], [1], [sharpd])
])
AS_IF([test "$enable_staticd" != "no"], [
AC_DEFINE([HAVE_STATICD], [1], [staticd])
])
AS_IF([test "$enable_fabricd" != "no"], [
AC_DEFINE([HAVE_FABRICD], [1], [fabricd])
])
AS_IF([test "$enable_vrrpd" != "no"], [
AC_DEFINE([HAVE_VRRPD], [1], [vrrpd])
])
2018-06-27 17:24:51 +02:00
if test "$enable_bfdd" = "no"; then
2018-11-14 12:23:49 +01:00
AC_DEFINE([HAVE_BFDD], [0], [bfdd])
2018-06-27 17:24:51 +02:00
BFDD=""
else
2018-11-14 12:23:49 +01:00
AC_DEFINE([HAVE_BFDD], [1], [bfdd])
2018-06-27 17:24:51 +02:00
BFDD="bfdd"
case $host_os in
linux*)
2018-11-14 12:23:49 +01:00
AC_DEFINE([BFD_LINUX], [1], [bfdd])
2018-06-27 17:24:51 +02:00
;;
*)
2018-11-14 12:23:49 +01:00
AC_DEFINE([BFD_BSD], [1], [bfdd])
2018-06-27 17:24:51 +02:00
;;
esac
fi
2020-07-31 18:04:20 +02:00
AS_IF([test "$enable_pathd" != "no"], [
AC_DEFINE([HAVE_PATHD], [1], [pathd])
2020-10-16 16:55:51 +02:00
AC_DEFINE([HAVE_PATHD_PCEP], [1], [pathd-pcep])
])
2021-01-22 10:38:12 +01:00
2020-03-11 12:09:13 +01:00
if test "$ac_cv_lib_json_c_json_object_get" = "no" -a "$BFDD" = "bfdd"; then
2018-06-27 17:24:51 +02:00
AC_MSG_ERROR(["you must use json-c library to use bfdd"])
fi
2017-03-07 16:56:57 +01:00
NHRPD=""
2017-07-26 19:49:15 +02:00
case "$host_os" in
linux*)
2019-08-13 16:22:22 +02:00
case "${enable_nhrpd}" in
no)
;;
yes)
2020-03-11 12:30:47 +01:00
if test "$enable_clippy_only" != "yes"; then
2019-08-29 03:49:14 +02:00
if test "$c_ares_found" != "true" ; then
2019-08-13 16:22:22 +02:00
AC_MSG_ERROR([nhrpd requires libcares. Please install c-ares and its -dev headers.])
fi
2019-09-13 06:12:34 +02:00
fi
2019-08-13 16:22:22 +02:00
NHRPD="nhrpd"
;;
*)
2019-08-29 03:49:14 +02:00
if test "$c_ares_found" = "true" ; then
2019-08-13 16:22:22 +02:00
NHRPD="nhrpd"
fi
;;
esac
2017-07-26 19:49:15 +02:00
;;
*)
2020-03-11 12:30:47 +01:00
if test "$enable_nhrpd" = "yes"; then
2017-07-26 19:49:15 +02:00
AC_MSG_ERROR([nhrpd requires kernel APIs that are only present on Linux.])
fi
;;
esac
2017-03-09 05:07:46 +01:00
2020-03-11 12:30:47 +01:00
if test "$enable_watchfrr" = "no";then
2017-01-04 02:13:02 +01:00
WATCHFRR=""
2004-12-22 15:03:52 +01:00
else
2017-01-04 02:13:02 +01:00
WATCHFRR="watchfrr"
2004-12-22 15:03:52 +01:00
fi
2003-03-21 16:16:05 +01:00
OSPFCLIENT=""
2020-03-11 12:30:47 +01:00
if test "$enable_ospfapi" != "no";then
2018-11-14 12:23:49 +01:00
AC_DEFINE([SUPPORT_OSPF_API], [1], [OSPFAPI])
2003-03-21 16:16:05 +01:00
2020-03-11 12:30:47 +01:00
if test "$enable_ospfclient" != "no";then
2003-03-21 16:16:05 +01:00
OSPFCLIENT="ospfclient"
fi
2003-03-17 03:05:07 +01:00
fi
2015-12-16 20:22:10 +01:00
2020-03-11 12:30:47 +01:00
if test "$enable_bgp_announce" = "no";then
2018-11-14 12:23:49 +01:00
AC_DEFINE([DISABLE_BGP_ANNOUNCE], [1], [Disable BGP installation to zebra])
2008-07-22 23:11:48 +02:00
else
2018-11-14 12:23:49 +01:00
AC_DEFINE([DISABLE_BGP_ANNOUNCE], [0], [Disable BGP installation to zebra])
2003-03-17 03:05:07 +01:00
fi
2020-03-11 12:30:47 +01:00
if test "$enable_bgp_vnc" != "no";then
2018-11-14 12:23:49 +01:00
AC_DEFINE([ENABLE_BGP_VNC], [1], [Enable BGP VNC support])
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
fi
2003-03-17 03:05:07 +01:00
2019-08-13 16:22:22 +02:00
bgpd_bmp=false
case "${enable_bmp}" in
no)
;;
yes)
2019-08-29 03:49:14 +02:00
if test "$c_ares_found" != "true" ; then
2019-08-13 16:22:22 +02:00
AC_MSG_ERROR([BMP support requires libcares. Please install c-ares and its -dev headers.])
fi
bgpd_bmp=true
;;
*)
2019-08-29 03:49:14 +02:00
if test "$c_ares_found" = "true" ; then
2019-08-13 16:22:22 +02:00
bgpd_bmp=true
fi
;;
esac
2020-06-17 18:48:34 +02:00
if test "$enable_version_build_config" != "no";then
AC_DEFINE([ENABLE_VERSION_BUILD_CONFIG], [1], [Report build configs in show version])
fi
2019-06-04 15:35:16 +02:00
dnl ##########################################################################
dnl LARGE if block
2020-03-11 12:30:47 +01:00
if test "$enable_clippy_only" != "yes"; then
2019-06-04 15:35:16 +02:00
dnl ##########################################################################
2003-03-17 03:05:07 +01:00
dnl ------------------
2006-01-31 11:09:27 +01:00
dnl check Net-SNMP library
2003-03-17 03:05:07 +01:00
dnl ------------------
2020-03-11 12:30:47 +01:00
if test "$enable_snmp" != "" -a "$enable_snmp" != "no"; then
2012-05-22 22:29:17 +02:00
AC_PATH_TOOL([NETSNMP_CONFIG], [net-snmp-config], [no])
2020-03-11 12:09:13 +01:00
if test "$NETSNMP_CONFIG" = "no"; then
2012-05-22 22:29:17 +02:00
AC_MSG_ERROR([--enable-snmp given but unable to find net-snmp-config])
fi
2016-06-13 15:44:26 +02:00
SNMP_LIBS="`${NETSNMP_CONFIG} --agent-libs`"
SNMP_CFLAGS="`${NETSNMP_CONFIG} --base-cflags`"
2018-10-27 19:06:22 +02:00
# 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
2012-05-22 22:29:17 +02:00
AC_MSG_CHECKING([whether we can link to Net-SNMP])
2017-06-14 10:26:07 +02:00
AC_LINK_IFELSE_FLAGS([$SNMP_CFLAGS], [$SNMP_LIBS], [AC_LANG_PROGRAM([
2012-05-22 22:29:17 +02:00
int main(void);
],
[
{
return 0;
}
2017-06-14 10:26:07 +02:00
])], [
2019-05-28 00:35:24 +02:00
AC_MSG_RESULT([no])
2012-05-22 22:29:17 +02:00
AC_MSG_ERROR([--enable-snmp given but not usable])])
2012-05-24 09:44:43 +02:00
case "${enable_snmp}" in
yes)
SNMP_METHOD=agentx
;;
2018-08-16 19:51:13 +02:00
agentx)
2012-05-24 09:44:43 +02:00
SNMP_METHOD="${enable_snmp}"
;;
*)
2018-08-16 19:51:13 +02:00
AC_MSG_ERROR([--enable-snmp given with an unknown method (${enable_snmp}). Use yes or agentx])
2012-05-24 09:44:43 +02:00
;;
esac
AH_TEMPLATE([SNMP_AGENTX], [Use SNMP AgentX to interface with snmpd])
2018-11-14 12:23:49 +01:00
AC_DEFINE_UNQUOTED(AS_TR_CPP(SNMP_${SNMP_METHOD}),,[SNMP method to interface with snmpd])
2005-01-12 17:52:55 +01:00
fi
2018-11-14 12:23:49 +01:00
AC_SUBST([SNMP_LIBS])
AC_SUBST([SNMP_CFLAGS])
2005-01-12 17:52:55 +01:00
2017-12-07 20:31:48 +01:00
dnl ---------------
dnl libyang
dnl ---------------
2021-05-04 16:41:58 +02:00
PKG_CHECK_MODULES([LIBYANG], [libyang >= 2.0.0], , [
AC_MSG_ERROR([libyang (>= 2.0.0) was not found on your system.])
2017-12-07 20:31:48 +01:00
])
2019-01-30 18:11:54 +01:00
ac_cflags_save="$CFLAGS"
CFLAGS="$CFLAGS $LIBYANG_CFLAGS"
2018-11-01 13:41:14 +01:00
AC_CHECK_MEMBER([struct lyd_node.priv], [], [
AC_MSG_ERROR([m4_normalize([
libyang needs to be compiled with ENABLE_LYD_PRIV=ON.
2019-02-19 20:53:54 +01:00
Instructions for this are included in the build documentation for your platform at http://docs.frrouting.org/projects/dev-guide/en/latest/building.html])
2018-11-01 13:41:14 +01:00
])
], [[#include <libyang/libyang.h>]])
2019-01-30 18:11:54 +01:00
CFLAGS="$ac_cflags_save"
2017-12-07 20:31:48 +01:00
dnl ---------------
dnl configuration rollbacks
dnl ---------------
SQLITE3=false
if test "$enable_config_rollbacks" = "yes"; then
2019-01-30 18:11:54 +01:00
PKG_CHECK_MODULES([SQLITE3], [sqlite3], [
2018-11-14 12:23:49 +01:00
AC_DEFINE([HAVE_CONFIG_ROLLBACKS], [1], [Enable configuration rollbacks])
AC_DEFINE([HAVE_SQLITE3], [1], [Enable sqlite3 database])
2017-12-07 20:31:48 +01:00
SQLITE3=true
], [
AC_MSG_ERROR([--enable-config-rollbacks given but sqlite3 was not found on your system.])
])
fi
2018-05-24 01:11:59 +02:00
dnl ---------------
dnl confd
dnl ---------------
if test "$enable_confd" != "" -a "$enable_confd" != "no"; then
2018-11-16 23:41:16 +01:00
AC_CHECK_PROG([CONFD], [confd], [confd], [/bin/false], "${enable_confd}/bin")
2020-03-11 12:09:13 +01:00
if test "$CONFD" = "/bin/false"; then
2018-05-24 01:11:59 +02:00
AC_MSG_ERROR([confd was not found on your system.])]
fi
CONFD_CFLAGS="-I${enable_confd}/include -L${enable_confd}/lib"
2018-11-14 12:23:49 +01:00
AC_SUBST([CONFD_CFLAGS])
2019-02-18 17:14:33 +01:00
CONFD_LIBS="-lconfd"
AC_SUBST([CONFD_LIBS])
2018-11-14 12:23:49 +01:00
AC_DEFINE([HAVE_CONFD], [1], [Enable confd integration])
2018-05-24 01:11:59 +02:00
fi
2018-05-24 01:12:29 +02:00
dnl ---------------
dnl sysrepo
dnl ---------------
if test "$enable_sysrepo" = "yes"; then
2021-01-16 06:38:18 +01:00
PKG_CHECK_MODULES([SYSREPO], [sysrepo],
2018-11-14 12:23:49 +01:00
[AC_DEFINE([HAVE_SYSREPO], [1], [Enable sysrepo integration])
2018-05-24 01:12:29 +02:00
SYSREPO=true],
[SYSREPO=false
AC_MSG_ERROR([sysrepo was not found on your system.])]
)
fi
2019-01-25 21:54:16 +01:00
dnl ---------------
dnl gRPC
dnl ---------------
if test "$enable_grpc" = "yes"; then
2021-05-20 08:46:34 +02:00
AC_LANG_PUSH([C++])
2021-05-20 08:46:34 +02:00
AX_CXX_COMPILE_STDCXX([11], [ext])
PKG_CHECK_MODULES([GRPC], [grpc >= 6.0.0 grpc++ >= 1.16.1 protobuf >= 3.6.1 ], [
2019-01-25 21:54:16 +01:00
AC_CHECK_PROGS([PROTOC], [protoc], [/bin/false])
if test "$PROTOC" = "/bin/false"; then
AC_MSG_FAILURE([grpc requested but protoc not found.])
fi
AC_DEFINE([HAVE_GRPC], [1], [Enable the gRPC northbound plugin])
GRPC=true
], [
GRPC=false
AC_MSG_ERROR([grpc/grpc++ were not found on your system.])
])
2021-05-20 08:46:34 +02:00
AC_LANG_POP([C++])
2019-01-25 21:54:16 +01:00
fi
2020-09-15 00:02:56 +02:00
dnl -----
dnl LTTng
dnl -----
if test "$enable_lttng" = "yes"; then
2021-09-23 15:58:52 +02:00
PKG_CHECK_MODULES([UST], [lttng-ust >= 2.9.0], [
2020-09-15 00:02:56 +02:00
AC_DEFINE([HAVE_LTTNG], [1], [Enable LTTng support])
LTTNG=true
], [
AC_MSG_ERROR([configuration specifies --enable-lttng but lttng-ust was not found])
])
fi
2020-09-28 23:22:53 +02:00
dnl ----
dnl USDT
dnl ----
if test "$enable_usdt" = "yes"; then
AC_CHECK_HEADERS([sys/sdt.h], [
AC_DEFINE([HAVE_USDT], [1], [Enable USDT probes])
USDT=true
], [
AC_MSG_ERROR([configuration specifies --enable-usdt but no USDT kernel headers (sys/sdt.h) found])
])
fi
2019-06-04 15:35:16 +02:00
dnl ------
dnl ZeroMQ
dnl ------
2020-03-11 12:09:13 +01:00
if test "$enable_zeromq" != "no"; then
2019-06-04 15:35:16 +02:00
PKG_CHECK_MODULES([ZEROMQ], [libzmq >= 4.0.0], [
AC_DEFINE([HAVE_ZEROMQ], [1], [Enable ZeroMQ support])
ZEROMQ=true
], [
2020-03-11 12:09:13 +01:00
if test "$enable_zeromq" = "yes"; then
2019-06-04 15:35:16 +02:00
AC_MSG_ERROR([configuration specifies --enable-zeromq but libzmq was not found])
fi
])
fi
dnl ------------------------------------
dnl Enable RPKI and add librtr to libs
dnl ------------------------------------
2020-03-11 12:30:47 +01:00
if test "$enable_rpki" = "yes"; then
2019-06-04 15:35:16 +02:00
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
2020-03-18 17:49:37 +01:00
dnl ------------------------------------
2020-03-19 11:55:42 +01:00
dnl pimd is not supported on OpenBSD and MacOS
2020-03-18 17:49:37 +01:00
dnl ------------------------------------
if test "$enable_pimd" != "no"; then
AC_MSG_CHECKING([for pimd OS support])
case "$host_os" in
2020-03-19 11:55:42 +01:00
darwin*)
AC_MSG_RESULT([no])
enable_pimd="no"
;;
2020-03-18 17:49:37 +01:00
openbsd*)
AC_MSG_RESULT([no])
enable_pimd="no"
;;
*)
AC_MSG_RESULT([yes])
;;
esac
fi
2020-03-17 22:26:20 +01:00
dnl -------------------------------------
dnl VRRP is only supported on linux
dnl -------------------------------------
if test "$enable_vrrpd" != "no"; then
AC_MSG_CHECKING([for VRRP OS support])
case "$host_os" in
linux*)
AC_MSG_RESULT([yes])
;;
*)
AC_MSG_RESULT([no])
enable_vrrpd="no"
;;
esac
fi
2019-06-04 15:35:16 +02:00
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], [1], [found_ssh])],
AC_MSG_RESULT([no])
)
2017-05-30 02:16:52 +02:00
2017-02-12 23:23:02 +01:00
dnl ---------------
dnl dlopen & dlinfo
dnl ---------------
2018-11-14 12:23:49 +01:00
AC_SEARCH_LIBS([dlopen], [dl dld], [], [
2016-05-31 19:25:46 +02:00
AC_MSG_ERROR([unable to find the dlopen()])
])
2017-02-12 23:23:02 +01:00
AC_CHECK_HEADERS([link.h])
2018-08-18 08:03:02 +02:00
AC_CACHE_CHECK([for dlinfo(RTLD_DI_ORIGIN)], [frr_cv_rtld_di_origin], [
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
2017-02-12 23:23:02 +01:00
#include <stdlib.h>
#ifdef HAVE_LINK_H
#include <link.h>
#endif
#include <dlfcn.h>
]], [[
char origin[1];
dlinfo (NULL, RTLD_DI_ORIGIN, &origin);
]])], [
2018-08-18 08:03:02 +02:00
frr_cv_rtld_di_origin=yes
], [
frr_cv_rtld_di_origin=no
])
2017-02-12 23:23:02 +01:00
])
2020-03-11 11:53:15 +01:00
if test "$frr_cv_rtld_di_origin" = "yes"; then
2018-11-14 12:23:49 +01:00
AC_DEFINE([HAVE_DLINFO_ORIGIN], [1], [Have dlinfo RTLD_DI_ORIGIN])
2018-08-18 08:03:02 +02:00
fi
2017-02-12 23:23:02 +01:00
2018-08-18 08:03:02 +02:00
AC_CACHE_CHECK([for dlinfo(RTLD_DI_LINKMAP)], [frr_cv_rtld_di_linkmap], [
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
2017-02-12 23:23:02 +01:00
#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);
]])], [
2018-08-18 08:03:02 +02:00
frr_cv_rtld_di_linkmap=yes
], [
frr_cv_rtld_di_linkmap=no
])
2017-02-12 23:23:02 +01:00
])
2020-03-11 11:53:15 +01:00
if test "$frr_cv_rtld_di_linkmap" = "yes"; then
2018-11-14 12:23:49 +01:00
AC_DEFINE([HAVE_DLINFO_LINKMAP], [1], [Have dlinfo RTLD_DI_LINKMAP])
2018-08-18 08:03:02 +02:00
fi
2005-01-12 17:52:55 +01:00
2019-06-04 15:35:16 +02:00
dnl ##########################################################################
2020-03-11 12:30:47 +01:00
dnl test "$enable_clippy_only" != "yes"
2019-06-04 15:35:16 +02:00
fi
dnl END OF LARGE if block
dnl ##########################################################################
2017-05-05 21:28:38 +02:00
2003-03-17 03:05:07 +01:00
dnl ---------------------------
[autoconf] bugs 162,303,178: Fix 'present but can not be compiled' warnings
2007-05-09 Paul Jakma <paul.jakma@sun.com>
* configure.ac: sys/conf.h depends on sys/param.h, at least on
FBSD 6.2.
(bug #363) Should check for in_pktinfo for IRDP
2006-05-27 Paul Jakma <paul.jakma@sun.com>
* configure.ac: General cleanup of header and type checks, introducing
an internal define, QUAGGA_INCLUDES, to build up a list of
stuff to include so as to avoid 'present but cant be compiled'
warnings.
Misc additional checks of things missing according to autoscan.
Add LIBM, for bgpd's use of libm, so as to avoid burdening
LIBS, and all the binaries, with libm linkage.
Remove the bad practice of using m4 changequote(), just
quote the []'s in the case statements properly.
This should fix bugs 162, 303 and 178.
* */*.{c,h}: Update all HAVE_* to the standard autoconf namespaced
HAVE_* defines. I.e. HAVE_SA_LEN -> HAVE_STRUCT_SOCKADDR_SA_LEN,
* bgpd/Makefile.am: Add LIBM to bgpd's LDADD, for pow().
2007-05-10 04:38:51 +02:00
dnl sockaddr and netinet checks
2003-03-17 03:05:07 +01:00
dnl ---------------------------
2016-11-15 05:37:14 +01:00
AC_CHECK_TYPES([
struct sockaddr_dl,
struct vifctl, struct mfcctl, struct sioc_sg_req,
2015-02-04 07:01:14 +01:00
vifi_t, struct sioc_vif_req, struct igmpmsg,
[autoconf] bugs 162,303,178: Fix 'present but can not be compiled' warnings
2007-05-09 Paul Jakma <paul.jakma@sun.com>
* configure.ac: sys/conf.h depends on sys/param.h, at least on
FBSD 6.2.
(bug #363) Should check for in_pktinfo for IRDP
2006-05-27 Paul Jakma <paul.jakma@sun.com>
* configure.ac: General cleanup of header and type checks, introducing
an internal define, QUAGGA_INCLUDES, to build up a list of
stuff to include so as to avoid 'present but cant be compiled'
warnings.
Misc additional checks of things missing according to autoscan.
Add LIBM, for bgpd's use of libm, so as to avoid burdening
LIBS, and all the binaries, with libm linkage.
Remove the bad practice of using m4 changequote(), just
quote the []'s in the case statements properly.
This should fix bugs 162, 303 and 178.
* */*.{c,h}: Update all HAVE_* to the standard autoconf namespaced
HAVE_* defines. I.e. HAVE_SA_LEN -> HAVE_STRUCT_SOCKADDR_SA_LEN,
* bgpd/Makefile.am: Add LIBM to bgpd's LDADD, for pow().
2007-05-10 04:38:51 +02:00
struct ifaliasreq, struct if6_aliasreq, struct in6_aliasreq,
2019-06-04 14:12:30 +02:00
struct nd_opt_adv_interval,
2019-01-26 23:51:48 +01:00
struct nd_opt_homeagent_info, struct nd_opt_adv_interval,
struct nd_opt_rdnss, struct nd_opt_dnssl],
2016-12-14 20:22:59 +01:00
[], [], FRR_INCLUDES)
[autoconf] bugs 162,303,178: Fix 'present but can not be compiled' warnings
2007-05-09 Paul Jakma <paul.jakma@sun.com>
* configure.ac: sys/conf.h depends on sys/param.h, at least on
FBSD 6.2.
(bug #363) Should check for in_pktinfo for IRDP
2006-05-27 Paul Jakma <paul.jakma@sun.com>
* configure.ac: General cleanup of header and type checks, introducing
an internal define, QUAGGA_INCLUDES, to build up a list of
stuff to include so as to avoid 'present but cant be compiled'
warnings.
Misc additional checks of things missing according to autoscan.
Add LIBM, for bgpd's use of libm, so as to avoid burdening
LIBS, and all the binaries, with libm linkage.
Remove the bad practice of using m4 changequote(), just
quote the []'s in the case statements properly.
This should fix bugs 162, 303 and 178.
* */*.{c,h}: Update all HAVE_* to the standard autoconf namespaced
HAVE_* defines. I.e. HAVE_SA_LEN -> HAVE_STRUCT_SOCKADDR_SA_LEN,
* bgpd/Makefile.am: Add LIBM to bgpd's LDADD, for pow().
2007-05-10 04:38:51 +02:00
AC_CHECK_MEMBERS([struct sockaddr.sa_len,
struct sockaddr_in.sin_len, struct sockaddr_un.sun_len,
2012-09-26 14:52:39 +02:00
struct sockaddr_dl.sdl_len,
[autoconf] bugs 162,303,178: Fix 'present but can not be compiled' warnings
2007-05-09 Paul Jakma <paul.jakma@sun.com>
* configure.ac: sys/conf.h depends on sys/param.h, at least on
FBSD 6.2.
(bug #363) Should check for in_pktinfo for IRDP
2006-05-27 Paul Jakma <paul.jakma@sun.com>
* configure.ac: General cleanup of header and type checks, introducing
an internal define, QUAGGA_INCLUDES, to build up a list of
stuff to include so as to avoid 'present but cant be compiled'
warnings.
Misc additional checks of things missing according to autoscan.
Add LIBM, for bgpd's use of libm, so as to avoid burdening
LIBS, and all the binaries, with libm linkage.
Remove the bad practice of using m4 changequote(), just
quote the []'s in the case statements properly.
This should fix bugs 162, 303 and 178.
* */*.{c,h}: Update all HAVE_* to the standard autoconf namespaced
HAVE_* defines. I.e. HAVE_SA_LEN -> HAVE_STRUCT_SOCKADDR_SA_LEN,
* bgpd/Makefile.am: Add LIBM to bgpd's LDADD, for pow().
2007-05-10 04:38:51 +02:00
struct if6_aliasreq.ifra_lifetime,
struct nd_opt_adv_interval.nd_opt_ai_type],
2016-12-14 20:22:59 +01:00
[], [], FRR_INCLUDES)
2005-03-25 14:05:47 +01:00
[autoconf] bugs 162,303,178: Fix 'present but can not be compiled' warnings
2007-05-09 Paul Jakma <paul.jakma@sun.com>
* configure.ac: sys/conf.h depends on sys/param.h, at least on
FBSD 6.2.
(bug #363) Should check for in_pktinfo for IRDP
2006-05-27 Paul Jakma <paul.jakma@sun.com>
* configure.ac: General cleanup of header and type checks, introducing
an internal define, QUAGGA_INCLUDES, to build up a list of
stuff to include so as to avoid 'present but cant be compiled'
warnings.
Misc additional checks of things missing according to autoscan.
Add LIBM, for bgpd's use of libm, so as to avoid burdening
LIBS, and all the binaries, with libm linkage.
Remove the bad practice of using m4 changequote(), just
quote the []'s in the case statements properly.
This should fix bugs 162, 303 and 178.
* */*.{c,h}: Update all HAVE_* to the standard autoconf namespaced
HAVE_* defines. I.e. HAVE_SA_LEN -> HAVE_STRUCT_SOCKADDR_SA_LEN,
* bgpd/Makefile.am: Add LIBM to bgpd's LDADD, for pow().
2007-05-10 04:38:51 +02:00
dnl ---------------------------
2007-06-22 18:14:42 +02:00
dnl IRDP/pktinfo/icmphdr checks
[autoconf] bugs 162,303,178: Fix 'present but can not be compiled' warnings
2007-05-09 Paul Jakma <paul.jakma@sun.com>
* configure.ac: sys/conf.h depends on sys/param.h, at least on
FBSD 6.2.
(bug #363) Should check for in_pktinfo for IRDP
2006-05-27 Paul Jakma <paul.jakma@sun.com>
* configure.ac: General cleanup of header and type checks, introducing
an internal define, QUAGGA_INCLUDES, to build up a list of
stuff to include so as to avoid 'present but cant be compiled'
warnings.
Misc additional checks of things missing according to autoscan.
Add LIBM, for bgpd's use of libm, so as to avoid burdening
LIBS, and all the binaries, with libm linkage.
Remove the bad practice of using m4 changequote(), just
quote the []'s in the case statements properly.
This should fix bugs 162, 303 and 178.
* */*.{c,h}: Update all HAVE_* to the standard autoconf namespaced
HAVE_* defines. I.e. HAVE_SA_LEN -> HAVE_STRUCT_SOCKADDR_SA_LEN,
* bgpd/Makefile.am: Add LIBM to bgpd's LDADD, for pow().
2007-05-10 04:38:51 +02:00
dnl ---------------------------
2017-08-06 09:19:14 +02:00
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
2005-03-25 14:05:47 +01:00
2015-02-04 07:01:14 +01:00
dnl -----------------------
dnl checking for IP_PKTINFO
dnl -----------------------
2018-11-14 12:23:49 +01:00
AC_MSG_CHECKING([for IP_PKTINFO])
2021-04-21 12:33:47 +02:00
AC_COMPILE_IFELSE(
[ AC_LANG_PROGRAM([[
#include <netdb.h>
]], [[
int opt = IP_PKTINFO;
]])
],[
2018-11-14 12:23:49 +01:00
AC_MSG_RESULT([yes])
AC_DEFINE([HAVE_IP_PKTINFO], [1], [Have IP_PKTINFO])
2021-04-21 12:33:47 +02:00
],[
2018-11-14 12:23:49 +01:00
AC_MSG_RESULT([no])
2015-02-04 07:01:14 +01:00
])
dnl ---------------------------
dnl checking for IP_RECVDSTADDR
dnl ---------------------------
2018-11-14 12:23:49 +01:00
AC_MSG_CHECKING([for IP_RECVDSTADDR])
2021-04-21 12:33:47 +02:00
AC_COMPILE_IFELSE(
[ AC_LANG_PROGRAM([[
#include <netinet/in.h>
]], [[
int opt = IP_RECVDSTADDR;
]])
],[
2018-11-14 12:23:49 +01:00
AC_MSG_RESULT([yes])
AC_DEFINE([HAVE_IP_RECVDSTADDR], [1], [Have IP_RECVDSTADDR])
2021-04-21 12:33:47 +02:00
],[
2018-11-14 12:23:49 +01:00
AC_MSG_RESULT([no])
2015-02-04 07:01:14 +01:00
])
dnl ----------------------
dnl checking for IP_RECVIF
dnl ----------------------
2018-11-14 12:23:49 +01:00
AC_MSG_CHECKING([for IP_RECVIF])
2021-04-21 12:33:47 +02:00
AC_COMPILE_IFELSE(
[ AC_LANG_PROGRAM([[
#include <netinet/in.h>
]], [[
int opt = IP_RECVIF;
]])
],[
2018-11-14 12:23:49 +01:00
AC_MSG_RESULT([yes])
AC_DEFINE([HAVE_IP_RECVIF], [1], [Have IP_RECVIF])
2021-04-21 12:33:47 +02:00
],[
2018-11-14 12:23:49 +01:00
AC_MSG_RESULT([no])
2015-02-04 07:01:14 +01:00
])
2016-03-01 19:31:28 +01:00
dnl ----------------------
dnl checking for SO_BINDANY
dnl ----------------------
2018-11-14 12:23:49 +01:00
AC_MSG_CHECKING([for SO_BINDANY])
2021-04-21 12:33:47 +02:00
AC_COMPILE_IFELSE(
[ AC_LANG_PROGRAM([[
#include <sys/socket.h>
]], [[
int opt = SO_BINDANY;
]])
],[
2018-11-14 12:23:49 +01:00
AC_MSG_RESULT([yes])
AC_DEFINE([HAVE_SO_BINDANY], [1], [Have SO_BINDANY])
2021-04-21 12:33:47 +02:00
],[
2018-11-14 12:23:49 +01:00
AC_MSG_RESULT([no])
2016-03-01 19:31:28 +01:00
])
dnl ----------------------
dnl checking for IP_FREEBIND
dnl ----------------------
2018-11-14 12:23:49 +01:00
AC_MSG_CHECKING([for IP_FREEBIND])
2021-04-21 12:33:47 +02:00
AC_COMPILE_IFELSE(
[ AC_LANG_PROGRAM([[
#include <netinet/in.h>
]], [[
int opt = IP_FREEBIND;
]])
],[
2018-11-14 12:23:49 +01:00
AC_MSG_RESULT([yes])
AC_DEFINE([HAVE_IP_FREEBIND], [1], [Have IP_FREEBIND])
2021-04-21 12:33:47 +02:00
],[
2018-11-14 12:23:49 +01:00
AC_MSG_RESULT([no])
2016-03-01 19:31:28 +01:00
])
2017-04-27 03:46:10 +02:00
dnl --------------------------------------
dnl checking for be32dec existence or not
dnl --------------------------------------
2021-04-21 12:23:14 +02:00
AC_CHECK_DECLS([be32enc, be32dec], [], [], [
#ifdef HAVE_SYS_ENDIAN_H
#include <sys/endian.h>
#endif
#ifdef HAVE_ENDIAN_H
#include <endian.h>
#endif
])
2017-04-27 03:46:10 +02:00
2009-05-29 00:29:10 +02:00
dnl --------------------------------------
dnl checking for clock_time monotonic struct and call
dnl --------------------------------------
2018-11-14 12:23:49 +01:00
AC_CHECK_DECL([CLOCK_MONOTONIC],
[AC_CHECK_LIB([rt], [clock_gettime], [LIBS="$LIBS -lrt"])
AC_DEFINE([HAVE_CLOCK_MONOTONIC], [1], [Have monotonic clock])
], [AC_MSG_RESULT([no])], [FRR_INCLUDES])
2009-05-29 00:29:10 +02:00
2021-04-13 20:49:26 +02:00
AC_CHECK_DECL([CLOCK_THREAD_CPUTIME_ID], [
AC_DEFINE([HAVE_CLOCK_THREAD_CPUTIME_ID], [1], [Have cpu-time clock])
], [AC_MSG_RESULT([no])], [FRR_INCLUDES])
2019-12-10 17:23:25 +01:00
AC_SEARCH_LIBS([clock_nanosleep], [rt], [
AC_DEFINE([HAVE_CLOCK_NANOSLEEP], [1], [Have clock_nanosleep()])
])
2016-07-11 21:34:13 +02:00
dnl --------------------------------------
dnl checking for flex and bison
dnl --------------------------------------
2016-12-16 01:24:53 +01:00
2016-07-11 21:34:13 +02:00
AM_PROG_LEX
2018-11-14 12:23:49 +01:00
AC_MSG_CHECKING([version of flex])
2017-07-12 18:25:33 +02:00
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], [
2016-12-16 01:24:53 +01:00
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], [''])
])
2016-12-16 00:37:52 +01:00
2016-07-11 21:34:13 +02:00
AC_PROG_YACC
2016-12-16 00:37:52 +01:00
dnl thanks GNU bison for this b*llshit...
2018-11-14 12:23:49 +01:00
AC_MSG_CHECKING([version of bison])
2017-07-12 18:25:33 +02:00
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"
2019-06-04 14:23:29 +02:00
case "x${frr_ac_bison_version}x" in
2016-12-16 00:37:52 +01:00
x2.7*)
BISON_OPENBRACE='"'
BISON_CLOSEBRACE='"'
2017-01-23 23:26:23 +01:00
BISON_VERBOSE=''
2017-07-12 18:25:33 +02:00
AC_MSG_RESULT([$frr_ac_bison_version - 2.7 or older])
2016-12-16 00:37:52 +01:00
;;
x2.*|x1.*)
2017-07-12 18:25:33 +02:00
AC_MSG_RESULT([$frr_ac_bison_version])
2016-12-16 00:37:52 +01:00
AC_MSG_WARN([installed bison is too old. Please install GNU bison 2.7.x or newer.])
2017-07-12 18:25:33 +02:00
frr_ac_bison_missing="true"
2016-12-16 00:37:52 +01:00
;;
x)
AC_MSG_RESULT([none])
AC_MSG_WARN([could not determine bison version. Please install GNU bison 2.7.x or newer.])
2017-07-12 18:25:33 +02:00
frr_ac_bison_missing="true"
2016-12-16 00:37:52 +01:00
;;
2019-06-04 14:23:29 +02:00
x3.[012][^0-9]*)
2016-12-16 00:37:52 +01:00
BISON_OPENBRACE='{'
BISON_CLOSEBRACE='}'
2017-01-23 23:26:23 +01:00
BISON_VERBOSE='-Dparse.error=verbose'
2019-06-04 14:23:29 +02:00
AC_MSG_RESULT([$frr_ac_bison_version - 3.0 to 3.2])
;;
*)
BISON_OPENBRACE='{'
BISON_CLOSEBRACE='}'
BISON_VERBOSE='-Dparse.error=verbose -Wno-yacc'
AC_MSG_RESULT([$frr_ac_bison_version - 3.3 or newer])
2016-12-16 00:37:52 +01:00
;;
esac
2018-11-14 12:23:49 +01:00
AC_SUBST([BISON_OPENBRACE])
AC_SUBST([BISON_CLOSEBRACE])
AC_SUBST([BISON_VERBOSE])
2016-12-16 00:37:52 +01:00
2017-07-12 18:25:33 +02:00
if $frr_ac_bison_missing; then
2016-12-16 00:37:52 +01:00
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
2016-07-11 21:34:13 +02:00
2003-06-04 15:59:38 +02:00
dnl -------------------
dnl capabilities checks
dnl -------------------
2020-03-11 12:30:47 +01:00
if test "$enable_capabilities" != "no"; then
2018-11-14 12:23:49 +01:00
AC_MSG_CHECKING([whether prctl PR_SET_KEEPCAPS is available])
2021-04-21 12:33:47 +02:00
AC_COMPILE_IFELSE(
[ AC_LANG_PROGRAM([[
#include <sys/prctl.h>
]], [[
prctl(PR_SET_KEEPCAPS, 1, 0, 0, 0);
]])
],[AC_MSG_RESULT([yes])
2018-11-14 12:23:49 +01:00
AC_DEFINE([HAVE_PR_SET_KEEPCAPS], [1], [prctl])
2021-04-21 12:33:47 +02:00
frr_ac_keepcaps="yes"
],[AC_MSG_RESULT(no)
])
2020-03-11 12:30:47 +01:00
if test "$frr_ac_keepcaps" = "yes"; then
2018-11-14 12:23:49 +01:00
AC_CHECK_HEADERS([sys/capability.h])
2004-04-06 13:59:00 +02:00
fi
2020-03-11 12:30:47 +01:00
if test "$ac_cv_header_sys_capability_h" = "yes"; then
2020-03-11 12:09:13 +01:00
AC_CHECK_LIB([cap], [cap_init],
2018-11-14 12:23:49 +01:00
[AC_DEFINE([HAVE_LCAPS], [1], [Capabilities])
2004-04-06 13:59:00 +02:00
LIBCAP="-lcap"
2016-12-14 20:22:59 +01:00
frr_ac_lcaps="yes"]
2004-04-06 13:59:00 +02:00
)
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
fi
2020-03-11 12:30:47 +01:00
if test "$frr_ac_scaps" = "yes" \
-o "$frr_ac_lcaps" = "yes"; then
2018-11-14 12:23:49 +01:00
AC_DEFINE([HAVE_CAPABILITIES], [1], [capabilities])
2004-04-06 13:59:00 +02:00
fi
2019-09-02 20:52:56 +02:00
case "$host_os" in
linux*)
2020-03-11 12:30:47 +01:00
if test "$enable_clippy_only" != "yes"; then
2019-09-02 20:52:56 +02:00
if test "$frr_ac_lcaps" != "yes"; then
AC_MSG_ERROR([libcap and/or its headers were not found. Running FRR without libcap support built in causes a huge performance penalty.])
fi
2019-09-13 06:16:18 +02:00
fi
2019-09-02 20:52:56 +02:00
;;
esac
else
case "$host_os" in
linux*)
AC_MSG_WARN([Running FRR without libcap support built in causes a huge performance penalty.])
;;
esac
2003-06-04 15:59:38 +02:00
fi
2018-11-14 12:23:49 +01:00
AC_SUBST([LIBCAP])
2003-06-04 15:59:38 +02:00
2003-06-04 11:40:54 +02:00
dnl ---------------------------
dnl check for glibc 'backtrace'
2020-03-11 12:09:13 +01:00
dnl ---------------------------
2020-03-11 12:30:47 +01:00
if test "$enable_backtrace" != "no" ; then
2013-08-01 09:43:36 +02:00
backtrace_ok=no
2017-08-24 16:09:48 +02:00
PKG_CHECK_MODULES([UNWIND], [libunwind], [
2018-11-14 12:23:49 +01:00
AC_DEFINE([HAVE_LIBUNWIND], [1], [libunwind])
2017-08-24 16:09:48 +02:00
backtrace_ok=yes
], [
2020-01-17 13:57:15 +01:00
true
])
if test "$backtrace_ok" = "no"; then
AC_CHECK_HEADER([unwind.h], [
AC_SEARCH_LIBS([unw_getcontext], [unwind], [
AC_DEFINE([HAVE_LIBUNWIND], [1], [libunwind])
backtrace_ok=yes
])
])
fi
if test "$backtrace_ok" = "no"; then
2017-05-06 06:40:17 +02:00
AC_CHECK_HEADER([execinfo.h], [
AC_SEARCH_LIBS([backtrace], [execinfo], [
AC_DEFINE([HAVE_GLIBC_BACKTRACE], [1], [Glibc backtrace])
2017-08-24 16:09:48 +02:00
backtrace_ok=yes
2017-05-06 06:40:17 +02:00
],, [-lm])
])
2020-01-17 13:57:15 +01:00
fi
2013-08-01 09:43:36 +02:00
2020-03-11 12:30:47 +01:00
if test "$enable_backtrace" = "yes" -a "$backtrace_ok" = "no"; then
2013-08-01 09:43:36 +02:00
dnl user explicitly requested backtrace but we failed to find support
2017-08-24 16:09:48 +02:00
AC_MSG_FAILURE([failed to find backtrace or libunwind support])
2013-08-01 09:43:36 +02:00
fi
fi
2003-06-04 11:40:54 +02:00
2006-03-30 15:53:59 +02:00
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
2020-09-09 05:59:18 +02:00
dnl mallinfo
2006-03-30 15:53:59 +02:00
dnl -----------------------------------------
2018-09-04 12:24:22 +02:00
AC_CHECK_HEADERS([malloc.h malloc_np.h malloc/malloc.h],,, [FRR_INCLUDES])
2018-08-08 16:33:13 +02:00
2018-08-18 08:03:02 +02:00
AC_CACHE_CHECK([whether mallinfo is available], [frr_cv_mallinfo], [
AC_LINK_IFELSE([AC_LANG_PROGRAM([FRR_INCLUDES [
2018-08-08 16:33:13 +02:00
#ifdef HAVE_MALLOC_H
#include <malloc.h>
#endif
2018-09-04 12:24:22 +02:00
#ifdef HAVE_MALLOC_NP_H
#include <malloc_np.h>
#endif
2018-08-08 16:33:13 +02:00
#ifdef HAVE_MALLOC_MALLOC_H
#include <malloc/malloc.h>
#endif
]], [[
struct mallinfo ac_x; ac_x = mallinfo ();
]])], [
2018-08-18 08:03:02 +02:00
frr_cv_mallinfo=yes
], [
frr_cv_mallinfo=no
])
2018-08-08 16:33:13 +02:00
])
2020-03-11 11:53:15 +01:00
if test "$frr_cv_mallinfo" = "yes"; then
2018-11-14 12:23:49 +01:00
AC_DEFINE([HAVE_MALLINFO], [1], [mallinfo])
2018-08-18 08:03:02 +02:00
fi
2018-08-08 16:33:13 +02:00
2021-02-08 07:56:07 +01:00
AC_CACHE_CHECK([whether mallinfo2 is available], [frr_cv_mallinfo2], [
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 mallinfo2 ac_x; ac_x = mallinfo2 ();
]])], [
frr_cv_mallinfo2=yes
], [
frr_cv_mallinfo2=no
])
])
if test "$frr_cv_mallinfo2" = "yes"; then
AC_DEFINE([HAVE_MALLINFO2], [1], [mallinfo2])
fi
2018-11-14 12:23:49 +01:00
AC_MSG_CHECKING([whether malloc_usable_size is available])
2018-08-08 16:33:13 +02:00
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);
]])], [
2018-11-14 12:23:49 +01:00
AC_MSG_RESULT([yes])
AC_DEFINE([HAVE_MALLOC_USABLE_SIZE], [1], [malloc_usable_size])
2018-08-08 16:33:13 +02:00
], [
2018-11-14 12:23:49 +01:00
AC_MSG_RESULT([no])
2018-08-08 16:33:13 +02:00
2018-11-14 12:23:49 +01:00
AC_MSG_CHECKING([whether malloc_size is available])
2018-08-08 16:33:13 +02:00
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);
]])], [
2018-11-14 12:23:49 +01:00
AC_MSG_RESULT([yes])
AC_DEFINE([HAVE_MALLOC_SIZE], [1], [malloc_size])
2018-08-08 16:33:13 +02:00
], [
2018-11-14 12:23:49 +01:00
AC_MSG_RESULT([no])
2018-08-08 16:33:13 +02:00
])
])
2006-03-30 15:53:59 +02:00
2003-05-20 02:03:33 +02:00
dnl ----------
dnl configure date
dnl ----------
2018-07-10 21:43:09 +02:00
dev_version=`echo $VERSION | grep dev`
#don't expire deprecated code in non 'dev' branch
2020-03-11 12:30:47 +01:00
if test "$dev_version" = ""; then
2018-07-10 21:43:09 +02:00
CONFDATE=0
else
CONFDATE=`date '+%Y%m%d'`
fi
2018-11-14 12:23:49 +01:00
AC_SUBST([CONFDATE])
2003-05-20 02:03:33 +02:00
2003-03-17 03:05:07 +01:00
dnl ------------------------------
2003-06-04 13:01:45 +02:00
dnl set paths for state directory
2003-04-07 08:11:09 +02:00
dnl ------------------------------
2018-11-14 12:23:49 +01:00
AC_MSG_CHECKING([directory to use for state file])
2020-03-11 12:30:47 +01:00
if test "$prefix" = "NONE"; then
2016-12-14 19:30:44 +01:00
frr_statedir_prefix="";
2003-04-07 08:11:09 +02:00
else
2016-12-14 19:30:44 +01:00
frr_statedir_prefix=${prefix}
2003-04-07 08:11:09 +02:00
fi
2020-03-11 12:30:47 +01:00
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
2016-12-14 19:30:44 +01:00
${frr_statedir_prefix}/var/adm dnl
${frr_statedir_prefix}/etc dnl
2003-06-04 13:01:45 +02:00
/var/run dnl
/var/adm dnl
/etc dnl
/dev/null;
2003-04-07 08:11:09 +02:00
do
2016-12-14 20:22:59 +01:00
test -d $FRR_STATE_DIR && break
2003-04-07 08:11:09 +02:00
done
2016-12-14 20:22:59 +01:00
frr_statedir=$FRR_STATE_DIR
2003-04-07 08:11:09 +02:00
else
2016-12-14 19:30:44 +01:00
frr_statedir=${localstatedir}
2003-06-04 13:01:45 +02:00
fi
2020-03-11 11:27:04 +01:00
if test "$frr_statedir" = "/dev/null"; then
2018-11-14 12:23:49 +01:00
AC_MSG_ERROR([STATE DIRECTORY NOT FOUND! FIX OR SPECIFY --localstatedir!])
2003-06-04 13:01:45 +02:00
fi
2018-11-14 12:23:49 +01:00
AC_MSG_RESULT([${frr_statedir}])
AC_SUBST([frr_statedir])
2016-12-14 19:30:44 +01:00
2019-05-31 01:23:15 +02:00
AC_DEFINE_UNQUOTED([LDPD_SOCKET], ["$frr_statedir%s%s/ldpd.sock"], [ldpd control socket])
2019-05-31 00:51:00 +02:00
AC_DEFINE_UNQUOTED([ZEBRA_SERV_PATH], ["$frr_statedir%s%s/zserv.api"], [zebra api socket])
2019-05-31 01:10:35 +02:00
AC_DEFINE_UNQUOTED([BFDD_CONTROL_SOCKET], ["$frr_statedir%s%s/bfdd.sock"], [bfdd control socket])
2021-05-31 15:27:51 +02:00
AC_DEFINE_UNQUOTED([OSPFD_GR_STATE], ["$frr_statedir%s/ospfd-gr.json"], [ospfd GR state information])
2021-07-02 18:01:32 +02:00
AC_DEFINE_UNQUOTED([OSPF6D_GR_STATE], ["$frr_statedir/ospf6d-gr.json"], [ospf6d GR state information])
2019-05-31 01:55:26 +02:00
AC_DEFINE_UNQUOTED([DAEMON_VTY_DIR], ["$frr_statedir%s%s"], [daemon vty directory])
2018-11-14 12:23:49 +01:00
AC_DEFINE_UNQUOTED([DAEMON_DB_DIR], ["$frr_statedir"], [daemon database directory])
2003-03-17 03:05:07 +01:00
2016-11-09 14:15:34 +01:00
dnl autoconf does this, but it does it too late...
2020-03-11 12:09:13 +01:00
test "$prefix" = "NONE" && prefix=$ac_default_prefix
test "$exec_prefix" = "NONE" && exec_prefix='${prefix}'
2016-11-09 14:15:34 +01:00
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
2018-11-14 12:23:49 +01:00
AC_DEFINE_UNQUOTED([VTYSH_BIN_PATH], ["$vtysh_bin"], [path to vtysh binary])
AC_SUBST([vtysh_bin])
2016-11-09 14:15:34 +01:00
2016-12-14 20:22:25 +01:00
CFG_SYSCONF="$sysconfdir"
CFG_SBIN="$sbindir"
CFG_STATE="$frr_statedir"
2016-05-31 19:25:46 +02:00
CFG_MODULE="$moduledir"
2017-12-07 20:31:48 +01:00
CFG_YANGMODELS="$yangmodelsdir"
2020-11-30 23:37:18 +01:00
CFG_SCRIPT="$scriptdir"
2016-12-14 20:22:25 +01:00
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\""
2016-05-31 19:25:46 +02:00
eval CFG_MODULE="\"$CFG_MODULE\""
2017-12-07 20:31:48 +01:00
eval CFG_YANGMODELS="\"$CFG_YANGMODELS\""
2020-11-30 23:37:18 +01:00
eval CFG_SCRIPT="\"$CFG_SCRIPT\""
2016-12-14 20:22:25 +01:00
done
2018-11-14 12:23:49 +01:00
AC_SUBST([CFG_SYSCONF])
AC_SUBST([CFG_SBIN])
AC_SUBST([CFG_STATE])
AC_SUBST([CFG_MODULE])
2020-11-30 23:37:18 +01:00
AC_SUBST([CFG_SCRIPT])
2018-11-14 12:23:49 +01:00
AC_SUBST([CFG_YANGMODELS])
AC_DEFINE_UNQUOTED([MODULE_PATH], ["$CFG_MODULE"], [path to modules])
2020-11-30 23:37:18 +01:00
AC_DEFINE_UNQUOTED([SCRIPT_PATH], ["$CFG_SCRIPT"], [path to scripts])
2018-11-14 12:23:49 +01:00
AC_DEFINE_UNQUOTED([YANG_MODELS_PATH], ["$CFG_YANGMODELS"], [path to YANG data models])
2019-01-24 18:17:40 +01:00
AC_DEFINE_UNQUOTED([WATCHFRR_SH_PATH], ["${CFG_SBIN%/}/watchfrr.sh"], [path to watchfrr.sh])
2016-12-14 20:22:25 +01:00
2019-06-04 15:35:16 +02:00
dnl various features
2020-03-11 12:30:47 +01:00
AM_CONDITIONAL([SUPPORT_REALMS], [test "$enable_realms" = "yes"])
AM_CONDITIONAL([ENABLE_BGP_VNC], [test "$enable_bgp_vnc" != "no"])
2019-08-13 16:22:22 +02:00
AM_CONDITIONAL([BGP_BMP], [$bgpd_bmp])
2019-06-04 15:35:16 +02:00
dnl northbound
AM_CONDITIONAL([SQLITE3], [$SQLITE3])
2020-03-11 12:09:13 +01:00
AM_CONDITIONAL([CONFD], [test "$enable_confd" != ""])
AM_CONDITIONAL([SYSREPO], [test "$enable_sysrepo" = "yes"])
AM_CONDITIONAL([GRPC], [test "$enable_grpc" = "yes"])
AM_CONDITIONAL([ZEROMQ], [test "$ZEROMQ" = "true"])
2019-06-04 15:35:16 +02:00
dnl plugins
2020-03-11 12:09:13 +01:00
AM_CONDITIONAL([RPKI], [test "$RPKI" = "true"])
AM_CONDITIONAL([SNMP], [test "$SNMP_METHOD" = "agentx"])
2019-06-04 15:35:16 +02:00
AM_CONDITIONAL([IRDP], [$IRDP])
2020-03-11 12:09:13 +01:00
AM_CONDITIONAL([FPM], [test "$enable_fpm" = "yes"])
AM_CONDITIONAL([HAVE_PROTOBUF], [test "$enable_protobuf" = "yes"])
2019-12-10 20:06:33 +01:00
AM_CONDITIONAL([HAVE_PROTOBUF3], [$PROTO3])
2020-10-16 16:55:51 +02:00
dnl PCEP plugin
2021-01-22 10:38:12 +01:00
AS_IF([test "$enable_pathd" != "no"], [
AC_SUBST([PATHD_PCEP_LIBS], ["pceplib/libpcep_pcc.la"])
AC_SUBST([PATHD_PCEP_INCL], ["-I./pceplib "])
])
AC_CHECK_LIB([cunit], [CU_initialize_registry], [pcep_cunit=yes],[pcep_cunit=no])
AM_CONDITIONAL([PATHD_PCEP_TEST], [test "x${pcep_cunit}" = xyes])
AC_CHECK_PROG(VALGRIND_CHECK, valgrind, yes)
AM_CONDITIONAL([HAVE_VALGRIND_PCEP], [test "$VALGRIND_CHECK" = "yes"])
2020-10-16 16:55:51 +02:00
2019-06-04 15:35:16 +02:00
dnl daemons
2020-03-11 12:09:13 +01:00
AM_CONDITIONAL([VTYSH], [test "$VTYSH" = "vtysh"])
2020-03-11 12:30:47 +01:00
AM_CONDITIONAL([ZEBRA], [test "$enable_zebra" != "no"])
AM_CONDITIONAL([BGPD], [test "$enable_bgpd" != "no"])
AM_CONDITIONAL([RIPD], [test "$enable_ripd" != "no"])
AM_CONDITIONAL([OSPFD], [test "$enable_ospfd" != "no"])
AM_CONDITIONAL([LDPD], [test "$enable_ldpd" != "no"])
2020-03-11 12:09:13 +01:00
AM_CONDITIONAL([BFDD], [test "$BFDD" = "bfdd"])
AM_CONDITIONAL([NHRPD], [test "$NHRPD" = "nhrpd"])
2020-03-11 12:30:47 +01:00
AM_CONDITIONAL([EIGRPD], [test "$enable_eigrpd" != "no"])
2020-03-11 12:09:13 +01:00
AM_CONDITIONAL([WATCHFRR], [test "$WATCHFRR" = "watchfrr"])
AM_CONDITIONAL([OSPFCLIENT], [test "$OSPFCLIENT" = "ospfclient"])
2020-03-11 12:30:47 +01:00
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"])
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"])
AM_CONDITIONAL([VRRPD], [test "$enable_vrrpd" != "no"])
2020-07-31 18:04:20 +02:00
AM_CONDITIONAL([PATHD], [test "$enable_pathd" != "no"])
2021-01-22 10:38:12 +01:00
AM_CONDITIONAL([PATHD_PCEP], [test "$enable_pathd" != "no"])
2003-03-17 03:05:07 +01:00
2020-04-15 10:27:49 +02:00
AC_CONFIG_FILES([Makefile],[
test "$enable_dev_build" = "yes" && makefile_devbuild="--dev-build"
${PYTHON} "${ac_abs_top_srcdir}/python/makefile.py" ${makefile_devbuild} || exit 1
], [
PYTHON="$PYTHON"
enable_dev_build="$enable_dev_build"
])
2018-08-21 20:33:13 +02:00
AC_CONFIG_FILES([
2018-10-23 14:06:25 +02:00
config.version
2017-06-30 21:18:58 +02:00
redhat/frr.spec
2018-03-11 18:32:24 +01:00
alpine/APKBUILD
2017-01-25 22:23:43 +01:00
snapcraft/snapcraft.yaml
2004-07-23 18:23:56 +02:00
lib/version.h
2017-03-09 19:00:19 +01:00
tests/lib/cli/test_cli.refout
2004-08-31 20:16:36 +02:00
pkgsrc/bgpd.sh pkgsrc/ospf6d.sh pkgsrc/ospfd.sh
2017-03-09 05:07:46 +01:00
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
2018-11-14 12:23:49 +01:00
AC_CONFIG_FILES([vtysh/extract.pl], [chmod +x vtysh/extract.pl])
AC_CONFIG_FILES([tools/frr], [chmod +x tools/frr])
2018-11-30 21:40:39 +01:00
AC_CONFIG_FILES([tools/watchfrr.sh], [chmod +x tools/watchfrr.sh])
AC_CONFIG_FILES([tools/frrinit.sh], [chmod +x tools/frrinit.sh])
AC_CONFIG_FILES([tools/frrcommon.sh])
2020-10-22 17:04:24 +02:00
AC_CONFIG_FILES([tools/frr.service])
AC_CONFIG_FILES([tools/frr@.service])
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
2020-03-11 12:09:13 +01:00
AS_IF([test "$with_pkg_git_version" = "yes"], [
2017-08-04 09:59:00 +02:00
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"
2020-03-11 12:30:47 +01:00
test -f "$dst" \
2017-08-04 09:59:00 +02:00
&& diff "${dst}.tmp" "${dst}" >/dev/null 2>/dev/null \
&& rm "${dst}.tmp" \
|| mv "${dst}.tmp" "${dst}"
], [
PERL="$PERL"
])
])
2017-07-12 18:25:33 +02:00
## Hack, but working solution to avoid rebuilding of frr.info.
2004-11-19 07:41:49 +01:00
## It's already in CVS until texinfo 4.7 is more common.
2004-11-07 23:34:23 +01:00
AC_OUTPUT
2003-03-17 03:05:07 +01:00
2020-10-22 16:24:02 +02:00
if test "$enable_rpath" = "yes" ; then
true
else
# See https://old-en.opensuse.org/openSUSE:Packaging_Guidelines#Removing_Rpath
2021-09-02 12:19:59 +02:00
sed -e 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool > libtool.sed && cat libtool.sed > libtool
sed -e 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool > libtool.sed && cat libtool.sed > libtool
test -f libtool.sed && rm libtool.sed
2020-10-22 16:24:02 +02:00
fi
2003-03-17 03:05:07 +01:00
echo "
2017-03-30 20:22:35 +02:00
FRRouting configuration
2016-12-14 19:30:44 +01:00
------------------------------
FRR version : ${PACKAGE_VERSION}
2012-05-30 08:15:48 +02:00
host operating system : ${host_os}
2003-03-17 03:05:07 +01:00
source code location : ${srcdir}
compiler : ${CC}
2021-05-20 21:30:26 +02:00
compiler flags : ${CFLAGS} ${WERROR} ${AC_CFLAGS} ${SAN_FLAGS}
[autoconf] bugs 162,303,178: Fix 'present but can not be compiled' warnings
2007-05-09 Paul Jakma <paul.jakma@sun.com>
* configure.ac: sys/conf.h depends on sys/param.h, at least on
FBSD 6.2.
(bug #363) Should check for in_pktinfo for IRDP
2006-05-27 Paul Jakma <paul.jakma@sun.com>
* configure.ac: General cleanup of header and type checks, introducing
an internal define, QUAGGA_INCLUDES, to build up a list of
stuff to include so as to avoid 'present but cant be compiled'
warnings.
Misc additional checks of things missing according to autoscan.
Add LIBM, for bgpd's use of libm, so as to avoid burdening
LIBS, and all the binaries, with libm linkage.
Remove the bad practice of using m4 changequote(), just
quote the []'s in the case statements properly.
This should fix bugs 162, 303 and 178.
* */*.{c,h}: Update all HAVE_* to the standard autoconf namespaced
HAVE_* defines. I.e. HAVE_SA_LEN -> HAVE_STRUCT_SOCKADDR_SA_LEN,
* bgpd/Makefile.am: Add LIBM to bgpd's LDADD, for pow().
2007-05-10 04:38:51 +02:00
make : ${MAKE-make}
2018-09-02 20:36:20 +02:00
linker flags : ${LDFLAGS} ${SAN_FLAGS} ${LIBS} ${LIBCAP} ${LIBREADLINE} ${LIBM}
2016-12-14 19:30:44 +01:00
state file directory : ${frr_statedir}
2003-10-22 02:07:44 +02:00
config file directory : `eval echo \`echo ${sysconfdir}\``
2016-05-31 19:25:46 +02:00
module directory : ${CFG_MODULE}
2020-11-30 23:37:18 +01:00
script directory : ${CFG_SCRIPT}
2016-12-14 19:30:44 +01:00
user to run as : ${enable_user}
group to run as : ${enable_group}
group for vty sockets : ${enable_vty_group}
2003-12-22 21:15:53 +01:00
config file mask : ${enable_configfile_mask}
log file mask : ${enable_logfile_mask}
2018-09-02 15:15:17 +02:00
zebra protobuf enabled : ${enable_protobuf:-no}
2020-01-25 19:38:39 +01:00
vici socket path : ${vici_socket}
2003-10-22 02:07:44 +02:00
The above user and group must have read/write access to the state file
2006-05-28 10:02:41 +02:00
directory and to the config files in the config file directory."
2018-08-16 23:25:34 +02:00
2021-04-13 20:38:09 +02:00
if test -n "$enable_datacenter"; then
AC_MSG_WARN([The --enable-datacenter compile time option is deprecated. Please modify the init script to pass -F datacenter to the daemons instead.])
fi
if test -n "$enable_time_check"; then
AC_MSG_WARN([The --enable-time-check compile time option is deprecated. Please use the service cputime-stats configuration option instead.])
fi
if test -n "$enable_cpu_time"; then
AC_MSG_WARN([The --enable-cpu-time compile time option is deprecated. Please use the service cputime-warning NNN configuration option instead.])
fi
2020-03-11 12:30:47 +01:00
if test "$enable_doc" != "no" -a "$frr_py_mod_sphinx" = "false"; then
2019-05-28 00:35:24 +02:00
AC_MSG_WARN([sphinx is missing but required to build documentation])
fi
2020-03-11 11:53:15 +01:00
if test "$frr_py_mod_pytest" = "false"; then
2019-05-28 00:35:24 +02:00
AC_MSG_WARN([pytest is missing, unit tests cannot be performed])
2018-08-16 23:25:34 +02:00
fi