Clean up and comment config.mk. Centralize more stuff. Bitch if

POSIX threads libraries are not available.  Add crypto support if
the crypto libraries are available.  Build dnssec-{keygen,signzone}
if crypto is available.

Submitted by:	(in part) dougb@
This commit is contained in:
des 2004-09-22 12:13:58 +00:00
parent f34045dc6a
commit 41e930f480
20 changed files with 125 additions and 55 deletions

View File

@ -60,8 +60,8 @@ SRCS+= herror.c res_comp.c res_data.c \
CFLAGS+= -I${SRCDIR}/port/freebsd/include -I${SRCDIR}/include
CFLAGS+= -I${.CURDIR} -I${.CURDIR}/..
DPADD= ${LIBPTHREAD}
LDADD= -lpthread
DPADD= ${PTHREAD_DPADD}
LDADD= ${PTHREAD_LDADD}
#INCS= ${SRCDIR}/include/isc/assertions.h \
# ${SRCDIR}/include/isc/ctl.h \

View File

@ -13,8 +13,8 @@ SRCS= check.c getaddresses.c version.c
CFLAGS+= -I${SRCDIR}/include -I${.CURDIR} -I${.CURDIR}/..
DPADD= ${LIBPTHREAD}
LDADD= -lpthread
DPADD= ${PTHREAD_DPADD}
LDADD= ${PTHREAD_LDADD}
INCS= ${SRCDIR}/include/bind9/check.h \
${SRCDIR}/include/bind9/getaddresses.h \

View File

@ -1,54 +1,79 @@
# $FreeBSD$
# BIND version number
CFLAGS+= -DVERSION='"9.3.0rc4"'
CFLAGS+= -DHAVE_CONFIG_H
# Get version numbers (for libraries)
.if defined(SRCDIR) && exists(${SRCDIR}/api)
.include "${SRCDIR}/api"
.endif
.if defined(LIB_BIND_DIR) && exists(${LIB_BIND_DIR}/config.h)
CFLAGS+= -I${LIB_BIND_DIR}
.endif
.if defined(LIBINTERFACE)
CFLAGS+= -DLIBINTERFACE=${LIBINTERFACE}
SHLIB_MAJOR= ${LIBINTERFACE}
.endif
.if defined(LIBREVISION)
CFLAGS+= -DLIBREVISION=${LIBREVISION}
SHLIB_MINOR= ${LIBINTERFACE}
.endif
.if defined(LIBAGE)
CFLAGS+= -DLIBAGE=${LIBAGE}
.endif
CFLAGS+= -DHAVE_CONFIG_H
# GSSAPI support is incomplete in 9.3.0rc4
#.if !defined(NO_KERBEROS)
#CFLAGS+= -DGSSAPI
#.endif
# Enable IPv6 support if available
.if !defined(NOINET6)
CFLAGS+= -DWANT_IPV6
.endif
.if ${MACHINE_ARCH} == powerpc || ${MACHINE_ARCH} == sparc64
# Enable crypto if available
.if !defined(NOCRYPT)
CFLAGS+= -DOPENSSL
.endif
# Enable MD5 - BIND has its own implementation
CFLAGS+= -DUSE_MD5
# Endianness
.if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "sparc64"
CFLAGS+= -DWORDS_BIGENDIAN
.endif
# Default file locations
LOCALSTATEDIR= /var/run
SYSCONFDIR= /etc
SYSCONFDIR= /etc/namedb
CFLAGS+= -DNS_LOCALSTATEDIR='"${LOCALSTATEDIR}"'
CFLAGS+= -DNS_SYSCONFDIR='"${SYSCONFDIR}"'
CFLAGS+= -DNAMED_CONFFILE='"${SYSCONFDIR}/named.conf"'
CFLAGS+= -DRNDC_CONFFILE='"${SYSCONFDIR}/rndc.conf"'
CFLAGS+= -DRNDC_KEYFILE='"${SYSCONFDIR}/rndc.key"'
# Add correct include path for config.h
.if defined(LIB_BIND_DIR) && exists(${LIB_BIND_DIR}/config.h)
CFLAGS+= -I${LIB_BIND_DIR}
.endif
# Link against BIND libraries
BIND_DPADD= ${LIBBIND9} ${LIBDNS} ${LIBISCCC} ${LIBISCCFG} \
${LIBISC} ${LIBLWRES} ${LIBCRYPTO} ${LIBPTHREAD}
BIND_LDADD= -lbind9 -ldns -lisccc -lisccfg -lisc -llwres \
-lcrypto -lpthread
${LIBISC} ${LIBLWRES}
BIND_LDADD= -lbind9 -ldns -lisccc -lisccfg -lisc -llwres
# Link against crypto library
.if !defined(NOCRYPT)
CRYPTO_DPADD+= ${LIBCRYPTO}
CRYPTO_LDADD+= -lcrypto
.endif
# Link against POSIX threads library
.if ${MACHINE_ARCH} == "alpha" || ${MACHINE_ARCH} == "sparc64"
.if defined(NOLIBC_R)
.error "BIND requires libc_r - define NO_BIND, or undefine NOLIBC_R"
.endif
PTHREAD_DPADD+= ${LIBC_R}
PTHREAD_LDADD+= -lc_r
.else
.if defined(NOLIBPTHREAD)
.error "BIND requires libpthread - define NO_BIND, or undefine NOLIBPTHREAD"
.endif
PTHREAD_DPADD+= ${LIBPTHREAD}
PTHREAD_LDADD+= -lpthread
.endif

View File

@ -36,8 +36,8 @@ SRCS+= acl.c adb.c byaddr.c \
CFLAGS+= -I${SRCDIR}/sec/dst/include -I${SRCDIR}/include -I${SRCDIR}
CFLAGS+= -I${.CURDIR} -I${.CURDIR}/..
DPADD= ${LIBPTHREAD}
LDADD= -lpthread
DPADD= ${CRYPTO_DPADD} ${PTHREAD_DPADD}
LDADD= ${CRYPTO_LDADD} ${PTHREAD_LDADD}
DNSINCS= ${SRCDIR}/include/dns/acl.h \
${SRCDIR}/include/dns/adb.h \

View File

@ -37,8 +37,8 @@ SRCS+= inet_pton.c \
CFLAGS+= -I${SRCDIR}/unix/include -I${SRCDIR}/pthreads/include
CFLAGS+= -I${SRCDIR}/include -I${.CURDIR} -I${.CURDIR}/..
DPADD= ${LIBPTHREAD}
LDADD= -lpthread
DPADD= ${PTHREAD_DPADD}
LDADD= ${PTHREAD_LDADD}
INCS= ${SRCDIR}/include/isc/app.h \
${SRCDIR}/include/isc/assertions.h \

View File

@ -15,8 +15,8 @@ SRCS= alist.c base64.c cc.c ccmsg.c \
CFLAGS+= -I${SRCDIR}/include -I${.CURDIR} -I${.CURDIR}/..
DPADD= ${LIBPTHREAD}
LDADD= -lpthread
DPADD= ${PTHREAD_DPADD}
LDADD= ${PTHREAD_LDADD}
INCS= ${SRCDIR}/include/isccc/alist.h \
${SRCDIR}/include/isccc/base64.h \

View File

@ -13,8 +13,8 @@ SRCS= log.c namedconf.c parser.c version.c
CFLAGS+= -I${SRCDIR}/include -I${.CURDIR} -I${.CURDIR}/..
DPADD= ${LIBPTHREAD}
LDADD= -lpthread
DPADD= ${PTHREAD_DPADD}
LDADD= ${PTHREAD_LDADD}
INCS= ${SRCDIR}/include/isccfg/cfg.h \
${SRCDIR}/include/isccfg/grammar.h \

View File

@ -18,8 +18,8 @@ SRCS+= context.c gai_strerror.c getaddrinfo.c gethost.c \
CFLAGS+= -I${SRCDIR}/unix/include -I${SRCDIR}/include
CFLAGS+= -I${.CURDIR} -I${.CURDIR}/..
DPADD= ${LIBPTHREAD}
LDADD= -lpthread
DPADD= ${PTHREAD_DPADD}
LDADD= ${PTHREAD_LDADD}
INCS= ${SRCDIR}/include/lwres/context.h \
${SRCDIR}/include/lwres/int.h \

View File

@ -13,8 +13,8 @@ SRCS+= dig.c dighost.c
CFLAGS+= -I${SRCDIR}/include
DPADD+= ${BIND_DPADD}
LDADD+= ${BIND_LDADD}
DPADD+= ${BIND_DPADD} ${CRYPTO_DPADD} ${PTHREAD_DPADD}
LDADD+= ${BIND_LDADD} ${CRYPTO_LDADD} ${PTHREAD_LDADD}
MAN= dig.1

View File

@ -13,8 +13,8 @@ SRCS+= dighost.c host.c
CFLAGS+= -I${SRCDIR}/include
DPADD+= ${BIND_DPADD}
LDADD+= ${BIND_LDADD}
DPADD+= ${BIND_DPADD} ${CRYPTO_DPADD} ${PTHREAD_DPADD}
LDADD+= ${BIND_LDADD} ${CRYPTO_LDADD} ${PTHREAD_LDADD}
MAN= host.1

View File

@ -13,8 +13,8 @@ SRCS+= dighost.c nslookup.c
CFLAGS+= -I${SRCDIR}/include
DPADD+= ${BIND_DPADD}
LDADD+= ${BIND_LDADD}
DPADD+= ${BIND_DPADD} ${CRYPTO_DPADD} ${PTHREAD_DPADD}
LDADD+= ${BIND_LDADD} ${CRYPTO_LDADD} ${PTHREAD_LDADD}
MAN= nslookup.1

View File

@ -13,8 +13,8 @@ SRCS+= nsupdate.c
CFLAGS+= -I${SRCDIR}/include
DPADD+= ${BIND_DPADD}
LDADD+= ${BIND_LDADD}
DPADD+= ${BIND_DPADD} ${CRYPTO_DPADD} ${PTHREAD_DPADD}
LDADD+= ${BIND_LDADD} ${CRYPTO_LDADD} ${PTHREAD_LDADD}
MAN= nsupdate.8

View File

@ -195,9 +195,12 @@ _atm= atm
#_bsnmpd= bsnmpd
.endif
.if !defined(NO_BIND) && !defined(NOCRYPT)
_dnssec-keygen= dnssec-keygen
_dnssec-signzone= dnssec-signzone
.endif
.if !defined(NO_BIND)
#_dnssec-keygen= dnssec-keygen
#_dnssec-signzone= dnssec-signzone
_named= named
_named.reload= named.reload
_named-checkconf= named-checkconf

View File

@ -0,0 +1,21 @@
# $FreeBSD$
BIND_DIR= ${.CURDIR}/../../contrib/bind9
LIB_BIND_DIR= ${.CURDIR}/../../lib/bind
SRCDIR= ${BIND_DIR}/bin/dnssec
.include "${LIB_BIND_DIR}/config.mk"
PROG= dnssec-keygen
.PATH: ${SRCDIR}
SRCS+= dnssec-keygen.c dnssectool.c
CFLAGS+= -I${SRCDIR}/unix/include -I${SRCDIR}/include
DPADD+= ${BIND_DPADD} ${CRYPTO_DPADD} ${PTHREAD_DPADD}
LDADD+= ${BIND_LDADD} ${CRYPTO_LDADD} ${PTHREAD_LDADD}
MAN= dnssec-keygen.8
.include <bsd.prog.mk>

View File

@ -0,0 +1,21 @@
# $FreeBSD$
BIND_DIR= ${.CURDIR}/../../contrib/bind9
LIB_BIND_DIR= ${.CURDIR}/../../lib/bind
SRCDIR= ${BIND_DIR}/bin/dnssec
.include "${LIB_BIND_DIR}/config.mk"
PROG= dnssec-signzone
.PATH: ${SRCDIR}
SRCS+= dnssec-signzone.c dnssectool.c
CFLAGS+= -I${SRCDIR}/unix/include -I${SRCDIR}/include
DPADD+= ${BIND_DPADD} ${CRYPTO_DPADD} ${PTHREAD_DPADD}
LDADD+= ${BIND_LDADD} ${CRYPTO_LDADD} ${PTHREAD_LDADD}
MAN= dnssec-signzone.8
.include <bsd.prog.mk>

View File

@ -13,8 +13,8 @@ SRCS+= named-checkconf.c check-tool.c
CFLAGS+= -I${LIB_BIND_DIR}
DPADD+= ${BIND_DPADD}
LDADD+= ${BIND_LDADD}
DPADD+= ${BIND_DPADD} ${CRYPTO_DPADD} ${PTHREAD_DPADD}
LDADD+= ${BIND_LDADD} ${CRYPTO_LDADD} ${PTHREAD_LDADD}
MAN= named-checkconf.8

View File

@ -13,8 +13,8 @@ SRCS+= named-checkzone.c check-tool.c
CFLAGS+= -I${LIB_BIND_DIR}
DPADD+= ${BIND_DPADD}
LDADD+= ${BIND_LDADD}
DPADD+= ${BIND_DPADD} ${CRYPTO_DPADD} ${PTHREAD_DPADD}
LDADD+= ${BIND_LDADD} ${CRYPTO_LDADD} ${PTHREAD_LDADD}
MAN= named-checkzone.8

View File

@ -23,8 +23,8 @@ SRCS+= aclconf.c builtin.c client.c config.c control.c \
CFLAGS+= -I${SRCDIR}/unix/include -I${SRCDIR}/include -I${LIB_BIND_DIR}
DPADD+= ${BIND_DPADD}
LDADD+= ${BIND_LDADD}
DPADD+= ${BIND_DPADD} ${CRYPTO_DPADD} ${PTHREAD_DPADD}
LDADD+= ${BIND_LDADD} ${CRYPTO_LDADD} ${PTHREAD_LDADD}
MAN= named.8 lwresd.8 named.conf.5

View File

@ -16,8 +16,8 @@ SRCS+= rndc-confgen.c util.c
CFLAGS+= -I${SRCDIR}/unix/include -I${SRCDIR}/include -I${LIB_BIND_DIR}
DPADD+= ${BIND_DPADD}
LDADD+= ${BIND_LDADD}
DPADD+= ${BIND_DPADD} ${CRYPTO_DPADD} ${PTHREAD_DPADD}
LDADD+= ${BIND_LDADD} ${CRYPTO_LDADD} ${PTHREAD_LDADD}
MAN= rndc-confgen.8

View File

@ -16,8 +16,8 @@ SRCS+= rndc.c util.c
CFLAGS+= -I${SRCDIR}/unix/include -I${SRCDIR}/include -I${LIB_BIND_DIR}
DPADD+= ${BIND_DPADD}
LDADD+= ${BIND_LDADD}
DPADD+= ${BIND_DPADD} ${CRYPTO_DPADD} ${PTHREAD_DPADD}
LDADD+= ${BIND_LDADD} ${CRYPTO_LDADD} ${PTHREAD_LDADD}
MAN= rndc.8 rndc.conf.5