$NetBSD: patch-ad,v 1.3 2004/11/19 23:16:02 jlam Exp $ --- configure.orig 2004-09-13 08:27:10.000000000 -0400 +++ configure @@ -3176,9 +3176,6 @@ fi -test "$sysconfdir" = '${prefix}/etc' && sysconfdir='/etc' -test "$localstatedir" = '${prefix}/var' && localstatedir='/var/heimdal' - # Make sure we can run config.sub. $ac_config_sub sun4 >/dev/null 2>&1 || { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 @@ -22413,6 +22410,127 @@ rm -f conftest.err conftest.$ac_objext \ LIBS="$save_LIBS" fi +if test "$crypto_lib" = "unknown" -a "$with_openssl" != "no"; then + save_CFLAGS="$CFLAGS" + save_LIBS="$LIBS" + INCLUDE_des= + LIB_des= + if test "$with_openssl_include" != ""; then + INCLUDE_des="-I${with_openssl_include}" + fi + if test "$with_openssl_lib" != ""; then + LIB_des="-L${with_openssl_lib}" + fi + CFLAGS="-DHAVE_OPENSSL ${INCLUDE_des} ${CFLAGS}" + saved_LIB_des="$LIB_des" + for lres in "" "-lnsl -lsocket"; do + LIB_des="${saved_LIB_des} -ldes -lcrypto $lres" + LIB_des_a="$LIB_des" + LIB_des_so="$LIB_des" + LIB_des_appl="$LIB_des" + LIBS="${LIBS} ${LIB_des}" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + #undef KRB5 /* makes md4.h et al unhappy */ + #ifdef HAVE_OPENSSL + #include + #include + #include + #define OPENSSL_DES_LIBDES_COMPATIBILITY + #include + #include + #include + #else + #include + #include + #include + #include + #include + #endif + #ifdef OLD_HASH_NAMES + typedef struct md4 MD4_CTX; + #define MD4_Init(C) md4_init((C)) + #define MD4_Update(C, D, L) md4_update((C), (D), (L)) + #define MD4_Final(D, C) md4_finito((C), (D)) + typedef struct md5 MD5_CTX; + #define MD5_Init(C) md5_init((C)) + #define MD5_Update(C, D, L) md5_update((C), (D), (L)) + #define MD5_Final(D, C) md5_finito((C), (D)) + typedef struct sha SHA_CTX; + #define SHA1_Init(C) sha_init((C)) + #define SHA1_Update(C, D, L) sha_update((C), (D), (L)) + #define SHA1_Final(D, C) sha_finito((C), (D)) + #endif + +int +main () +{ + + void *schedule = 0; + MD4_CTX md4; + MD5_CTX md5; + SHA_CTX sha1; + + MD4_Init(&md4); + MD5_Init(&md5); + SHA1_Init(&sha1); + #ifdef HAVE_OPENSSL + RAND_status(); + #endif + + des_cbc_encrypt(0, 0, 0, schedule, 0, 0); + RC4(0, 0, 0, 0); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + + crypto_lib=libcrypto openssl=yes + echo "$as_me:$LINENO: result: libcrypto" >&5 +echo "${ECHO_T}libcrypto" >&6 + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test "$crypto_lib" = libcrypto ; then + break; + fi + done + CFLAGS="$save_CFLAGS" + LIBS="$save_LIBS" +fi + if test "$crypto_lib" = "unknown"; then DIR_des='des'