AX_CFLAGS_GCC_OPTION([-Wno-sign-compare], [LLDP_CFLAGS]) dnl Should be fixed later
AX_LDFLAGS_OPTION([-Wl,-z,relro], [LLDP_LDFLAGS])
AX_LDFLAGS_OPTION([-Wl,-z,now], [LLDP_LDFLAGS])
-lldp_CHECK_CTORS
# Hardening
AC_ARG_ENABLE([hardening],
[AX_LDFLAGS_OPTION([-fPIE -Wl,-pie], [LLDP_BIN_LDFLAGS])])
fi
+# Sanitizers
+AC_ARG_ENABLE([sanitizers],
+ AS_HELP_STRING(
+ [--enable-sanitizers],
+ [Enable code instrumentation with selected sanitizers @<:@default=no@:>@]),
+ [
+case "$enableval" in
+ no) sanitizers= ;;
+ yes) sanitizers="-fsanitize=address,undefined" ;;
+ *) sanitizers="-fsanitize=$enableval" ;;
+esac
+if test x"$sanitizers" != x; then
+ LLDP_CFLAGS="$LLDP_CFLAGS $sanitizers"
+ LLDP_LDFLAGS="$LLDP_LDFLAGS $sanitizers"
+ AC_DEFINE([HAVE_ADDRESS_SANITIZER], 1, [Define if have both address and leak sanitizer])
+fi
+ ])
+
# OS
lldp_CHECK_OS
lldp_CFLAGS_OS
fi
fi
+# Build date
+if test x"$SOURCE_DATE_EPOCH" != x; then
+ AC_DEFINE_UNQUOTED(BUILD_DATE, "[$SOURCE_DATE_EPOCH]", [Build date and time])
+fi
+AC_DEFINE_UNQUOTED(LLDP_CC, "[$CC $LLDP_CFLAGS $LLDP_CPPFLAGS $CFLAGS $CPPFLAGS]", [C compiler command])
+AC_DEFINE_UNQUOTED(LLDP_LD, "[$LD $LLDP_LDFLAGS $LLDP_BIN_LDFLAGS $LDFLAGS $LIBS]", [Linker compiler command])
+
#######################
# Output results
AC_SUBST([LLDP_CFLAGS])
Linker.........: $LD $LLDP_LDFLAGS $LLDP_BIN_LDFLAGS $LDFLAGS $LIBS
Libevent.......: $libevent
Readline.......: ${ax_cv_lib_readline}
+
Optional features:
SNMP support...: ${with_snmp-no}
CDP............: $enable_cdp
JSON output....: ${with_json-no}
Oldies support.: $enable_oldies
seccomp........: ${with_seccomp-no}
+
Privilege separation:
Enabled........: $enable_privsep
User/group.....: ${with_privsep_user}/${with_privsep_group}
Chroot.........: ${with_privsep_chroot}
+------------- Compiler version --------------
+$($CC --version || true)
+-------------- Linker version ---------------
+$($LD --version || true)
---------------------------------------------
Check the above options and compile with: