]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - crypto/heimdal/tools/krb5-config.in
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / crypto / heimdal / tools / krb5-config.in
1 #!/bin/sh
2 # $Id: krb5-config.in 20528 2007-04-22 13:22:16Z lha $
3
4 do_libs=no
5 do_cflags=no
6 do_usage=no
7 print_prefix=no
8 print_exec_prefix=no
9 library=krb5
10
11 if test $# -eq 0; then
12   do_usage=yes
13   usage_exit=1
14 fi
15
16 for i in $*; do
17   case $i in
18   --help)
19     do_usage=yes
20     usage_exit=0
21     ;;
22   --version)
23     echo "@PACKAGE@ @VERSION@"
24     echo '$Id: krb5-config.in 20528 2007-04-22 13:22:16Z lha $'
25     exit 0
26     ;;
27   --prefix=*)
28     prefix=`echo $i | sed 's/^--prefix=//'`
29     ;;
30   --prefix)
31     print_prefix=yes
32     ;;
33   --exec-prefix=*)
34     exec_prefix=`echo $i | sed 's/^--exec-prefix=//'`
35     ;;
36   --exec-prefix)
37     print_exec_prefix=yes
38     ;;
39   --libs)
40     do_libs=yes
41     ;;
42   --cflags)
43     do_cflags=yes
44     ;;
45   krb5)
46     library=krb5
47     ;;
48   gssapi)
49     library=gssapi
50     ;;
51   kadm-client)
52     library=kadm-client
53     ;;
54   kadm-server)
55     library=kadm-server
56     ;;
57   kafs)
58     library=kafs
59     ;;
60   *)
61     echo "unknown option: $i"
62     exit 1
63     ;;
64   esac
65 done
66
67 if test "$do_usage" = "yes"; then
68     echo "usage: $0 [options] [libraries]"
69     echo "options: [--prefix[=dir]] [--exec-prefix[=dir]] [--libs] [--cflags]"
70     echo "libraries: krb5 gssapi kadm-client kadm-server kafs"
71     exit $usage_exit
72 fi
73
74 if test "$prefix" = ""; then
75   prefix=@prefix@
76 fi
77 if test "$exec_prefix" = ""; then
78   exec_prefix=@exec_prefix@
79 fi
80
81 libdir=@libdir@
82 includedir=@includedir@
83
84 if test "$print_prefix" = "yes"; then
85     echo $prefix
86 fi
87
88 if test "$print_exec_prefix" = "yes"; then
89     echo $exec_prefix
90 fi
91
92 if test "$do_libs" = "yes"; then
93     lib_flags="-L${libdir}"
94     case $library in
95     gssapi)
96         lib_flags="$lib_flags -lgssapi -lheimntlm"
97         ;;
98     kadm-client)
99         lib_flags="$lib_flags -lkadm5clnt"
100         ;;
101     kadm-server)
102         lib_flags="$lib_flags -lkadm5srv @LIB_dbopen@"
103         ;;
104     kafs)
105         lib_flags="$lib_flags -lkafs"
106         ;;
107     esac
108     lib_flags="$lib_flags -lkrb5 @LIB_pkinit@ -lcom_err"
109     lib_flags="$lib_flags @LIB_hcrypto_appl@ -lasn1 -lroken"
110     lib_flags="$lib_flags @LIB_crypt@ @LIB_dlopen@"
111     lib_flags="$lib_flags @LIB_door_create@ @LIBS@"
112     echo $lib_flags
113 fi
114 if test "$do_cflags" = "yes"; then
115     echo "-I${includedir} @INCLUDE_hcrypto@"
116 fi
117
118 exit 0