diff --git a/contrib/unbound/freebsd-configure.sh b/contrib/unbound/freebsd-configure.sh index 7169bbcce732..cd45d4716320 100755 --- a/contrib/unbound/freebsd-configure.sh +++ b/contrib/unbound/freebsd-configure.sh @@ -1,41 +1,42 @@ #!/bin/sh # # $FreeBSD$ # set -e error() { echo "$@" >&2 exit 1 } unbound=$(dirname $(realpath $0)) cd $unbound # Run autotools before we drop LOCALBASE out of PATH (cd $unbound && libtoolize --copy && autoheader && autoconf) # Ensure we use the correct toolchain and clean our environment export CC=$(echo ".include " | make -f /dev/stdin -VCC) export CPP=$(echo ".include " | make -f /dev/stdin -VCPP) unset CFLAGS CPPFLAGS LDFLAGS LD_LIBRARY_PATH LIBS export PATH=/bin:/sbin:/usr/bin:/usr/sbin ldnssrc=$(realpath $unbound/../ldns) [ -f $ldnssrc/ldns/ldns.h ] || error "can't find LDNS sources" export CFLAGS="-I$ldnssrc" ldnsbld=$(realpath $unbound/../../lib/libldns) [ -f $ldnsbld/Makefile ] || error "can't find LDNS build directory" ldnsobj=$(realpath $(make -C$ldnsbld -V.OBJDIR)) [ -f $ldnsobj/libprivateldns.a ] || error "can't find LDNS object directory" export LDFLAGS="-L$ldnsobj" cd $unbound ./configure \ --prefix= --exec-prefix=/usr \ --with-conf-file=/var/unbound/unbound.conf \ --with-run-dir=/var/unbound \ --with-username=unbound +mv config.h ../../lib/libunbound diff --git a/lib/libunbound/Makefile b/lib/libunbound/Makefile index 2b792d3ade2b..e6f095a09d10 100644 --- a/lib/libunbound/Makefile +++ b/lib/libunbound/Makefile @@ -1,48 +1,47 @@ PACKAGE=lib${LIB} # Vendor sources and generated files LDNSDIR= ${SRCTOP}/contrib/ldns UNBOUNDDIR= ${SRCTOP}/contrib/unbound # Hold my beer and watch this .PATH: ${UNBOUNDDIR} ${UNBOUNDDIR}/cachedb ${UNBOUNDDIR}/dns64 ${UNBOUNDDIR}/iterator ${UNBOUNDDIR}/sldns ${UNBOUNDDIR}/libunbound ${UNBOUNDDIR}/services ${UNBOUNDDIR}/services/cache ${UNBOUNDDIR}/util ${UNBOUNDDIR}/util/data ${UNBOUNDDIR}/respip ${UNBOUNDDIR}/util/storage ${UNBOUNDDIR}/validator LIB= unbound PRIVATELIB= PACKAGE= unbound -CFLAGS+= -I${UNBOUNDDIR} -I${LDNSDIR} -I${.OBJDIR} -CFLAGS+= -I${SRCTOP}/usr.sbin/unbound +CFLAGS+= -I${UNBOUNDDIR} -I${LDNSDIR} -I${.OBJDIR} -I${.CURDIR} CFLAGS+= -DOPENSSL_API_COMPAT=0x10100000L SRCS= alloc.c as112.c authzone.c autotrust.c cachedb.c config_file.c \ configlexer.l configparser.y context.c dname.c dns.c dns64.c \ dnstree.c edns.c fptr_wlist.c infra.c iter_delegpt.c iter_donotq.c \ iter_fwd.c iter_hints.c iter_priv.c iter_resptype.c iter_scrub.c \ iter_utils.c iterator.c keyraw.c libunbound.c libworker.c \ listen_dnsport.c localzone.c locks.c log.c lookup3.c lruhash.c \ mesh.c mini_event.c modstack.c module.c msgencode.c msgparse.c \ msgreply.c net_help.c netevent.c outbound_list.c outside_network.c \ packed_rrset.c parse.c parseutil.c proxy_protocol.c \ random.c rbtree.c redis.c \ regional.c respip.c rpz.c rrdef.c rrset.c rtt.c sbuffer.c slabhash.c \ str2wire.c tcp_conn_limit.c timehist.c tube.c ub_event_pluggable.c \ val_anchor.c val_kcache.c val_kentry.c val_neg.c val_nsec.c \ val_nsec3.c val_secalgo.c val_sigcrypt.c val_utils.c validator.c \ view.c winsock_event.c wire2str.c WARNS?= 2 NO_WTHREAD_SAFETY= true LIBADD= ssl crypto pthread # Misnamed file in upstream source configlexer.l: configlexer.lex ${CP} ${.ALLSRC} ${.TARGET} CLEANFILES+= configlexer.l # Symbol prefix for lex and yacc LFLAGS= -Pub_c_ YFLAGS= -pub_c_ -d .include diff --git a/usr.sbin/unbound/config.h b/lib/libunbound/config.h similarity index 100% rename from usr.sbin/unbound/config.h rename to lib/libunbound/config.h diff --git a/usr.sbin/unbound/anchor/Makefile b/usr.sbin/unbound/anchor/Makefile index 01a7c53c8ae8..91ae1090415a 100644 --- a/usr.sbin/unbound/anchor/Makefile +++ b/usr.sbin/unbound/anchor/Makefile @@ -1,16 +1,17 @@ # Vendor sources and generated files LDNSDIR= ${SRCTOP}/contrib/ldns UNBOUNDDIR= ${SRCTOP}/contrib/unbound +LIBUNBOUNDDIR=${SRCTOP}/lib/libunbound EXPATDIR= ${SRCTOP}/contrib/expat .PATH: ${UNBOUNDDIR} ${UNBOUNDDIR}/smallapp ${UNBOUNDDIR}/doc PROG= local-unbound-anchor SRCS= unbound-anchor.c CFLAGS+= -I${UNBOUNDDIR} -I${LDNSDIR} -I${EXPATDIR}/lib -CFLAGS+= -I${.CURDIR:H} -I${.CURDIR} +CFLAGS+= -I${LIBUNBOUNDDIR} -I${.CURDIR} LIBADD= unbound bsdxml ssl crypto pthread MAN= local-unbound-anchor.8 .include diff --git a/usr.sbin/unbound/checkconf/Makefile b/usr.sbin/unbound/checkconf/Makefile index 264f3b829fc4..c8d8397225b0 100644 --- a/usr.sbin/unbound/checkconf/Makefile +++ b/usr.sbin/unbound/checkconf/Makefile @@ -1,15 +1,16 @@ # Vendor sources and generated files LDNSDIR= ${SRCTOP}/contrib/ldns UNBOUNDDIR= ${SRCTOP}/contrib/unbound +LIBUNBOUNDDIR=${SRCTOP}/lib/libunbound .PATH: ${UNBOUNDDIR} ${UNBOUNDDIR}/smallapp ${UNBOUNDDIR}/util ${UNBOUNDDIR}/doc PROG= local-unbound-checkconf SRCS= ub_event.c unbound-checkconf.c worker_cb.c CFLAGS+= -I${UNBOUNDDIR} -I${LDNSDIR} -CFLAGS+= -I${.CURDIR:H} -I${.CURDIR} +CFLAGS+= -I${LIBUNBOUNDDIR} -I${.CURDIR} LIBADD= unbound pthread MAN= local-unbound-checkconf.8 .include diff --git a/usr.sbin/unbound/control/Makefile b/usr.sbin/unbound/control/Makefile index b5340c0bca67..ad5f7eb21f09 100644 --- a/usr.sbin/unbound/control/Makefile +++ b/usr.sbin/unbound/control/Makefile @@ -1,15 +1,16 @@ # Vendor sources and generated files LDNSDIR= ${SRCTOP}/contrib/ldns UNBOUNDDIR= ${SRCTOP}/contrib/unbound +LIBUNBOUNDDIR=${SRCTOP}/lib/libunbound .PATH: ${UNBOUNDDIR} ${UNBOUNDDIR}/smallapp ${UNBOUNDDIR}/util ${UNBOUNDDIR}/doc PROG= local-unbound-control SRCS= ub_event.c unbound-control.c worker_cb.c CFLAGS+= -I${UNBOUNDDIR} -I${LDNSDIR} -CFLAGS+= -I${.CURDIR:H} -I${.CURDIR} +CFLAGS+= -I${LIBUNBOUNDDIR} -I${.CURDIR} LIBADD= unbound crypto ssl pthread MAN= local-unbound-control.8 .include diff --git a/usr.sbin/unbound/daemon/Makefile b/usr.sbin/unbound/daemon/Makefile index ad0f5b2fb245..28b451aa5061 100644 --- a/usr.sbin/unbound/daemon/Makefile +++ b/usr.sbin/unbound/daemon/Makefile @@ -1,16 +1,17 @@ # Vendor sources and generated files LDNSDIR= ${SRCTOP}/contrib/ldns UNBOUNDDIR= ${SRCTOP}/contrib/unbound +LIBUNBOUNDDIR=${SRCTOP}/lib/libunbound .PATH: ${UNBOUNDDIR} ${UNBOUNDDIR}/daemon ${UNBOUNDDIR}/util ${UNBOUNDDIR}/util/shm_side ${UNBOUNDDIR}/doc PROG= local-unbound SRCS= acl_list.c cachedump.c daemon.c remote.c shm_main.c stats.c \ ub_event.c unbound.c worker.c CFLAGS+= -I${UNBOUNDDIR} -I${LDNSDIR} -CFLAGS+= -I${.CURDIR:H} -I${.CURDIR} +CFLAGS+= -I${LIBUNBOUNDDIR} -I${.CURDIR} LIBADD= unbound util ssl crypto pthread MAN= local-unbound.8 local-unbound.conf.5 .include