From 867a97e60e0883451653a9613fcc5bbce4721157 Mon Sep 17 00:00:00 2001 From: Olaf Rempel Date: Sat, 30 Sep 2006 22:55:04 +0200 Subject: [PATCH] build without librrd --- Makefile | 21 +++++++++++++++++---- network.c | 2 -- rrdtool.c | 2 -- rrdtool.h | 4 ++++ 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 6f44913..a232e20 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,22 @@ # Toplevel Makefile -SAMMLER_SRC := sammler.c configfile.c logging.c network.c rrdtool.c plugins.c -PLUGIN_SRC := $(wildcard p_*.c) -CFLAGS := -O2 -Wall -LDFLAGS := -ldl -lrrd -rdynamic +WITH_RRD = yes + +# ############################ + +SAMMLER_SRC := sammler.c configfile.c logging.c network.c plugins.c +PLUGIN_SRC := p_ctstat.c p_load.c p_memory.c p_mount.c p_netdev.c p_random.c +PLUGIN_SRC += p_rtstat.c p_stat.c p_uptime.c p_vmstat.c +CFLAGS := -O2 -Wall +LDFLAGS := -ldl -rdynamic + +# ############################ + +ifeq ("$(WITH_RRD)", "yes") + SAMMLER_SRC += rrdtool.c + CFLAGS += -DWITH_RRD + LDFLAGS += -lrrd +endif # ############################ diff --git a/network.c b/network.c index 880d33b..8bab5af 100644 --- a/network.c +++ b/network.c @@ -39,7 +39,6 @@ void net_submit(char *hostname, char *plugin, char *filename, int ds_id, char *d list_for_each_entry(entry, &fwd_list, list) sendto(entry->sock, tx_buf, size +1, 0, (struct sockaddr *)&entry->sa, sizeof(entry->sa)); -// log_print(LOG_DEBUG, "net_submit: %s", tx_buf); } int net_receive(int socket) @@ -72,7 +71,6 @@ int net_receive(int socket) *data++ = '\0'; -// log_print(LOG_DEBUG, "net_receive: %s|%s|%s|%d|%s", hostname, plugin, filename, atoi(ds_id), data); rrd_submit(hostname, plugin, filename, atoi(ds_id), data); return 0; diff --git a/rrdtool.c b/rrdtool.c index 27b4c36..63e8646 100644 --- a/rrdtool.c +++ b/rrdtool.c @@ -76,8 +76,6 @@ static int do_rrd(int mode, char *cmd) int argc; char *argv[ARGCMAX]; -// log_print(LOG_DEBUG, "do_rrd: %s", cmd); - argc = strsplit(cmd, argv, ARGCMAX -1); argv[argc] = NULL; diff --git a/rrdtool.h b/rrdtool.h index bec29ef..527394a 100644 --- a/rrdtool.h +++ b/rrdtool.h @@ -1,6 +1,10 @@ #ifndef _RRDTOOL_H_ #define _RRDTOOL_H_ +#ifdef WITH_RRD void rrd_submit(char *hostname, char *plugin, char *filename, int ds_id, char *data); +#else +#define rrd_submit(hostname, plugin, filename, ds_id, data) +#endif #endif /* _RRDTOOL_H_ */