summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1d71cea)
raw | patch | inline | side by side (parent: 1d71cea)
author | octo <octo> | |
Sun, 29 Jan 2006 21:59:07 +0000 (21:59 +0000) | ||
committer | octo <octo> | |
Sun, 29 Jan 2006 21:59:07 +0000 (21:59 +0000) |
configure.in | patch | blob | history | |
src/Makefile.am | patch | blob | history | |
src/collectd.h | patch | blob | history | |
src/hddtemp.c | patch | blob | history | |
src/network.c | patch | blob | history |
diff --git a/configure.in b/configure.in
index 1a97afa3a31906c1b254356f03ef3b280c0cbcc3..6937227e91b630fe0c0c977c19c247ffe5fb8ba4 100644 (file)
--- a/configure.in
+++ b/configure.in
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)
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
#
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)
# 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)
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)
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 b6ae7588f2babe2849e5ecf0918bdf56c2a67580..341c682076638f6ef0e66cb48051b9d0ca1a37a3 100644 (file)
--- a/src/Makefile.am
+++ b/src/Makefile.am
SUBDIRS += libping
endif
+if COMPILER_IS_GCC
+AM_CFLAGS = -Wall -Werror
+endif
+
sbin_PROGRAMS = collectd
collectd_SOURCES = collectd.c collectd.h \
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
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
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
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
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
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
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
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
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
mysql_la_LDFLAGS += -lmysqlclient
endif
#mysql_la_LIBADD = -lmysqlclient
-mysql_la_CFLAGS = -Wall -Werror
collectd_LDADD += "-dlopen" mysql.la
collectd_DEPENDENCIES += mysql.la
endif
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
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
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
sensors_la_LDFLAGS += -lsensors
endif
sensors_la_LIBADD = -lsensors
-sensors_la_CFLAGS = -Wall -Werror
collectd_LDADD += "-dlopen" sensors.la
collectd_DEPENDENCIES += sensors.la
endif
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
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
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
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
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 1697df70d35beb0e20fb2e43a4a510d89bc40d32..34b026171efd31307eea8a98e1ded0e93e72c2a0 100644 (file)
--- a/src/collectd.h
+++ b/src/collectd.h
# endif
#endif
+#if HAVE_ASSERT_H
+# include <assert.h>
+#else
+# define assert(...) /* nop */
+#endif
+
#if HAVE_DIRENT_H
# include <dirent.h>
# define NAMLEN(dirent) strlen((dirent)->d_name)
diff --git a/src/hddtemp.c b/src/hddtemp.c
index f77c03058f6782cbd82ede62a43a477ede1f3e27..1651a32d4e569a6a16c1d21a626c2a15c38cd343 100644 (file)
--- a/src/hddtemp.c
+++ b/src/hddtemp.c
*/
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 ddc36e772176aa57715471ff652ebb7c5229d82a..3a88b60518e49eb3dcb1da456f408c8dc170e238 100644 (file)
--- a/src/network.c
+++ b/src/network.c
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
-#include <netdb.h>
#include <sys/types.h>
#include <sys/socket.h>
+#include <netdb.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <syslog.h>
#include <errno.h>
-#include <assert.h>
#include "network.h"
#include "common.h"