dns plugin: Only include and build with `utils_dns.c' if it's actually used.
authorFlorian Forster <octo@leeloo.lan.home.verplant.org>
Sat, 10 Feb 2007 09:40:30 +0000 (10:40 +0100)
committerFlorian Forster <octo@leeloo.lan.home.verplant.org>
Sat, 10 Feb 2007 09:40:30 +0000 (10:40 +0100)
src/Makefile.am
src/dns.c
src/utils_dns.c

index d9b3b9c..58cc0fe 100644 (file)
@@ -158,7 +158,12 @@ endif
 
 if BUILD_MODULE_DNS
 pkglib_LTLIBRARIES += dns.la
-dns_la_SOURCES = dns.c utils_dns.c utils_dns.h
+dns_la_SOURCES = dns.c
+if BUILD_WITH_LIBPCAP
+if BUILD_WITH_LIBPTHREAD
+dns_la_SOURCES += utils_dns.c utils_dns.h
+endif
+endif
 dns_la_LDFLAGS = -module -avoid-version
 if BUILD_WITH_LIBPCAP
 dns_la_LDFLAGS += -lpcap
index cd068fb..cd73a7e 100644 (file)
--- a/src/dns.c
+++ b/src/dns.c
 #include "plugin.h"
 #include "configfile.h"
 #include "utils_debug.h"
-#include "utils_dns.h"
 
 #define MODULE_NAME "dns"
 
 #if HAVE_LIBPCAP && HAVE_LIBPTHREAD
+# include "utils_dns.h"
 # include <pthread.h>
 # include <pcap.h>
 # include <sys/poll.h>
index a6643bb..6541b89 100644 (file)
@@ -35,6 +35,9 @@
 
 #include "collectd.h"
 
+#if HAVE_NETINET_IN_SYSTM_H
+# include <netinet/in_systm.h>
+#endif
 #if HAVE_NETINET_IN_H
 # include <netinet/in.h>
 #endif
 # include <netdb.h>
 #endif
 
-#if HAVE_NETINET_IN_SYSTM_H
-# include <netinet/in_systm.h>
-#endif
-#if HAVE_NETINET_IN_H
-# include <netinet/in.h>
-#endif
 #if HAVE_NETINET_IP_H
 # include <netinet/ip.h>
 #endif