Changeset 58137


Ignore:
Timestamp:
Sep 22, 2009, 9:40:23 PM (11 years ago)
Author:
toby@…
Message:

base: prefer CommonCrypto, use libmd otherwise. no libcrypto

Location:
trunk/base
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/aclocal.m4

    r58015 r58137  
    543543                MD5_LIBS="-lmd"]
    544544        )
    545         if test "x$MD5_LIBS" = "x" ; then
    546                 # If libmd is not found, check for libcrypto from OpenSSL
    547                 AC_CHECK_LIB([crypto], [MD5_Update],[
    548                         AC_CHECK_HEADERS([openssl/md5.h],,[
    549                                 case $host_os in
    550                                         darwin*)       
    551                                         AC_MSG_NOTICE([Please install the BSD SDK package from the Xcode Developer Tools CD.])
    552                                                 ;;
    553                                         *)     
    554                                         AC_MSG_NOTICE([Please install the libmd developer headers for your platform.])
    555                                                 ;;
    556                                 esac
    557                                 AC_MSG_ERROR([libcrypt was found, but header file openssl/md5.h is missing.])
    558                         ])
    559                         AC_DEFINE([HAVE_LIBCRYPTO],,[Define if you have the `crypto' library (-lcrypto).])
    560                         MD5_LIBS="-lcrypto"
    561                 ], [
    562                         AC_MSG_ERROR([Neither OpenSSL or libmd were found. A working md5 implementation is required.])
    563                 ])
    564         fi
    565545        if test "x$MD5_LIBS" = "x"; then
    566                 AC_MSG_ERROR([Neither OpenSSL or libmd were found. A working md5 implementation is required.])
     546                AC_MSG_ERROR([Neither CommonCrypto nor libmd were found. A working md5 implementation is required.])
    567547        fi
    568548        AC_SUBST([MD5_LIBS])
  • trunk/base/configure

    r58129 r58137  
    82458245
    82468246for 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 \
    8247         readline/readline.h readline/history.h pwd.h sys/paths.h utime.h CommonCrypto/CommonDigest.h
     8247        readline/readline.h readline/history.h pwd.h sys/paths.h utime.h
    82488248do :
    82498249  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
     
    83298329
    83308330# Check for md5 implementation
     8331ac_fn_c_check_header_mongrel "$LINENO" "CommonCrypto/CommonDigest.h" "ac_cv_header_CommonCrypto_CommonDigest_h" "$ac_includes_default"
     8332if test "x$ac_cv_header_CommonCrypto_CommonDigest_h" = x""yes; then :
     8333
     8334$as_echo "#define HAVE_COMMONCRYPTO_COMMONDIGEST_H 1" >>confdefs.h
     8335
     8336else
    83318337
    83328338
     
    84038409fi
    84048410
    8405         if test "x$MD5_LIBS" = "x" ; then
    8406                 # If libmd is not found, check for libcrypto from OpenSSL
    8407                 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MD5_Update in -lcrypto" >&5
    8408 $as_echo_n "checking for MD5_Update in -lcrypto... " >&6; }
    8409 if test "${ac_cv_lib_crypto_MD5_Update+set}" = set; then :
    8410   $as_echo_n "(cached) " >&6
    8411 else
    8412   ac_check_lib_save_LIBS=$LIBS
    8413 LIBS="-lcrypto  $LIBS"
    8414 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    8415 /* end confdefs.h.  */
    8416 
    8417 /* Override any GCC internal prototype to avoid an error.
    8418    Use char because int might match the return type of a GCC
    8419    builtin and then its argument prototype would still apply.  */
    8420 #ifdef __cplusplus
    8421 extern "C"
    8422 #endif
    8423 char MD5_Update ();
    8424 int
    8425 main ()
    8426 {
    8427 return MD5_Update ();
    8428   ;
    8429   return 0;
    8430 }
    8431 _ACEOF
    8432 if ac_fn_c_try_link "$LINENO"; then :
    8433   ac_cv_lib_crypto_MD5_Update=yes
    8434 else
    8435   ac_cv_lib_crypto_MD5_Update=no
    8436 fi
    8437 rm -f core conftest.err conftest.$ac_objext \
    8438     conftest$ac_exeext conftest.$ac_ext
    8439 LIBS=$ac_check_lib_save_LIBS
    8440 fi
    8441 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_MD5_Update" >&5
    8442 $as_echo "$ac_cv_lib_crypto_MD5_Update" >&6; }
    8443 if test "x$ac_cv_lib_crypto_MD5_Update" = x""yes; then :
    8444 
    8445                         for ac_header in openssl/md5.h
    8446 do :
    8447   ac_fn_c_check_header_mongrel "$LINENO" "openssl/md5.h" "ac_cv_header_openssl_md5_h" "$ac_includes_default"
    8448 if test "x$ac_cv_header_openssl_md5_h" = x""yes; then :
    8449   cat >>confdefs.h <<_ACEOF
    8450 #define HAVE_OPENSSL_MD5_H 1
    8451 _ACEOF
    8452 
    8453 else
    8454 
    8455                                 case $host_os in
    8456                                         darwin*)
    8457                                         { $as_echo "$as_me:${as_lineno-$LINENO}: Please install the BSD SDK package from the Xcode Developer Tools CD." >&5
    8458 $as_echo "$as_me: Please install the BSD SDK package from the Xcode Developer Tools CD." >&6;}
    8459                                                 ;;
    8460                                         *)
    8461                                         { $as_echo "$as_me:${as_lineno-$LINENO}: Please install the libmd developer headers for your platform." >&5
    8462 $as_echo "$as_me: Please install the libmd developer headers for your platform." >&6;}
    8463                                                 ;;
    8464                                 esac
    8465                                 as_fn_error "libcrypt was found, but header file openssl/md5.h is missing." "$LINENO" 5
    8466 
    8467 fi
    8468 
    8469 done
    8470 
    8471 
    8472 $as_echo "#define HAVE_LIBCRYPTO /**/" >>confdefs.h
    8473 
    8474                         MD5_LIBS="-lcrypto"
    8475 
    8476 else
    8477 
    8478                         as_fn_error "Neither OpenSSL or libmd were found. A working md5 implementation is required." "$LINENO" 5
    8479 
    8480 fi
    8481 
     8411        if test "x$MD5_LIBS" = "x"; then
     8412                as_fn_error "Neither CommonCrypto nor libmd were found. A working md5 implementation is required." "$LINENO" 5
    84828413        fi
    8483         if test "x$MD5_LIBS" = "x"; then
    8484                 as_fn_error "Neither OpenSSL or libmd were found. A working md5 implementation is required." "$LINENO" 5
    8485         fi
     8414
     8415
     8416fi
    84868417
    84878418
  • trunk/base/configure.ac

    r58129 r58137  
    196196AC_HEADER_SYS_WAIT
    197197AC_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 \
    198         readline/readline.h readline/history.h pwd.h sys/paths.h utime.h CommonCrypto/CommonDigest.h])
     198        readline/readline.h readline/history.h pwd.h sys/paths.h utime.h])
    199199
    200200INCLUDES="-I.. -I. $INCLUDES"
     
    205205
    206206# Check for md5 implementation
    207 MP_LIB_MD5
     207AC_CHECK_HEADER([CommonCrypto/CommonDigest.h], [AC_DEFINE([HAVE_COMMONCRYPTO_COMMONDIGEST_H], [1], [Define if CommonCrypto is available.])], [MP_LIB_MD5])
    208208
    209209# Check for readline
  • trunk/base/src/config.h.in

    r58129 r58137  
    1919#undef HAVE_CLEARENV
    2020
    21 /* Define to 1 if you have the <CommonCrypto/CommonDigest.h> header file. */
     21/* Define if CommonCrypto is available. */
    2222#undef HAVE_COMMONCRYPTO_COMMONDIGEST_H
    2323
     
    8484#undef HAVE_INTTYPES_H
    8585
    86 /* Define if you have the `crypto' library (-lcrypto). */
    87 #undef HAVE_LIBCRYPTO
    88 
    8986/* Define if you have the `md' library (-lmd). */
    9087#undef HAVE_LIBMD
     
    113110/* Define to 1 if you have the <objc/objc.h> header file. */
    114111#undef HAVE_OBJC_OBJC_H
    115 
    116 /* Define to 1 if you have the <openssl/md5.h> header file. */
    117 #undef HAVE_OPENSSL_MD5_H
    118112
    119113/* Define to 1 if you have the <paths.h> header file. */
Note: See TracChangeset for help on using the changeset viewer.