[plugin-nfacct],
[AS_HELP_STRING([--enable-plugin-nfacct], [enable nfacct plugin, requires root])],
,
- [enable_plugin_nfacct="no"]
+ [enable_plugin_nfacct="detect"]
)
AC_ARG_ENABLE(
[plugin-freeipmi],
- [AS_HELP_STRING([--enable-plugin-freeipmi], [freeipmi plugin, requires root])],
+ [AS_HELP_STRING([--enable-plugin-freeipmi], [enable freeipmi plugin])],
,
[enable_plugin_freeipmi="detect"]
)
AX_CHECK_COMPILE_FLAG(${opt}, [CFLAGS="${CFLAGS} ${opt}"], [])
fi
-if test "${enable_lto}" != "no"; then
- opt="-flto"
- AX_CHECK_COMPILE_FLAG(${opt}, [have_lto=yes], [have_lto=no])
-fi
-test "${enable_lto}" = "yes" -a "${have_lto}" != "yes" && \
- AC_MSG_ERROR([LTO is required but is not available.])
-AC_MSG_CHECKING([if LTO should be enabled])
-if test "${enable_lto}" != "no" -a "${have_lto}" = "yes"; then
- enable_lto="yes"
- CFLAGS="${CFLAGS} -flto"
-else
- enable_lto="no"
-fi
-AC_MSG_RESULT([${enable_lto}])
-
if test "${GCC}" = "yes"; then
AC_DEFINE_UNQUOTED([likely(x)], [__builtin_expect(!!(x), 1)], [gcc branch optimization])
AC_DEFINE_UNQUOTED([unlikely(x)], [__builtin_expect(!!(x), 0)], [gcc branch optimization])
# -----------------------------------------------------------------------------
# nfacct.plugin - libmnl, libnetfilter_acct
+AC_CHECK_HEADERS_ONCE([linux/netfilter/nfnetlink_conntrack.h])
+
PKG_CHECK_MODULES(
[NFACCT],
[libnetfilter_acct],
[have_libnetfilter_acct=yes],
[have_libnetfilter_acct=no]
)
+
+if test "${have_libnetfilter_acct}" = "yes"; then
+ AC_DEFINE([HAVE_LIBNETFILTER_ACCT], [1], [libnetfilter_acct usability])
+ OPTIONAL_NFACCT_CLFAGS="${OPTIONAL_NFACCT_CLFAGS} ${NFACCT_CFLAGS}"
+ OPTIONAL_NFACCT_LIBS="${OPTIONAL_NFACCT_LIBS} ${NFACCT_LIBS}"
+fi
+
PKG_CHECK_MODULES(
[LIBMNL],
[libmnl],
[have_libmnl=no]
)
+if test "${have_libmnl}" = "yes"; then
+ AC_DEFINE([HAVE_LIBMNL], [1], [libmnl usability])
+ OPTIONAL_NFACCT_CLFAGS="${OPTIONAL_NFACCT_CLFAGS} ${LIBMNL_CFLAGS}"
+ OPTIONAL_NFACCT_LIBS="${OPTIONAL_NFACCT_LIBS} ${LIBMNL_LIBS}"
+fi
+
test "${enable_plugin_nfacct}" = "yes" -a "${have_libnetfilter_acct}" != "yes" && \
AC_MSG_ERROR([netfilter_acct required but not found])
AM_CONDITIONAL([ENABLE_PLUGIN_NFACCT], [test "${enable_plugin_nfacct}" = "yes"])
+# -----------------------------------------------------------------------------
+# Link-Time-Optimization
+
+if test "${enable_lto}" != "no"; then
+ opt="-flto"
+ AX_CHECK_COMPILE_FLAG(${opt}, [have_lto=yes], [have_lto=no])
+fi
+if test "${have_lto}" = "yes"; then
+ oCFLAGS="${CFLAGS}"
+ CFLAGS="${CFLAGS} -flto ${OPTIONAL_MATH_CLFAGS} ${OPTIONAL_NFACCT_CLFAGS} ${OPTIONAL_ZLIB_CLFAGS} ${OPTIONAL_UUID_CLFAGS} ${OPTIONAL_LIBCAP_CFLAGS} ${OPTIONAL_IPMIMONITORING_CFLAGS}"
+ ac_cv_c_lto_cross_compile="${enable_lto}"
+ test "${ac_cv_c_lto_cross_compile}" != "yes" && ac_cv_c_lto_cross_compile="no"
+ AC_C_LTO
+ CFLAGS="${oCFLAGS}"
+ test "${ac_cv_c_lto}" != "yes" && have_lto="no"
+fi
+test "${enable_lto}" = "yes" -a "${have_lto}" != "yes" && \
+ AC_MSG_ERROR([LTO is required but is not available.])
+AC_MSG_CHECKING([if LTO should be enabled])
+if test "${enable_lto}" != "no" -a "${have_lto}" = "yes"; then
+ enable_lto="yes"
+ CFLAGS="${CFLAGS} -flto"
+else
+ enable_lto="no"
+fi
+AC_MSG_RESULT([${enable_lto}])
+
+
# -----------------------------------------------------------------------------
AC_DEFINE_UNQUOTED([NETDATA_USER], ["${with_user}"], [use this user to drop privileged])