]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/blob - contrib/unbound/freebsd-configure.sh
MFC r368207,368607:
[FreeBSD/stable/10.git] / contrib / unbound / freebsd-configure.sh
1 #!/bin/sh
2 #
3 # $FreeBSD$
4 #
5
6 set -e
7
8 error() {
9         echo "$@" >&2
10         exit 1
11 }
12
13 unbound=$(dirname $(realpath $0))
14 cd $unbound
15
16 ldnssrc=$(realpath $unbound/../ldns)
17 [ -f $ldnssrc/ldns/ldns.h ] || error "can't find LDNS sources"
18 export CFLAGS="-I$ldnssrc"
19
20 ldnsbld=$(realpath $unbound/../../lib/libldns)
21 [ -f $ldnsbld/Makefile ] || error "can't find LDNS build directory"
22
23 ldnsobj=$(realpath $(make -C$ldnsbld -V.OBJDIR))
24 [ -f $ldnsobj/libldns.a ] || error "can't find LDNS object directory"
25 export LDFLAGS="-L$ldnsobj"
26
27 export CC=$(echo ".include <bsd.lib.mk>" | make -f /dev/stdin -VCC)
28 export CPP=$(echo ".include <bsd.lib.mk>" | make -f /dev/stdin -VCPP)
29
30 autoconf
31 autoheader
32 ./configure \
33         --prefix= --exec-prefix=/usr \
34         --with-conf-file=/var/unbound/unbound.conf \
35         --with-run-dir=/var/unbound \
36         --with-username=unbound
37
38 # Don't try to provide bogus memory usage statistics based on sbrk(2).
39 sed -n -i.orig -e '/HAVE_SBRK/!p' config.status
40 ./config.status config.h