From: octo Date: Sun, 29 Jan 2006 21:59:07 +0000 (+0000) Subject: Updated `configure.in' X-Git-Tag: collectd-3.7.0~10 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=586eed684dc5529c74d6e81f80e226c122494495;p=collectd.git Updated `configure.in' --- diff --git a/configure.in b/configure.in index 1a97afa3..6937227e 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.7.alpha1) +AC_INIT(collectd, 3.7.alpha2) 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 @@ -31,15 +32,19 @@ AC_CONFIG_SUBDIRS(libltdl src/libconfig) # AC_HEADER_SYS_WAIT AC_HEADER_DIRENT +AC_CHECK_HEADERS(errno.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(netinet/in.h) AC_CHECK_HEADERS(sys/resource.h) AC_CHECK_HEADERS(sys/param.h) -AC_CHECK_HEADERS(errno.h) -AC_CHECK_HEADERS(syslog.h) # For cpu modules AC_CHECK_HEADERS(sys/sysctl.h sys/dkstat.h) @@ -47,10 +52,6 @@ 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) @@ -99,7 +100,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) @@ -187,6 +188,7 @@ esac AC_MSG_RESULT([$ac_system]) dnl Checks for libraries. +# FIXME don't link all plugins against these libraries! AC_CHECK_LIB(socket, socket) AC_CHECK_LIB(resolv, res_search) diff --git a/src/Makefile.am b/src/Makefile.am index b6ae7588..341c6820 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -3,6 +3,10 @@ if BUILD_MODULE_PING SUBDIRS += libping endif +if COMPILER_IS_GCC +AM_CFLAGS = -Wall -Werror +endif + sbin_PROGRAMS = collectd collectd_SOURCES = collectd.c collectd.h \ @@ -24,7 +28,6 @@ if BUILD_FEATURE_DEBUG collectd_CPPFLAGS += -DLOGFILE='"${localstatedir}/log/${PACKAGE_NAME}/collectd.log"' endif collectd_LDFLAGS = -export-dynamic -collectd_CFLAGS = -Wall -Werror collectd_LDADD = $(LIBLTDL) libconfig/libconfig.la "-dlopen" self collectd_DEPENDENCIES = $(LIBLTDL) libconfig/libconfig.la @@ -34,7 +37,6 @@ if BUILD_MODULE_BATTERY pkglib_LTLIBRARIES += battery.la battery_la_SOURCES = battery.c battery_la_LDFLAGS = -module -avoid-version -battery_la_CFLAGS = -Wall -Werror collectd_LDADD += "-dlopen" battery.la collectd_DEPENDENCIES += battery.la endif @@ -43,7 +45,6 @@ if BUILD_MODULE_CPU pkglib_LTLIBRARIES += cpu.la cpu_la_SOURCES = cpu.c cpu.h cpu_la_LDFLAGS = -module -avoid-version -cpu_la_CFLAGS = -Wall -Werror collectd_LDADD += "-dlopen" cpu.la collectd_DEPENDENCIES += cpu.la endif @@ -52,7 +53,6 @@ if BUILD_MODULE_CPUFREQ pkglib_LTLIBRARIES += cpufreq.la cpufreq_la_SOURCES = cpufreq.c cpufreq.h cpufreq_la_LDFLAGS = -module -avoid-version -cpufreq_la_CFLAGS = -Wall -Werror collectd_LDADD += "-dlopen" cpufreq.la collectd_DEPENDENCIES += cpufreq.la endif @@ -61,7 +61,6 @@ if BUILD_MODULE_DF pkglib_LTLIBRARIES += df.la df_la_SOURCES = df.c df_la_LDFLAGS = -module -avoid-version -df_la_CFLAGS = -Wall -Werror collectd_LDADD += "-dlopen" df.la collectd_DEPENDENCIES += df.la endif @@ -70,7 +69,6 @@ if BUILD_MODULE_DISK pkglib_LTLIBRARIES += disk.la disk_la_SOURCES = disk.c disk.h disk_la_LDFLAGS = -module -avoid-version -disk_la_CFLAGS = -Wall -Werror collectd_LDADD += "-dlopen" disk.la collectd_DEPENDENCIES += disk.la endif @@ -90,7 +88,6 @@ if BUILD_MODULE_HDDTEMP pkglib_LTLIBRARIES += hddtemp.la hddtemp_la_SOURCES = hddtemp.c hddtemp.h hddtemp_la_LDFLAGS = -module -avoid-version -hddtemp_la_CFLAGS = -Wall -Werror collectd_LDADD += "-dlopen" hddtemp.la collectd_DEPENDENCIES += hddtemp.la endif @@ -99,7 +96,6 @@ if BUILD_MODULE_LOAD pkglib_LTLIBRARIES += load.la load_la_SOURCES = load.c load.h load_la_LDFLAGS = -module -avoid-version -load_la_CFLAGS = -Wall -Werror collectd_LDADD += "-dlopen" load.la collectd_DEPENDENCIES += load.la endif @@ -108,7 +104,6 @@ if BUILD_MODULE_MEMORY pkglib_LTLIBRARIES += memory.la memory_la_SOURCES = memory.c memory.h memory_la_LDFLAGS = -module -avoid-version -memory_la_CFLAGS = -Wall -Werror collectd_LDADD += "-dlopen" memory.la collectd_DEPENDENCIES += memory.la endif @@ -121,7 +116,6 @@ if BUILD_WITH_LIBMYSQL mysql_la_LDFLAGS += -lmysqlclient endif #mysql_la_LIBADD = -lmysqlclient -mysql_la_CFLAGS = -Wall -Werror collectd_LDADD += "-dlopen" mysql.la collectd_DEPENDENCIES += mysql.la endif @@ -130,7 +124,6 @@ if BUILD_MODULE_NFS pkglib_LTLIBRARIES += nfs.la nfs_la_SOURCES = nfs.c nfs.h nfs_la_LDFLAGS = -module -avoid-version -nfs_la_CFLAGS = -Wall -Werror collectd_LDADD += "-dlopen" nfs.la collectd_DEPENDENCIES += nfs.la endif @@ -141,7 +134,6 @@ ping_la_SOURCES = ping.c ping.h ping_la_LDFLAGS = -module -avoid-version ping_la_LIBADD = libping/libping.la ping_la_DEPENDENCIES = libping/libping.la -ping_la_CFLAGS = -Wall -Werror collectd_LDADD += "-dlopen" ping.la collectd_DEPENDENCIES += ping.la endif @@ -150,7 +142,6 @@ if BUILD_MODULE_PROCESSES pkglib_LTLIBRARIES += processes.la processes_la_SOURCES = processes.c processes.h processes_la_LDFLAGS = -module -avoid-version -processes_la_CFLAGS = -Wall -Werror collectd_LDADD += "-dlopen" processes.la collectd_DEPENDENCIES += processes.la endif @@ -163,7 +154,6 @@ if BUILD_WITH_LM_SENSORS sensors_la_LDFLAGS += -lsensors endif sensors_la_LIBADD = -lsensors -sensors_la_CFLAGS = -Wall -Werror collectd_LDADD += "-dlopen" sensors.la collectd_DEPENDENCIES += sensors.la endif @@ -172,7 +162,6 @@ if BUILD_MODULE_SERIAL pkglib_LTLIBRARIES += serial.la serial_la_SOURCES = serial.c serial.h serial_la_LDFLAGS = -module -avoid-version -serial_la_CFLAGS = -Wall -Werror collectd_LDADD += "-dlopen" serial.la collectd_DEPENDENCIES += serial.la endif @@ -181,7 +170,6 @@ if BUILD_MODULE_SWAP pkglib_LTLIBRARIES += swap.la swap_la_SOURCES = swap.c swap.h swap_la_LDFLAGS = -module -avoid-version -swap_la_CFLAGS = -Wall -Werror collectd_LDADD += "-dlopen" swap.la collectd_DEPENDENCIES += swap.la endif @@ -190,7 +178,6 @@ if BUILD_MODULE_TAPE pkglib_LTLIBRARIES += tape.la tape_la_SOURCES = tape.c tape.h tape_la_LDFLAGS = -module -avoid-version -tape_la_CFLAGS = -Wall -Werror collectd_LDADD += "-dlopen" tape.la collectd_DEPENDENCIES += tape.la endif @@ -199,7 +186,6 @@ if BUILD_MODULE_TRAFFIC pkglib_LTLIBRARIES += traffic.la traffic_la_SOURCES = traffic.c traffic.h traffic_la_LDFLAGS = -module -avoid-version -traffic_la_CFLAGS = -Wall -Werror collectd_LDADD += "-dlopen" traffic.la collectd_DEPENDENCIES += traffic.la endif @@ -208,7 +194,6 @@ if BUILD_MODULE_USERS pkglib_LTLIBRARIES += users.la users_la_SOURCES = users.c users.h users_la_LDFLAGS = -module -avoid-version -users_la_CFLAGS = -Wall -Werror collectd_LDADD += "-dlopen" users.la collectd_DEPENDENCIES += users.la endif diff --git a/src/collectd.h b/src/collectd.h index 1697df70..34b02617 100644 --- a/src/collectd.h +++ b/src/collectd.h @@ -95,6 +95,12 @@ # endif #endif +#if HAVE_ASSERT_H +# include +#else +# define assert(...) /* nop */ +#endif + #if HAVE_DIRENT_H # include # define NAMLEN(dirent) strlen((dirent)->d_name) diff --git a/src/hddtemp.c b/src/hddtemp.c index f77c0305..1651a32d 100644 --- a/src/hddtemp.c +++ b/src/hddtemp.c @@ -127,6 +127,10 @@ static int hddtemp_query_daemon (char *buffer, int buffer_size) */ memset (&srv_addr, '\0', sizeof (srv_addr)); + /* + * FIXME + * use `getaddrinfo' + */ if ((srv_ent = gethostbyname (host)) == NULL) { syslog (LOG_WARNING, "hddtemp: Could not resolve hostname `%s'", diff --git a/src/network.c b/src/network.c index ddc36e77..3a88b605 100644 --- a/src/network.c +++ b/src/network.c @@ -23,14 +23,13 @@ #include #include #include -#include #include #include +#include #include #include #include #include -#include #include "network.h" #include "common.h"