]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/unbound/freebsd-configure.sh
Pull in all the OpenSSH bits that we'd previously left out because we
[FreeBSD/FreeBSD.git] / contrib / unbound / freebsd-configure.sh
1 #!/bin/sh
2
3 set -e
4
5 error() {
6         echo "$@" >&2
7         exit 1
8 }
9
10 unbound=$(dirname $(realpath $0))
11 cd $unbound
12
13 ldnssrc=$(realpath $unbound/../ldns)
14 [ -f $ldnssrc/ldns/ldns.h ] || error "can't find LDNS sources"
15 export CFLAGS="-I$ldnssrc"
16
17 ldnsbld=$(realpath $unbound/../../lib/libldns)
18 [ -f $ldnsbld/Makefile ] || error "can't find LDNS build directory"
19
20 ldnsobj=$(realpath $(make -C$ldnsbld -V.OBJDIR))
21 [ -f $ldnsobj/libldns.a ] || error "can't find LDNS object directory"
22 export LDFLAGS="-L$ldnsobj"
23
24 ./configure \
25         --prefix= --exec-prefix=/usr \
26         --with-conf-file=/etc/unbound/unbound.conf \
27         --with-run-dir=/var/unbound \
28         --with-username=unbound
29
30 # Regenerate the configuration parser
31 {
32 cat <<EOF
33 #include "config.h"
34 #include "util/configyyrename.h"
35 EOF
36 /usr/bin/flex -L -t util/configlexer.lex
37 } >util/configlexer.c
38
39 /usr/bin/yacc -o util/configparser.c util/configparser.y