X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=configure.in;h=47e7291de8a18660de9dffa45eeccb155fb33da7;hb=de23afd;hp=7c4e417d90719f8097763c7c334b5375f4304903;hpb=a3da854628383819439f0680acd2786fd00744fe;p=collectd.git diff --git a/configure.in b/configure.in index 7c4e417d..47e7291d 100644 --- a/configure.in +++ b/configure.in @@ -67,21 +67,36 @@ fi if test "x$ac_system" = "xSolaris" then - CPPFLAGS="$CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS" + AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [Define to enforce POSIX thread semantics under Solaris.]) fi # Where to install .pc files. pkgconfigdir="${libdir}/pkgconfig" AC_SUBST(pkgconfigdir) +# Check for standards compliance mode +AC_ARG_ENABLE(standards, + AS_HELP_STRING([--enable-standards], [Enable standards compliance mode]), + [enable_standards="$enableval"], + [enable_standards="no"]) +if test "x$enable_standards" = "xyes" +then + AC_DEFINE(_ISOC99_SOURCE, 1, [Define to enforce ISO C99 compliance.]) + AC_DEFINE(_POSIX_C_SOURCE, 200112L, [Define to enforce POSIX.1-2001 compliance.]) + AC_DEFINE(_XOPEN_SOURCE, 600, [Define to enforce X/Open 6 (XSI) compliance.]) + AC_DEFINE(_REENTRANT, 1, [Define to enable reentrancy interfaces.]) +fi +AM_CONDITIONAL(BUILD_FEATURE_STANDARDS, test "x$enable_standards" = "xyes") + # # Checks for header files. # AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_HEADER_DIRENT +AC_HEADER_STDBOOL -AC_CHECK_HEADERS(stdio.h stdint.h stdbool.h errno.h math.h stdarg.h syslog.h fcntl.h signal.h assert.h sys/types.h sys/socket.h sys/select.h poll.h netdb.h arpa/inet.h sys/resource.h sys/param.h kstat.h regex.h sys/ioctl.h endian.h sys/isa_defs.h) +AC_CHECK_HEADERS(stdio.h stdint.h errno.h math.h stdarg.h syslog.h fcntl.h signal.h assert.h sys/types.h sys/socket.h sys/select.h poll.h netdb.h arpa/inet.h sys/resource.h sys/param.h kstat.h regex.h sys/ioctl.h endian.h sys/isa_defs.h) # For ping library AC_CHECK_HEADERS(netinet/in_systm.h, [], [], @@ -250,7 +265,7 @@ AC_CHECK_HEADERS(IOKit/ps/IOPowerSources.h, [], [], # For the swap module have_sys_swap_h="yes" -AC_CHECK_HEADERS(sys/swap.h, [], [have_sys_swap_h="no"], +AC_CHECK_HEADERS(sys/swap.h vm/anon.h, [], [have_sys_swap_h="no"], [ #if HAVE_SYS_TYPES_H # include @@ -262,7 +277,14 @@ AC_CHECK_HEADERS(sys/swap.h, [], [have_sys_swap_h="no"], if test "x$have_sys_swap_h$ac_system" = "xnoSolaris" then - AC_MSG_NOTICE([Solaris detected and sys/swap.h not found: Try building a 64bit binary.]) + hint_64="" + if test "x$GCC" = "xyes" + then + hint_64="CFLAGS='-m64'" + else + hint_64="CFLAGS='-xarch=v9'" + fi + AC_MSG_NOTICE([Solaris detected and sys/swap.h not usable. Try building a 64-bit binary ($hint_64 ./configure).]) fi # For load module @@ -347,7 +369,7 @@ AC_CHECK_HEADERS(linux/un.h, [], [], #endif ]) -AC_CHECK_HEADERS(pwd.h grp.h sys/un.h ctype.h limits.h sys/quota.h xfs/xqm.h fs_info.h fshelp.h paths.h mntent.h mnttab.h sys/fstyp.h sys/fs_types.h sys/mntent.h sys/mnttab.h sys/statfs.h sys/statvfs.h sys/vfs.h sys/vfstab.h kvm.h wordexp.h) +AC_CHECK_HEADERS(pwd.h grp.h sys/un.h ctype.h limits.h xfs/xqm.h fs_info.h fshelp.h paths.h mntent.h mnttab.h sys/fstyp.h sys/fs_types.h sys/mntent.h sys/mnttab.h sys/statfs.h sys/statvfs.h sys/vfs.h sys/vfstab.h kvm.h wordexp.h) # For the dns plugin AC_CHECK_HEADERS(arpa/nameser.h) @@ -799,7 +821,6 @@ if test "x$have_getmntent" = "xc"; then [c_cv_have_one_getmntent], AC_COMPILE_IFELSE( AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT -#include #include "$srcdir/src/utils_mount.h"]], [[ FILE *fh; @@ -816,7 +837,6 @@ if test "x$have_getmntent" = "xc"; then [c_cv_have_two_getmntent], AC_COMPILE_IFELSE( AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT -#include #include "$srcdir/src/utils_mount.h"]], [[ FILE *fh; @@ -876,8 +896,40 @@ AC_CHECK_MEMBERS([struct net_device_stats.rx_bytes, struct net_device_stats.tx_p #include ]) +AC_CHECK_MEMBERS([struct kinfo_proc.ki_pid, struct kinfo_proc.ki_rssize, struct kinfo_proc.ki_rusage], + [ + AC_DEFINE(HAVE_STRUCT_KINFO_PROC_FREEBSD, 1, + [Define if struct kinfo_proc exists in the FreeBSD variant.]) + have_struct_kinfo_proc_freebsd="yes" + ], + [ + have_struct_kinfo_proc_freebsd="no" + ], + [ +#include +#include +#include +#include + ]) + +AC_CHECK_MEMBERS([struct kinfo_proc.kp_proc, struct kinfo_proc.kp_eproc], + [ + AC_DEFINE(HAVE_STRUCT_KINFO_PROC_OPENBSD, 1, + [Define if struct kinfo_proc exists in the OpenBSD variant.]) + have_struct_kinfo_proc_openbsd="yes" + ], + [ + have_struct_kinfo_proc_openbsd="no" + ], + [ +#include +#include +#include + ]) + AC_CHECK_MEMBERS([struct udphdr.uh_dport, struct udphdr.uh_sport], [], [], -[#if HAVE_STDINT_H +[#define _BSD_SOURCE +#if HAVE_STDINT_H # include #endif #if HAVE_SYS_TYPES_H @@ -897,7 +949,8 @@ AC_CHECK_MEMBERS([struct udphdr.uh_dport, struct udphdr.uh_sport], [], [], #endif ]) AC_CHECK_MEMBERS([struct udphdr.dest, struct udphdr.source], [], [], -[#if HAVE_STDINT_H +[#define _BSD_SOURCE +#if HAVE_STDINT_H # include #endif #if HAVE_SYS_TYPES_H @@ -1336,11 +1389,20 @@ then AC_CHECK_LIB(gcrypt, gcry_md_hash_buffer, [with_libgcrypt="yes"], [with_libgcrypt="no (symbol gcry_md_hash_buffer not found)"]) + + if test "$with_libgcrypt" != "no"; then + AM_PATH_LIBGCRYPT(1:1.2.0,,with_libgcrypt="no (version 1.2.0+ required)") + fi fi CPPFLAGS="$SAVE_CPPFLAGS" LDFLAGS="$SAVE_LDFLAGS" +if test "x$with_libgcrypt" = "xyes" +then + AC_DEFINE(HAVE_LIBGCRYPT, 1, [Define to 1 if you have the gcrypt library (-lgcrypt).]) +fi + AC_SUBST(GCRYPT_CPPFLAGS) AC_SUBST(GCRYPT_LDFLAGS) AC_SUBST(GCRYPT_LIBS) @@ -1419,6 +1481,7 @@ with_java_home="$JAVA_HOME" with_java_vmtype="client" with_java_cflags="" with_java_libs="" +JAVAC="$JAVAC" AC_ARG_WITH(java, [AS_HELP_STRING([--with-java@<:@=PREFIX@:>@], [Path to Java home.])], [ if test "x$withval" = "xno" @@ -1437,18 +1500,47 @@ if test "x$with_java" = "xyes" then if test -d "$with_java_home" then - if test -d "$with_java_home/include" + AC_MSG_CHECKING([for jni.h]) + TMPDIR=`find -L "$with_java_home" -name jni.h -type f -exec 'dirname' '{}' ';' | head -n 1` + if test "x$TMPDIR" != "x" then - JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$with_java_home/include" + AC_MSG_RESULT([found in $TMPDIR]) + JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPDIR" else - JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$with_java_home" + AC_MSG_RESULT([not found]) fi - - if test -d "$with_java_home/lib" + + AC_MSG_CHECKING([for jni_md.h]) + TMPDIR=`find -L "$with_java_home" -name jni_md.h -type f -exec 'dirname' '{}' ';' | head -n 1` + if test "x$TMPDIR" != "x" then - JAVA_LDFLAGS="$JAVA_LDFLAGS -L$with_java_home/lib" + AC_MSG_RESULT([found in $TMPDIR]) + JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$TMPDIR" else - JAVA_LDFLAGS="$JAVA_LDFLAGS -L$with_java_home" + AC_MSG_RESULT([not found]) + fi + + AC_MSG_CHECKING([for libjvm.so]) + TMPDIR=`find -L "$with_java_home" -name libjvm.so -type f -exec 'dirname' '{}' ';' | head -n 1` + if test "x$TMPDIR" != "x" + then + AC_MSG_RESULT([found in $TMPDIR]) + JAVA_LDFLAGS="$JAVA_LDFLAGS -L$TMPDIR" + else + AC_MSG_RESULT([not found]) + fi + + if test "x$JAVAC" = "x" + then + AC_MSG_CHECKING([for javac]) + TMPDIR=`find -L "$with_java_home" -name javac -type f | head -n 1` + if test "x$TMPDIR" != "x" + then + JAVAC="$TMPDIR" + AC_MSG_RESULT([$JAVAC]) + else + AC_MSG_RESULT([not found]) + fi fi else if test "x$with_java_home" != "x" then @@ -1468,6 +1560,24 @@ if test "x$JAVA_LDFLAGS" != "x" then AC_MSG_NOTICE([Building with JAVA_LDFLAGS set to: $JAVA_LDFLAGS]) fi +if test "x$JAVAC" = "x" +then + with_javac_path="$PATH" + if test "x$with_java_home" != "x" + then + with_javac_path="$with_java_home:with_javac_path" + if test -d "$with_java_home/bin" + then + with_javac_path="$with_java_home/bin:with_javac_path" + fi + fi + + AC_PATH_PROG(JAVAC, javac, [], "$with_javac_path") +fi +if test "x$JAVAC" = "x" +then + with_java="no (javac not found)" +fi SAVE_CPPFLAGS="$CPPFLAGS" SAVE_CFLAGS="$CFLAGS" @@ -1623,6 +1733,11 @@ then [with_libmysql="yes"], [with_libmysql="no (symbol 'mysql_init' not found)"], [$with_mysql_libs]) + + AC_CHECK_LIB(mysqlclient, mysql_get_server_version, + [with_libmysql="yes"], + [with_libmysql="no (symbol 'mysql_get_server_version' not found)"], + [$with_mysql_libs]) fi fi if test "x$with_libmysql" = "xyes" @@ -2187,7 +2302,6 @@ then LDFLAGS=$SAVE_LDFLAGS fi -c_cv_have_broken_perl_load_module="no" if test "x$with_libperl" = "xyes" then SAVE_CFLAGS=$CFLAGS @@ -3109,28 +3223,42 @@ AC_DEFUN( [AC_PLUGIN], [ enable_plugin="no" + force="no" AC_ARG_ENABLE([$1], AC_HELP_STRING([--enable-$1], [$3]), [ if test "x$enableval" = "xyes" then enable_plugin="yes" - else - enable_plugin="no" - fi - ], - [ - if test "x$2" = "xyes" + else if test "x$enableval" = "xforce" then enable_plugin="yes" + force="yes" else enable_plugin="no" - fi + fi; fi + ], + [ + if test "x$enable_all_plugins" = "xauto" + then + if test "x$2" = "xyes" + then + enable_plugin="yes" + else + enable_plugin="no" + fi + else + enable_plugin="$enable_all_plugins" + fi ]) if test "x$enable_plugin" = "xyes" then - if test "x$2" = "xyes" + if test "x$2" = "xyes" || test "x$force" = "xyes" then AC_DEFINE([HAVE_PLUGIN_]my_toupper([$1]), 1, [Define to 1 if the $1 plugin is enabled.]) + if test "x$2" != "xyes" + then + dependency_warning="yes" + fi else # User passed "yes" but dependency checking yielded "no" => Dependency problem. dependency_error="yes" enable_plugin="no (dependency error)" @@ -3148,7 +3276,9 @@ AC_COLLECTD([debug], [enable], [feature], [debugging]) AC_COLLECTD([daemon], [disable], [feature], [daemon mode]) AC_COLLECTD([getifaddrs],[enable], [feature], [getifaddrs under Linux]) +dependency_warning="no" dependency_error="no" + plugin_ascent="no" plugin_battery="no" plugin_bind="no" @@ -3167,6 +3297,7 @@ plugin_load="no" plugin_memory="no" plugin_multimeter="no" plugin_nfs="no" +plugin_fscache="no" plugin_perl="no" plugin_processes="no" plugin_protocols="no" @@ -3196,6 +3327,7 @@ then plugin_load="yes" plugin_memory="yes" plugin_nfs="yes" + plugin_fscache="yes" plugin_processes="yes" plugin_protocols="yes" plugin_serial="yes" @@ -3286,15 +3418,41 @@ then plugin_tcpconns="yes" fi -if test "x$have_statfs" = "xyes" +# Df plugin: Check if we know how to determine mount points first. +#if test "x$have_listmntent" = "xyes"; then +# plugin_df="yes" +#fi +if test "x$have_getvfsstat" = "xyes" || test "x$have_getfsstat" = "xyes" +then + plugin_df="yes" +fi +if test "x$c_cv_have_two_getmntent" = "xyes" || test "x$have_getmntent" = "xgen" || test "x$have_getmntent" = "xsun" then plugin_df="yes" fi -if test "x$have_statvfs" = "xyes" +#if test "x$have_getmntent" = "xseq" +#then +# plugin_df="yes" +#fi +if test "x$c_cv_have_one_getmntent" = "xyes" then plugin_df="yes" fi +# Df plugin: Check if we have either `statfs' or `statvfs' second. +if test "x$plugin_df" = "xyes" +then + plugin_df="no" + if test "x$have_statfs" = "xyes" + then + plugin_df="yes" + fi + if test "x$have_statvfs" = "xyes" + then + plugin_df="yes" + fi +fi + if test "x$have_getifaddrs" = "xyes" then plugin_interface="yes" @@ -3332,7 +3490,7 @@ then plugin_processes="yes" fi -if test "x$with_kvm_getprocs" = "xyes" +if test "x$with_kvm_getprocs" = "xyes" && test "x$have_struct_kinfo_proc_freebsd" = "xyes" then plugin_processes="yes" fi @@ -3364,6 +3522,24 @@ fi m4_divert_once([HELP_ENABLE], [ collectd plugins:]) +AC_ARG_ENABLE([all-plugins], + AC_HELP_STRING([--enable-all-plugins], + [enable all plugins (auto by def)]), + [ + if test "x$enableval" = "xyes" + then + enable_all_plugins="yes" + else if test "x$enableval" = "xauto" + then + enable_all_plugins="auto" + else + enable_all_plugins="no" + fi; fi + ], + [enable_all_plugins="auto"]) + +m4_divert_once([HELP_ENABLE], []) + AC_PLUGIN([apache], [$with_libcurl], [Apache httpd statistics]) AC_PLUGIN([apcups], [yes], [Statistics of UPSes by APC]) AC_PLUGIN([apple_sensors], [$with_libiokit], [Apple's hardware sensors]) @@ -3383,6 +3559,7 @@ AC_PLUGIN([email], [yes], [EMail statistics]) AC_PLUGIN([entropy], [$plugin_entropy], [Entropy statistics]) AC_PLUGIN([exec], [yes], [Execution of external programs]) AC_PLUGIN([filecount], [yes], [Count files in directories]) +AC_PLUGIN([fscache], [$plugin_fscache], [fscache statistics]) AC_PLUGIN([gmond], [$with_libganglia], [Ganglia plugin]) AC_PLUGIN([hddtemp], [yes], [Query hddtempd]) AC_PLUGIN([interface], [$plugin_interface], [Interface traffic statistics]) @@ -3580,7 +3757,7 @@ AC_SUBST(LCC_VERSION_STRING) AC_CONFIG_FILES(src/libcollectdclient/lcc_features.h) -AC_OUTPUT(Makefile src/Makefile src/collectd.conf src/libiptc/Makefile src/libcollectdclient/Makefile src/libcollectdclient/libcollectdclient.pc src/liboconfig/Makefile bindings/Makefile) +AC_OUTPUT(Makefile src/Makefile src/collectd.conf src/libiptc/Makefile src/libcollectdclient/Makefile src/libcollectdclient/libcollectdclient.pc src/liboconfig/Makefile bindings/Makefile bindings/java/Makefile) if test "x$with_librrd" = "xyes" \ && test "x$librrd_threadsafe" != "xyes" @@ -3613,6 +3790,7 @@ Configuration: libcurl . . . . . . . $with_libcurl libdbi . . . . . . . $with_libdbi libesmtp . . . . . . $with_libesmtp + libgcrypt . . . . . . $with_libgcrypt libiokit . . . . . . $with_libiokit libiptc . . . . . . . $with_libiptc libjvm . . . . . . . $with_java @@ -3665,6 +3843,7 @@ Configuration: entropy . . . . . . . $enable_entropy exec . . . . . . . . $enable_exec filecount . . . . . . $enable_filecount + fscache . . . . . . . $enable_fscache gmond . . . . . . . . $enable_gmond hddtemp . . . . . . . $enable_hddtemp interface . . . . . . $enable_interface @@ -3731,7 +3910,11 @@ Configuration: EOF if test "x$dependency_error" = "xyes"; then - AC_MSG_ERROR("Some plugins are missing dependencies - see above summary for details") + AC_MSG_ERROR("Some plugins are missing dependencies - see the summary above for details") +fi + +if test "x$dependency_warning" = "xyes"; then + AC_MSG_WARN("Some plugins seem to have missing dependencies but have been enabled forcibly - see the summary above for details") fi # vim: set fdm=marker :