1282088Sdes#!/bin/sh
2282088Sdes#
3282088Sdes# $FreeBSD: stable/11/contrib/ldns/freebsd-configure.sh 356345 2020-01-04 01:09:33Z cy $
4282088Sdes#
5282088Sdes
6282088Sdesset -e
7282088Sdes
8356345Scyerror() {
9356345Scy	echo "$@" >&2
10356345Scy	exit 1
11356345Scy}
12356345Scy
13282088Sdesldns=$(dirname $(realpath $0))
14282088Sdescd $ldns
15282088Sdes
16356345Scy# Run autotools before we drop LOCALBASE out of PATH
17356345Scy(cd $ldns && libtoolize --copy && autoheader && autoconf)
18356345Scy(cd $ldns/drill && aclocal && autoheader && autoconf)
19356345Scy
20356345Scy# Ensure we use the correct toolchain and clean our environment
21356345Scyexport CC=$(echo ".include <bsd.lib.mk>" | make -f /dev/stdin -VCC)
22356345Scyexport CPP=$(echo ".include <bsd.lib.mk>" | make -f /dev/stdin -VCPP)
23356345Scyunset CFLAGS CPPFLAGS LDFLAGS LD_LIBRARY_PATH LIBS
24356345Scyexport PATH=/bin:/sbin:/usr/bin:/usr/sbin
25356345Scy
26356345Scycd $ldns
27282088Sdes./configure --prefix= --exec-prefix=/usr
28282088Sdes
29282088Sdescd $ldns/drill
30282088Sdes./configure --prefix= --exec-prefix=/usr
31