X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=configure.in;h=6ecb81c50687182faf8c19df74b9f7eab0af92a9;hb=1842a7a770593554fd0bac5f407e47f765011eb9;hp=02f9db861dd57121c7d0383f09bbafabbac9a235;hpb=50cadef109fdefb91794ab2e059f6a295fd7136b;p=collectd.git diff --git a/configure.in b/configure.in index 02f9db86..6ecb81c5 100644 --- a/configure.in +++ b/configure.in @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT(collectd, 3.6.0) +AC_INIT(collectd, 3.9.0) AC_CONFIG_SRCDIR(src/collectd.c) AC_CONFIG_HEADERS(src/config.h) AM_INIT_AUTOMAKE(dist-bzip2) @@ -15,6 +15,7 @@ AC_PROG_CPP AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET +AM_CONDITIONAL(COMPILER_IS_GCC, test "x$GCC" = "xyes") dnl configure libtool AC_DISABLE_STATIC @@ -29,17 +30,109 @@ AC_CONFIG_SUBDIRS(libltdl src/libconfig) # # Checks for header files. # +AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_HEADER_DIRENT +AC_CHECK_HEADERS(stdint.h) +AC_CHECK_HEADERS(stdio.h) +AC_CHECK_HEADERS(errno.h) +AC_CHECK_HEADERS(math.h) +AC_CHECK_HEADERS(syslog.h) AC_CHECK_HEADERS(fcntl.h) AC_CHECK_HEADERS(signal.h) +AC_CHECK_HEADERS(assert.h) +AC_CHECK_HEADERS(sys/types.h) AC_CHECK_HEADERS(sys/socket.h) AC_CHECK_HEADERS(sys/select.h) AC_CHECK_HEADERS(netdb.h) +AC_CHECK_HEADERS(arpa/inet.h) AC_CHECK_HEADERS(sys/resource.h) AC_CHECK_HEADERS(sys/param.h) -AC_CHECK_HEADERS(errno.h) -AC_CHECK_HEADERS(syslog.h) + +# For ping library +AC_CHECK_HEADERS(netinet/in_systm.h, [], [], +[#if HAVE_STDINT_H +# include +#endif +]) +AC_CHECK_HEADERS(netinet/in.h, [], [], +[#if HAVE_STDINT_H +# include +#endif +#if HAVE_NETINET_IN_SYSTM_H +# include +#endif +]) +AC_CHECK_HEADERS(netinet/ip.h, [], [], +[#if HAVE_STDINT_H +# include +#endif +#if HAVE_NETINET_IN_SYSTM_H +# include +#endif +#if HAVE_NETINET_IN_H +# include +#endif +]) +AC_CHECK_HEADERS(netinet/ip_icmp.h, [], [], +[#if HAVE_STDINT_H +# include +#endif +#if HAVE_NETINET_IN_SYSTM_H +# include +#endif +#if HAVE_NETINET_IN_H +# include +#endif +#if HAVE_NETINET_IP_H +# include +#endif +]) +AC_CHECK_HEADERS(netinet/ip_var.h, [], [], +[#if HAVE_STDINT_H +# include +#endif +#if HAVE_NETINET_IN_SYSTM_H +# include +#endif +#if HAVE_NETINET_IN_H +# include +#endif +#if HAVE_NETINET_IP_H +# include +#endif +]) +AC_CHECK_HEADERS(netinet/ip6.h, [], [], +[#if HAVE_STDINT_H +# include +#endif +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_NETINET_IN_SYSTM_H +# include +#endif +#if HAVE_NETINET_IN_H +# include +#endif +]) +AC_CHECK_HEADERS(netinet/icmp6.h, [], [], +[#if HAVE_STDINT_H +# include +#endif +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_NETINET_IN_SYSTM_H +# include +#endif +#if HAVE_NETINET_IN_H +# include +#endif +#if HAVE_NETINET_IP6_H +# include +#endif +]) # For cpu modules AC_CHECK_HEADERS(sys/sysctl.h sys/dkstat.h) @@ -47,14 +140,13 @@ AC_CHECK_HEADERS(sys/sysctl.h sys/dkstat.h) # For load module AC_CHECK_HEADERS(sys/loadavg.h) -# For ping module -AC_CHECK_HEADERS(arpa/inet.h) -AC_CHECK_HEADERS(netinet/in.h) - # For users module AC_CHECK_HEADERS(utmp.h) AC_CHECK_HEADERS(utmpx.h) +# For apache plugin +AC_CHECK_HEADERS(curl/curl.h) + # For quota module AC_CHECK_HEADERS(grp.h pwd.h sys/ucred.h) AC_CHECK_HEADERS(ctype.h) @@ -99,7 +191,7 @@ AC_HEADER_TIME AC_PROG_GCC_TRADITIONAL AC_CHECK_FUNCS(gettimeofday select strdup strtol) AC_CHECK_FUNCS(socket, , AC_CHECK_LIB(socket, socket)) -AC_CHECK_FUNCS(gethostbyname, , AC_CHECK_LIB(nsl, gethostbyname)) +AC_CHECK_FUNCS(getaddrinfo getnameinfo) AC_CHECK_FUNCS(strchr memcpy strstr strcmp strncmp strncpy strlen) AC_CHECK_FUNCS(strncasecmp strcasecmp) AC_CHECK_FUNCS(openlog syslog closelog) @@ -122,7 +214,26 @@ AC_CHECK_FUNCS(getgrgid getpwuid) # For mount interface AC_CHECK_FUNCS(getfsent getvfsent listmntent) +AC_CHECK_FUNCS(getfsstat) + +# Check for different versions of `getmntent' here.. AC_FUNC_GETMNTENT +if test "x$ac_cv_lib_sun_getmntent" = "xyes" +then + AC_DEFINE(HAVE_SUN_GETMNTENT, 1, + [Define if the function getmntent exists. It's the version from libsun.]) +fi +if test "x$ac_cv_lib_seq_getmntent" = "xyes" +then + AC_DEFINE(HAVE_SEQ_GETMNTENT, 1, + [Define if the function getmntent exists. It's the version from libseq.]) +fi +if test "x$ac_cv_lib_gen_getmntent" = "xyes" +then + AC_DEFINE(HAVE_GEN_GETMNTENT, 1, + [Define if the function getmntent exists. It's the version from libgen.]) +fi + if test "x$ac_cv_func_getmntent" = "xyes"; then saveCFLAGS="$CFLAGS" CFLAGS="-Wall -Werror $CFLAGS" @@ -186,9 +297,22 @@ case $host_os in esac AC_MSG_RESULT([$ac_system]) -dnl Checks for libraries. -AC_CHECK_LIB(socket, socket) -AC_CHECK_LIB(resolv, res_search) +with_libsocket="yes" +AC_CHECK_LIB(socket, socket, +[ + AC_DEFINE(HAVE_LIBSOCKET, 1, [Define to 1 if you have the 'socket' library (-lsocket).]) +], +[with_libsocket="no"]) +AM_CONDITIONAL(BUILD_WITH_LIBSOCKET, test "x$with_libsocket" = "xyes") + +with_libresolv="yes" +AC_CHECK_LIB(resolv, res_search, +[ + AC_DEFINE(HAVE_LIBRESOLV, 1, [Define to 1 if you have the 'resolv' library (-lresolv).]) +], +[with_libresolv="no"]) +AM_CONDITIONAL(BUILD_WITH_LIBRESOLV, test "x$with_libresolv" = "xyes") + m4_divert_once([HELP_WITH], [ collectd additional packages:]) @@ -204,7 +328,11 @@ AC_ARG_WITH(rrdtool, [AS_HELP_STRING([--with-rrdtool@<:@=PREFIX@:>@], [Path to r ], [with_rrdtool="yes"]) if test "x$with_rrdtool" = "xyes" then - AC_CHECK_LIB(rrd, rrd_update,, [with_rrdtool="no (librrd not found)"], [-lm]) + AC_CHECK_LIB(rrd, rrd_update, + [ + AC_DEFINE(HAVE_LIBRRD, 1, [Define to 1 if you have the rrd library (-lrrd).]) + ], + [with_rrdtool="no (librrd not found)"], [-lm]) fi if test "x$with_rrdtool" = "xyes" then @@ -271,9 +399,78 @@ AC_DEFINE_UNQUOTED(COLLECT_KSTAT, [$collect_kstat], [Wether or not to use kstat library (Solaris)]) AM_CONDITIONAL(BUILD_WITH_KSTAT, test "x$with_kstat" = "xyes") +### BEGIN of check for libcurl ### +with_curl_config="curl-config" +with_curl_prefix=0 +with_curl_libs="" +AC_ARG_WITH(libcurl, [AS_HELP_STRING([--with-libcurl@<:@=PREFIX@:>@], [Path to libcurl.])], +[ + if test "x$withval" != "xno" -a "x$withval" != "xyes" + then + if test -x "$withval/bin/curl-config" + then + with_curl_config="$withval/bin/curl-config" + with_curl_prefix=1 + fi + fi + if test "x$withval" = "xno" + then + with_libcurl="no" + else + with_libcurl="yes" + fi +], +[ + with_libcurl="yes" +]) +if test "x$with_libcurl" = "xyes" +then + with_curl_libs=`$with_curl_config --libs 2>/dev/null` + curl_config_status=$? + + if test $curl_config_status -ne 0 + then + with_libcurl="no" + else + AC_CHECK_LIB(curl, curl_easy_init, + [ + BUILD_WITH_LIBCURL_LIBS="$with_curl_libs" + AC_SUBST(BUILD_WITH_LIBCURL_LIBS) + ], + [ + with_libcurl="no" + ], + [$with_curl_libs]) + fi +fi +if test "x$with_libcurl" = "xyes" -a $with_curl_prefix -ne 0 +then + with_curl_prefix=`$with_curl_config --libs 2>/dev/null` + curl_config_status=$? + + if test $curl_config_status -ne 0 + then + with_libcurl="no" + else + if test -d "$with_curl_prefix/include" + then + CPPFLAGS="$CPPFLAGS -I$with_curl_prefix/include" + fi + fi +fi + +with_libcurl_numeric=0 +if test "x$with_libcurl" = "xyes" +then + with_libcurl_numeric=1 +fi +AC_DEFINE_UNQUOTED(HAVE_LIBCURL, [$with_libcurl_numeric], [Define to 1 if you have the 'curl' library (-lcurl).]) +AM_CONDITIONAL(BUILD_WITH_LIBCURL, test "x$with_libcurl" = "xyes") +### END of check for libcurl ### + AC_ARG_WITH(libstatgrab, [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])], [ - if test "x$withval" != "xno" && test "x$withval" != "xyes" + if test "x$withval" != "xno" -a "x$withval" != "xyes" then LDFLAGS="$LDFLAGS -L$withval/lib" CPPFLAGS="$CPPFLAGS -I$withval/include" @@ -365,11 +562,17 @@ AC_ARG_WITH(libmysql, [AS_HELP_STRING([--with-libmysql@<:@=PREFIX@:>@], [Path to ]) if test "x$with_libmysql" = "xyes" then - AC_CHECK_LIB(mysqlclient, mysql_init,, [with_libmysql="no (libmysql not found)"]) + AC_CHECK_LIB(mysqlclient, mysql_init, + [ + AC_DEFINE(HAVE_LIBMYSQLCLIENT, 1, [Define to 1 if you have the mysqlclient library (-lmysqlclient).]) + ], [with_libmysql="no (libmysql not found)"]) fi if test "x$with_libmysql" = "xyes" then - AC_CHECK_HEADERS(mysql/mysql.h,, [with_libmysql="no (mysql/mysql.h not found)"]) + AC_CHECK_HEADERS(mysql/mysql.h, + [ + AC_DEFINE(HAVE_MYSQL_MYSQL_H, 1, [Define to 1 if you have the header file.]) + ], [with_libmysql="no (mysql/mysql.h not found)"]) fi if test "x$with_libmysql" = "xyes" then @@ -381,6 +584,42 @@ AC_DEFINE_UNQUOTED(COLLECT_LIBMYSQL, [$collect_libmysql], [Wether or not to use mysql library]) AM_CONDITIONAL(BUILD_WITH_LIBMYSQL, test "x$with_libmysql" = "xyes") +# Define `step' and `hearbeat' values.. +declare -i collectd_step=10 +declare -i collectd_heartbeat=25 +AC_ARG_WITH(step, [AS_HELP_STRING([--with-step=SECONDS], [Interval in which plugins are queried.])], +[ + if test "x$withval" != "xno" -a "x$withval" != "xyes" + then + declare -i tmp_collectd_step="$withval" + if test $tmp_collectd_step -gt 0 + then + collectd_step=$tmp_collectd_step + let "collectd_heartbeat=$collectd_step*2" + fi + fi +], []) +AC_ARG_WITH(heartbeat, [AS_HELP_STRING([--with-heartbeat=SECONDS], [Heartbeat of the DS in generated RRD files.])], +[ + if test "x$withval" != "xno" -a "x$withval" != "xyes" + then + declare -i tmp_collectd_heartbeat="$withval" + if test $tmp_collectd_heartbeat -gt 0 + then + collectd_heartbeat=$tmp_collectd_heartbeat + fi + fi +], []) + +if test $collectd_step -ne 10 +then + AC_DEFINE_UNQUOTED(COLLECTD_STEP, "$collectd_step", [Interval in which plugins are queried.]) +fi +if test $collectd_heartbeat -ne 25 +then + AC_DEFINE_UNQUOTED(COLLECTD_HEARTBEAT, "$collectd_heartbeat", [Interval in which plugins are queried.]) +fi + # # Check for enabled/disabled features # @@ -452,6 +691,8 @@ AC_COLLECTD([daemon], [disable], [feature], [daemon mode]) m4_divert_once([HELP_ENABLE], [ collectd modules:]) +AC_COLLECTD([apache], [disable], [module], [Apache httpd statistics]) +AC_COLLECTD([battery], [disable], [module], [battery statistics]) AC_COLLECTD([cpu], [disable], [module], [cpu usage statistics]) AC_COLLECTD([cpufreq], [disable], [module], [system cpu frequency statistics]) AC_COLLECTD([disk], [disable], [module], [disk/partition statistics]) @@ -470,6 +711,8 @@ AC_COLLECTD([swap], [disable], [module], [swap statistics]) AC_COLLECTD([tape], [disable], [module], [tape statistics]) AC_COLLECTD([traffic], [disable], [module], [system traffic statistics]) AC_COLLECTD([users], [disable], [module], [user count statistics]) +AC_COLLECTD([vserver], [disable], [module], [vserver statistics]) +AC_COLLECTD([wireless], [disable], [module], [wireless link statistics]) #m4_divert_once([HELP_ENABLE], [ #collectd modules:]) @@ -687,12 +930,13 @@ AC_COLLECTD([users], [disable], [module], [user count statistics]) #AC_COLLECTD([users], [disable], [module], [user count statistics]) -AC_OUTPUT(Makefile src/libconfig/Makefile src/libping/Makefile src/Makefile) +AC_OUTPUT(Makefile src/libconfig/Makefile src/liboping/Makefile src/Makefile) cat <