1dnl checking for kerberos 4 libraries (and DES) 2 3AC_DEFUN([SASL_DES_CHK], [ 4AC_ARG_WITH(des, [ --with-des=DIR with DES (look in DIR) [yes] ], 5 with_des=$withval, 6 with_des=yes) 7 8LIB_DES="" 9if test "$with_des" != no; then 10 if test -d $with_des; then 11 CPPFLAGS="$CPPFLAGS -I${with_des}/include" 12 LDFLAGS="$LDFLAGS -L${with_des}/lib" 13 fi 14 15 if test "$with_openssl" != no; then 16 dnl check for openssl installing -lcrypto, then make vanilla check 17 AC_CHECK_LIB(crypto, des_cbc_encrypt, [ 18 AC_CHECK_HEADER(openssl/des.h, [AC_DEFINE(WITH_SSL_DES,[],[Use OpenSSL DES Implementation]) 19 LIB_DES="-lcrypto"; 20 with_des=yes], 21 with_des=no)], 22 with_des=no, $LIB_RSAREF) 23 24 dnl same test again, different symbol name 25 if test "$with_des" = no; then 26 AC_CHECK_LIB(crypto, DES_cbc_encrypt, [ 27 AC_CHECK_HEADER(openssl/des.h, [AC_DEFINE(WITH_SSL_DES,[],[Use OpenSSL DES Implementation]) 28 LIB_DES="-lcrypto"; 29 with_des=yes], 30 with_des=no)], 31 with_des=no, $LIB_RSAREF) 32 fi 33 else 34 with_des=no 35 fi 36 37 if test "$with_des" = no; then 38 AC_CHECK_LIB(des, des_cbc_encrypt, [LIB_DES="-ldes"; 39 with_des=yes], with_des=no) 40 fi 41 42 if test "$with_des" = no; then 43 AC_CHECK_LIB(des425, des_cbc_encrypt, [LIB_DES="-ldes425"; 44 with_des=yes], with_des=no) 45 fi 46 47 if test "$with_des" = no; then 48 AC_CHECK_LIB(des524, des_cbc_encrypt, [LIB_DES="-ldes524"; 49 with_des=yes], with_des=no) 50 fi 51 52 if test "$with_des" = no; then 53 dnl if openssl is around, we might be able to use that for des 54 55 dnl if openssl has been compiled with the rsaref2 libraries, 56 dnl we need to include the rsaref libraries in the crypto check 57 LIB_RSAREF="" 58 AC_CHECK_LIB(rsaref, RSAPublicEncrypt, 59 LIB_RSAREF="-lRSAglue -lrsaref"; cmu_have_rsaref=yes, 60 cmu_have_rsaref=no) 61 62 AC_CHECK_LIB(crypto, des_cbc_encrypt, [ 63 AC_CHECK_HEADER(openssl/des.h, [AC_DEFINE(WITH_SSL_DES,[],[Use OpenSSL DES Implementation]) 64 LIB_DES="-lcrypto"; 65 with_des=yes], 66 with_des=no)], 67 with_des=no, $LIB_RSAREF) 68 fi 69fi 70 71if test "$with_des" != no; then 72 AC_DEFINE(WITH_DES,[],[Use DES]) 73fi 74 75AC_SUBST(LIB_DES) 76]) 77 78AC_DEFUN([SASL_KERBEROS_V4_CHK], [ 79 AC_REQUIRE([SASL_DES_CHK]) 80 81 AC_ARG_ENABLE(krb4, [ --enable-krb4 enable KERBEROS_V4 authentication [[no]] ], 82 krb4=$enableval, 83 krb4=no) 84 85 if test "$krb4" != no; then 86 dnl In order to compile kerberos4, we need libkrb and libdes. 87 dnl (We've already gotten libdes from SASL_DES_CHK) 88 dnl we might need -lresolv for kerberos 89 AC_CHECK_LIB(resolv,res_search) 90 91 dnl if we were ambitious, we would look more aggressively for the 92 dnl krb4 install 93 if test -d ${krb4}; then 94 AC_CACHE_CHECK(for Kerberos includes, cyrus_cv_krbinclude, [ 95 for krbhloc in include/kerberosIV include/kerberos include 96 do 97 if test -f ${krb4}/${krbhloc}/krb.h ; then 98 cyrus_cv_krbinclude=${krb4}/${krbhloc} 99 break 100 fi 101 done 102 ]) 103 104 if test -n "${cyrus_cv_krbinclude}"; then 105 CPPFLAGS="$CPPFLAGS -I${cyrus_cv_krbinclude}" 106 fi 107 LDFLAGS="$LDFLAGS -L$krb4/lib" 108 fi 109 110 if test "$with_des" != no; then 111 AC_CHECK_HEADER(krb.h, [ 112 AC_CHECK_LIB(com_err, com_err, [ 113 AC_CHECK_LIB(krb, krb_mk_priv, 114 [COM_ERR="-lcom_err"; SASL_KRB_LIB="-lkrb"; krb4lib="yes"], 115 krb4lib=no, $LIB_DES -lcom_err)], [ 116 AC_CHECK_LIB(krb, krb_mk_priv, 117 [COM_ERR=""; SASL_KRB_LIB="-lkrb"; krb4lib="yes"], 118 krb4lib=no, $LIB_DES)])], krb4="no") 119 120 if test "$krb4" != "no" -a "$krb4lib" = "no"; then 121 AC_CHECK_LIB(krb4, krb_mk_priv, 122 [COM_ERR=""; SASL_KRB_LIB="-lkrb4"; krb4=yes], 123 krb4=no, $LIB_DES) 124 fi 125 if test "$krb4" = no; then 126 AC_WARN(No Kerberos V4 found) 127 fi 128 else 129 AC_WARN(No DES library found for Kerberos V4 support) 130 krb4=no 131 fi 132 fi 133 134 if test "$krb4" != no; then 135 cmu_save_LIBS="$LIBS" 136 LIBS="$LIBS $SASL_KRB_LIB" 137 AC_CHECK_FUNCS(krb_get_err_text) 138 LIBS="$cmu_save_LIBS" 139 fi 140 141 AC_MSG_CHECKING(KERBEROS_V4) 142 if test "$krb4" != no; then 143 AC_MSG_RESULT(enabled) 144 SASL_MECHS="$SASL_MECHS libkerberos4.la" 145 SASL_STATIC_SRCS="$SASL_STATIC_SRCS \$(top_srcdir)/plugins/kerberos4.c" 146 SASL_STATIC_OBJS="$SASL_STATIC_OBJS kerberos4.o" 147 AC_DEFINE(STATIC_KERBEROS4,[],[User KERBEROS_V4 Staticly]) 148 AC_DEFINE(HAVE_KRB,[],[Do we have Kerberos 4 Support?]) 149 SASL_KRB_LIB="$SASL_KRB_LIB $LIB_DES $COM_ERR" 150 else 151 AC_MSG_RESULT(disabled) 152 fi 153 AC_SUBST(SASL_KRB_LIB) 154]) 155 156