[Looks plausible, although I haven't looked at the Kerberos config stuff enough to say. I'm not sure why the patch sets KRB4 to 'false' rather than just 'no'. As for indentation, future submitted patches should feel free to let us do the re-indenting (as noting in HACKING). -kingdon] To: bug-cvs@gnu.org Subject: PATCH: --without-krb4 and --without-gssapi From: Russ Allbery Date: 31 Aug 1998 08:05:34 -0700 CVS 1.10 doesn't honor the above; instead, they just set the krb4 and GSSAPI paths to "no" (not particularly useful). This means that there is no way to disable krb4 and GSSAPI support on a platform where the libraries are installed without hand-editing config.h and Makefiles. A patch to configure.in to fix this follows. The actual patch is fairly simple; it's only so long because of the indentation changes in large blocks of configure.in code. -- Russ Allbery (rra@stanford.edu) --- cvs-1.10/configure.in.orig Tue Jun 2 10:29:56 1998 +++ cvs-1.10/configure.in Mon Aug 31 06:25:03 1998 @@ -179,73 +179,82 @@ define(WITH_KRB4,[ AC_ARG_WITH([krb4], [ --with-krb4=value set default \$(KRB4) from value], - [KRB4=$withval], + [case "${withval}" in + no) KRB4=false ;; + *) KRB4=$withval + esac], )dnl -echo "default place for krb4 is $KRB4" -AC_SUBST(KRB4)])dnl -WITH_KRB4 - -krb_h= -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" - 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=])]) - CFLAGS=$hold_cflags +if test "$KRB4" = false; then + echo "checking whether krb4 support is desired... no" else - AC_TRY_LINK([#include ],[int i;], - [krb_h=yes krb_incdir=]) -fi -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 - hold_cflags=$CFLAGS - CFLAGS="$CFLAGS -I$KRB4/include/kerberosIV" - AC_TRY_LINK([#include ],[int i;], - [krb_h=yes krb_incdir=$KRB4/include/kerberosIV]) - CFLAGS=$hold_cflags - fi]) -fi -AC_MSG_RESULT($krb_h) + echo "default place for krb4 is $KRB4" + AC_SUBST(KRB4) +fi])dnl +WITH_KRB4 -includeopt= -AC_SUBST(includeopt) -if test -n "$krb_h"; then - krb_lib= - if test "$cross_compiling" != yes && test -r $KRB4/lib/libkrb.a; then - hold_ldflags=$LDFLAGS - LDFLAGS="-L${KRB4}/lib $LDFLAGS" - AC_CHECK_LIB(krb,printf,[krb_lib=yes 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=])]) - LDFLAGS=$hold_ldflags +if test "$KRB4" != false; then + krb_h= + 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" + 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=])]) + CFLAGS=$hold_cflags else - AC_CHECK_LIB(krb,printf,[krb_lib=yes krb_libdir=]) + AC_TRY_LINK([#include ],[int i;], + [krb_h=yes krb_incdir=]) + fi + 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 + hold_cflags=$CFLAGS + CFLAGS="$CFLAGS -I$KRB4/include/kerberosIV" + AC_TRY_LINK([#include ],[int i;], + [krb_h=yes krb_incdir=$KRB4/include/kerberosIV]) + CFLAGS=$hold_cflags + fi]) fi - if test -n "$krb_lib"; then - AC_DEFINE(HAVE_KERBEROS) - test -n "${krb_libdir}" && LIBS="${LIBS} -L${krb_libdir}" - LIBS="${LIBS} -lkrb" - # 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"]) - LDFLAGS=$hold_ldflags - if test -n "$krb_incdir"; then - includeopt="${includeopt} -I$krb_incdir" + 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 + hold_ldflags=$LDFLAGS + LDFLAGS="-L${KRB4}/lib $LDFLAGS" + AC_CHECK_LIB(krb,printf,[krb_lib=yes 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=])]) + LDFLAGS=$hold_ldflags + else + AC_CHECK_LIB(krb,printf,[krb_lib=yes 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" + # 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"]) + LDFLAGS=$hold_ldflags + if test -n "$krb_incdir"; then + includeopt="${includeopt} -I$krb_incdir" + fi fi fi + AC_CHECK_FUNCS(krb_get_err_text) fi -AC_CHECK_FUNCS(krb_get_err_text) dnl dnl Use --with-gssapi=DIR to enable GSSAPI support. @@ -254,37 +263,46 @@ define(WITH_GSSAPI,[ AC_ARG_WITH([gssapi], [ --with-gssapi=value GSSAPI directory], - [GSSAPI=$withval], + [case "${withval}" in + no) GSSAPI=false ;; + *) GSSAPI=$withval + esac], )dnl -echo "default place for GSSAPI is $GSSAPI" -AC_SUBST(GSSAPI)])dnl +if test "$GSSAPI" = false; then + echo "checking whether GSSAPI support is desired... no" +else + echo "default place for GSSAPI is $GSSAPI" + AC_SUBST(GSSAPI) +fi])dnl WITH_GSSAPI -hold_cppflags=$CPPFLAGS -CPPFLAGS="$CPPFLAGS -I$GSSAPI/include " -AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h gssapi/gssapi_generic.h) -CPPFLAGS=$hold_cppflags - -if test "$ac_cv_header_gssapi_h" = "yes" || test "$ac_cv_header_gssapi_gssapi_h" = "yes"; then - AC_DEFINE(HAVE_GSSAPI) - includeopt="${includeopt} -I$GSSAPI/include" - # FIXME: This is ugly, but these things don't seem to be standardized. - if test "$ac_cv_header_gssapi_h" = "yes"; then - LIBS="$LIBS -L$GSSAPI/lib -lgssapi -lkrb5 -lasn1 -ldes -lroken" - else - LIBS="$LIBS -L$GSSAPI/lib -lgssapi_krb5 -lkrb5 -lcrypto -lcom_err" - fi - save_CPPFLAGS=$CPPFLAGS - CPPFLAGS="-I$GSSAPI/include $CPPFLAGS" - if test "$ac_cv_header_gssapi_h" = "yes"; then - AC_EGREP_HEADER(GSS_C_NT_HOSTBASED_SERVICE, gssapi.h, AC_DEFINE(HAVE_GSS_C_NT_HOSTBASED_SERVICE)) - else - AC_EGREP_HEADER(GSS_C_NT_HOSTBASED_SERVICE, gssapi/gssapi.h, AC_DEFINE(HAVE_GSS_C_NT_HOSTBASED_SERVICE)) +if test "$GSSAPI" != false; then + hold_cppflags=$CPPFLAGS + CPPFLAGS="$CPPFLAGS -I$GSSAPI/include " + AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h gssapi/gssapi_generic.h) + CPPFLAGS=$hold_cppflags + + if test "$ac_cv_header_gssapi_h" = "yes" || test "$ac_cv_header_gssapi_gssapi_h" = "yes"; then + AC_DEFINE(HAVE_GSSAPI) + includeopt="${includeopt} -I$GSSAPI/include" + # FIXME: This is ugly, but these things don't seem to be standardized. + if test "$ac_cv_header_gssapi_h" = "yes"; then + LIBS="$LIBS -L$GSSAPI/lib -lgssapi -lkrb5 -lasn1 -ldes -lroken" + else + LIBS="$LIBS -L$GSSAPI/lib -lgssapi_krb5 -lkrb5 -lcrypto -lcom_err" + fi + save_CPPFLAGS=$CPPFLAGS + CPPFLAGS="-I$GSSAPI/include $CPPFLAGS" + if test "$ac_cv_header_gssapi_h" = "yes"; then + AC_EGREP_HEADER(GSS_C_NT_HOSTBASED_SERVICE, gssapi.h, AC_DEFINE(HAVE_GSS_C_NT_HOSTBASED_SERVICE)) + else + AC_EGREP_HEADER(GSS_C_NT_HOSTBASED_SERVICE, gssapi/gssapi.h, AC_DEFINE(HAVE_GSS_C_NT_HOSTBASED_SERVICE)) + fi + CPPFLAGS=$save_CPPFLAGS + # This is necessary on Irix 5.3, in order to link against libkrb5 -- + # there, an_to_ln.o refers to things defined only in -lgen. + AC_CHECK_LIB(gen, compile) fi - CPPFLAGS=$save_CPPFLAGS - # This is necessary on Irix 5.3, in order to link against libkrb5 -- - # there, an_to_ln.o refers to things defined only in -lgen. - AC_CHECK_LIB(gen, compile) fi dnl