X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=configure.ac;h=b1dc31f4ffdcfebea357ed3ede6ea055b3c820dc;hb=840f4cef30b01a6928832f09daf00890b35f3582;hp=655d6d8fd0d82b0e9b7815ad5b805fc639302623;hpb=130bf8ce428a7bbdec766d35c76bd616358e5431;p=collectd.git diff --git a/configure.ac b/configure.ac index 655d6d8f..b1dc31f4 100644 --- a/configure.ac +++ b/configure.ac @@ -44,6 +44,7 @@ AC_SYS_LARGEFILE # AC_PROG_CC AC_PROG_CPP +AC_PROG_EGREP AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET @@ -54,8 +55,24 @@ AC_DISABLE_STATIC AC_PROG_LIBTOOL AC_PROG_LEX AC_PROG_YACC + +# Warn when pkg.m4 is missing +m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config]) + PKG_PROG_PKG_CONFIG +AC_CACHE_CHECK([if bison is the parser generator], + [collectd_cv_prog_bison], + [AS_IF([$YACC --version 2>/dev/null | $EGREP -q '^bison '], + [collectd_cv_prog_bison=yes], [collectd_cv_prog_bison=no] + )] +) + +if test "x$collectd_cv_prog_bison" = "xno" && test ! -f "${srcdir}/src/liboconfig/parser.c" +then + AC_MSG_ERROR([bison is missing and you do not have ${srcdir}/src/liboconfig/parser.c. Please install bison]) +fi + AC_CHECK_PROG([have_protoc_c], [protoc-c], [yes], [no]) if test "x$have_protoc_c" = "xno" then @@ -95,6 +112,10 @@ case $host_os in AC_DEFINE([KERNEL_OPENBSD], 1, [True if program is to be compiled for an OpenBSD kernel]) ac_system="OpenBSD" ;; + *netbsd*) + AC_DEFINE([KERNEL_NETBSD], 1, [True if program is to be compiled for a NetBSD kernel]) + ac_system="NetBSD" + ;; *aix*) AC_DEFINE([KERNEL_AIX], 1, [True if program is to be compiled for a AIX kernel]) ac_system="AIX" @@ -182,6 +203,19 @@ AC_HEADER_STDBOOL AC_CHECK_HEADERS(stdio.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 fnmatch.h libgen.h) +# For entropy plugin on newer NetBSD +AC_CHECK_HEADERS(sys/rndio.h, [], [], +[#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_SYS_IOCTL_H +# include +#endif +#if HAVE_SYS_PARAM_H +# include +#endif +]) + # For ping library AC_CHECK_HEADERS(netinet/in_systm.h, [], [], [#if HAVE_STDINT_H @@ -396,7 +430,7 @@ AC_CHECK_HEADERS(sys/sysctl.h, [], [], AC_MSG_CHECKING([for sysctl kern.cp_times]) if test -x /sbin/sysctl then - /sbin/sysctl kern.cp_times 2>/dev/null + /sbin/sysctl kern.cp_times >/dev/null 2>&1 if test $? -eq 0 then AC_MSG_RESULT([yes]) @@ -409,6 +443,22 @@ else AC_MSG_RESULT([no]) fi +AC_MSG_CHECKING([for sysctl kern.cp_time]) +if test -x /sbin/sysctl +then + /sbin/sysctl kern.cp_time >/dev/null 2>&1 + if test $? -eq 0 + then + AC_MSG_RESULT([yes]) + AC_DEFINE(HAVE_SYSCTL_KERN_CP_TIME, 1, + [Define if sysctl supports kern.cp_time]) + else + AC_MSG_RESULT([no]) + fi +else + AC_MSG_RESULT([no]) +fi + # For hddtemp module AC_CHECK_HEADERS(linux/major.h) @@ -427,7 +477,7 @@ else have_linux_raid_md_u_h="no" fi -# For the swap module +# For the wireless module have_linux_wireless_h="no" if test "x$ac_system" = "xLinux" then @@ -634,8 +684,6 @@ AC_CHECK_HEADERS(netinet/if_ether.h, [], [], #endif ]) -AC_CHECK_HEADERS(netinet/ip_compat.h) - have_net_pfvar_h="no" AC_CHECK_HEADERS(net/pfvar.h, [have_net_pfvar_h="yes"], @@ -690,13 +738,9 @@ AC_CHECK_HEADERS(sys/capability.h) # Checks for typedefs, structures, and compiler characteristics. # AC_C_CONST -AC_C_INLINE -AC_TYPE_OFF_T AC_TYPE_PID_T AC_TYPE_SIZE_T -AC_TYPE_SSIZE_T AC_TYPE_UID_T -AC_TYPE_UINT32_T AC_HEADER_TIME # @@ -806,8 +850,6 @@ fi if test "x$have_clock_gettime" = "xyes" then AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Define if the clock_gettime(2) function is available.]) -else - AC_MSG_WARN(cannot find clock_gettime) fi nanosleep_needs_rt="no" @@ -1435,6 +1477,24 @@ AC_CHECK_MEMBERS([struct kinfo_proc.p_pid, struct kinfo_proc.p_vm_rssize], #include ]) + +AC_CHECK_MEMBERS([struct kinfo_proc2.p_pid, struct kinfo_proc2.p_uru_maxrss], + [ + AC_DEFINE(HAVE_STRUCT_KINFO_PROC2_NETBSD, 1, + [Define if struct kinfo_proc2 exists in the NetBSD variant.]) + have_struct_kinfo_proc2_netbsd="yes" + ], + [ + have_struct_kinfo_proc2_netbsd="no" + ], + [ +#include +#include +#include + ]) + + + AC_CHECK_MEMBERS([struct udphdr.uh_dport, struct udphdr.uh_sport], [], [], [#define _BSD_SOURCE #define _DEFAULT_SOURCE @@ -1515,6 +1575,46 @@ if test "x$with_libhal" = "xyes"; then fi fi +# --with-libpthread {{{ +AC_ARG_WITH(libpthread, [AS_HELP_STRING([--with-libpthread=@<:@=PREFIX@:>@], [Path to libpthread.])], +[ if test "x$withval" != "xno" \ + && test "x$withval" != "xyes" + then + LDFLAGS="$LDFLAGS -L$withval/lib" + CPPFLAGS="$CPPFLAGS -I$withval/include" + with_libpthread="yes" + else + if test "x$withval" = "xno" + then + with_libpthread="no (disabled)" + fi + fi +], [with_libpthread="yes"]) + +AC_SUBST([PTHREAD_LIBS]) +if test "x$with_libpthread" = "xyes" +then + SAVE_LIBS="$LIBS" + AC_CHECK_LIB(pthread, pthread_create, [], [with_libpthread="no (Symbol 'pthread_create' not found)"], []) + PTHREAD_LIBS="$LIBS" + LIBS="$SAVE_LIBS" +fi + +if test "x$with_libpthread" = "xyes" +then + AC_CHECK_HEADERS(pthread.h,, [with_libpthread="no (pthread.h not found)"]) +fi +if test "x$with_libpthread" = "xyes" +then + collect_pthread=1 +else + collect_pthread=0 +fi +AC_DEFINE_UNQUOTED(HAVE_LIBPTHREAD, [$collect_pthread], + [Wether or not to use pthread (POSIX threads) library]) +AM_CONDITIONAL(BUILD_WITH_LIBPTHREAD, test "x$with_libpthread" = "xyes") +# }}} + m4_divert_once([HELP_WITH], [ collectd additional packages:]) @@ -2183,9 +2283,6 @@ if test "x$with_java_home" = "x" then with_java_home="/usr/lib/jvm" fi -with_java_vmtype="client" -with_java_cflags="" -with_java_libs="" JAVAC="$JAVAC" JAR="$JAR" AC_ARG_WITH(java, [AS_HELP_STRING([--with-java@<:@=PREFIX@:>@], [Path to Java home.])], @@ -2278,6 +2375,10 @@ if test "x$JAVA_LDFLAGS" != "x" then AC_MSG_NOTICE([Building with JAVA_LDFLAGS set to: $JAVA_LDFLAGS]) fi +if test "x$JAVA_LIBS" != "x" +then + AC_MSG_NOTICE([Building with JAVA_LIBS set to: $JAVA_LIBS]) +fi if test "x$JAVAC" = "x" then with_javac_path="$PATH" @@ -2318,9 +2419,11 @@ fi SAVE_CPPFLAGS="$CPPFLAGS" SAVE_CFLAGS="$CFLAGS" SAVE_LDFLAGS="$LDFLAGS" +SAVE_LIBS="$LIBS" CPPFLAGS="$CPPFLAGS $JAVA_CPPFLAGS" CFLAGS="$CFLAGS $JAVA_CFLAGS" LDFLAGS="$LDFLAGS $JAVA_LDFLAGS" +LIBS="$LIBS $JAVA_LIBS" if test "x$with_java" = "xyes" then @@ -2330,8 +2433,8 @@ if test "x$with_java" = "xyes" then AC_CHECK_LIB(jvm, JNI_CreateJavaVM, [with_java="yes"], - [with_java="no (libjvm not found)"], - [$JAVA_LIBS]) + [with_java="no (Symbol 'JNI_CreateJavaVM' not found)"], + [$JAVA_LIBS $PTHREAD_LIBS]) fi if test "x$with_java" = "xyes" then @@ -2342,6 +2445,7 @@ fi CPPFLAGS="$SAVE_CPPFLAGS" CFLAGS="$SAVE_CFLAGS" LDFLAGS="$SAVE_LDFLAGS" +LIBS="$SAVE_LIBS" AC_SUBST(JAVA_CPPFLAGS) AC_SUBST(JAVA_CFLAGS) @@ -2413,17 +2517,25 @@ with_liblvm2app_cppflags="" with_liblvm2app_ldflags="" AC_ARG_WITH(liblvm2app, [AS_HELP_STRING([--with-liblvm2app@<:@=PREFIX@:>@], [Path to liblvm2app.])], [ - if test "x$withval" != "xno" && test "x$withval" != "xyes" - then - with_liblvm2app_cppflags="-I$withval/include" - with_liblvm2app_ldflags="-L$withval/lib" - with_liblvm2app="yes" - else - with_liblvm2app="$withval" + if test "x$withval" = "xno" + then + with_liblvm2app="no" + else + with_liblvm2app="yes" + if test "x$withval" != "xyes" + then + with_liblvm2app_cppflags="-I$withval/include" + with_liblvm2app_ldflags="-L$withval/lib" + fi fi ], [ - with_liblvm2app="yes" + if test "x$ac_system" = "xLinux" + then + with_liblvm2app="yes" + else + with_liblvm2app="no (Linux only library)" + fi ]) if test "x$with_liblvm2app" = "xyes" then @@ -2967,7 +3079,7 @@ then if test "x$LIBNETAPP_LIBS" = "x" then - LIBNETAPP_LIBS="-lpthread -lxml -ladt -lssl -lm -lcrypto -lz" + LIBNETAPP_LIBS="$PTHREAD_LIBS -lxml -ladt -lssl -lm -lcrypto -lz" fi AC_MSG_NOTICE([netapp LIBS: $LIBNETAPP_LIBS]) @@ -3606,41 +3718,6 @@ fi AM_CONDITIONAL(BUILD_WITH_LIBPQ, test "x$with_libpq" = "xyes") # }}} -# --with-libpthread {{{ -AC_ARG_WITH(libpthread, [AS_HELP_STRING([--with-libpthread=@<:@=PREFIX@:>@], [Path to libpthread.])], -[ if test "x$withval" != "xno" \ - && test "x$withval" != "xyes" - then - LDFLAGS="$LDFLAGS -L$withval/lib" - CPPFLAGS="$CPPFLAGS -I$withval/include" - with_libpthread="yes" - else - if test "x$withval" = "xno" - then - with_libpthread="no (disabled)" - fi - fi -], [with_libpthread="yes"]) -if test "x$with_libpthread" = "xyes" -then - AC_CHECK_LIB(pthread, pthread_create, [with_libpthread="yes"], [with_libpthread="no (libpthread not found)"], []) -fi - -if test "x$with_libpthread" = "xyes" -then - AC_CHECK_HEADERS(pthread.h,, [with_libpthread="no (pthread.h not found)"]) -fi -if test "x$with_libpthread" = "xyes" -then - collect_pthread=1 -else - collect_pthread=0 -fi -AC_DEFINE_UNQUOTED(HAVE_LIBPTHREAD, [$collect_pthread], - [Wether or not to use pthread (POSIX threads) library]) -AM_CONDITIONAL(BUILD_WITH_LIBPTHREAD, test "x$with_libpthread" = "xyes") -# }}} - # --with-python {{{ with_python_prog="" with_python_path="$PATH" @@ -4087,11 +4164,6 @@ then SAVE_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $with_sensors_cflags" -# AC_CHECK_HEADERS(sensors/sensors.h, -# [ -# AC_DEFINE(HAVE_SENSORS_SENSORS_H, 1, [Define to 1 if you have the header file.]) -# ], -# [with_libsensors="no (sensors/sensors.h not found)"]) AC_CHECK_HEADERS(sensors/sensors.h, [], [with_libsensors="no (sensors/sensors.h not found)"]) CPPFLAGS="$SAVE_CPPFLAGS" @@ -4299,6 +4371,7 @@ fi if test "x$with_libstatgrab" = "xyes" then SAVE_CFLAGS="$CFLAGS" + SAVE_LDFLAGS="$LDFLAGS" SAVE_LIBS="$LIBS" CFLAGS="$CFLAGS $with_libstatgrab_cflags" @@ -4747,7 +4820,7 @@ AC_ARG_WITH(mic,[AS_HELP_STRING([--with-mic@<:@=PREFIX@:>@], [Path to Intel MIC AC_MSG_NOTICE([Not checking for Intel Mic: Manually configured]) with_mic_cflags="-I$withval/include" with_mic_ldpath="-L$withval/lib/Linux" - with_mic_libs="-lMicAccessSDK -lscif -lpthread" + with_mic_libs="$PTHREAD_LIBS -lMicAccessSDK -lscif" with_mic="yes" fi; fi; fi ], @@ -4769,8 +4842,8 @@ then AC_CHECK_LIB(MicAccessSDK, MicInitAPI, [with_mic_ldpath="$with_mic_ldpath" - with_mic_libs="-lMicAccessSDK -lscif -lpthread"], - [with_mic="no (symbol MicInitAPI not found)"],[-lscif -lpthread]) + with_mic_libs="$PTHREAD_LIBS -lMicAccessSDK -lscif"], + [with_mic="no (symbol MicInitAPI not found)"],[$PTHREAD_LIBS -lscif]) CPPFLAGS="$SAVE_CPPFLAGS" LDFLAGS="$SAVE_LDFLAGS" @@ -5127,11 +5200,8 @@ AM_CONDITIONAL(BUILD_WITH_LIBATASMART, test "x$with_libatasmart" = "xyes") PKG_CHECK_MODULES([LIBNOTIFY], [libnotify], [with_libnotify="yes"], - [if test "x$LIBNOTIFY_PKG_ERRORS" = "x"; then - with_libnotify="no" - else - with_libnotify="no ($LIBNOTIFY_PKG_ERRORS)" - fi]) + [with_libnotify="no (pkg-config doesn't know libnotify)"] +) # Check for enabled/disabled features # @@ -5358,6 +5428,14 @@ then plugin_tcpconns="yes" fi +if test "x$ac_system" = "xNetBSD" +then + plugin_entropy="yes" + plugin_irq="yes" + plugin_processes="yes" + plugin_disk="yes" +fi + # Mac OS X devices if test "x$with_libiokit" = "xyes" then @@ -5419,7 +5497,6 @@ then fi # libi2c-dev -with_libi2c="no" if test "x$ac_system" = "xLinux" then AC_CHECK_DECL(i2c_smbus_read_i2c_block_data, @@ -5427,6 +5504,8 @@ AC_CHECK_DECL(i2c_smbus_read_i2c_block_data, [with_libi2c="no (symbol i2c_smbus_read_i2c_block_data not found - have you installed libi2c-dev ?)"], [[#include #include ]]) +else + with_libi2c="no (Linux only)" fi if test "x$with_libi2c" = "xyes" @@ -5603,6 +5682,11 @@ then plugin_swap="yes" fi +if test "x$have_swapctl" = "xyes" && test "x$c_cv_have_swapctl_three_args" = "xyes" +then + plugin_swap="yes" +fi + if test "x$with_kvm_openfiles$with_kvm_nlist" = "xyesyes" then plugin_tcpconns="yes"