Patrick Welche <prlw1@cam.ac.uk>
[netbsd-mini2440.git] / crypto / dist / heimdal / tools / krb5-config.in
blobf714557d1c3dc1f44ea7c4adcf14adf7807da2b9
1 #!/bin/sh
2 # $Heimdal: krb5-config.in 20528 2007-04-22 13:22:16Z lha $
3 # $NetBSD$
5 do_libs=no
6 do_cflags=no
7 do_usage=no
8 print_prefix=no
9 print_exec_prefix=no
10 library=krb5
12 if test $# -eq 0; then
13 do_usage=yes
14 usage_exit=1
17 for i in $*; do
18 case $i in
19 --help)
20 do_usage=yes
21 usage_exit=0
23 --version)
24 echo "@PACKAGE@ @VERSION@"
25 echo '$Id: krb5-config.in,v 1.3 2008/03/22 08:37:24 mlelstv Exp $'
26 exit 0
28 --prefix=*)
29 prefix=`echo $i | sed 's/^--prefix=//'`
31 --prefix)
32 print_prefix=yes
34 --exec-prefix=*)
35 exec_prefix=`echo $i | sed 's/^--exec-prefix=//'`
37 --exec-prefix)
38 print_exec_prefix=yes
40 --libs)
41 do_libs=yes
43 --cflags)
44 do_cflags=yes
46 krb5)
47 library=krb5
49 gssapi)
50 library=gssapi
52 kadm-client)
53 library=kadm-client
55 kadm-server)
56 library=kadm-server
58 kafs)
59 library=kafs
62 echo "unknown option: $i"
63 exit 1
65 esac
66 done
68 if test "$do_usage" = "yes"; then
69 echo "usage: $0 [options] [libraries]"
70 echo "options: [--prefix[=dir]] [--exec-prefix[=dir]] [--libs] [--cflags]"
71 echo "libraries: krb5 gssapi kadm-client kadm-server kafs"
72 exit $usage_exit
75 if test "$prefix" = ""; then
76 prefix=@prefix@
78 if test "$exec_prefix" = ""; then
79 exec_prefix=@exec_prefix@
82 libdir=@libdir@
83 includedir=@includedir@
85 if test "$print_prefix" = "yes"; then
86 echo $prefix
89 if test "$print_exec_prefix" = "yes"; then
90 echo $exec_prefix
93 if test "$do_libs" = "yes"; then
94 lib_flags="-L${libdir}"
95 case $library in
96 gssapi)
97 lib_flags="$lib_flags -lgssapi -lheimntlm"
99 kadm-client)
100 lib_flags="$lib_flags -lkadm5clnt"
102 kadm-server)
103 lib_flags="$lib_flags -lkadm5srv @LIB_dbopen@"
105 kafs)
106 lib_flags="$lib_flags -lkafs"
108 esac
109 lib_flags="$lib_flags -lkrb5 @LIB_pkinit@ -lcom_err"
110 lib_flags="$lib_flags @LIB_hcrypto_appl@ -lasn1 -lroken"
111 lib_flags="$lib_flags @LIB_crypt@ @LIB_dlopen@"
112 lib_flags="$lib_flags @LIB_door_create@ @LIBS@"
113 echo $lib_flags
115 if test "$do_cflags" = "yes"; then
116 echo "-I${includedir} @INCLUDE_hcrypto@"
119 exit 0