krb5-config 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  1. #!/bin/sh
  2. # Copyright 2001, 2002, 2003 by the Massachusetts Institute of Technology.
  3. # All Rights Reserved.
  4. #
  5. # Export of this software from the United States of America may
  6. # require a specific license from the United States Government.
  7. # It is the responsibility of any person or organization contemplating
  8. # export to obtain such a license before exporting.
  9. #
  10. # WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
  11. # distribute this software and its documentation for any purpose and
  12. # without fee is hereby granted, provided that the above copyright
  13. # notice appear in all copies and that both that copyright notice and
  14. # this permission notice appear in supporting documentation, and that
  15. # the name of M.I.T. not be used in advertising or publicity pertaining
  16. # to distribution of the software without specific, written prior
  17. # permission. Furthermore if you modify this software you must label
  18. # your software as modified software and not distribute it in such a
  19. # fashion that it might be confused with the original M.I.T. software.
  20. # M.I.T. makes no representations about the suitability of
  21. # this software for any purpose. It is provided "as is" without express
  22. # or implied warranty.
  23. #
  24. #
  25. # Configurable parameters set by autoconf
  26. version_string="Kerberos 5 release 1.20.1"
  27. prefix=/croot/krb5_1686930994487/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pl
  28. exec_prefix=${prefix}
  29. includedir=${prefix}/include
  30. libdir=${exec_prefix}/lib
  31. CC_LINK='$(CC) $(PROG_LIBPATH) $(PROG_RPATH_FLAGS) $(CFLAGS) $(LDFLAGS)'
  32. KDB5_DB_LIB=
  33. LDFLAGS='-Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,--disable-new-dtags -Wl,--gc-sections -Wl,-rpath,/croot/krb5_1686930994487/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pl/lib -Wl,-rpath-link,/croot/krb5_1686930994487/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pl/lib -L/croot/krb5_1686930994487/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pl/lib -L/croot/krb5_1686930994487/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pl/lib -Wl,--disable-new-dtags'
  34. RPATH_FLAG='-Wl,--enable-new-dtags -Wl,-rpath -Wl,'
  35. PROG_RPATH_FLAGS='$(RPATH_FLAG)$(PROG_RPATH)'
  36. PTHREAD_CFLAGS='-pthread'
  37. DL_LIB='-ldl'
  38. DEFCCNAME='FILE:/tmp/krb5cc_%{uid}'
  39. DEFKTNAME='FILE:/etc/krb5.keytab'
  40. DEFCKTNAME='FILE:/opt/conda/var/krb5/user/%{euid}/client.keytab'
  41. LIBS='-lcrypto -lresolv '
  42. GEN_LIB=
  43. # Defaults for program
  44. library=krb5
  45. # Some constants
  46. vendor_string="Massachusetts Institute of Technology"
  47. # Process arguments
  48. # Yes, we are sloppy, library specifications can come before options
  49. while test $# != 0; do
  50. case $1 in
  51. --all)
  52. do_all=1
  53. ;;
  54. --cflags)
  55. do_cflags=1
  56. ;;
  57. --defccname)
  58. do_defccname=1
  59. ;;
  60. --defcktname)
  61. do_defcktname=1
  62. ;;
  63. --defktname)
  64. do_defktname=1
  65. ;;
  66. --deps) # historically a no-op
  67. ;;
  68. --exec-prefix)
  69. do_exec_prefix=1
  70. ;;
  71. --help)
  72. do_help=1
  73. ;;
  74. --libs)
  75. do_libs=1
  76. ;;
  77. --prefix)
  78. do_prefix=1
  79. ;;
  80. --vendor)
  81. do_vendor=1
  82. ;;
  83. --version)
  84. do_version=1
  85. ;;
  86. krb5)
  87. library=krb5
  88. ;;
  89. gssapi)
  90. library=gssapi
  91. ;;
  92. gssrpc)
  93. library=gssrpc
  94. ;;
  95. kadm-client)
  96. library=kadm_client
  97. ;;
  98. kadm-server)
  99. library=kadm_server
  100. ;;
  101. kdb)
  102. library=kdb
  103. ;;
  104. *)
  105. echo "$0: Unknown option \`$1' -- use \`--help' for usage"
  106. exit 1
  107. esac
  108. shift
  109. done
  110. # If required options - provide help
  111. if test -z "$do_all" -a -z "$do_version" -a -z "$do_vendor" -a \
  112. -z "$do_prefix" -a -z "$do_vendor" -a -z "$do_exec_prefix" -a \
  113. -z "$do_defccname" -a -z "$do_defktname" -a -z "$do_defcktname" -a \
  114. -z "$do_cflags" -a -z "$do_libs"; then
  115. do_help=1
  116. fi
  117. if test -n "$do_help"; then
  118. echo "Usage: $0 [OPTIONS] [LIBRARIES]"
  119. echo "Options:"
  120. echo " [--help] Help"
  121. echo " [--all] Display version, vendor, and various values"
  122. echo " [--version] Version information"
  123. echo " [--vendor] Vendor information"
  124. echo " [--prefix] Kerberos installed prefix"
  125. echo " [--exec-prefix] Kerberos installed exec_prefix"
  126. echo " [--defccname] Show built-in default ccache name"
  127. echo " [--defktname] Show built-in default keytab name"
  128. echo " [--defcktname] Show built-in default client keytab name"
  129. echo " [--cflags] Compile time CFLAGS"
  130. echo " [--libs] List libraries required to link [LIBRARIES]"
  131. echo "Libraries:"
  132. echo " krb5 Kerberos 5 application"
  133. echo " gssapi GSSAPI application with Kerberos 5 bindings"
  134. echo " gssrpc GSSAPI RPC application"
  135. echo " kadm-client Kadmin client"
  136. echo " kadm-server Kadmin server"
  137. echo " kdb Application that accesses the kerberos database"
  138. exit 0
  139. fi
  140. if test -n "$do_all"; then
  141. all_exit=
  142. do_version=1
  143. do_prefix=1
  144. do_exec_prefix=1
  145. do_vendor=1
  146. title_version="Version: "
  147. title_prefix="Prefix: "
  148. title_exec_prefix="Exec_prefix: "
  149. title_vendor="Vendor: "
  150. else
  151. all_exit="exit 0"
  152. fi
  153. if test -n "$do_version"; then
  154. echo "$title_version$version_string"
  155. $all_exit
  156. fi
  157. if test -n "$do_vendor"; then
  158. echo "$title_vendor$vendor_string"
  159. $all_exit
  160. fi
  161. if test -n "$do_prefix"; then
  162. echo "$title_prefix$prefix"
  163. $all_exit
  164. fi
  165. if test -n "$do_exec_prefix"; then
  166. echo "$title_exec_prefix$exec_prefix"
  167. $all_exit
  168. fi
  169. if test -n "$do_defccname"; then
  170. echo "$DEFCCNAME"
  171. $all_exit
  172. fi
  173. if test -n "$do_defktname"; then
  174. echo "$DEFKTNAME"
  175. $all_exit
  176. fi
  177. if test -n "$do_defcktname"; then
  178. echo "$DEFCKTNAME"
  179. $all_exit
  180. fi
  181. if test -n "$do_cflags"; then
  182. if test x"$includedir" != x"/usr/include" ; then
  183. echo "-I${includedir}"
  184. else
  185. echo ''
  186. fi
  187. fi
  188. if test -n "$do_libs"; then
  189. # Assumes /usr/lib is the standard library directory everywhere...
  190. if test "$libdir" = /usr/lib; then
  191. libdirarg=
  192. else
  193. libdirarg="-L$libdir"
  194. fi
  195. # Ugly gross hack for our build tree
  196. lib_flags=`echo $CC_LINK | sed -e 's/\$(CC)//' \
  197. -e 's/\$(PURE)//' \
  198. -e 's#\$(PROG_RPATH_FLAGS)#'"$PROG_RPATH_FLAGS"'#' \
  199. -e 's#\$(PROG_RPATH)#'$libdir'#' \
  200. -e 's#\$(PROG_LIBPATH)#'$libdirarg'#' \
  201. -e 's#\$(RPATH_FLAG)#'"$RPATH_FLAG"'#' \
  202. -e 's#\$(LDFLAGS)#'"$LDFLAGS"'#' \
  203. -e 's#\$(PTHREAD_CFLAGS)#'"$PTHREAD_CFLAGS"'#' \
  204. -e 's#\$(CFLAGS)##'`
  205. if test $library = 'kdb'; then
  206. lib_flags="$lib_flags -lkdb5 $KDB5_DB_LIB"
  207. library=krb5
  208. fi
  209. if test $library = 'kadm_server'; then
  210. lib_flags="$lib_flags -lkadm5srv_mit -lkdb5 $KDB5_DB_LIB"
  211. library=gssrpc
  212. fi
  213. if test $library = 'kadm_client'; then
  214. lib_flags="$lib_flags -lkadm5clnt_mit"
  215. library=gssrpc
  216. fi
  217. if test $library = 'gssrpc'; then
  218. lib_flags="$lib_flags -lgssrpc"
  219. library=gssapi
  220. fi
  221. if test $library = 'gssapi'; then
  222. lib_flags="$lib_flags -lgssapi_krb5"
  223. library=krb5
  224. fi
  225. if test $library = 'krb5'; then
  226. lib_flags="$lib_flags -lkrb5 -lk5crypto -lcom_err"
  227. fi
  228. # If we ever support a flag to generate output suitable for static
  229. # linking, we would output "-lkrb5support $GEN_LIB $LIBS $DL_LIB"
  230. # here.
  231. echo $lib_flags
  232. fi
  233. exit 0