From: Ruben Kerkhof Date: Fri, 11 Dec 2015 20:38:58 +0000 (+0100) Subject: Merge pull request #1459 from rubenk/remove-unneccesary-check-for-ip-compat-h X-Git-Tag: collectd-5.6.0~496 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=57dfc4722bb1c4d7f735c71aa113b9f6bbdce964;hp=311c7cf4b61bc02793fe3455202b2cbbfe4860e6;p=collectd.git Merge pull request #1459 from rubenk/remove-unneccesary-check-for-ip-compat-h Remove check for ip_compat.h --- diff --git a/README b/README index ad5b6678..f2371cbe 100644 --- a/README +++ b/README @@ -896,18 +896,19 @@ Configuring with libjvm library checks succeed. If this doesn't work for you, you have the possibility to specify CPP-flags, - C-flags and LD-flags for the ‘Java’ plugin by hand, using the following three - (environment) variables: + C-flags, LD-flags and LIBS for the ‘Java’ plugin by hand, using the + following environment variables: - JAVA_CPPFLAGS - JAVA_CFLAGS - JAVA_LDFLAGS + - JAVA_LIBS For example (shortened for demonstration purposes): ./configure JAVA_CPPFLAGS="-I$JAVA_HOME/include -I$JAVA_HOME/include/linux" - Adding "-ljvm" to the JAVA_LDFLAGS is done automatically, you don't have to + Adding "-ljvm" to JAVA_LIBS is done automatically, you don't have to do that. Generating the configure script diff --git a/configure.ac b/configure.ac index 97108199..257818d9 100644 --- a/configure.ac +++ b/configure.ac @@ -396,7 +396,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]) @@ -1513,6 +1513,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:]) @@ -2181,9 +2221,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.])], @@ -2276,6 +2313,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" @@ -2316,9 +2357,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 @@ -2328,7 +2371,7 @@ if test "x$with_java" = "xyes" then AC_CHECK_LIB(jvm, JNI_CreateJavaVM, [with_java="yes"], - [with_java="no (libjvm not found)"], + [with_java="no (Symbol 'JNI_CreateJavaVM' not found)"], [$JAVA_LIBS]) fi if test "x$with_java" = "xyes" @@ -2340,6 +2383,7 @@ fi CPPFLAGS="$SAVE_CPPFLAGS" CFLAGS="$SAVE_CFLAGS" LDFLAGS="$SAVE_LDFLAGS" +LIBS="$SAVE_LIBS" AC_SUBST(JAVA_CPPFLAGS) AC_SUBST(JAVA_CFLAGS) @@ -2965,7 +3009,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]) @@ -3233,13 +3277,13 @@ fi # --with-libowcapi {{{ with_libowcapi_cppflags="" -with_libowcapi_libs="-lowcapi" +with_libowcapi_ldflags="" AC_ARG_WITH(libowcapi, [AS_HELP_STRING([--with-libowcapi@<:@=PREFIX@:>@], [Path to libowcapi.])], [ if test "x$withval" != "xno" && test "x$withval" != "xyes" then with_libowcapi_cppflags="-I$withval/include" - with_libowcapi_libs="-L$withval/lib -lowcapi" + with_libowcapi_ldflags="-L$withval/lib" with_libowcapi="yes" else with_libowcapi="$withval" @@ -3251,7 +3295,7 @@ AC_ARG_WITH(libowcapi, [AS_HELP_STRING([--with-libowcapi@<:@=PREFIX@:>@], [Path if test "x$with_libowcapi" = "xyes" then SAVE_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$with_libowcapi_cppflags" + CPPFLAGS="$CPPFLAGS $with_libowcapi_cppflags" AC_CHECK_HEADERS(owcapi.h, [with_libowcapi="yes"], [with_libowcapi="no (owcapi.h not found)"]) @@ -3261,7 +3305,7 @@ if test "x$with_libowcapi" = "xyes" then SAVE_LDFLAGS="$LDFLAGS" SAVE_CPPFLAGS="$CPPFLAGS" - LDFLAGS="$with_libowcapi_libs" + LDFLAGS="$LDFLAGS $with_libowcapi_ldflags" CPPFLAGS="$with_libowcapi_cppflags" AC_CHECK_LIB(owcapi, OW_get, [with_libowcapi="yes"], [with_libowcapi="no (libowcapi not found)"]) @@ -3272,8 +3316,10 @@ fi if test "x$with_libowcapi" = "xyes" then BUILD_WITH_LIBOWCAPI_CPPFLAGS="$with_libowcapi_cppflags" - BUILD_WITH_LIBOWCAPI_LIBS="$with_libowcapi_libs" + BUILD_WITH_LIBOWCAPI_LDFLAGS="$with_libowcapi_ldflags" + BUILD_WITH_LIBOWCAPI_LIBS="-lowcapi" AC_SUBST(BUILD_WITH_LIBOWCAPI_CPPFLAGS) + AC_SUBST(BUILD_WITH_LIBOWCAPI_LDFLAGS) AC_SUBST(BUILD_WITH_LIBOWCAPI_LIBS) fi # }}} @@ -3602,41 +3648,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" @@ -4083,11 +4094,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" @@ -4743,7 +4749,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 ], @@ -4765,8 +4771,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" @@ -5123,11 +5129,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 # @@ -5415,7 +5418,6 @@ then fi # libi2c-dev -with_libi2c="no" if test "x$ac_system" = "xLinux" then AC_CHECK_DECL(i2c_smbus_read_i2c_block_data, @@ -5423,6 +5425,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" diff --git a/src/Makefile.am b/src/Makefile.am index 9c1e32fb..ff3eef49 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -97,7 +97,7 @@ if BUILD_AIX collectd_tg_LDADD += -lm endif if BUILD_WITH_LIBPTHREAD -collectd_tg_LDADD += -lpthread +collectd_tg_LDADD += $(PTHREAD_LIBS) endif collectd_tg_LDADD += libcollectdclient/libcollectdclient.la collectd_tg_DEPENDENCIES = libcollectdclient/libcollectdclient.la @@ -349,21 +349,21 @@ if BUILD_PLUGIN_DNS pkglib_LTLIBRARIES += dns.la dns_la_SOURCES = dns.c utils_dns.c utils_dns.h dns_la_LDFLAGS = $(PLUGIN_LDFLAGS) -dns_la_LIBADD = -lpcap -lpthread +dns_la_LIBADD = $(PTHREAD_LIBS) -lpcap endif if BUILD_PLUGIN_DRBD pkglib_LTLIBRARIES += drbd.la drbd_la_SOURCES = drbd.c drbd_la_LDFLAGS = $(PLUGIN_LDFLAGS) -drbd_la_LIBADD = -lpthread +drbd_la_LIBADD = $(PTHREAD_LIBS) endif if BUILD_PLUGIN_EMAIL pkglib_LTLIBRARIES += email.la email_la_SOURCES = email.c email_la_LDFLAGS = $(PLUGIN_LDFLAGS) -email_la_LIBADD = -lpthread +email_la_LIBADD = $(PTHREAD_LIBS) endif if BUILD_PLUGIN_ENTROPY @@ -379,7 +379,7 @@ exec_la_SOURCES = exec.c \ utils_cmd_putval.c utils_cmd_putval.h \ utils_parse_option.h utils_parse_option.c exec_la_LDFLAGS = $(PLUGIN_LDFLAGS) -exec_la_LIBADD = -lpthread +exec_la_LIBADD = $(PTHREAD_LIBS) endif if BUILD_PLUGIN_ETHSTAT @@ -688,7 +688,7 @@ network_la_SOURCES = network.c network.h \ utils_fbhash.c utils_fbhash.h network_la_CPPFLAGS = $(AM_CPPFLAGS) network_la_LDFLAGS = $(PLUGIN_LDFLAGS) -network_la_LIBADD = -lpthread +network_la_LIBADD = $(PTHREAD_LIBS) if BUILD_WITH_LIBSOCKET network_la_LIBADD += -lsocket endif @@ -735,7 +735,7 @@ if BUILD_PLUGIN_NOTIFY_EMAIL pkglib_LTLIBRARIES += notify_email.la notify_email_la_SOURCES = notify_email.c notify_email_la_LDFLAGS = $(PLUGIN_LDFLAGS) -notify_email_la_LIBADD = -lesmtp -lssl -lcrypto -lpthread +notify_email_la_LIBADD = $(PTHREAD_LIBS) -lesmtp -lssl -lcrypto endif if BUILD_PLUGIN_NOTIFY_NAGIOS @@ -765,7 +765,7 @@ pkglib_LTLIBRARIES += nut.la nut_la_SOURCES = nut.c nut_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBUPSCLIENT_CFLAGS) nut_la_LDFLAGS = $(PLUGIN_LDFLAGS) -nut_la_LIBADD = -lpthread $(BUILD_WITH_LIBUPSCLIENT_LIBS) +nut_la_LIBADD = $(PTHREAD_LIBS) $(BUILD_WITH_LIBUPSCLIENT_LIBS) endif if BUILD_PLUGIN_OLSRD @@ -784,7 +784,7 @@ onewire_la_SOURCES = onewire.c onewire_la_CFLAGS = $(AM_CFLAGS) onewire_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBOWCAPI_CPPFLAGS) onewire_la_LIBADD = $(BUILD_WITH_LIBOWCAPI_LIBS) -onewire_la_LDFLAGS = $(PLUGIN_LDFLAGS) +onewire_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBOWCAPI_LDFLAGS) endif if BUILD_PLUGIN_OPENLDAP @@ -972,7 +972,7 @@ snmp_la_CFLAGS += $(BUILD_WITH_LIBSNMP_CFLAGS) snmp_la_LIBADD += $(BUILD_WITH_LIBSNMP_LIBS) endif if BUILD_WITH_LIBPTHREAD -snmp_la_LIBADD += -lpthread +snmp_la_LIBADD += $(PTHREAD_LIBS) endif endif @@ -980,7 +980,7 @@ if BUILD_PLUGIN_STATSD pkglib_LTLIBRARIES += statsd.la statsd_la_SOURCES = statsd.c statsd_la_LDFLAGS = $(PLUGIN_LDFLAGS) -statsd_la_LIBADD = liblatency.la -lpthread -lm +statsd_la_LIBADD = $(PTHREAD_LIBS) liblatency.la -lm endif if BUILD_PLUGIN_SWAP @@ -1131,7 +1131,7 @@ unixsock_la_SOURCES = unixsock.c \ utils_cmd_putnotif.h utils_cmd_putnotif.c \ utils_parse_option.h utils_parse_option.c unixsock_la_LDFLAGS = $(PLUGIN_LDFLAGS) -unixsock_la_LIBADD = -lpthread +unixsock_la_LIBADD = $(PTHREAD_LIBS) endif if BUILD_PLUGIN_UPTIME diff --git a/src/daemon/common_test.c b/src/daemon/common_test.c index 399f8b53..ca8f15a3 100644 --- a/src/daemon/common_test.c +++ b/src/daemon/common_test.c @@ -24,8 +24,8 @@ * Florian octo Forster */ -#include "testing.h" #include "common.h" +#include "testing.h" #if HAVE_LIBKSTAT kstat_ctl_t *kc; diff --git a/src/daemon/meta_data_test.c b/src/daemon/meta_data_test.c index b4c0e276..48760d64 100644 --- a/src/daemon/meta_data_test.c +++ b/src/daemon/meta_data_test.c @@ -24,9 +24,9 @@ * Florian octo Forster */ -#include "testing.h" -#include "collectd.h" #include "common.h" /* for STATIC_ARRAY_SIZE */ +#include "collectd.h" +#include "testing.h" #include "meta_data.h" DEF_TEST(base) diff --git a/src/daemon/utils_avltree_test.c b/src/daemon/utils_avltree_test.c index 6dbafe18..489d60fa 100644 --- a/src/daemon/utils_avltree_test.c +++ b/src/daemon/utils_avltree_test.c @@ -24,10 +24,10 @@ * Florian octo Forster */ -#include "testing.h" +#include "common.h" /* STATIC_ARRAY_SIZE */ #include "collectd.h" +#include "testing.h" #include "utils_avltree.h" -#include "common.h" /* STATIC_ARRAY_SIZE */ static int compare_total_count = 0; #define RESET_COUNTS() do { compare_total_count = 0; } while (0) diff --git a/src/daemon/utils_heap_test.c b/src/daemon/utils_heap_test.c index 53d0fba8..6ef80475 100644 --- a/src/daemon/utils_heap_test.c +++ b/src/daemon/utils_heap_test.c @@ -24,8 +24,8 @@ * Florian octo Forster */ -#include "testing.h" #include "collectd.h" +#include "testing.h" #include "utils_heap.h" static int compare (void const *v0, void const *v1) diff --git a/src/daemon/utils_subst_test.c b/src/daemon/utils_subst_test.c index c12aa105..ec2e3514 100644 --- a/src/daemon/utils_subst_test.c +++ b/src/daemon/utils_subst_test.c @@ -24,9 +24,9 @@ * Florian octo Forster */ -#include "testing.h" -#include "collectd.h" #include "common.h" /* for STATIC_ARRAY_SIZE */ +#include "collectd.h" +#include "testing.h" #include "utils_subst.h" #if HAVE_LIBKSTAT diff --git a/src/daemon/utils_time_test.c b/src/daemon/utils_time_test.c index 255286f4..4d64991b 100644 --- a/src/daemon/utils_time_test.c +++ b/src/daemon/utils_time_test.c @@ -26,8 +26,8 @@ #define DBL_PRECISION 1e-3 -#include "testing.h" #include "collectd.h" +#include "testing.h" #include "utils_time.h" DEF_TEST(conversion) diff --git a/src/utils_latency_test.c b/src/utils_latency_test.c index 5769ec95..f275813d 100644 --- a/src/utils_latency_test.c +++ b/src/utils_latency_test.c @@ -26,9 +26,9 @@ #define DBL_PRECISION 1e-9 -#include "testing.h" -#include "collectd.h" #include "common.h" /* for STATIC_ARRAY_SIZE */ +#include "collectd.h" +#include "testing.h" #include "utils_time.h" #include "utils_latency.h" diff --git a/src/utils_mount_test.c b/src/utils_mount_test.c index b4cb4321..d9d685ae 100644 --- a/src/utils_mount_test.c +++ b/src/utils_mount_test.c @@ -24,8 +24,8 @@ * Florian octo Forster */ -#include "testing.h" #include "collectd.h" +#include "testing.h" #include "utils_mount.h" #if HAVE_LIBKSTAT diff --git a/src/utils_vl_lookup_test.c b/src/utils_vl_lookup_test.c index 41cc0a41..6d23c8c5 100644 --- a/src/utils_vl_lookup_test.c +++ b/src/utils_vl_lookup_test.c @@ -24,8 +24,8 @@ * Florian Forster **/ -#include "testing.h" #include "collectd.h" +#include "testing.h" #include "utils_vl_lookup.h" static _Bool expect_new_obj = 0;