--- ext/digest/md5/extconf.rb.orig	2007-10-23 18:31:40.000000000 +0200
+++ ext/digest/md5/extconf.rb	2007-10-23 18:26:33.000000000 +0200
@@ -11,6 +11,7 @@
 dir_config("openssl")
 
 if !with_config("bundled-md5") &&
+   !have_header("CommonCrypto/CommonDigest.h") &&
     have_library("crypto") && have_header("openssl/md5.h")
   $objs << "md5ossl.#{$OBJEXT}"
 
--- ext/digest/md5/md5.h.orig	2007-10-23 18:31:52.000000000 +0200
+++ ext/digest/md5/md5.h	2007-10-23 18:28:19.000000000 +0200
@@ -48,6 +48,10 @@
 
 #include "defs.h"
 
+#if defined(HAVE_COMMONCRYPTO_COMMONDIGEST_H)
+# include <CommonCrypto/CommonDigest.h>
+#endif
+
 /*
  * This code has some adaptations for the Ghostscript environment, but it
  * will compile and run correctly in any environment with 8-bit chars and
--- ext/digest/sha1/extconf.rb.orig	2007-10-23 18:42:07.000000000 +0200
+++ ext/digest/sha1/extconf.rb	2007-10-23 18:43:01.000000000 +0200
@@ -11,6 +11,7 @@
 dir_config("openssl")
 
 if !with_config("bundled-sha1") &&
+   !have_header("CommonCrypto/CommonDigest.h") &&
     have_library("crypto") && have_header("openssl/sha.h")
   $objs << "sha1ossl.#{$OBJEXT}"
 else
--- ext/digest/sha1/sha1.h.orig	2007-10-23 18:42:14.000000000 +0200
+++ ext/digest/sha1/sha1.h	2007-10-23 18:43:23.000000000 +0200
@@ -13,6 +13,10 @@
 
 #include "defs.h"
 
+#if defined(HAVE_COMMONCRYPTO_COMMONDIGEST_H)
+# include <CommonCrypto/CommonDigest.h>
+#endif
+
 typedef struct {
 	uint32_t state[5];
 	uint32_t count[2];  
