From c7dd0420a25bcc4adcdd8d8f9d6b01c3e90ae816 Mon Sep 17 00:00:00 2001 From: Brian Wellington Date: Fri, 23 Jun 2000 20:52:35 +0000 Subject: [PATCH] Add isc-config.sh --- Makefile.in | 3 +- configure | 3 ++ configure.in | 4 +- isc-config.sh.in | 105 +++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 113 insertions(+), 2 deletions(-) create mode 100644 isc-config.sh.in diff --git a/Makefile.in b/Makefile.in index 62464490df..8d5dd0195f 100644 --- a/Makefile.in +++ b/Makefile.in @@ -13,7 +13,7 @@ # ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS # SOFTWARE. -# $Id: Makefile.in,v 1.18 2000/06/23 17:52:07 tale Exp $ +# $Id: Makefile.in,v 1.19 2000/06/23 20:52:31 bwelling Exp $ srcdir = @srcdir@ VPATH = @srcdir@ @@ -35,6 +35,7 @@ DOCDIRS = arm draft misc rfc distclean:: rm -f config.cache config.h config.log config.status libtool TAGS + rm -f isc-config.sh cleandir: distclean diff --git a/configure b/configure index 2a969a49dd..ce9b2028be 100755 --- a/configure +++ b/configure @@ -4451,6 +4451,7 @@ trap 'rm -fr `echo "make/rules bin/dnssec/Makefile util/Makefile util/conf.sh + isc-config.sh config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF @@ -4866,3 +4868,4 @@ chmod +x $CONFIG_STATUS rm -fr confdefs* $ac_clean_files test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 +chmod a+x isc-config.sh diff --git a/configure.in b/configure.in index 7c2b0d14bd..bcd5f726a4 100644 --- a/configure.in +++ b/configure.in @@ -18,7 +18,7 @@ AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl esyscmd([sed "s/^/# /" COPYRIGHT])dnl AC_DIVERT_POP()dnl -AC_REVISION($Revision: 1.161 $) +AC_REVISION($Revision: 1.162 $) AC_INIT(lib/dns/name.c) AC_PREREQ(2.13) @@ -1054,4 +1054,6 @@ AC_OUTPUT( bin/dnssec/Makefile util/Makefile util/conf.sh + isc-config.sh ) +chmod a+x isc-config.sh diff --git a/isc-config.sh.in b/isc-config.sh.in new file mode 100644 index 0000000000..f1bcd99ffe --- /dev/null +++ b/isc-config.sh.in @@ -0,0 +1,105 @@ +#!/bin/sh + +prefix=@prefix@ +exec_prefix=@exec_prefix@ +exec_prefix_set= + +usage() +{ + cat << EOF +Usage: isc-config [OPTIONS] [LIBRARIES] +Options: + [--prefix[=DIR]] + [--exec-prefix[=DIR]] + [--version] + [--libs] + [--cflags] +Libraries: + isc + dns + lwres + omapi +EOF + exit $1 +} + +if test $# -eq 0; then + usage 1 1>&2 +fi + +while test $# -gt 0; do + case "$1" in + -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) optarg= ;; + esac + + case "$1" in + --prefix=*) + prefix=$optarg + if test "x$exec_prefix_set" = x ; then + exec_prefix=$prefix + fi + ;; + --prefix) + echo_prefix=true + ;; + --exec-prefix=*) + exec_prefix=$optarg + ;; + --exec-prefix) + echo_exec_prefix=true + ;; + --version) + echo @BIND9_VERSION@ + exit 0 + ;; + --cflags) + includes="-I${prefix}/include" + echo_cflags=true + ;; + --libs) + echo_libs=true; + ;; + isc) + libisc=true; + ;; + dns) + libdns=true; + ;; + lwres) + liblwres=true; + ;; + omapi) + libomapi=true; + ;; + *) + usage 1 1>&2 + esac + shift +done + +if test x"$echo_prefix" = x"true" ; then + echo $prefix +fi +if test x"$echo_exec_prefix" = x"true" ; then + echo $exec_prefix +fi +if test x"$echo_cflags" = x"true"; then + echo -I${exec_prefix}/include $includes +fi +if test x"$echo_libs" = x"true"; then + libs=-L${exec_prefix}/lib + if test x"$libomapi" = x"true" ; then + libs="$libs -lomapi" + fi + if test x"$liblwres" = x"true" ; then + libs="$libs -llwres" + fi + if test x"$libdns" = x"true" ; then + libs="$libs -ldns @DNS_OPENSSL_LIBS@" + fi + if test x"$libisc" = x"true" ; then + libs="$libs -lisc" + fi + echo $libs @LIBS@ +fi