dnl Process this file with autoconf to produce a configure script.
- AC_INIT([collectd],[m4_esyscmd(./version-gen.sh)])
+ AC_INIT([collectd],
+ [m4_esyscmd(./version-gen.sh)],
+ [https://github.com/collectd/collectd/issues],
+ [collectd],
+ [https://collectd.org])
AC_CONFIG_SRCDIR(src/)
AC_CONFIG_HEADERS(src/config.h)
AC_CONFIG_AUX_DIR([libltdl/config])
+dnl older automake's default of ARFLAGS=cru is noisy on newer binutils;
+dnl we don't really need the 'u' even in older toolchains. Then there is
+dnl older libtool, which spelled it AR_FLAGS
+m4_divert_text([DEFAULTS], [: "${ARFLAGS=cr} ${AR_FLAGS=cr}"])
+
m4_ifdef([LT_PACKAGE_VERSION],
# libtool >= 2.2
[
]
)
+AM_CONDITIONAL([BUILD_INCLUDED_LTDL], [test "x$LTDLDEPS" != "x"])
+
AM_INIT_AUTOMAKE([tar-pax dist-bzip2 foreign])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AC_LANG(C)
#if HAVE_NET_IF_H
# include <net/if.h>
#endif
+#if HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
])
# For the multimeter plugin
AC_CHECK_FUNCS(getvfsstat, [have_getvfsstat="yes"])
have_listmntent="no"
AC_CHECK_FUNCS(listmntent, [have_listmntent="yes"])
+have_getmntent_r="no"
+AC_CHECK_FUNCS(getmntent_r, [have_getmntent_r="yes"])
have_getmntent="no"
AC_CHECK_FUNCS(getmntent, [have_getmntent="c"])
GANGLIA_LDFLAGS="-L$withval/lib"
with_libganglia="yes"
else
- with_libganglia_config="ganglia-config"
with_libganglia="$withval"
fi; fi; fi
],
[
- with_libganglia_config="ganglia-config"
with_libganglia="yes"
])
-if test "x$with_libganglia" = "xyes" && test "x$with_libganglia_config" != "x"
+if test "x$with_libganglia" = "xyes"
then
- if test "x$GANGLIA_CPPFLAGS" = "x"
+ if test "x$with_libganglia_config" != "x"
then
- GANGLIA_CPPFLAGS=`"$with_libganglia_config" --cflags 2>/dev/null`
- fi
+ if test "x$GANGLIA_CPPFLAGS" = "x"
+ then
+ GANGLIA_CPPFLAGS=`"$with_libganglia_config" --cflags 2>/dev/null`
+ fi
- if test "x$GANGLIA_LDFLAGS" = "x"
- then
- GANGLIA_LDFLAGS=`"$with_libganglia_config" --ldflags 2>/dev/null`
- fi
+ if test "x$GANGLIA_LDFLAGS" = "x"
+ then
+ GANGLIA_LDFLAGS=`"$with_libganglia_config" --ldflags 2>/dev/null`
+ fi
- if test "x$GANGLIA_LIBS" = "x"
- then
- GANGLIA_LIBS=`"$with_libganglia_config" --libs 2>/dev/null`
+ if test "x$GANGLIA_LIBS" = "x"
+ then
+ GANGLIA_LIBS=`"$with_libganglia_config" --libs 2>/dev/null`
+ fi
+ else
+ GANGLIA_LIBS="-lganglia"
fi
fi
])
if test "x$with_libmysql" = "xyes"
then
- with_mysql_cflags=`$with_mysql_config --cflags 2>/dev/null`
+ with_mysql_cflags=`$with_mysql_config --include 2>/dev/null`
mysql_config_status=$?
if test $mysql_config_status -ne 0
then
with_libmysql="no ($with_mysql_config failed)"
else
- AC_CHECK_LIB(mysqlclient, mysql_init,
- [with_libmysql="yes"],
- [with_libmysql="no (symbol 'mysql_init' not found)"],
- [$with_mysql_libs])
-
- AC_CHECK_LIB(mysqlclient, mysql_get_server_version,
+ SAVE_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $with_mysql_cflags"
+ SAVE_LIBS="$LIBS"
+ LIBS="$with_mysql_libs"
+ AC_SEARCH_LIBS([mysql_get_server_version],
+ [],
[with_libmysql="yes"],
[with_libmysql="no (symbol 'mysql_get_server_version' not found)"],
- [$with_mysql_libs])
+ [])
+ CPPFLAGS="$SAVE_CPPFLAGS"
+ LIBS="$SAVE_LIBS"
fi
fi
if test "x$with_libmysql" = "xyes"
fi
if test "x$with_libpcap" = "xyes"
then
- AC_CHECK_HEADERS(pcap-bpf.h,,
- [with_libpcap="no (pcap-bpf.h not found)"])
-fi
-if test "x$with_libpcap" = "xyes"
-then
AC_CACHE_CHECK([whether libpcap has PCAP_ERROR_IFACE_NOT_UP],
[c_cv_libpcap_have_pcap_error_iface_not_up],
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
AC_COLLECTD([debug], [enable], [feature], [debugging])
AC_COLLECTD([daemon], [disable], [feature], [daemon mode])
AC_COLLECTD([getifaddrs],[enable], [feature], [getifaddrs under Linux])
+AC_COLLECTD([werror], [disable], [feature], [building with -Werror])
dependency_warning="no"
dependency_error="no"
plugin_df="yes"
fi
+if test "x$c_cv_have_getmntent_r" = "xyes"
+then
+ plugin_df="yes"
+fi
+
# Df plugin: Check if we have either `statfs' or `statvfs' second.
if test "x$plugin_df" = "xyes"
then
AC_CONFIG_FILES(src/libcollectdclient/collectd/lcc_features.h)
+AM_CFLAGS="-Wall"
+if test "x$enable_werror" != "xno"
+then
+ AM_CFLAGS="$AM_CFLAGS -Werror"
+fi
+AC_SUBST([AM_CFLAGS])
+
AC_CONFIG_FILES([Makefile src/Makefile src/daemon/Makefile src/collectd.conf src/libcollectdclient/Makefile src/libcollectdclient/libcollectdclient.pc src/liboconfig/Makefile bindings/Makefile bindings/java/Makefile])
AC_OUTPUT
cat <<EOF;
Configuration:
+ Build:
+ Platform . . . . . . $ac_system
+ CC . . . . . . . . . $CC
+ CFLAGS . . . . . . . $AM_CFLAGS $CFLAGS
+ CPP . . . . . . . . . $CPP
+ CPPFLAGS . . . . . . $CPPFLAGS
+ LD . . . . . . . . . $LD
+ LDFLAGS . . . . . . . $LDFLAGS
+ YACC . . . . . . . . $YACC
+ YFLAGS . . . . . . . $YFLAGS
+
Libraries:
intel mic . . . . . . $with_mic
libaquaero5 . . . . . $with_libaquaero5