Ticket #26813: macports-1.9.2.patch

File macports-1.9.2.patch, 6.9 KB (added by mmpestorich (Mike M Pestorich), 14 years ago)
  • src/pextlib1.0/md5cmd.c

    old new  
    4444
    4545#include "md5cmd.h"
    4646
    47 #if HAVE_COMMONCRYPTO_COMMONDIGEST_H
     47#if HAVE_COMMONCRYPTO_COMMONDIGEST_H || defined(HAVE_LIBCRYPTO)
    4848
     49#if HAVE_COMMONCRYPTO_COMMONDIGEST_H
    4950#define COMMON_DIGEST_FOR_OPENSSL
    5051#include <CommonCrypto/CommonDigest.h>
     52#endif
     53
     54#if defined(HAVE_LIBCRYPTO)
     55#include <stdio.h>
     56#include <openssl/md5.h>
     57#endif
    5158
    5259/* md5 functions are named differently */
    5360#define MD5Init(x) MD5_Init(x)
     
    6269#include <sys/types.h>
    6370#include <md5.h>
    6471#else
    65 #error CommonCrypto or libmd required
     72#error CommonCrypto, OpenSSL (libcrypto) or libmd required
    6673#endif
    6774
    6875int MD5Cmd(ClientData clientData UNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])
  • src/pextlib1.0/sha1cmd.c

    old new  
    4545
    4646#include "sha1cmd.h"
    4747
    48 #if HAVE_COMMONCRYPTO_COMMONDIGEST_H
     48#if HAVE_COMMONCRYPTO_COMMONDIGEST_H || defined(HAVE_LIBCRYPTO)
    4949
     50#if HAVE_COMMONCRYPTO_COMMONDIGEST_H
    5051#define COMMON_DIGEST_FOR_OPENSSL
    5152#include <CommonCrypto/CommonDigest.h>
    52 
    5353#include "md_wrappers.h"
    5454CHECKSUMEnd(SHA1_, SHA_CTX, SHA_DIGEST_LENGTH)
    5555CHECKSUMFile(SHA1_, SHA_CTX)
     56#endif
     57
     58#if defined(HAVE_LIBCRYPTO)
     59#include <stdio.h>
     60#include <openssl/sha.h>
     61#define SHA1Init(x) SHA1_Init(x)
     62#define SHA1Update(x,y,z) SHA1_Update(x,y,z)
     63#define SHA1Final(x,y) SHA1_Final(x,y)
     64#define SHA1_File(x,y) SHA1File(x,y)
     65#include "md_wrappers.h"
     66CHECKSUMEnd(SHA1, SHA_CTX, SHA_DIGEST_LENGTH)
     67CHECKSUMFile(SHA1, SHA_CTX)
     68#endif
     69
    5670
    5771#elif defined(HAVE_LIBMD)
    5872#include <sys/types.h>
     
    6073#define SHA_DIGEST_LENGTH (SHA_HASHBYTES)
    6174#define SHA1_File(x,y) SHAFile(x,y)
    6275#else
    63 #error CommonCrypto or libmd required
     76#error CommonCrypto, OpenSSL (libcrypto) or libmd required
    6477#endif
    6578
    6679int SHA1Cmd(ClientData clientData UNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])
  • src/pextlib1.0/sha256cmd.c

    old new  
    4444
    4545#include "sha256cmd.h"
    4646
     47#if HAVE_COMMONCRYPTO_COMMONDIGEST_H || defined(HAVE_LIBCRYPTO)
     48
    4749#if HAVE_COMMONCRYPTO_COMMONDIGEST_H
    4850
    4951#define COMMON_DIGEST_FOR_OPENSSL
     
    5860#define SHA256_Final(m, c)              CC_SHA256_Final(m,c)
    5961#endif
    6062
     63#include "md_wrappers.h"
     64CHECKSUMEnd(SHA256_, SHA256_CTX, SHA256_DIGEST_LENGTH)
     65CHECKSUMFile(SHA256_, SHA256_CTX)
     66#endif
     67
     68#if defined(HAVE_LIBCRYPTO)
     69#include <stdio.h>
     70#include <openssl/sha.h>
     71#define SHA256Init(x) SHA256_Init(x)
     72#define SHA256Update(x,y,z) SHA256_Update(x,y,z)
     73#define SHA256Final(x,y) SHA256_Final(x,y)
     74#define SHA256_File(x,y) SHA256File(x,y)
     75#include "md_wrappers.h"
     76CHECKSUMEnd(SHA256, SHA256_CTX, SHA256_DIGEST_LENGTH)
     77CHECKSUMFile(SHA256, SHA256_CTX)
     78#endif
     79
    6180#else
    6281/* We do not have CommonCrypto.
    6382* let's use our own version of sha256* libraries.
     
    6582#include <sys/types.h>
    6683#include "sha2.h"
    6784#include "sha2.c"
    68 #endif
    69 
    7085#include "md_wrappers.h"
    7186CHECKSUMEnd(SHA256_, SHA256_CTX, SHA256_DIGEST_LENGTH)
    7287CHECKSUMFile(SHA256_, SHA256_CTX)
     88#endif
    7389
    7490int SHA256Cmd(ClientData clientData UNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])
    7591{
  • aclocal.m4

    old new  
    540540                        AC_MSG_ERROR([libmd was found, but md5.h is missing.])
    541541                ])
    542542                AC_DEFINE([HAVE_LIBMD], ,[Define if you have the `md' library (-lmd).])
    543                 MD5_LIBS="-lmd"]
    544         )
     543                MD5_LIBS="-lmd"
     544        ])
    545545        if test "x$MD5_LIBS" = "x"; then
    546                 AC_MSG_ERROR([Neither CommonCrypto nor libmd were found. A working md5 implementation is required.])
     546                AC_CHECK_LIB([crypto], [MD5_Update], [
     547                        AC_CHECK_HEADERS([openssl/md5.h], , [
     548                                AC_MSG_ERROR([OpenSSL's libcrypto was found, but the openssl/md5.h header file is missing.])
     549                        ])
     550                        AC_DEFINE([HAVE_LIBCRYPTO],,[Define if you have the `crypto' library (-lcrypto).])
     551                        MD5_LIBS="-lcrypto"
     552                ])
     553        fi
     554        if test "x$MD5_LIBS" = "x"; then
     555                AC_MSG_ERROR([Neither CommonCrypto nor libmd nor OpenSSL's libcrypto were found. A working md5 implementation is required.])
    547556        fi
    548557        AC_SUBST([MD5_LIBS])
    549558])
  • src/config.h.in

    old new  
    8383/* Define to 1 if you have the <inttypes.h> header file. */
    8484#undef HAVE_INTTYPES_H
    8585
     86/* Define if you have the `crypto' library (-lcrypto). */
     87#undef HAVE_LIBCRYPTO
     88
    8689/* Define if you have the `md' library (-lmd). */
    8790#undef HAVE_LIBMD
    8891
     
    110113/* Define to 1 if you have the <objc/objc.h> header file. */
    111114#undef HAVE_OBJC_OBJC_H
    112115
     116/* Define to 1 if you have the <openssl/md5.h> header file. */
     117#undef HAVE_OPENSSL_MD5_H
     118
    113119/* Define to 1 if you have the <paths.h> header file. */
    114120#undef HAVE_PATHS_H
    115121
  • configure

    old new  
    84178411fi
    84188412
    84198413        if test "x$MD5_LIBS" = "x"; then
    8420                 as_fn_error $? "Neither CommonCrypto nor libmd were found. A working md5 implementation is required." "$LINENO" 5
     8414                { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MD5_Update in -lcrypto" >&5
     8415$as_echo_n "checking for MD5_Update in -lcrypto... " >&6; }
     8416if ${ac_cv_lib_crypto_MD5_Update+:} false; then :
     8417  $as_echo_n "(cached) " >&6
     8418else
     8419  ac_check_lib_save_LIBS=$LIBS
     8420LIBS="-lcrypto  $LIBS"
     8421cat confdefs.h - <<_ACEOF >conftest.$ac_ext
     8422/* end confdefs.h.  */
     8423
     8424/* Override any GCC internal prototype to avoid an error.
     8425   Use char because int might match the return type of a GCC
     8426   builtin and then its argument prototype would still apply.  */
     8427#ifdef __cplusplus
     8428extern "C"
     8429#endif
     8430char MD5_Update ();
     8431int
     8432main ()
     8433{
     8434return MD5_Update ();
     8435  ;
     8436  return 0;
     8437}
     8438_ACEOF
     8439if ac_fn_c_try_link "$LINENO"; then :
     8440  ac_cv_lib_crypto_MD5_Update=yes
     8441else
     8442  ac_cv_lib_crypto_MD5_Update=no
     8443fi
     8444rm -f core conftest.err conftest.$ac_objext \
     8445    conftest$ac_exeext conftest.$ac_ext
     8446LIBS=$ac_check_lib_save_LIBS
     8447fi
     8448{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_MD5_Update" >&5
     8449$as_echo "$ac_cv_lib_crypto_MD5_Update" >&6; }
     8450if test "x$ac_cv_lib_crypto_MD5_Update" = xyes; then :
     8451
     8452                        for ac_header in openssl/md5.h
     8453do :
     8454  ac_fn_c_check_header_mongrel "$LINENO" "openssl/md5.h" "ac_cv_header_openssl_md5_h" "$ac_includes_default"
     8455if test "x$ac_cv_header_openssl_md5_h" = xyes; then :
     8456  cat >>confdefs.h <<_ACEOF
     8457#define HAVE_OPENSSL_MD5_H 1
     8458_ACEOF
     8459
     8460else
     8461
     8462                                as_fn_error $? "OpenSSL's libcrypto was found, but the openssl/md5.h header file is missing." "$LINENO" 5
     8463
     8464fi
     8465
     8466done
     8467
     8468
     8469$as_echo "#define HAVE_LIBCRYPTO /**/" >>confdefs.h
     8470
     8471                        MD5_LIBS="-lcrypto"
     8472
     8473fi
     8474
     8475        fi
     8476        if test "x$MD5_LIBS" = "x"; then
     8477                as_fn_error $? "Neither CommonCrypto nor libmd nor OpenSSL's libcrypto were found. A working md5 implementation is required." "$LINENO" 5
    84218478        fi
    84228479
    84238480