etc/services - sync with NetBSD-8
[minix.git] / external / bsd / bind / Makefile.inc
blob133efaad91f3c8caa1be5945c0bd04b2c7829800
1 #       $NetBSD: Makefile.inc,v 1.22 2014/08/18 04:40:51 christos Exp $
3 .if !defined(BIND9_MAKEFILE_INC)
4 BIND9_MAKEFILE_INC=yes
6 #NAMED_DEBUG=1
8 USE_FORT?= yes  # network client/server
10 WARNS?= 1
12 CWARNFLAGS.clang+=      -Wno-unused-value -Wno-parentheses
14 .include <bsd.own.mk>
16 .if ${MKCRYPTO} == "no"
17 NAMED_USE_OPENSSL?=no
18 .else
19 NAMED_USE_OPENSSL?=yes
20 .endif
22 .if exists(${NETBSDSRCDIR}/sys/sys/atomic.h) && !defined(__MINIX)
23 NAMED_USE_PTHREADS?=yes
24 .else
25 NAMED_USE_PTHREADS?=no
26 .endif
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}
35 SYSCONFDIR=/etc
36 LOCALSTATEDIR=/var
38 CPPFLAGS+=-I${BIND_SRCDIR}/include \
39         -I${IDIST} \
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
54 .endif
56 .if defined(HAVE_GCC)
57 COPTS+= -Wno-pointer-sign
58 .endif
60 .if defined(NAMED_DEBUG)
61 DBG=-g3 -gstabs
62 .endif
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
68 .else
69 LDADD+=         -lbind9 -llwres -lisccfg -ldns -lisccc -lisc
70 DPADD+=         ${LIBBIND9} ${LIBDNS} ${LIBLWRES}
71 DPADD+=         ${LIBISCCFG} ${LIBISCCC} ${LIBISC}
72 .endif
73 .else
74 CPPFLAGS+= -DLIBINTERFACE=${LIBINTERFACE} \
75            -DLIBREVISION=${LIBREVISION} -DLIBAGE=${LIBAGE}
76 .endif
77 #CPPFLAGS+= -DUSE_MEMIMPREGISTER -DUSE_APPIMPREGISTER -DUSE_SOCKETIMPREGISTER \
78 #    -DUSE_TIMERIMPREGISTER
80 .if ${NAMED_USE_PTHREADS} == "yes"
81 # XXX: Not ready yet
82 # CPPFLAGS+=    -DISC_PLATFORM_USE_NATIVE_RWLOCKS
83 CPPFLAGS+=      -DISC_PLATFORM_USETHREADS
84 .if !defined (LIB) || empty(LIB)
85 LDADD+= -lpthread
86 DPADD+= ${LIBPTHREAD}
87 .else
88 LIBDPLIBS+=      pthread  ${NETBSDSRCDIR}/lib/libpthread
89 .endif
90 .endif
92 .if ${NAMED_USE_OPENSSL} == "yes"
93 CPPFLAGS+=-DOPENSSL -DUSE_ISC_SPNEGO
94 .if ${MKKERBEROS} != "no"
95 CPPFLAGS+=-DGSSAPI
96 .endif
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}
103 .else
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
106 .endfor
107 .endif
108 .endif
109 .if !defined (LIB) || empty(LIB)
110 LDADD+= -lcrypto -lcrypt
111 DPADD+= ${LIBCRYPTO} ${LIBCRYPT}
112 .else
113 .if exists(${NETBSDSRCDIR}/crypto/external/bsd/openssl/lib/libcrypto)
114 LIBDPLIBS+=     crypto ${NETBSDSRCDIR}/crypto/external/bsd/openssl/lib/libcrypto
115 .else
116 LIBDPLIBS+=     crypto ${NETBSDSRCDIR}/lib/libcrypto
117 .endif
118 .endif
119 .endif
121 .if ${NAMED_USE_PTHREADS} == "yes"
122 CPPFLAGS+=-DISC_PLATFORM_USETHREADS -I${IDIST}/lib/isc/pthreads/include
123 .else
124 CPPFLAGS+=-I${IDIST}/lib/isc/nothreads/include
125 .endif
127 .if exists(${.PARSEDIR}/../Makefile.inc)
128 .include "${.PARSEDIR}/../Makefile.inc"
129 .endif
130 .endif