git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v7 1/3] Makefile: add support for Apple CommonCrypto facility

From
Eric Sunshine <sunshine@sunshineco.com>
Date
May 18, 2013, 00:32 UTC
Message-ID
<1368837158-13915-2-git-send-email-sunshine@sunshineco.com>
In-Reply-To
<1368837158-13915-1-git-send-email-sunshine@sunshineco.com>
From: David Aguilar <davvid@gmail.com>

As of Mac OS X 10.7, Apple deprecated all OpenSSL functions due to OpenSSL ABI instability, thus leading to build warnings. As a replacement, Apple encourages developers to migrate to its own (stable) CommonCrypto facility.

Introduce boilerplate which controls whether Apple's CommonCrypto facility is employed (enabled by default). Also add a NO_APPLE_COMMON_CRYPTO flag which the user can tweak to override the default if OpenSSL is instead preferred.

[es: extracted CommonCrypto-related Makefile boilerplate into separate introductory patch]

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
---
 Makefile | 9 +++++++++
 1 file changed, 9 insertions(+)
diff --git a/Makefile b/Makefile
index f698c1a..2178c2c 100644
--- a/Makefile
+++ b/Makefile
@@ -137,6 +137,10 @@ all::
 # specify your own (or DarwinPort's) include directories and
 # library directories by defining CFLAGS and LDFLAGS appropriately.
 #
+# Define NO_APPLE_COMMON_CRYPTO if you are building on Darwin/Mac OS X
+# and do not want to use Apple's CommonCrypto library.  This allows you
+# to provide your own OpenSSL library, for example from MacPorts.
+#
 # Define BLK_SHA1 environment variable to make use of the bundled
 # optimized C SHA1 routine.
 #
@@ -1054,6 +1058,11 @@ ifeq ($(uname_S),Darwin)
 			BASIC_LDFLAGS += -L/opt/local/lib
 		endif
 	endif
+	ifndef NO_APPLE_COMMON_CRYPTO
+		APPLE_COMMON_CRYPTO = YesPlease
+	else
+		COMPAT_CFLAGS += -DNO_APPLE_COMMON_CRYPTO
+	endif
 	NO_REGEX = YesPlease
 	PTHREAD_LIBS =
 endif
-- 
1.8.2.3
Previous: Eric SunshineNext: Eric Sunshine
Message 2 of 5 in “Begin replacing OpenSSL with CommonCrypto”
  1. 0/3 Begin replacing OpenSSL with CommonCryptoEric Sunshine, May 18, 2013
  2. 1/3 Makefile: add support for Apple CommonCrypto facilityEric Sunshine, May 18, 2013
  3. 2/3 cache.h: eliminate SHA-1 deprecation warnings on Mac OS XEric Sunshine, May 18, 2013
  4. 3/3 imap-send: eliminate HMAC deprecation warnings on Mac OS XEric Sunshine, May 18, 2013
  5. Junio C HamanoMay 18, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.