Makefile: add support for Apple CommonCrypto facility

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 build flag with which the user can opt out to use OpenSSL instead. [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> Signed-off-by: Junio C Hamano <gitster@pobox.com>

David Aguilar committed May 19, 2013 at 06:23 UTC 4dcd7732db071c8e1e0466b98eaf9501f7fe1a7e
1 file changed +8
Makefile
+8
@@ -137,6 +137,10 @@ all::
137 # specify your own (or DarwinPort's) include directories and
138 # library directories by defining CFLAGS and LDFLAGS appropriately.
139 #
140 +# Define NO_APPLE_COMMON_CRYPTO if you are building on Darwin/Mac OS X
141 +# and do not want to use Apple's CommonCrypto library. This allows you
142 +# to provide your own OpenSSL library, for example from MacPorts.
143 +#
144 # Define BLK_SHA1 environment variable to make use of the bundled
145 # optimized C SHA1 routine.
146 #
@@ -1054,6 +1058,10 @@ ifeq ($(uname_S),Darwin)
1058 BASIC_LDFLAGS += -L/opt/local/lib
1059 endif
1060 endif
1061 + ifndef NO_APPLE_COMMON_CRYPTO
1062 + APPLE_COMMON_CRYPTO = YesPlease
1063 + COMPAT_CFLAGS += -DAPPLE_COMMON_CRYPTO
1064 + endif
1065 NO_REGEX = YesPlease
1066 PTHREAD_LIBS =
1067 endif