2013-09-15 00:05:16 +00:00
|
|
|
#!/bin/sh
|
2013-09-21 23:29:02 +00:00
|
|
|
#
|
|
|
|
# $FreeBSD$
|
|
|
|
#
|
2013-09-15 00:05:16 +00:00
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
error() {
|
|
|
|
echo "$@" >&2
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
unbound=$(dirname $(realpath $0))
|
|
|
|
cd $unbound
|
|
|
|
|
2018-10-10 22:29:06 +00:00
|
|
|
# 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 <bsd.lib.mk>" | make -f /dev/stdin -VCC)
|
|
|
|
export CPP=$(echo ".include <bsd.lib.mk>" | make -f /dev/stdin -VCPP)
|
|
|
|
unset CFLAGS CPPFLAGS LDFLAGS LD_LIBRARY_PATH LIBS
|
|
|
|
export PATH=/bin:/sbin:/usr/bin:/usr/sbin
|
|
|
|
|
2013-09-15 00:05:16 +00:00
|
|
|
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))
|
2015-09-17 16:10:11 +00:00
|
|
|
[ -f $ldnsobj/libprivateldns.a ] || error "can't find LDNS object directory"
|
2013-09-15 00:05:16 +00:00
|
|
|
export LDFLAGS="-L$ldnsobj"
|
|
|
|
|
2018-10-10 22:29:06 +00:00
|
|
|
cd $unbound
|
2013-09-15 00:05:16 +00:00
|
|
|
./configure \
|
2013-09-15 13:49:43 +00:00
|
|
|
--prefix= --exec-prefix=/usr \
|
2013-09-24 09:56:10 +00:00
|
|
|
--with-conf-file=/var/unbound/unbound.conf \
|
2013-09-15 00:05:16 +00:00
|
|
|
--with-run-dir=/var/unbound \
|
|
|
|
--with-username=unbound
|