]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - lib/bind/config.mk
rfork_thread(3): Mark deprecated in favor of pthread_create(3).
[FreeBSD/FreeBSD.git] / lib / bind / config.mk
1 # $FreeBSD$
2
3 .include <bsd.own.mk>
4 .include <bsd.endian.mk>
5
6 # BIND version number
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}"'
11 .endif
12
13 CFLAGS+=        -DHAVE_CONFIG_H
14 CFLAGS+=        -D_REENTRANT -D_THREAD_SAFE
15
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}
25 .else
26 INTERNALLIB=
27 .endif
28 .endif
29
30 # GSSAPI support is incomplete in 9.3.0
31 #.if ${MK_KERBEROS} != "no"
32 #CFLAGS+=       -DGSSAPI
33 #.endif
34
35 # Enable IPv6 support if available
36 .if ${MK_INET6_SUPPORT} != "no"
37 CFLAGS+=        -DWANT_IPV6
38 .endif
39
40 # Enable crypto if available
41 .if ${MK_OPENSSL} != "no"
42 CFLAGS+=        -DOPENSSL
43 .endif
44
45 # Enable MD5 - BIND has its own implementation
46 CFLAGS+=        -DUSE_MD5
47
48 # Endianness
49 .if ${TARGET_ENDIANNESS} == 4321
50 CFLAGS+=        -DWORDS_BIGENDIAN
51 .endif
52
53 # Default file locations
54 LOCALSTATEDIR=  /var
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"'
61
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}
65 .endif
66
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
70 .else
71 ISC_ATOMIC_ARCH=        ${MACHINE_CPUARCH}
72 .endif
73
74 # Optional features
75 .if ${MK_BIND_LARGE_FILE} == "yes"
76 CFLAGS+=        -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
77 .endif
78 .if ${MK_BIND_SIGCHASE} == "yes"
79 CFLAGS+=        -DDIG_SIGCHASE
80 .endif
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
85 .endif
86
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 \
94                 -I${LIB_BIND_DIR}/dns
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
108 .endif
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
113 .else
114 BIND_LDADD=     ${BIND_DPADD}
115 .endif
116
117 # Link against crypto library
118 .if ${MK_OPENSSL} != "no"
119 CRYPTO_DPADD=   ${LIBCRYPTO}
120 CRYPTO_LDADD=   -lcrypto
121 .endif
122
123 PTHREAD_DPADD=  ${LIBPTHREAD}
124 PTHREAD_LDADD=  -lpthread