From c356a17b51a7377eb9e68b9078c0b0671286147f Mon Sep 17 00:00:00 2001 From: Ezra Peisach Date: Wed, 30 May 2001 18:44:44 +0000 Subject: [PATCH] * krb5-config.in: New script for providing linker and compiler information for applications. * patchlevel.h: Update to current release. Mkrel script generates this in distribtions. * configure.in: Add support for parsing patchlevel.h into a useable form for krb5-config. Generate krb5-config from krb5-config.in. Add KRB5_BUILD_PROGRAM for variable substitution. * Makefile.in: Add support for building and installing krb5-config. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13249 dc483132-0cff-0310-8789-dd5450dbe970 --- src/ChangeLog | 14 +++ src/Makefile.in | 10 ++- src/configure.in | 10 +++ src/krb5-config.in | 213 +++++++++++++++++++++++++++++++++++++++++++++ src/patchlevel.h | 4 +- 5 files changed, 248 insertions(+), 3 deletions(-) create mode 100644 src/krb5-config.in diff --git a/src/ChangeLog b/src/ChangeLog index 47b23a598..2ecd4b085 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,17 @@ +2001-05-30 Ezra Peisach + + * krb5-config.in: New script for providing linker and compiler + information for applications. + + * patchlevel.h: Update to current release. Mkrel script generates + this in distribtions. + + * configure.in: Add support for parsing patchlevel.h into a + useable form for krb5-config. Generate krb5-config from + krb5-config.in. Add KRB5_BUILD_PROGRAM for variable substitution. + + * Makefile.in: Add support for building and installing krb5-config. + 2001-05-23 Ezra Peisach * aclocal.m4 (WITH_CC, WITH_CCOPTS): Autoconf 2.50 fix. Change diff --git a/src/Makefile.in b/src/Makefile.in index 669531c32..a6d0d7e85 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -13,7 +13,7 @@ HDRS = DISTFILES = $(SRCS) $(HDRS) COPYING COPYING.LIB ChangeLog Makefile.in -all-unix:: +all-unix:: krb5-config all-mac:: @@ -542,3 +542,11 @@ install-windows:: $(CP) clients\kpasswd\$(OUTPRE)kpasswd.exe "$(KRB_INSTALL_DIR)\bin\." @if exist "$(KRB_INSTALL_DIR)\bin\krb4_32.dll" del "$(KRB_INSTALL_DIR)\bin\krb4_32.dll" @if exist "$(KRB_INSTALL_DIR)\lib\krb4_32.lib" del "$(KRB_INSTALL_DIR)\lib\krb4_32.lib" + +install-unix:: + $(INSTALL) krb5-config \ + $(DESTDIR)$(CLIENT_BINDIR)/krb5-config + +krb5-config: $(srcdir)/krb5-config.in $(thisconfigdir)/config.status + cd $(thisconfigdir) && $(SHELL) config.status + diff --git a/src/configure.in b/src/configure.in index 76ef35526..e2b2b862e 100644 --- a/src/configure.in +++ b/src/configure.in @@ -9,10 +9,16 @@ fi dnl CONFIG_RULES dnl +dnl Determine version from patchlevel.h +eval `sed 's/#define \([A-Z0-9_]*\)[ \t]*\(.*\)/\1=\2/' < $srcdir/patchlevel.h` +KRB5_VERSION="$KRB5_MAJOR_RELEASE.$KRB5_MINOR_RELEASE.$KRB5_PATCHLEVEL" +AC_SUBST(KRB5_VERSION) +dnl dnl This causes us to *always* set CPP, instead of doing it below only dnl when krb5_cv_prog_gcc isn't set. AC_REQUIRE_CPP dnl +dnl dnl We cannot use the autoconf form as it is too generic and sets other dnl variables. This is only for the purpose of changing the link options. AC_MSG_CHECKING(whether we are using GNU C) @@ -61,6 +67,7 @@ AC_PROG_RANLIB AC_CHECK_FUNCS(memmove) KRB5_BUILD_LIBOBJS KRB5_BUILD_LIBRARY +KRB5_BUILD_PROGRAM dnl dnl For util/makeshlib. (Is SHLIB_TAIL_COMP still necessary?!?) dnl @@ -76,6 +83,9 @@ AC_SUBST(SHLIB_TAIL_COMP) dnl dnl AC_CONFIG_SUBDIRS(util/et util/ss util/profile util/pty util/db2 include lib/crypto lib/krb5 lib/des425 $libkrb4 lib/krb5util lib/kdb lib/gssapi lib/rpc lib/kadm5 $krb524 kdc kadmin slave clients appl tests) +AC_OUTPUT_COMMANDS([chmod +x krb5-config]) +AC_OUTPUT_COMMANDS([echo timestamp > krb5-stamp-h]) +K5_GEN_FILE(krb5-config) K5_GEN_MAKEFILE(.) K5_GEN_MAKEFILE(util) K5_GEN_MAKEFILE(util/send-pr) diff --git a/src/krb5-config.in b/src/krb5-config.in new file mode 100644 index 000000000..e5a97012a --- /dev/null +++ b/src/krb5-config.in @@ -0,0 +1,213 @@ +#!/bin/sh + +# Copyright 2001 by the Massachusetts Institute of Technology. +# All Rights Reserved. +# +# Export of this software from the United States of America may +# require a specific license from the United States Government. +# It is the responsibility of any person or organization contemplating +# export to obtain such a license before exporting. +# +# WITHIN THAT CONSTRAINT, permission to use, copy, modify, and +# distribute this software and its documentation for any purpose and +# without fee is hereby granted, provided that the above copyright +# notice appear in all copies and that both that copyright notice and +# this permission notice appear in supporting documentation, and that +# the name of M.I.T. not be used in advertising or publicity pertaining +# to distribution of the software without specific, written prior +# permission. Furthermore if you modify this software you must label +# your software as modified software and not distribute it in such a +# fashion that it might be confused with the original M.I.T. software. +# M.I.T. makes no representations about the suitability of +# this software for any purpose. It is provided "as is" without express +# or implied warranty. +# +# + +# Configurable parameters set by autoconf +version_string="Kerberos 5 release @KRB5_VERSION@" + +prefix=@prefix@ +exec_prefix=@exec_prefix@ +includedir=@includedir@ +libdir=@libdir@ +CC_LINK="@CC_LINK@" +KRB4_LIB=@KRB4_LIB@ +DES425_LIB=@DES425_LIB@ + + +LIBS=@LIBS@ +GEN_LIB=@GEN_LIB@ + +# Defaults for program +library=krb5 + +# Some constants +vendor_string="Massachusetts Institute of Technology" + +# Process arguments +# Yes, we are sloppy, library specifications can come before options +while test $# != 0; do + case $1 in + --all) + do_all=1 + ;; + --cflags) + do_cflags=1 + ;; + --deps) + do_deps=1 + ;; + --exec-prefix) + do_exec_prefix=1 + ;; + --help) + do_help=1 + ;; + --libs) + do_libs=1 + ;; + --prefix) + do_prefix=1 + ;; + --vendor) + do_vendor=1 + ;; + --version) + do_version=1 + ;; + krb5) + library=krb5 + ;; + gssapi) + library=gssapi + ;; + krb4) + library=krb4 + ;; + kadm-client) + library=kadm_client + ;; + kadm-server) + library=kadm_server + ;; + kdb) + library=kdb + ;; + *) + echo "$0: Unknown option \`$1' -- use \`--help' for usage" + exit 1 + esac + shift +done + +# If required options - provide help +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 + do_help=1 +fi + + +if test -n "$do_help"; then + echo "Usage: $0 [OPTIONS] [LIBRARIES]" + echo "Options:" + echo " [--help] Help" + echo " [--all] Display version, vendor, and various values" + echo " [--version] Version information" + echo " [--vendor] Vendor information" + echo " [--prefix] Kerberos installed prefix" + echo " [--exec-prefix] Kerberos installed exec_prefix" + echo " [--cflags] Compile time CFLAGS" + echo " [--libs] List libraries required to link [LIBRARIES]" + echo "Libraries:" + echo " krb5 Kerberos 5 application" + echo " gssapi GSSAPI application with Kerberos 5 bindings" + echo " krb4 Kerberos 4 application" + echo " kadm-client Kadmin client" + echo " kadm-server Kadmin server" + echo " kdb Application that accesses the kerberos database" + exit 0 +fi + +if test -n "$do_all"; then + all_exit= + do_version=1 + do_prefix=1 + do_exec_prefix=1 + do_vendor=1 + title_version="Version: " + title_prefix="Prefix: " + title_exec_prefix="Exec_prefix: " + title_vendor="Vendor: " +else + all_exit="exit 0" +fi + +if test -n "$do_version"; then + echo "$title_version$version_string" + $all_exit +fi + +if test -n "$do_vendor"; then + echo "$title_vendor$vendor_string" + $all_exit +fi + +if test -n "$do_prefix"; then + echo "$title_prefix$prefix" + $all_exit +fi + +if test -n "$do_exec_prefix"; then + echo "$title_exec_prefix$exec_prefix" + $all_exit +fi + +if test -n "$do_cflags"; then + echo "-I${includedir}" +fi + + +if test -n "$do_libs"; then + # Ugly gross hack for our build tree + lib_flags=`echo $CC_LINK | sed -e 's/\$(CC)//' \ + -e 's#\$(PROG_RPATH)#'$libdir'#' \ + -e 's#\$(PROG_LIBPATH)#-L'$libdir'#'` + + if test $library = 'kdb'; then + lib_flags="$lib_flags -lkdb5 -ldb" + library=krb5 + fi + + if test $library = 'kadm_server'; then + lib_flags="$lib_flags -lkadm5srv -lkdb5 -ldb" + library=kadm_common + fi + + if test $library = 'kadm_client'; then + lib_flags="$lib_flags -lkadm5clnt" + library=kadm_common + fi + + if test $library = 'kadm_common'; then + lib_flags="$lib_flags -lgssrpc -ldyn" + library=gssapi + fi + + if test $library = 'gssapi'; then + lib_flags="$lib_flags -lgssapi_krb5" + library=krb5 + fi + + if test $library = 'krb4'; then + lib_flags="$lib_flags $KRB4_LIB $DES425_LIB" + library=krb5 + fi + + if test $library = 'krb5'; then + lib_flags="$lib_flags -lkrb5 -lk5crypto -lcom_err $GEN_LIB" + fi + + echo $lib_flags +fi + +exit 0 diff --git a/src/patchlevel.h b/src/patchlevel.h index 45d84f194..807b86f5b 100644 --- a/src/patchlevel.h +++ b/src/patchlevel.h @@ -1,3 +1,3 @@ #define KRB5_MAJOR_RELEASE 1 -#define KRB5_MINOR_RELEASE 0 -#define KRB5_PATCHLEVEL 0 +#define KRB5_MINOR_RELEASE 2 +#define KRB5_PATCHLEVEL 2 -- 2.26.2