From: Florian Forster Date: Sat, 10 Feb 2007 09:40:30 +0000 (+0100) Subject: dns plugin: Only include and build with `utils_dns.c' if it's actually used. X-Git-Tag: collectd-3.11.1~1 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=f78087f853abf3c02795b4b6408c8ba438476fe1;p=collectd.git dns plugin: Only include and build with `utils_dns.c' if it's actually used. --- diff --git a/src/Makefile.am b/src/Makefile.am index d9b3b9ca..58cc0fe2 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -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 diff --git a/src/dns.c b/src/dns.c index cd068fb3..cd73a7e0 100644 --- a/src/dns.c +++ b/src/dns.c @@ -25,11 +25,11 @@ #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 # include # include diff --git a/src/utils_dns.c b/src/utils_dns.c index a6643bbf..6541b897 100644 --- a/src/utils_dns.c +++ b/src/utils_dns.c @@ -35,6 +35,9 @@ #include "collectd.h" +#if HAVE_NETINET_IN_SYSTM_H +# include +#endif #if HAVE_NETINET_IN_H # include #endif @@ -71,12 +74,6 @@ # include #endif -#if HAVE_NETINET_IN_SYSTM_H -# include -#endif -#if HAVE_NETINET_IN_H -# include -#endif #if HAVE_NETINET_IP_H # include #endif