diff --git a/aclocal.m4 b/aclocal.m4 index 35df7a2cc..e6668251c 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -542,28 +542,8 @@ AC_DEFUN([MP_LIB_MD5],[ AC_DEFINE([HAVE_LIBMD], ,[Define if you have the `md' library (-lmd).]) MD5_LIBS="-lmd"] ) - if test "x$MD5_LIBS" = "x" ; then - # If libmd is not found, check for libcrypto from OpenSSL - AC_CHECK_LIB([crypto], [MD5_Update],[ - AC_CHECK_HEADERS([openssl/md5.h],,[ - case $host_os in - darwin*) - AC_MSG_NOTICE([Please install the BSD SDK package from the Xcode Developer Tools CD.]) - ;; - *) - AC_MSG_NOTICE([Please install the libmd developer headers for your platform.]) - ;; - esac - AC_MSG_ERROR([libcrypt was found, but header file openssl/md5.h is missing.]) - ]) - AC_DEFINE([HAVE_LIBCRYPTO],,[Define if you have the `crypto' library (-lcrypto).]) - MD5_LIBS="-lcrypto" - ], [ - AC_MSG_ERROR([Neither OpenSSL or libmd were found. A working md5 implementation is required.]) - ]) - fi if test "x$MD5_LIBS" = "x"; then - AC_MSG_ERROR([Neither OpenSSL or libmd were found. A working md5 implementation is required.]) + AC_MSG_ERROR([Neither CommonCrypto nor libmd were found. A working md5 implementation is required.]) fi AC_SUBST([MD5_LIBS]) ]) diff --git a/configure b/configure index 9ced0fe9d..5998925dc 100755 --- a/configure +++ b/configure @@ -8244,7 +8244,7 @@ $as_echo "#define HAVE_SYS_WAIT_H 1" >>confdefs.h fi for ac_header in limits.h paths.h sys/file.h crt_externs.h fcntl.h sys/fcntl.h sys/cdefs.h err.h sys/socket.h \ - readline/readline.h readline/history.h pwd.h sys/paths.h utime.h CommonCrypto/CommonDigest.h + readline/readline.h readline/history.h pwd.h sys/paths.h utime.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" @@ -8328,6 +8328,12 @@ $as_echo "#define READLINK_IS_NOT_P1003_1A /**/" >>confdefs.h # Check for md5 implementation +ac_fn_c_check_header_mongrel "$LINENO" "CommonCrypto/CommonDigest.h" "ac_cv_header_CommonCrypto_CommonDigest_h" "$ac_includes_default" +if test "x$ac_cv_header_CommonCrypto_CommonDigest_h" = x""yes; then : + +$as_echo "#define HAVE_COMMONCRYPTO_COMMONDIGEST_H 1" >>confdefs.h + +else # Check for libmd, which is prefered @@ -8402,89 +8408,14 @@ $as_echo "#define HAVE_LIBMD /**/" >>confdefs.h fi - if test "x$MD5_LIBS" = "x" ; then - # If libmd is not found, check for libcrypto from OpenSSL - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MD5_Update in -lcrypto" >&5 -$as_echo_n "checking for MD5_Update in -lcrypto... " >&6; } -if test "${ac_cv_lib_crypto_MD5_Update+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lcrypto $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char MD5_Update (); -int -main () -{ -return MD5_Update (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_crypto_MD5_Update=yes -else - ac_cv_lib_crypto_MD5_Update=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_MD5_Update" >&5 -$as_echo "$ac_cv_lib_crypto_MD5_Update" >&6; } -if test "x$ac_cv_lib_crypto_MD5_Update" = x""yes; then : - - for ac_header in openssl/md5.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "openssl/md5.h" "ac_cv_header_openssl_md5_h" "$ac_includes_default" -if test "x$ac_cv_header_openssl_md5_h" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_OPENSSL_MD5_H 1 -_ACEOF - -else - - case $host_os in - darwin*) - { $as_echo "$as_me:${as_lineno-$LINENO}: Please install the BSD SDK package from the Xcode Developer Tools CD." >&5 -$as_echo "$as_me: Please install the BSD SDK package from the Xcode Developer Tools CD." >&6;} - ;; - *) - { $as_echo "$as_me:${as_lineno-$LINENO}: Please install the libmd developer headers for your platform." >&5 -$as_echo "$as_me: Please install the libmd developer headers for your platform." >&6;} - ;; - esac - as_fn_error "libcrypt was found, but header file openssl/md5.h is missing." "$LINENO" 5 - -fi - -done - - -$as_echo "#define HAVE_LIBCRYPTO /**/" >>confdefs.h - - MD5_LIBS="-lcrypto" - -else - - as_fn_error "Neither OpenSSL or libmd were found. A working md5 implementation is required." "$LINENO" 5 - -fi - - fi if test "x$MD5_LIBS" = "x"; then - as_fn_error "Neither OpenSSL or libmd were found. A working md5 implementation is required." "$LINENO" 5 + as_fn_error "Neither CommonCrypto nor libmd were found. A working md5 implementation is required." "$LINENO" 5 fi +fi + + # Check for readline # Check whether --enable-readline was given. diff --git a/configure.ac b/configure.ac index c346370f2..7f8c78791 100644 --- a/configure.ac +++ b/configure.ac @@ -195,7 +195,7 @@ AC_HEADER_STDC AC_HEADER_DIRENT AC_HEADER_SYS_WAIT AC_CHECK_HEADERS([limits.h paths.h sys/file.h crt_externs.h fcntl.h sys/fcntl.h sys/cdefs.h err.h sys/socket.h \ - readline/readline.h readline/history.h pwd.h sys/paths.h utime.h CommonCrypto/CommonDigest.h]) + readline/readline.h readline/history.h pwd.h sys/paths.h utime.h]) INCLUDES="-I.. -I. $INCLUDES" @@ -204,7 +204,7 @@ AC_CHECK_FUNCS([bzero memset fgetln lockf flock setmode strcasecmp strncasecmp s MP_CHECK_READLINK_IS_P1003_1A # Check for md5 implementation -MP_LIB_MD5 +AC_CHECK_HEADER([CommonCrypto/CommonDigest.h], [AC_DEFINE([HAVE_COMMONCRYPTO_COMMONDIGEST_H], [1], [Define if CommonCrypto is available.])], [MP_LIB_MD5]) # Check for readline AC_ARG_ENABLE(readline, AS_HELP_STRING([--enable-readline],[Enable addition of readline support, if readline present.]), diff --git a/src/config.h.in b/src/config.h.in index cb4c29b8e..21505be3f 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -18,7 +18,7 @@ /* Define to 1 if you have the `clearenv' function. */ #undef HAVE_CLEARENV -/* Define to 1 if you have the header file. */ +/* Define if CommonCrypto is available. */ #undef HAVE_COMMONCRYPTO_COMMONDIGEST_H /* Define to 1 if you have the `copyfile' function. */ @@ -83,9 +83,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H -/* Define if you have the `crypto' library (-lcrypto). */ -#undef HAVE_LIBCRYPTO - /* Define if you have the `md' library (-lmd). */ #undef HAVE_LIBMD @@ -113,9 +110,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_OBJC_OBJC_H -/* Define to 1 if you have the header file. */ -#undef HAVE_OPENSSL_MD5_H - /* Define to 1 if you have the header file. */ #undef HAVE_PATHS_H