]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/blob - contrib/bind9/isc-config.sh.in
MFC r305365
[FreeBSD/stable/9.git] / contrib / bind9 / isc-config.sh.in
1 #!/bin/sh
2 #
3 # Copyright (C) 2004, 2007, 2012, 2013, 2015  Internet Systems Consortium, Inc. ("ISC")
4 # Copyright (C) 2000, 2001, 2003  Internet Software Consortium.
5 #
6 # Permission to use, copy, modify, and/or distribute this software for any
7 # purpose with or without fee is hereby granted, provided that the above
8 # copyright notice and this permission notice appear in all copies.
9 #
10 # THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
11 # REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
12 # AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
13 # INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
14 # LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
15 # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16 # PERFORMANCE OF THIS SOFTWARE.
17
18 # $Id: isc-config.sh.in,v 1.17 2007/06/19 23:46:59 tbox Exp $
19
20 prefix=@prefix@
21 exec_prefix=@exec_prefix@
22 exec_prefix_set=
23 includedir=@includedir@
24 libdir=@libdir@
25
26 usage()
27 {
28         cat << EOF
29 Usage: isc-config [OPTIONS] [LIBRARIES]
30 Options:
31         [--prefix[=DIR]]
32         [--exec-prefix[=DIR]]
33         [--version]
34         [--libs]
35         [--cflags]
36 Libraries:
37         isc
38         isccc
39         isccfg
40         dns
41         lwres
42         bind9
43         irs
44 EOF
45         exit $1
46 }
47
48 if test $# -eq 0; then
49         usage 1 1>&2
50 fi
51
52 while test $# -gt 0; do
53         case "$1" in
54         -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
55         *) optarg= ;;
56         esac
57
58         case "$1" in
59         --prefix=*)
60                 prefix=$optarg
61                 if test "x$exec_prefix_set" = x ; then
62                         exec_prefix=$prefix
63                         exec_prefix_set=true
64                 fi
65                 ;;
66         --prefix)
67                 echo_prefix=true
68                 ;;
69         --exec-prefix=*)
70                 exec_prefix=$optarg
71                 exec_prefix_set=true
72                 ;;
73         --exec-prefix)
74                 echo_exec_prefix=true
75                 ;;
76         --version)
77                 echo @BIND9_VERSION@
78                 exit 0
79                 ;;
80         --cflags)
81                 echo_cflags=true
82                 ;;
83         --libs)
84                 echo_libs=true;
85                 ;;
86         irs)
87                 libirs=true;
88                 libdns=true;
89                 libisccfg=true;
90                 libisc=true;
91                 ;;
92         isc) 
93                 libisc=true;
94                 ;;
95         isccc)
96                 libisccc=true;
97                 libisc=true;
98                 ;;
99         isccfg)
100                 libisccfg=true;
101                 libisc=true;
102                 ;;
103         dns)
104                 libdns=true;
105                 libisc=true;
106                 ;;
107         lwres)
108                 liblwres=true;
109                 ;;
110         bind9)
111                 libdns=true;
112                 libisc=true;
113                 libisccfg=true;
114                 libbind9=true;
115                 ;;
116         *)
117                 usage 1 1>&2
118         esac
119         shift
120 done
121
122 if test x"$echo_prefix" = x"true" ; then
123         echo $prefix
124 fi
125 if test x"$echo_exec_prefix" = x"true" ; then
126         echo $exec_prefix
127 fi
128 if test x"$echo_cflags" = x"true"; then
129         if test x"${exec_prefix_set}" = x"true"; then
130                 includes="-I${exec_prefix}/include"
131         else
132                 includes="-I${includedir}"
133         fi
134         if test x"$libisc" = x"true"; then
135                 includes="$includes @ALWAYS_DEFINES@ @STD_CINCLUDES@ @STD_CDEFINES@ @CCOPT@"
136         fi
137         echo $includes
138 fi
139 if test x"$echo_libs" = x"true"; then
140         if test x"${exec_prefix_set}" = x"true"; then
141                 libs="-L${exec_prefix}/lib"
142         else
143                 libs="-L${libdir}"
144         fi
145         if test x"$libirs" = x"true" ; then
146                 libs="$libs -lirs"
147         fi
148         if test x"$liblwres" = x"true" ; then
149                 libs="$libs -llwres"
150         fi
151         if test x"$libbind9" = x"true" ; then
152                 libs="$libs -lbind9"
153         fi
154         if test x"$libdns" = x"true" ; then
155                 libs="$libs -ldns @DNS_CRYPTO_LIBS@"
156         fi
157         if test x"$libisccfg" = x"true" ; then
158                 libs="$libs -lisccfg"
159         fi
160         if test x"$libisccc" = x"true" ; then
161                 libs="$libs -lisccc"
162         fi
163         if test x"$libisc" = x"true" ; then
164                 libs="$libs -lisc"
165                 needothers=true
166         fi
167         if test x"$needothers" = x"true" ; then
168                 libs="$libs @CCOPT@ @LIBS@"
169         fi
170         echo $libs
171 fi