Path: blob/main/krb5/util/build-tools/krb5-config.sh
34883 views
#!/bin/sh12# 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 may6# require a specific license from the United States Government.7# It is the responsibility of any person or organization contemplating8# export to obtain such a license before exporting.9#10# WITHIN THAT CONSTRAINT, permission to use, copy, modify, and11# distribute this software and its documentation for any purpose and12# without fee is hereby granted, provided that the above copyright13# notice appear in all copies and that both that copyright notice and14# this permission notice appear in supporting documentation, and that15# the name of M.I.T. not be used in advertising or publicity pertaining16# to distribution of the software without specific, written prior17# permission. Furthermore if you modify this software you must label18# your software as modified software and not distribute it in such a19# fashion that it might be confused with the original M.I.T. software.20# M.I.T. makes no representations about the suitability of21# this software for any purpose. It is provided "as is" without express22# or implied warranty.23#24#2526# Configurable parameters set by autoconf27# Disreagard the above. Edit this by hand in the bespoke FreeBSD build.28version_string="Kerberos 5 release 1.22.1"2930prefix=/usr31exec_prefix=${prefix}32includedir=${prefix}/include33libdir=${exec_prefix}/lib34CC_LINK='$(CC) $(PROG_LIBPATH) $(PROG_RPATH_FLAGS) $(CFLAGS) $(LDFLAGS)'35KDB5_DB_LIB=36RPATH_FLAG=''37PROG_RPATH_FLAGS=''38PTHREAD_CFLAGS='-pthread'39DL_LIB=''40DEFCCNAME='FILE:/tmp/krb5cc_%{uid}'41DEFKTNAME='FILE:/etc/krb5.keytab'42DEFCKTNAME='FILE:/var/krb5/user/%{euid}/client.keytab'4344LIBS='-lintl -L/usr/local/lib'45GEN_LIB=4647# Defaults for program48library=krb54950# Some constants51vendor_string="Massachusetts Institute of Technology"5253# Process arguments54# Yes, we are sloppy, library specifications can come before options55while test $# != 0; do56case $1 in57--all)58do_all=159;;60--cflags)61do_cflags=162;;63--defccname)64do_defccname=165;;66--defcktname)67do_defcktname=168;;69--defktname)70do_defktname=171;;72--deps) # historically a no-op73;;74--exec-prefix)75do_exec_prefix=176;;77--help)78do_help=179;;80--libs)81do_libs=182;;83--prefix)84do_prefix=185;;86--vendor)87do_vendor=188;;89--version)90do_version=191;;92krb5)93library=krb594;;95gssapi)96library=gssapi97;;98gssrpc)99library=gssrpc100;;101kadm-client)102library=kadm_client103;;104kadm-server)105library=kadm_server106;;107kdb)108library=kdb109;;110*)111echo "$0: Unknown option \`$1' -- use \`--help' for usage"112exit 1113esac114shift115done116117# If required options - provide help118if test -z "$do_all" -a -z "$do_version" -a -z "$do_vendor" -a \119-z "$do_prefix" -a -z "$do_vendor" -a -z "$do_exec_prefix" -a \120-z "$do_defccname" -a -z "$do_defktname" -a -z "$do_defcktname" -a \121-z "$do_cflags" -a -z "$do_libs"; then122do_help=1123fi124125126if test -n "$do_help"; then127echo "Usage: $0 [OPTIONS] [LIBRARIES]"128echo "Options:"129echo " [--help] Help"130echo " [--all] Display version, vendor, and various values"131echo " [--version] Version information"132echo " [--vendor] Vendor information"133echo " [--prefix] Kerberos installed prefix"134echo " [--exec-prefix] Kerberos installed exec_prefix"135echo " [--defccname] Show built-in default ccache name"136echo " [--defktname] Show built-in default keytab name"137echo " [--defcktname] Show built-in default client keytab name"138echo " [--cflags] Compile time CFLAGS"139echo " [--libs] List libraries required to link [LIBRARIES]"140echo "Libraries:"141echo " krb5 Kerberos 5 application"142echo " gssapi GSSAPI application with Kerberos 5 bindings"143echo " gssrpc GSSAPI RPC application"144echo " kadm-client Kadmin client"145echo " kadm-server Kadmin server"146echo " kdb Application that accesses the kerberos database"147exit 0148fi149150if test -n "$do_all"; then151all_exit=152do_version=1153do_prefix=1154do_exec_prefix=1155do_vendor=1156title_version="Version: "157title_prefix="Prefix: "158title_exec_prefix="Exec_prefix: "159title_vendor="Vendor: "160else161all_exit="exit 0"162fi163164if test -n "$do_version"; then165echo "$title_version$version_string"166$all_exit167fi168169if test -n "$do_vendor"; then170echo "$title_vendor$vendor_string"171$all_exit172fi173174if test -n "$do_prefix"; then175echo "$title_prefix$prefix"176$all_exit177fi178179if test -n "$do_exec_prefix"; then180echo "$title_exec_prefix$exec_prefix"181$all_exit182fi183184if test -n "$do_defccname"; then185echo "$DEFCCNAME"186$all_exit187fi188189if test -n "$do_defktname"; then190echo "$DEFKTNAME"191$all_exit192fi193194if test -n "$do_defcktname"; then195echo "$DEFCKTNAME"196$all_exit197fi198199if test -n "$do_cflags"; then200if test x"$includedir" != x"/usr/include" ; then201echo "-I${includedir}"202else203echo ''204fi205fi206207208if test -n "$do_libs"; then209# Assumes /usr/lib is the standard library directory everywhere...210if test "$libdir" = /usr/lib; then211libdirarg=212else213libdirarg="-L$libdir"214fi215# Ugly gross hack for our build tree216lib_flags=`echo $CC_LINK | sed -e 's/\$(CC)//' \217-e 's/\$(PURE)//' \218-e 's#\$(PROG_RPATH_FLAGS)#'"$PROG_RPATH_FLAGS"'#' \219-e 's#\$(PROG_RPATH)#'$libdir'#' \220-e 's#\$(PROG_LIBPATH)#'$libdirarg'#' \221-e 's#\$(RPATH_FLAG)#'"$RPATH_FLAG"'#' \222-e 's#\$(LDFLAGS)##' \223-e 's#\$(PTHREAD_CFLAGS)#'"$PTHREAD_CFLAGS"'#' \224-e 's#\$(CFLAGS)##'`225226if test $library = 'kdb'; then227lib_flags="$lib_flags -lkdb5 $KDB5_DB_LIB"228library=krb5229fi230231if test $library = 'kadm_server'; then232lib_flags="$lib_flags -lkadm5srv_mit -lkdb5 $KDB5_DB_LIB"233library=gssrpc234fi235236if test $library = 'kadm_client'; then237lib_flags="$lib_flags -lkadm5clnt_mit"238library=gssrpc239fi240241if test $library = 'gssrpc'; then242lib_flags="$lib_flags -lgssrpc"243library=gssapi244fi245246if test $library = 'gssapi'; then247lib_flags="$lib_flags -lgssapi_krb5"248library=krb5249fi250251if test $library = 'krb5'; then252lib_flags="$lib_flags -lkrb5 -lk5crypto -lcom_err"253fi254255# If we ever support a flag to generate output suitable for static256# linking, we would output "-lkrb5support $GEN_LIB $LIBS $DL_LIB"257# here.258259echo $lib_flags260fi261262exit 0263264265