Deleted Added
full compact
freebsd-configure.sh (255594) freebsd-configure.sh (255779)
1#!/bin/sh
1#!/bin/sh
2#
3# $FreeBSD: head/contrib/unbound/freebsd-configure.sh 255779 2013-09-21 23:29:02Z des $
4#
2
3set -e
4
5error() {
6 echo "$@" >&2
7 exit 1
8}
9
10unbound=$(dirname $(realpath $0))
11cd $unbound
12
13ldnssrc=$(realpath $unbound/../ldns)
14[ -f $ldnssrc/ldns/ldns.h ] || error "can't find LDNS sources"
15export CFLAGS="-I$ldnssrc"
16
17ldnsbld=$(realpath $unbound/../../lib/libldns)
18[ -f $ldnsbld/Makefile ] || error "can't find LDNS build directory"
19
20ldnsobj=$(realpath $(make -C$ldnsbld -V.OBJDIR))
21[ -f $ldnsobj/libldns.a ] || error "can't find LDNS object directory"
22export 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{
32cat <<EOF
33#include "config.h"
34#include "util/configyyrename.h"
35EOF
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
5
6set -e
7
8error() {
9 echo "$@" >&2
10 exit 1
11}
12
13unbound=$(dirname $(realpath $0))
14cd $unbound
15
16ldnssrc=$(realpath $unbound/../ldns)
17[ -f $ldnssrc/ldns/ldns.h ] || error "can't find LDNS sources"
18export CFLAGS="-I$ldnssrc"
19
20ldnsbld=$(realpath $unbound/../../lib/libldns)
21[ -f $ldnsbld/Makefile ] || error "can't find LDNS build directory"
22
23ldnsobj=$(realpath $(make -C$ldnsbld -V.OBJDIR))
24[ -f $ldnsobj/libldns.a ] || error "can't find LDNS object directory"
25export LDFLAGS="-L$ldnsobj"
26
27./configure \
28 --prefix= --exec-prefix=/usr \
29 --with-conf-file=/etc/unbound/unbound.conf \
30 --with-run-dir=/var/unbound \
31 --with-username=unbound
32
33# Regenerate the configuration parser
34{
35cat <<EOF
36#include "config.h"
37#include "util/configyyrename.h"
38EOF
39/usr/bin/flex -L -t util/configlexer.lex
40} >util/configlexer.c
41
42/usr/bin/yacc -o util/configparser.c util/configparser.y