4 .include <bsd.endian.mk>
7 .if defined(BIND_DIR) && exists(${BIND_DIR}/version)
8 .include "${BIND_DIR}/version"
9 BIND_VERSION= ${MAJORVER}.${MINORVER}.${PATCHVER}${RELEASETYPE}${RELEASEVER}
10 CFLAGS+= -DVERSION='"${BIND_VERSION}"'
13 CFLAGS+= -DHAVE_CONFIG_H
14 CFLAGS+= -D_REENTRANT -D_THREAD_SAFE
16 # Get version numbers (for libraries)
17 .if defined(SRCDIR) && exists(${SRCDIR}/api)
18 .include "${SRCDIR}/api"
19 CFLAGS+= -DLIBINTERFACE=${LIBINTERFACE}
20 CFLAGS+= -DLIBREVISION=${LIBREVISION}
21 CFLAGS+= -DLIBAGE=${LIBAGE}
22 .if ${MK_BIND_LIBS} != "no"
23 SHLIB_MAJOR= ${LIBINTERFACE}
24 SHLIB_MINOR= ${LIBINTERFACE}
30 # GSSAPI support is incomplete in 9.3.0
31 #.if ${MK_KERBEROS} != "no"
35 # Enable IPv6 support if available
36 .if ${MK_INET6_SUPPORT} != "no"
40 # Enable crypto if available
41 .if ${MK_OPENSSL} != "no"
45 # Enable MD5 - BIND has its own implementation
49 .if ${TARGET_ENDIANNESS} == 4321
50 CFLAGS+= -DWORDS_BIGENDIAN
53 # Default file locations
55 SYSCONFDIR= /etc/namedb
56 CFLAGS+= -DNS_LOCALSTATEDIR='"${LOCALSTATEDIR}"'
57 CFLAGS+= -DNS_SYSCONFDIR='"${SYSCONFDIR}"'
58 CFLAGS+= -DNAMED_CONFFILE='"${SYSCONFDIR}/named.conf"'
59 CFLAGS+= -DRNDC_CONFFILE='"${SYSCONFDIR}/rndc.conf"'
60 CFLAGS+= -DRNDC_KEYFILE='"${SYSCONFDIR}/rndc.key"'
62 # Add correct include path for config.h
63 .if defined(LIB_BIND_DIR) && exists(${LIB_BIND_DIR}/config.h)
64 CFLAGS+= -I${LIB_BIND_DIR}
67 # Use the right version of the atomic.h file from lib/isc
68 .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
69 ISC_ATOMIC_ARCH= x86_32
71 ISC_ATOMIC_ARCH= ${MACHINE_CPUARCH}
75 .if ${MK_BIND_LARGE_FILE} == "yes"
76 CFLAGS+= -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
78 .if ${MK_BIND_SIGCHASE} == "yes"
79 CFLAGS+= -DDIG_SIGCHASE
81 .if ${MK_BIND_XML} == "yes"
82 CFLAGS+= -DHAVE_LIBXML2
83 CFLAGS+= -I/usr/local/include -I/usr/local/include/libxml2
84 CFLAGS+= -L/usr/local/lib -lxml2 -lz -liconv -lm
87 # Link against BIND libraries
88 .if ${MK_BIND_LIBS} == "no"
89 LIBBIND9= ${LIB_BIND_REL}/bind9/libbind9.a
90 CFLAGS+= -I${BIND_DIR}/lib/bind9/include
91 LIBDNS= ${LIB_BIND_REL}/dns/libdns.a
92 CFLAGS+= -I${BIND_DIR}/lib/dns/include/dst \
93 -I${BIND_DIR}/lib/dns/include \
95 LIBISCCC= ${LIB_BIND_REL}/isccc/libisccc.a
96 CFLAGS+= -I${BIND_DIR}/lib/isccc/include
97 LIBISCCFG= ${LIB_BIND_REL}/isccfg/libisccfg.a
98 CFLAGS+= -I${BIND_DIR}/lib/isccfg/include
99 LIBISC= ${LIB_BIND_REL}/isc/libisc.a
100 CFLAGS+= -I${BIND_DIR}/lib/isc/unix/include \
101 -I${BIND_DIR}/lib/isc/pthreads/include \
102 -I${BIND_DIR}/lib/isc/include \
103 -I${LIB_BIND_DIR}/isc
104 LIBLWRES= ${LIB_BIND_REL}/lwres/liblwres.a
105 CFLAGS+= -I${BIND_DIR}/lib/lwres/unix/include \
106 -I${BIND_DIR}/lib/lwres/include \
107 -I${LIB_BIND_DIR}/lwres
109 BIND_DPADD= ${LIBBIND9} ${LIBDNS} ${LIBISCCC} ${LIBISCCFG} \
110 ${LIBISC} ${LIBLWRES}
111 .if ${MK_BIND_LIBS} != "no"
112 BIND_LDADD= -lbind9 -ldns -lisccc -lisccfg -lisc -llwres
114 BIND_LDADD= ${BIND_DPADD}
117 # Link against crypto library
118 .if ${MK_OPENSSL} != "no"
119 CRYPTO_DPADD= ${LIBCRYPTO}
120 CRYPTO_LDADD= -lcrypto
123 PTHREAD_DPADD= ${LIBPTHREAD}
124 PTHREAD_LDADD= -lpthread