Code

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 d9b3b9cabc9a35783188f104fe1868d2c8421582..58cc0fe2a6ed845c9c19f7df10a50f0d4c5189b9 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 cd068fb363744b05c06f637a53ec248bd4d48ea5..cd73a7e0c7b227d0c5cfcd61d4e92bbe593be3ac 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 a6643bbf2774e72041b9ba7a891bc84571a65713..6541b897ffdd68da466472269998b3d4b893d549 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