c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington#!/bin/sh
9a3d43d3b4f1b3f90edfd306222b219a6690bc68Andreas Gustafsson#
ea9558dc722ab9ff80bd106f31a836e1a5016627Tinderbox User# Copyright (C) 2000, 2001, 2003, 2004, 2007, 2012, 2013, 2015-2017 Internet Systems Consortium, Inc. ("ISC")
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews#
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# This Source Code Form is subject to the terms of the Mozilla Public
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# License, v. 2.0. If a copy of the MPL was not distributed with this
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# file, You can obtain one at http://mozilla.org/MPL/2.0/.
9a3d43d3b4f1b3f90edfd306222b219a6690bc68Andreas Gustafsson
70e5a7403f0e0a3bd292b8287c5fed5772c15270Automatic Updater# $Id: isc-config.sh.in,v 1.17 2007/06/19 23:46:59 tbox Exp $
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellingtonprefix=@prefix@
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellingtonexec_prefix=@exec_prefix@
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellingtonexec_prefix_set=
afc047fdb535cdd44e20ffbb62d12b2408f0a07eMark Andrewsincludedir=@includedir@
afc047fdb535cdd44e20ffbb62d12b2408f0a07eMark Andrewslibdir=@libdir@
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellingtonusage()
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington{
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington cat << EOF
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian WellingtonUsage: isc-config [OPTIONS] [LIBRARIES]
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian WellingtonOptions:
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington [--prefix[=DIR]]
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington [--exec-prefix[=DIR]]
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington [--version]
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington [--libs]
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington [--cflags]
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian WellingtonLibraries:
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington isc
0aec2246a17ece5bf15223795368162891dc7886Brian Wellington isccc
0aec2246a17ece5bf15223795368162891dc7886Brian Wellington isccfg
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington dns
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington lwres
44e09abdf052ad02b6250d4ac6a3530a19c4f7ccMark Andrews bind9
d9a0f1bea7c183864c72d0ad14f6b61fbe1b5b05Mark Andrews irs
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian WellingtonEOF
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington exit $1
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington}
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellingtonif test $# -eq 0; then
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington usage 1 1>&2
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellingtonfi
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellingtonwhile test $# -gt 0; do
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington case "$1" in
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington *) optarg= ;;
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington esac
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington case "$1" in
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington --prefix=*)
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington prefix=$optarg
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington if test "x$exec_prefix_set" = x ; then
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington exec_prefix=$prefix
afc047fdb535cdd44e20ffbb62d12b2408f0a07eMark Andrews exec_prefix_set=true
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington fi
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington ;;
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington --prefix)
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington echo_prefix=true
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington ;;
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington --exec-prefix=*)
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington exec_prefix=$optarg
afc047fdb535cdd44e20ffbb62d12b2408f0a07eMark Andrews exec_prefix_set=true
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington ;;
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington --exec-prefix)
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington echo_exec_prefix=true
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington ;;
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington --version)
e13d04fda918c0c14c2247475bb99e0760d9a6a4Evan Hunt echo VERSION=@BIND9_VERSION@
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington exit 0
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington ;;
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington --cflags)
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington echo_cflags=true
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington ;;
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington --libs)
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington echo_libs=true;
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington ;;
d9a0f1bea7c183864c72d0ad14f6b61fbe1b5b05Mark Andrews irs)
d9a0f1bea7c183864c72d0ad14f6b61fbe1b5b05Mark Andrews libirs=true;
d9a0f1bea7c183864c72d0ad14f6b61fbe1b5b05Mark Andrews libdns=true;
d9a0f1bea7c183864c72d0ad14f6b61fbe1b5b05Mark Andrews libisccfg=true;
d9a0f1bea7c183864c72d0ad14f6b61fbe1b5b05Mark Andrews libisc=true;
d9a0f1bea7c183864c72d0ad14f6b61fbe1b5b05Mark Andrews ;;
d9a0f1bea7c183864c72d0ad14f6b61fbe1b5b05Mark Andrews isc)
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington libisc=true;
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington ;;
0aec2246a17ece5bf15223795368162891dc7886Brian Wellington isccc)
0aec2246a17ece5bf15223795368162891dc7886Brian Wellington libisccc=true;
0aec2246a17ece5bf15223795368162891dc7886Brian Wellington libisc=true;
0aec2246a17ece5bf15223795368162891dc7886Brian Wellington ;;
0aec2246a17ece5bf15223795368162891dc7886Brian Wellington isccfg)
0aec2246a17ece5bf15223795368162891dc7886Brian Wellington libisccfg=true;
0aec2246a17ece5bf15223795368162891dc7886Brian Wellington libisc=true;
0aec2246a17ece5bf15223795368162891dc7886Brian Wellington ;;
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington dns)
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington libdns=true;
0aec2246a17ece5bf15223795368162891dc7886Brian Wellington libisc=true;
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington ;;
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington lwres)
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington liblwres=true;
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington ;;
59b3618ebe54e29b568e7d9db1dbaf38694a728eMark Andrews bind9)
59b3618ebe54e29b568e7d9db1dbaf38694a728eMark Andrews libdns=true;
59b3618ebe54e29b568e7d9db1dbaf38694a728eMark Andrews libisc=true;
59b3618ebe54e29b568e7d9db1dbaf38694a728eMark Andrews libisccfg=true;
44e09abdf052ad02b6250d4ac6a3530a19c4f7ccMark Andrews libbind9=true;
59b3618ebe54e29b568e7d9db1dbaf38694a728eMark Andrews ;;
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington *)
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington usage 1 1>&2
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington esac
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington shift
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellingtondone
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellingtonif test x"$echo_prefix" = x"true" ; then
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington echo $prefix
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellingtonfi
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellingtonif test x"$echo_exec_prefix" = x"true" ; then
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington echo $exec_prefix
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellingtonfi
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellingtonif test x"$echo_cflags" = x"true"; then
afc047fdb535cdd44e20ffbb62d12b2408f0a07eMark Andrews if test x"${exec_prefix_set}" = x"true"; then
afc047fdb535cdd44e20ffbb62d12b2408f0a07eMark Andrews includes="-I${exec_prefix}/include"
afc047fdb535cdd44e20ffbb62d12b2408f0a07eMark Andrews else
afc047fdb535cdd44e20ffbb62d12b2408f0a07eMark Andrews includes="-I${includedir}"
afc047fdb535cdd44e20ffbb62d12b2408f0a07eMark Andrews fi
0aec2246a17ece5bf15223795368162891dc7886Brian Wellington if test x"$libisc" = x"true"; then
e34b3266268cfce864fd9d308eeb27c05e0eee13Bob Halley includes="$includes @ALWAYS_DEFINES@ @STD_CINCLUDES@ @STD_CDEFINES@ @CCOPT@"
0529b1c2bf8fcc05dfbd0344cae7b3677339440eBrian Wellington fi
0529b1c2bf8fcc05dfbd0344cae7b3677339440eBrian Wellington echo $includes
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellingtonfi
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellingtonif test x"$echo_libs" = x"true"; then
afc047fdb535cdd44e20ffbb62d12b2408f0a07eMark Andrews if test x"${exec_prefix_set}" = x"true"; then
d9a0f1bea7c183864c72d0ad14f6b61fbe1b5b05Mark Andrews libs="-L${exec_prefix}/lib"
afc047fdb535cdd44e20ffbb62d12b2408f0a07eMark Andrews else
afc047fdb535cdd44e20ffbb62d12b2408f0a07eMark Andrews libs="-L${libdir}"
afc047fdb535cdd44e20ffbb62d12b2408f0a07eMark Andrews fi
d9a0f1bea7c183864c72d0ad14f6b61fbe1b5b05Mark Andrews if test x"$libirs" = x"true" ; then
d9a0f1bea7c183864c72d0ad14f6b61fbe1b5b05Mark Andrews libs="$libs -lirs"
d9a0f1bea7c183864c72d0ad14f6b61fbe1b5b05Mark Andrews fi
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington if test x"$liblwres" = x"true" ; then
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington libs="$libs -llwres"
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington fi
36ac8850c6ae6659c6cd89bf431cd2d942901cf7Mark Andrews if test x"$libbind9" = x"true" ; then
36ac8850c6ae6659c6cd89bf431cd2d942901cf7Mark Andrews libs="$libs -lbind9"
36ac8850c6ae6659c6cd89bf431cd2d942901cf7Mark Andrews fi
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington if test x"$libdns" = x"true" ; then
0e40083fdd5445703bd30e46e5bfe7d047bced12Brian Wellington libs="$libs -ldns @DNS_CRYPTO_LIBS@"
0aec2246a17ece5bf15223795368162891dc7886Brian Wellington fi
0aec2246a17ece5bf15223795368162891dc7886Brian Wellington if test x"$libisccfg" = x"true" ; then
0aec2246a17ece5bf15223795368162891dc7886Brian Wellington libs="$libs -lisccfg"
0aec2246a17ece5bf15223795368162891dc7886Brian Wellington fi
0aec2246a17ece5bf15223795368162891dc7886Brian Wellington if test x"$libisccc" = x"true" ; then
0aec2246a17ece5bf15223795368162891dc7886Brian Wellington libs="$libs -lisccc"
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington fi
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington if test x"$libisc" = x"true" ; then
e2cc7418bf895d22854d84590b63905fac0d4b90Mark Andrews libs="$libs -lisc @ISC_OPENSSL_LIBS@"
0c7426a8e946ecded1f9fa852577270f9b70682cBrian Wellington needothers=true
0c7426a8e946ecded1f9fa852577270f9b70682cBrian Wellington fi
0c7426a8e946ecded1f9fa852577270f9b70682cBrian Wellington if test x"$needothers" = x"true" ; then
0529b1c2bf8fcc05dfbd0344cae7b3677339440eBrian Wellington libs="$libs @CCOPT@ @LIBS@"
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellington fi
0c7426a8e946ecded1f9fa852577270f9b70682cBrian Wellington echo $libs
c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816Brian Wellingtonfi