AC_C_FLAG([-fsanitize=memory -fPIE -pie], [
AC_MSG_ERROR([$CC does not support Memory Sanitizer.])
], [
- SAN_FLAGS="-fsanitize=memory -fPIE -pie"
+ SAN_FLAGS="$SAN_FLAGS -fsanitize=memory -fPIE -pie"
+ ])
+fi
+if test "$enable_undefined_sanitizer" = "yes"; then
+ AC_C_FLAG([-fsanitize=undefined], [
+ AC_MSG_ERROR([$CC does not support UndefinedBehaviorSanitizer.])
+ ], [
+ SAN_FLAGS="$SAN_FLAGS -fsanitize=undefined"
])
fi
AC_SUBST([SAN_FLAGS])
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]))
+AC_ARG_ENABLE([undefined-sanitizer],
+ AS_HELP_STRING([--undefined-sanitizer], [enable UndefinedBehaviorSanitizer support for detecting undefined behavior]))
AC_ARG_WITH([crypto],
AS_HELP_STRING([--with-crypto=<internal|openssl>], [choose between different implementations of cryptographic functions(default value is --with-crypto=internal)]))
dnl V6 headers are checked below, after we check for v6
+is_linux=false
+
AC_MSG_CHECKING([which operating system interface to use])
case "$host_os" in
sunos* | solaris2*)
dnl how to fix it but no real progress on implementation
dnl when they fix it, remove this
AC_DEFINE([IPV6_MINHOPCOUNT], [73], [Linux ipv6 Min Hop Count])
+
+ is_linux=true
;;
openbsd*)
AC_MSG_RESULT([OpenBSD])
;;
esac
AM_CONDITIONAL([SOLARIS], [test "${SOLARIS}" = "solaris"])
+AM_CONDITIONAL([LINUX], [${is_linux}])
AC_SYS_LARGEFILE
#
# Logic for protobuf support.
#
+PROTO3=false
if test "$enable_protobuf" = "yes"; then
# Check for protoc & protoc-c
PKG_CHECK_MODULES([PROTOBUF_C], [libprotobuf-c >= 0.14],, [
AC_MSG_FAILURE([protobuf requested but libprotobuf-c not found. Install protobuf-c.])
])
- AC_CHECK_HEADER([google/protobuf-c/protobuf-c.h], [], [
- AC_MSG_FAILURE([protobuf requested but protobuf-c.h not found. Install protobuf-c.])
- ])
+
+ 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.])])
AC_DEFINE([HAVE_PROTOBUF], [1], [protobuf])
fi
AM_CONDITIONAL([IRDP], [$IRDP])
AM_CONDITIONAL([FPM], [test "x$enable_fpm" = "xyes"])
AM_CONDITIONAL([HAVE_PROTOBUF], [test "x$enable_protobuf" = "xyes"])
+AM_CONDITIONAL([HAVE_PROTOBUF3], [$PROTO3])
dnl daemons
AM_CONDITIONAL([VTYSH], [test "x$VTYSH" = "xvtysh"])
AM_CONDITIONAL([ZEBRA], [test "${enable_zebra}" != "no"])