From 8e75ad45e65482b72809d1deb1ff5e25e5f69409 Mon Sep 17 00:00:00 2001 From: Doug Barton Date: Sat, 16 Jul 2011 07:12:02 +0000 Subject: [PATCH] Handle the MK_BIND_XML option more intelligently --- lib/bind/config.mk | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/lib/bind/config.mk b/lib/bind/config.mk index 184d0172e908..fdf03a03a265 100644 --- a/lib/bind/config.mk +++ b/lib/bind/config.mk @@ -78,11 +78,6 @@ CFLAGS+= -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 .if ${MK_BIND_SIGCHASE} == "yes" CFLAGS+= -DDIG_SIGCHASE .endif -.if ${MK_BIND_XML} == "yes" -CFLAGS+= -DHAVE_LIBXML2 -CFLAGS+= -I/usr/local/include -I/usr/local/include/libxml2 -CFLAGS+= -L/usr/local/lib -lxml2 -lz -liconv -lm -.endif # Link against BIND libraries .if ${MK_BIND_LIBS} == "no" @@ -120,5 +115,17 @@ CRYPTO_DPADD= ${LIBCRYPTO} CRYPTO_LDADD= -lcrypto .endif +.if ${MK_BIND_XML} == "yes" +CFLAGS+= -DHAVE_LIBXML2 +CFLAGS+= -I/usr/local/include -I/usr/local/include/libxml2 +.if ${MK_BIND_LIBS} != "no" +CFLAGS+= -L/usr/local/lib +BIND_LDADD+= -lxml2 -lz -liconv -lm +.else +BIND_DPADD+= /usr/local/lib/libxml2.a ${LIBZ} +BIND_DPADD+= /usr/local/lib/libiconv.a ${LIBM} +.endif +.endif + PTHREAD_DPADD= ${LIBPTHREAD} PTHREAD_LDADD= -lpthread