To: bug-cvs@gnu.org Subject: [Patches (again): smarter configure for kerberos] Date: Mon, 13 Apr 98 18:19:03 -0700 From: Wilfredo Sanchez Kerberos patches. See ChangeLog. Lets CVS use kerberos4 if you have kerberos5 installed. Ideally, CVS would use kerberos5, but that's harder. -Fred wsanchez@apple.com diff -u -r cvs.Cyclic/ChangeLog cvs.kerberos/ChangeLog --- cvs.Cyclic/ChangeLog Mon Apr 6 22:02:57 1998 +++ cvs.kerberos/ChangeLog Mon Apr 13 17:39:57 1998 @@ -14,6 +14,14 @@ * TODO (190): Remove "failed to check out" from commit.c from lists of error messages suppressed by -q; it no longer is. +Wed Feb 11 23:32:45 PST 1998 Wilfredo Sanchez + + * configure.in: Make krb5's krb4 compatibility libs work in place of krb4. + Fix --with-encryption usage message to say --enable-encryption. + + * configure.in: Modify kerberos checks for possible locations in + Rhapsody. + 4 Feb 1998 Jim Kingdon * cvsnt.mak: The usual "because Visual C++ feels like it" diff -u -r cvs.Cyclic/configure.in cvs.kerberos/configure.in --- cvs.Cyclic/configure.in Mon Apr 6 22:03:00 1998 +++ cvs.kerberos/configure.in Mon Apr 13 17:40:32 1998 @@ -187,6 +187,8 @@ dnl override the system -lkrb. dnl KRB4=/usr/kerberos +KRB4INCLUDE=$KRB4/include +KRB4LIB=$KRB4/lib define(WITH_KRB4,[ AC_ARG_WITH([krb4], [ --with-krb4=value set default \$(KRB4) from value], @@ -200,12 +202,12 @@ AC_MSG_CHECKING([for krb.h]) if test "$cross_compiling" != yes && test -r $KRB4/include/krb.h; then hold_cflags=$CFLAGS - CFLAGS="$CFLAGS -I$KRB4/include" + CFLAGS="$CFLAGS -I$KRB4INCLUDE" AC_TRY_LINK([#include ],[int i;], - [krb_h=yes krb_incdir=$KRB4/include], - [CFLAGS=$hold_cflags - AC_TRY_LINK([#include ],[int i;], - [krb_h=yes krb_incdir=])]) + [krb_h=yes krb_incdir=$KRB4INCLUDE], + [CFLAGS=$hold_cflags + AC_TRY_LINK([#include ],[int i;], + [krb_h=yes krb_incdir=])) CFLAGS=$hold_cflags else AC_TRY_LINK([#include ],[int i;], @@ -214,48 +216,79 @@ if test -z "$krb_h"; then AC_TRY_LINK([#include ],[int i;], [krb_h=yes krb_incdir=], - [if test "$cross_compiling" != yes && test -r $KRB4/include/kerberosIV/krb.h; then + [if test "$cross_compiling" != yes && test -r $KRB4INCLUDE/kerberosIV/krb.h; then hold_cflags=$CFLAGS - CFLAGS="$CFLAGS -I$KRB4/include/kerberosIV" + CFLAGS="$CFLAGS -I$KRB4INCLUDE/kerberosIV -I$KRB4INCLUDE/kerberosIV/.." AC_TRY_LINK([#include ],[int i;], - [krb_h=yes krb_incdir=$KRB4/include/kerberosIV]) + [krb_h=yes krb_incdir=$KRB4INCLUDE/kerberosIV]) CFLAGS=$hold_cflags fi]) fi +dnl For Apple Rhapsody... +for LIBROOT in Local Network System; do + if test -z "$krb_h"; then + KRBFRAMEWORK=/$LIBROOT/Library/Frameworks/Kerberos.framework + AC_TRY_LINK([#include ],[int i;], + [krb_h=yes krb_incdir=], + [if test "$cross_compiling" != yes && test -r $KRBFRAMEWORK/Headers/kerberosIV/krb.h; then + hold_cflags=$CFLAGS + CFLAGS="$CFLAGS -I$KRBFRAMEWORK/Headers/kerberosIV -I$KRBFRAMEWORK/Headers/kerberosIV/.." + AC_TRY_LINK([#include ],[int i;], + [krb_h=yes krb_incdir=$KRBFRAMEWORK/Headers/kerberosIV]) + CFLAGS=$hold_cflags + fi]) + fi +done AC_MSG_RESULT($krb_h) includeopt= AC_SUBST(includeopt) if test -n "$krb_h"; then krb_lib= - if test "$cross_compiling" != yes && test -r $KRB4/lib/libkrb.a; then + if test "$cross_compiling" != yes && test -r $KRB4LIB/libkrb.a; then hold_ldflags=$LDFLAGS - LDFLAGS="-L${KRB4}/lib $LDFLAGS" - AC_CHECK_LIB(krb,printf,[krb_lib=yes krb_libdir=${KRB4}/lib], + LDFLAGS="-L${KRB4LIB} $LDFLAGS" + AC_CHECK_LIB(krb,printf,[krb_lib=krb krb_libdir=${KRB4}/lib], [LDFLAGS=$hold_ldflags # Using open here instead of printf so we don't # get confused by the cached value for printf from above. - AC_CHECK_LIB(krb,open,[krb_lib=yes krb_libdir=])]) + AC_CHECK_LIB(krb,open,[krb_lib=krb krb_libdir=])]) + LDFLAGS=$hold_ldflags + elif test "$cross_compiling" != yes && test -r $KRB4LIB/libkrb4.a; then + hold_ldflags=$LDFLAGS + LDFLAGS="-L${KRB4LIB} $LDFLAGS" + AC_CHECK_LIB(krb4,printf,[krb_lib=krb4 krb_libdir=${KRB4}/lib], + [LDFLAGS=$hold_ldflags + # Using open here instead of printf so we don't + # get confused by the cached value for printf from above. + AC_CHECK_LIB(krb4,open,[krb_lib=krb4 krb_libdir=])]) LDFLAGS=$hold_ldflags else - AC_CHECK_LIB(krb,printf,[krb_lib=yes krb_libdir=]) + AC_CHECK_LIB(krb,printf,[krb_lib=krb krb_libdir=], + AC_CHECK_LIB(krb4,printf,[krb_lib=krb4 krb_libdir=])) fi if test -n "$krb_lib"; then AC_DEFINE(HAVE_KERBEROS) test -n "${krb_libdir}" && LIBS="${LIBS} -L${krb_libdir}" - LIBS="${LIBS} -lkrb" + LIBS="${LIBS} -l${krb_lib}" # Put -L${krb_libdir} in LDFLAGS temporarily so that it appears before # -ldes in the command line. Don't do it permanently so that we honor # the user's setting for LDFLAGS hold_ldflags=$LDFLAGS test -n "${krb_libdir}" && LDFLAGS="$LDFLAGS -L${krb_libdir}" AC_CHECK_LIB(des,printf,[LIBS="${LIBS} -ldes"]) + AC_CHECK_LIB(des425,printf,[LIBS="${LIBS} -ldes425"]) + AC_CHECK_LIB(com_err,printf,[LIBS="${LIBS} -lkrb524"]) + AC_CHECK_LIB(krb5,printf,[LIBS="${LIBS} -lkrb5"]) + AC_CHECK_LIB(crypto,printf,[LIBS="${LIBS} -lcrypto"]) + AC_CHECK_LIB(com_err,printf,[LIBS="${LIBS} -lcom_err"]) LDFLAGS=$hold_ldflags if test -n "$krb_incdir"; then - includeopt="${includeopt} -I$krb_incdir" + includeopt="${includeopt} -I$krb_incdir -I$krb_incdir/.." fi fi fi + AC_CHECK_FUNCS(krb_get_err_text) dnl @@ -284,7 +317,7 @@ CPPFLAGS=$hold_cppflags dnl -dnl Use --with-encryption to turn on encryption support +dnl Use --enable-encryption to turn on encryption support dnl AC_ARG_ENABLE(encryption, [ --enable-encryption enable encryption support],