1#!/bin/sh
2#
3# $FreeBSD: stable/11/contrib/ldns/freebsd-configure.sh 356345 2020-01-04 01:09:33Z cy $
4#
5
6set -e
7
8error() {
9	echo "$@" >&2
10	exit 1
11}
12
13ldns=$(dirname $(realpath $0))
14cd $ldns
15
16# Run autotools before we drop LOCALBASE out of PATH
17(cd $ldns && libtoolize --copy && autoheader && autoconf)
18(cd $ldns/drill && aclocal && autoheader && autoconf)
19
20# Ensure we use the correct toolchain and clean our environment
21export CC=$(echo ".include <bsd.lib.mk>" | make -f /dev/stdin -VCC)
22export CPP=$(echo ".include <bsd.lib.mk>" | make -f /dev/stdin -VCPP)
23unset CFLAGS CPPFLAGS LDFLAGS LD_LIBRARY_PATH LIBS
24export PATH=/bin:/sbin:/usr/bin:/usr/sbin
25
26cd $ldns
27./configure --prefix= --exec-prefix=/usr
28
29cd $ldns/drill
30./configure --prefix= --exec-prefix=/usr
31