afslog.1: Remove documentation for removed no-v4 argument.
[heimdal.git] / tools / krb5-config.in
blob0cc662baea26a3fcd0fce4cdd4990368a450ce5d
1 #!/bin/sh
3 # Copyright (c) 2000 - 2008 Kungliga Tekniska Högskolan
4 # (Royal Institute of Technology, Stockholm, Sweden).
5 # All rights reserved.
7 # Redistribution and use in source and binary forms, with or without
8 # modification, are permitted provided that the following conditions
9 # are met:
11 # 1. Redistributions of source code must retain the above copyright
12 # notice, this list of conditions and the following disclaimer.
14 # 2. Redistributions in binary form must reproduce the above copyright
15 # notice, this list of conditions and the following disclaimer in the
16 # documentation and/or other materials provided with the distribution.
18 # 3. Neither the name of the Institute nor the names of its contributors
19 # may be used to endorse or promote products derived from this software
20 # without specific prior written permission.
22 # THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
23 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 # ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
26 # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 # SUCH DAMAGE.
35 do_all=no
36 do_libs=no
37 do_lib_deps=no
38 do_cflags=no
39 do_usage=no
40 print_prefix=no
41 print_exec_prefix=no
42 library=
43 lib_krb5=no
44 lib_gssapi=no
45 lib_kadm_client=no
46 lib_kadm_server=no
47 lib_kafs=no
49 if test $# -eq 0; then
50 do_usage=yes
51 usage_exit=1
54 for i in $*; do
55 case $i in
56 --help)
57 do_usage=yes
58 usage_exit=0
60 --all)
61 do_all=yes
63 --vendor)
64 echo "Heimdal"
65 exit 0;
67 --version)
68 echo "@PACKAGE@ @VERSION@"
69 exit 0
71 --prefix=*)
72 prefix=`echo $i | sed 's/^--prefix=//'`
74 --prefix)
75 print_prefix=yes
77 --exec-prefix=*)
78 exec_prefix=`echo $i | sed 's/^--exec-prefix=//'`
80 --exec-prefix)
81 print_exec_prefix=yes
83 --libs)
84 do_libs=yes
86 --deps)
87 do_lib_deps=yes
89 --cflags)
90 do_cflags=yes
92 krb5)
93 library=krb5
94 lib_krb5=yes
96 gssapi)
97 library=gssapi
98 lib_gssapi=yes
100 kadm-client)
101 library=kadm-client
102 lib_kadm_client=yes
104 kadm-server)
105 library=kadm-server
106 lib_kadm_server=yes
108 kafs)
109 library=kafs
110 lib_kafs=yes
113 echo "unknown option: $i"
114 exit 1
116 esac
117 done
119 if test "$do_usage" = "yes"; then
120 echo "usage: $0 [options] [libraries]"
121 echo "options: [--help] show this message"
122 echo " [--all] display version, vendor, etc."
123 echo " [--version] display version information"
124 echo " [--prefix] display the prefix of Kerberos"
125 echo " [--exec-prefix] display the exec_prefix of Kerberos"
126 echo " [--cflags] display the CFLAGS required"
127 echo " [--libs] display the libraries required to link"
128 echo " [--deps] display the dependent libs required"
129 echo " for static linking"
130 echo
131 echo "libraries: krb5 Kerberos 5 applications"
132 echo " gssapi GSSAPI applications"
133 echo " kadm-client libkadm5 client"
134 echo " kadm-server libkadm5 server"
135 echo " kafs kafs"
136 exit $usage_exit
139 if test X"$library" = X; then
140 lib_krb5=yes
143 if test "$prefix" = ""; then
144 prefix=@prefix@
146 if test "$exec_prefix" = ""; then
147 exec_prefix=@exec_prefix@
150 libdir=@libdir@
151 includedir=@includedir@
153 if test "$do_all" = "yes"; then
154 echo "Version: @PACKAGE@ @VERSION@"
155 echo "Vendor: Heimdal"
156 echo "Prefix: $prefix"
157 echo "Exec_prefix: $exec_prefix"
158 exit 0
161 if test "$print_prefix" = "yes"; then
162 echo $prefix
163 exit 0
166 if test "$print_exec_prefix" = "yes"; then
167 echo $exec_prefix
168 exit 0
171 if test "$do_libs" = "yes"; then
172 deplibs=""
173 if test "$lib_gssapi" = yes; then
174 lib_flags="$lib_flags -lgssapi"
175 deplibs="$deplibs -lheimntlm"
176 if test X"$do_lib_deps" = Xyes; then
177 lib_krb5=yes
180 if test "$lib_kadm_client" = yes; then
181 lib_flags="$lib_flags -lkadm5clnt"
182 if test X"$do_lib_deps" = Xyes; then
183 lib_krb5=yes
186 if test "$lib_kadm_server" = yes; then
187 lib_flags="$lib_flags -lkadm5srv"
188 deplibs="$deplibs @LIB_dbopen@"
189 if test X"$do_lib_deps" = Xyes; then
190 lib_krb5=yes
193 if test "$lib_kafs" = yes; then
194 lib_flags="$lib_flags -lkafs"
195 if test X"$do_lib_deps" = Xyes; then
196 lib_krb5=yes
199 if test "$lib_krb5" = yes; then
200 lib_flags="$lib_flags -lkrb5"
202 deplibs="$deplibs @LIB_pkinit@ -lcom_err"
203 deplibs="$deplibs @LIB_hcrypto_appl@ -lasn1 -lwind -lheimbase -lroken"
204 deplibs="$deplibs @LIB_crypt@ @PTHREAD_LIBADD@ @LIB_dlopen@"
205 deplibs="$deplibs @LIB_door_create@ @LIBS@"
206 if test X"$do_lib_deps" = X"yes"; then
207 lib_flags="$lib_flags $deplibs"
209 if test X"$libdir" != X/usr/lib; then
210 lib_flags="-L${libdir} $lib_flags"
213 echo ${lib_flags}
215 if test "$do_cflags" = "yes"; then
216 cflags="@INCLUDE_hcrypto@"
217 if test X"${includedir}" != X/usr/include; then
218 cflags="-I${includedir} $cflags"
220 echo $cflags
223 exit 0