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