Skip to content

Commit 4dcd773

Browse files
davvidgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Eric Sunshine <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 29de205 commit 4dcd773

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,10 @@ all::
137137
# specify your own (or DarwinPort's) include directories and
138138
# library directories by defining CFLAGS and LDFLAGS appropriately.
139139
#
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+
#
140144
# Define BLK_SHA1 environment variable to make use of the bundled
141145
# optimized C SHA1 routine.
142146
#
@@ -1054,6 +1058,10 @@ ifeq ($(uname_S),Darwin)
10541058
BASIC_LDFLAGS += -L/opt/local/lib
10551059
endif
10561060
endif
1061+
ifndef NO_APPLE_COMMON_CRYPTO
1062+
APPLE_COMMON_CRYPTO = YesPlease
1063+
COMPAT_CFLAGS += -DAPPLE_COMMON_CRYPTO
1064+
endif
10571065
NO_REGEX = YesPlease
10581066
PTHREAD_LIBS =
10591067
endif

0 commit comments

Comments
 (0)