[58137] trunk/base

toby at macports.org toby at macports.org
Tue Sep 22 14:40:23 PDT 2009


Revision: 58137
          http://trac.macports.org/changeset/58137
Author:   toby at macports.org
Date:     2009-09-22 14:40:23 -0700 (Tue, 22 Sep 2009)
Log Message:
-----------
prefer CommonCrypto, use libmd otherwise. no libcrypto

Modified Paths:
--------------
    trunk/base/aclocal.m4
    trunk/base/configure
    trunk/base/configure.ac
    trunk/base/src/config.h.in

Modified: trunk/base/aclocal.m4
===================================================================
--- trunk/base/aclocal.m4	2009-09-22 21:37:53 UTC (rev 58136)
+++ trunk/base/aclocal.m4	2009-09-22 21:40:23 UTC (rev 58137)
@@ -542,28 +542,8 @@
 		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])
 ])

Modified: trunk/base/configure
===================================================================
--- trunk/base/configure	2009-09-22 21:37:53 UTC (rev 58136)
+++ trunk/base/configure	2009-09-22 21:40:23 UTC (rev 58137)
@@ -8244,7 +8244,7 @@
 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,8 +8328,14 @@
 
 
 # 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
 	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for MD5Update in -lmd" >&5
 $as_echo_n "checking for MD5Update in -lmd... " >&6; }
@@ -8402,90 +8408,15 @@
 
 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.  */
+	if test "x$MD5_LIBS" = "x"; then
+		as_fn_error "Neither CommonCrypto nor libmd were found. A working md5 implementation is required." "$LINENO" 5
+	fi
 
-/* 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
-	fi
-
-
-
 # Check for readline
 # Check whether --enable-readline was given.
 if test "${enable_readline+set}" = set; then :

Modified: trunk/base/configure.ac
===================================================================
--- trunk/base/configure.ac	2009-09-22 21:37:53 UTC (rev 58136)
+++ trunk/base/configure.ac	2009-09-22 21:40:23 UTC (rev 58137)
@@ -195,7 +195,7 @@
 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 @@
 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.]),

Modified: trunk/base/src/config.h.in
===================================================================
--- trunk/base/src/config.h.in	2009-09-22 21:37:53 UTC (rev 58136)
+++ trunk/base/src/config.h.in	2009-09-22 21:40:23 UTC (rev 58137)
@@ -18,7 +18,7 @@
 /* Define to 1 if you have the `clearenv' function. */
 #undef HAVE_CLEARENV
 
-/* Define to 1 if you have the <CommonCrypto/CommonDigest.h> 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 <inttypes.h> 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 <objc/objc.h> header file. */
 #undef HAVE_OBJC_OBJC_H
 
-/* Define to 1 if you have the <openssl/md5.h> header file. */
-#undef HAVE_OPENSSL_MD5_H
-
 /* Define to 1 if you have the <paths.h> header file. */
 #undef HAVE_PATHS_H
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090922/4fba959c/attachment-0001.html>


More information about the macports-changes mailing list