From f78087f853abf3c02795b4b6408c8ba438476fe1 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Sat, 10 Feb 2007 10:40:30 +0100 Subject: [PATCH] dns plugin: Only include and build with `utils_dns.c' if it's actually used. --- src/Makefile.am | 7 ++++++- src/dns.c | 2 +- src/utils_dns.c | 9 +++------ 3 files changed, 10 insertions(+), 8 deletions(-) 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 -- 2.30.2