13 unbound=$(dirname $(realpath $0))
16 # Run autotools before we drop LOCALBASE out of PATH
17 (cd $unbound && libtoolize --copy && autoheader && autoconf)
19 # Ensure we use the correct toolchain and clean our environment
20 export CC=$(echo ".include <bsd.lib.mk>" | make -f /dev/stdin -VCC)
21 export CPP=$(echo ".include <bsd.lib.mk>" | make -f /dev/stdin -VCPP)
22 unset CFLAGS CPPFLAGS LDFLAGS LD_LIBRARY_PATH LIBS
23 export PATH=/bin:/sbin:/usr/bin:/usr/sbin
25 ldnssrc=$(realpath $unbound/../ldns)
26 [ -f $ldnssrc/ldns/ldns.h ] || error "can't find LDNS sources"
27 export CFLAGS="-I$ldnssrc"
29 ldnsbld=$(realpath $unbound/../../lib/libldns)
30 [ -f $ldnsbld/Makefile ] || error "can't find LDNS build directory"
32 ldnsobj=$(realpath $(make -C$ldnsbld -V.OBJDIR))
33 [ -f $ldnsobj/libprivateldns.a ] || error "can't find LDNS object directory"
34 export LDFLAGS="-L$ldnsobj"
38 --prefix= --exec-prefix=/usr \
39 --with-conf-file=/var/unbound/unbound.conf \
40 --with-run-dir=/var/unbound \
41 --with-username=unbound