dmake: do not set MAKEFLAGS=k
[unleashed/tickless.git] / usr / src / cmd / krb5 / krb5-config / krb5-config.sh
blob1bebe1ed98be7bd9af70cd57ae79dac2fb73fc7e
1 #!/bin/sh
4 # Copyright 2008 Sun Microsystems, Inc. All rights reserved.
5 # Use is subject to license terms.
8 # Copyright 2001, 2002, 2003 by the Massachusetts Institute of Technology.
9 # All Rights Reserved.
11 # Export of this software from the United States of America may
12 # require a specific license from the United States Government.
13 # It is the responsibility of any person or organization contemplating
14 # export to obtain such a license before exporting.
16 # WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
17 # distribute this software and its documentation for any purpose and
18 # without fee is hereby granted, provided that the above copyright
19 # notice appear in all copies and that both that copyright notice and
20 # this permission notice appear in supporting documentation, and that
21 # the name of M.I.T. not be used in advertising or publicity pertaining
22 # to distribution of the software without specific, written prior
23 # permission. Furthermore if you modify this software you must label
24 # your software as modified software and not distribute it in such a
25 # fashion that it might be confused with the original M.I.T. software.
26 # M.I.T. makes no representations about the suitability of
27 # this software for any purpose. It is provided "as is" without express
28 # or implied warranty.
32 # Configurable parameters set by autoconf
33 version_string="Solaris Kerberos (based on MIT Kerberos 5 release 1.6.3)"
35 prefix=/usr
36 exec_prefix=${prefix}
37 includedir=${prefix}/include/kerberosv5
38 libdir=${exec_prefix}/lib
39 CC_LINK='$(PURE) $(CC) $(PROG_LIBPATH) $(RPATH_FLAG)$(PROG_RPATH) $(CFLAGS) $(LDFLAGS)'
40 #KRB4_LIB=-lkrb4
41 #DES425_LIB=-ldes425
42 KDB5_DB_LIB=
43 LDFLAGS=''
44 RPATH_FLAG='-R'
45 PTHREAD_CFLAGS=''
47 GEN_LIB=
49 # Defaults for program
50 library=krb5
52 # Some constants
53 vendor_string="Sun Microsystems, Inc."
55 # Process arguments
56 # Yes, we are sloppy, library specifications can come before options
57 while test $# != 0; do
58 case $1 in
59 --all)
60 do_all=1
62 --cflags)
63 do_cflags=1
65 --deps)
66 do_deps=1
68 --exec-prefix)
69 do_exec_prefix=1
71 --help)
72 do_help=1
74 --libs)
75 do_libs=1
77 --prefix)
78 do_prefix=1
80 --vendor)
81 do_vendor=1
83 --version)
84 do_version=1
86 krb5)
87 library=krb5
90 echo "$0: Unknown option \`$1' -- use \`--help' for usage"
91 exit 1
92 esac
93 shift
94 done
96 # If required options - provide help
97 if test -z "$do_all" -a -z "$do_version" -a -z "$do_vendor" -a -z "$do_prefix" -a -z "$do_vendor" -a -z "$do_exec_prefix" -a -z "$do_cflags" -a -z "$do_libs"; then
98 do_help=1
102 if test -n "$do_help"; then
103 echo "Usage: $0 [OPTIONS] [LIBRARIES]"
104 echo "Options:"
105 echo " [--help] Help"
106 echo " [--all] Display version, vendor, and various values"
107 echo " [--version] Version information"
108 echo " [--vendor] Vendor information"
109 echo " [--prefix] Kerberos installed prefix"
110 echo " [--exec-prefix] Kerberos installed exec_prefix"
111 echo " [--cflags] Compile time CFLAGS"
112 echo " [--libs] List libraries required to link [LIBRARIES]"
113 echo "Libraries:"
114 echo " krb5 Kerberos 5 application"
116 exit 0
119 if test -n "$do_all"; then
120 all_exit=
121 do_version=1
122 do_prefix=1
123 do_exec_prefix=1
124 do_vendor=1
125 title_version="Version: "
126 title_prefix="Prefix: "
127 title_exec_prefix="Exec_prefix: "
128 title_vendor="Vendor: "
129 else
130 all_exit="exit 0"
133 if test -n "$do_version"; then
134 echo "$title_version$version_string"
135 $all_exit
138 if test -n "$do_vendor"; then
139 echo "$title_vendor$vendor_string"
140 $all_exit
143 if test -n "$do_prefix"; then
144 echo "$title_prefix$prefix"
145 $all_exit
148 if test -n "$do_exec_prefix"; then
149 echo "$title_exec_prefix$exec_prefix"
150 $all_exit
153 if test -n "$do_cflags"; then
154 echo "-I${includedir}"
158 if test -n "$do_libs"; then
159 # Ugly gross hack for our build tree
160 lib_flags=`echo $CC_LINK | sed -e 's/\$(CC)//' \
161 -e 's/\$(PURE)//' \
162 -e 's#\$(PROG_RPATH)#'$libdir'#' \
163 -e 's#\$(PROG_LIBPATH)#-L'$libdir'#' \
164 -e 's#\$(RPATH_FLAG)#'"$RPATH_FLAG"'#' \
165 -e 's#\$(LDFLAGS)#'"$LDFLAGS"'#' \
166 -e 's#\$(PTHREAD_CFLAGS)#'"$PTHREAD_CFLAGS"'#' \
167 -e 's#\$(CFLAGS)#'"$CFLAGS"'#'`
169 if test $library = 'kdb'; then
170 lib_flags="$lib_flags -lkdb5 $KDB5_DB_LIB"
171 library=krb5
174 if test $library = 'kadm_server'; then
175 lib_flags="$lib_flags -lkadm5srv -lkdb5 $KDB5_DB_LIB"
176 library=kadm_common
179 if test $library = 'kadm_client'; then
180 lib_flags="$lib_flags -lkadm5clnt"
181 library=kadm_common
184 if test $library = 'kadm_common'; then
185 lib_flags="$lib_flags -lgssrpc"
186 library=gssapi
189 if test $library = 'gssapi'; then
190 lib_flags="$lib_flags -lgssapi_krb5"
191 library=krb5
194 if test $library = 'krb4'; then
195 lib_flags="$lib_flags $KRB4_LIB $DES425_LIB"
196 library=krb5
199 if test $library = 'krb5'; then
200 lib_flags="$lib_flags -lkrb5 $GEN_LIB"
203 echo $lib_flags
206 exit 0