1 # $NetBSD: Makefile.inc,v 1.22 2014/08/18 04:40:51 christos Exp $
3 .if !defined(BIND9_MAKEFILE_INC)
8 USE_FORT?= yes # network client/server
12 CWARNFLAGS.clang+= -Wno-unused-value -Wno-parentheses
16 .if ${MKCRYPTO} == "no"
19 NAMED_USE_OPENSSL?=yes
22 .if exists(${NETBSDSRCDIR}/sys/sys/atomic.h) && !defined(__MINIX)
23 NAMED_USE_PTHREADS?=yes
25 NAMED_USE_PTHREADS?=no
28 IDIST= ${NETBSDSRCDIR}/external/bsd/bind/dist
29 BIND_SRCDIR= ${NETBSDSRCDIR}/external/bsd/bind
30 BIND_HTMLDIR= /usr/share/doc/reference/ref8/bind9
32 .include "${IDIST}/version"
34 VERSION=${MAJORVER}.${MINORVER}.${PATCHVER}${RELEASETYPE}${RELEASEVER}
38 CPPFLAGS+=-I${BIND_SRCDIR}/include \
40 -I${IDIST}/lib/dns/include \
41 -I${IDIST}/lib/isc/include -I${IDIST}/lib/isc/unix/include \
42 -I${IDIST}/lib/bind9/include \
43 -I${IDIST}/lib/isccfg/include \
44 -I${IDIST}/lib/isccc/include \
45 -I${IDIST}/lib/lwres/include -I${IDIST}/lib/lwres/unix/include \
46 -DNS_LOCALSTATEDIR=\"${LOCALSTATEDIR}\" \
47 -DNS_SYSCONFDIR=\"${SYSCONFDIR}\" \
48 -DSESSION_KEYFILE=\"${LOCALSTATEDIR}/run/named/session.key\" \
49 -DVERSION=\"${VERSION}\" -DBIND9
51 .if (${USE_INET6} != "no")
52 CPPFLAGS+= -DWANT_IPV6
53 CPPFLAGS+= -DALLOW_FILTER_AAAA
57 COPTS+= -Wno-pointer-sign
60 .if defined(NAMED_DEBUG)
64 .if !defined(LIB) || empty(LIB)
65 # NOTE: the order of these libraries is important...
66 .if defined(NAMED_DEBUG)
67 LDADD+= -lbind9_g -llwres_g -lisccfg_g -ldns_g -lisccc_g -lisc_g
69 LDADD+= -lbind9 -llwres -lisccfg -ldns -lisccc -lisc
70 DPADD+= ${LIBBIND9} ${LIBDNS} ${LIBLWRES}
71 DPADD+= ${LIBISCCFG} ${LIBISCCC} ${LIBISC}
74 CPPFLAGS+= -DLIBINTERFACE=${LIBINTERFACE} \
75 -DLIBREVISION=${LIBREVISION} -DLIBAGE=${LIBAGE}
77 #CPPFLAGS+= -DUSE_MEMIMPREGISTER -DUSE_APPIMPREGISTER -DUSE_SOCKETIMPREGISTER \
78 # -DUSE_TIMERIMPREGISTER
80 .if ${NAMED_USE_PTHREADS} == "yes"
82 # CPPFLAGS+= -DISC_PLATFORM_USE_NATIVE_RWLOCKS
83 CPPFLAGS+= -DISC_PLATFORM_USETHREADS
84 .if !defined (LIB) || empty(LIB)
88 LIBDPLIBS+= pthread ${NETBSDSRCDIR}/lib/libpthread
92 .if ${NAMED_USE_OPENSSL} == "yes"
93 CPPFLAGS+=-DOPENSSL -DUSE_ISC_SPNEGO
94 .if ${MKKERBEROS} != "no"
97 .if ${MKKERBEROS} != "no"
98 .if !defined (LIB) || empty(LIB)
99 LDADD+= -lgssapi -lheimntlm -lkrb5 -lhx509 -lheimbase \
100 -lcom_err -lroken -lasn1 -lwind
101 DPADD+= ${LIBGSSAPI} ${LIBKRB5} ${LIBHX509} ${LIBHEIMNTLM} ${LIBHEIMBASE} \
102 ${LIBCOM_ERR} ${LIBROKEN} ${LIBASN1} ${LIBWIND}
104 .for L in gssapi krb5 hx509 heimntlm heimbase com_err roken asn1 wind
105 LIBDPLIBS+= $L ${NETBSDSRCDIR}/crypto/external/bsd/heimdal/lib/lib$L
109 .if !defined (LIB) || empty(LIB)
110 LDADD+= -lcrypto -lcrypt
111 DPADD+= ${LIBCRYPTO} ${LIBCRYPT}
113 .if exists(${NETBSDSRCDIR}/crypto/external/bsd/openssl/lib/libcrypto)
114 LIBDPLIBS+= crypto ${NETBSDSRCDIR}/crypto/external/bsd/openssl/lib/libcrypto
116 LIBDPLIBS+= crypto ${NETBSDSRCDIR}/lib/libcrypto
121 .if ${NAMED_USE_PTHREADS} == "yes"
122 CPPFLAGS+=-DISC_PLATFORM_USETHREADS -I${IDIST}/lib/isc/pthreads/include
124 CPPFLAGS+=-I${IDIST}/lib/isc/nothreads/include
127 .if exists(${.PARSEDIR}/../Makefile.inc)
128 .include "${.PARSEDIR}/../Makefile.inc"