1# $NetBSD: Makefile.inc,v 1.1 2024/02/18 20:57:30 christos Exp $ 2 3.if !defined(BIND9_MAKEFILE_INC) 4BIND9_MAKEFILE_INC=yes 5 6#NAMED_DEBUG=1 7 8USE_FORT?= yes # network client/server 9 10WARNS?= 1 11 12CWARNFLAGS.clang+= -Wno-unused-value -Wno-parentheses \ 13 -Wno-atomic-alignment 14 15.include <bsd.own.mk> 16 17LIBUVDIR=${NETBSDSRCDIR}/external/mit/libuv 18LIBUVOBJDIR!= cd ${LIBUVDIR}/lib && ${PRINTOBJDIR} 19 20NAMED_USE_OPENSSL?=yes 21 22.if exists(${NETBSDSRCDIR}/sys/sys/atomic.h) 23NAMED_USE_PTHREADS?=yes 24.else 25NAMED_USE_PTHREADS?=no 26.endif 27 28BIND_SRCDIR:= ${.PARSEDIR} 29IDIST= ${BIND_SRCDIR}/dist 30BIND_HTMLDIR= /usr/share/doc/reference/ref8/bind9 31 32VERSIONFILE=${IDIST}/version 33.include "${VERSIONFILE}" 34 35VERSION=${MAJORVER}.${MINORVER}.${PATCHVER}${RELEASETYPE}${RELEASEVER} 36SYSCONFDIR=/etc 37LOCALSTATEDIR=/var 38 39LINTFLAGS+=-Z-include -Z${BIND_SRCDIR}/include/config.h 40CPPFLAGS+=-include ${BIND_SRCDIR}/include/config.h 41CPPFLAGS+=-I${BIND_SRCDIR}/include \ 42 -I${IDIST} \ 43 -I${IDIST}/lib/bind9/include \ 44 -I${IDIST}/lib/dns/include \ 45 -I${IDIST}/lib/ns/include \ 46 -I${IDIST}/lib/irs/include \ 47 -I${IDIST}/lib/isc/include -I${IDIST}/lib/isc/unix/include \ 48 -I${IDIST}/lib/isccfg/include \ 49 -I${IDIST}/lib/isccc/include \ 50 -DNS_LOCALSTATEDIR=\"${LOCALSTATEDIR}\" \ 51 -DNS_SYSCONFDIR=\"${SYSCONFDIR}\" \ 52 -DSESSION_KEYFILE=\"${LOCALSTATEDIR}/run/named/session.key\" \ 53 -DNAMED_CONFFILE=\"${SYSCONFDIR}/named.conf\" \ 54 -DVERSION=\"${VERSION}\" -DBIND9 55 56.if (${USE_INET6} != "no") 57CPPFLAGS+= -DWANT_IPV6 58CPPFLAGS+= -DALLOW_FILTER_AAAA 59.endif 60 61.if defined(HAVE_GCC) 62COPTS+= -Wno-pointer-sign 63.endif 64 65.if defined(NAMED_DEBUG) 66DBG=-g3 -gstabs 67.endif 68 69.if !defined(LIB) || empty(LIB) 70# NOTE: the order of these libraries is important... 71.if defined(NAMED_DEBUG) 72LDADD+= -lbind9_g -lisccfg_g -ldns_g -lns_g -lirs_g 73LDADD+= -lisccc_g -lisc_g 74LDADD+= -L${LIBUVOBJDIR} -luv_g 75LDADD+= -lexecinfo_g -lkvm_g -lz_g 76.else 77LDADD+= -lbind9 -lisccfg -ldns -lns -lirs 78DPADD+= ${LIBBIND9} ${LIBISCCFG} ${LIBDNS} ${LIBNS} ${LIBIRS} 79LDADD+= -lisccc -lisc 80LDADD+= -L${LIBUVOBJDIR} -luv 81LDADD+= -lexecinfo -lkvm -lz 82DPADD+= ${LIBISCCC} ${LIBISC} 83DPADD+= ${LIBUVOBJDIR}/libuv.a 84DPADD+= ${LIBEXECINFO} ${LIBKVM} ${LIBZ} 85.endif 86.else 87CPPFLAGS+= -DLIBINTERFACE=${LIBINTERFACE} \ 88 -DLIBREVISION=${LIBREVISION} -DLIBAGE=${LIBAGE} 89.endif 90#CPPFLAGS+= -DUSE_MEMIMPREGISTER -DUSE_APPIMPREGISTER -DUSE_SOCKETIMPREGISTER \ 91# -DUSE_TIMERIMPREGISTER 92 93LDADD+=-lblocklist 94DPADD+=${LIBBLOCKLIST} 95 96.if ${NAMED_USE_PTHREADS} == "yes" 97# XXX: Not ready yet 98# CPPFLAGS+= -DISC_PLATFORM_USE_NATIVE_RWLOCKS 99CPPFLAGS+= -DISC_PLATFORM_USETHREADS 100.if !defined (LIB) || empty(LIB) 101LDADD+= -lpthread 102DPADD+= ${LIBPTHREAD} 103.else 104LIBDPLIBS+= pthread ${NETBSDSRCDIR}/lib/libpthread 105.endif 106.endif 107 108.if ${NAMED_USE_OPENSSL} == "yes" 109CPPFLAGS+=-DOPENSSL -DUSE_ISC_SPNEGO 110.if ${HAVE_OPENSSL} == 10 111CPPFLAGS+=-DHAVE_OPENSSL_GOST 112.endif 113.if ${MKKERBEROS} != "no" 114CPPFLAGS+=-DGSSAPI 115.endif 116.if ${MKKERBEROS} != "no" 117.if !defined (LIB) || empty(LIB) 118LDADD+= -lgssapi -lheimntlm ${LIBKRB5_LDADD} 119DPADD+= ${LIBGSSAPI} ${LIBHEIMNTLM} ${LIBKRB5_DPADD} 120.else 121.for L in gssapi krb5 hx509 heimntlm heimbase com_err roken asn1 wind 122LIBDPLIBS+= $L ${NETBSDSRCDIR}/crypto/external/bsd/heimdal/lib/lib$L 123.endfor 124.endif 125.endif 126.if !defined (LIB) || empty(LIB) 127LDADD+= -lssl -lcrypto -lcrypt 128DPADD+= ${LIBSSL} ${LIBCRYPTO} ${LIBCRYPT} 129.else 130LIBDPLIBS+= crypto ${NETBSDSRCDIR}/crypto/external/bsd/${EXTERNAL_OPENSSL_SUBDIR}/lib/libcrypto 131.endif 132.endif 133 134.if ${NAMED_USE_PTHREADS} == "yes" 135CPPFLAGS+=-DISC_PLATFORM_USETHREADS -I${IDIST}/lib/isc/pthreads/include 136.else 137CPPFLAGS+=-I${IDIST}/lib/isc/nothreads/include 138.endif 139 140.if exists(${.PARSEDIR}/../Makefile.inc) 141.include "${.PARSEDIR}/../Makefile.inc" 142.endif 143.endif 144 145COPTS+= -fcommon 146