]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/blob - contrib/unbound/freebsd-configure.sh
Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.
[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 autoconf
28 autoheader
29 ./configure \
30         --prefix= --exec-prefix=/usr \
31         --with-conf-file=/var/unbound/unbound.conf \
32         --with-run-dir=/var/unbound \
33         --with-username=unbound
34
35 # Regenerate the configuration parser
36 {
37 cat <<EOF
38 #include "config.h"
39 #include "util/configyyrename.h"
40 EOF
41 /usr/bin/flex -L -t util/configlexer.lex
42 } >util/configlexer.c
43
44 /usr/bin/yacc -d -o util/configparser.c util/configparser.y