Re: [PATCH 1/3] Makefile: Fix APPLE_COMMON_CRYPTO with BLK_SHA1

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH 1/3] Makefile: Fix APPLE_COMMON_CRYPTO with BLK_SHA1

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:58:19

Brian Gernhardt [off-list ref] writes:
quoted hunk
It used to be that APPLE_COMMON_CRYPTO did nothing when BLK_SHA1 was
set.  But APPLE_COMMON_CRYPTO is now used for more than just SHA1 (see
3ef2bca) so make sure that the appropriate libraries are always set.

Signed-off-by: Brian Gernhardt <redacted>
---
 Makefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 82f2e22..7051956 100644
--- a/Makefile
+++ b/Makefile
@@ -1182,6 +1182,9 @@ ifdef NEEDS_SSL_WITH_CRYPTO
 else
 	LIB_4_CRYPTO = $(OPENSSL_LINK) -lcrypto
 endif
+ifdef APPLE_COMMON_CRYPTO
+	LIB_4_CRYPTO += -framework Security -framework CoreFoundation
+endif
 endif
 ifdef NEEDS_LIBICONV
 	ifdef ICONVDIR
@@ -1413,7 +1416,6 @@ ifdef PPC_SHA1
 	LIB_H += ppc/sha1.h
 else
 ifdef APPLE_COMMON_CRYPTO
-	LIB_4_CRYPTO += -framework Security -framework CoreFoundation
 	COMPAT_CFLAGS += -DCOMMON_DIGEST_FOR_OPENSSL
 	SHA1_HEADER = <CommonCrypto/CommonDigest.h>
 else
Hmph.

So the people previously tested this must have built imap-send
without blk-sha1, which not just linked with these libs but also
included the <CommonCrypto/CommonDigest.h> header file and defined
the -DCOMMON_DIGEST_FOR_OPENSSL preprocessor macro.  Building with
blk-sha1 would not have worked for them.

Now we always link with these libraries, even when building with
blk-sha1.  Do the COMPAT_CFLAGS and SHA1_HEADER pieces only needed
when using the SHA1 digest implementation from CommonCrypto and
nothing imap-send uses?

Re: [PATCH 1/3] Makefile: Fix APPLE_COMMON_CRYPTO with BLK_SHA1

From: David Aguilar <hidden>
Date: 2016-06-15 22:58:20

On Mon, Aug 5, 2013 at 10:52 AM, Junio C Hamano [off-list ref] wrote:
Brian Gernhardt [off-list ref] writes:
quoted
It used to be that APPLE_COMMON_CRYPTO did nothing when BLK_SHA1 was
set.  But APPLE_COMMON_CRYPTO is now used for more than just SHA1 (see
3ef2bca) so make sure that the appropriate libraries are always set.

Signed-off-by: Brian Gernhardt <redacted>
---
 Makefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 82f2e22..7051956 100644
--- a/Makefile
+++ b/Makefile
@@ -1182,6 +1182,9 @@ ifdef NEEDS_SSL_WITH_CRYPTO
 else
      LIB_4_CRYPTO = $(OPENSSL_LINK) -lcrypto
 endif
+ifdef APPLE_COMMON_CRYPTO
+     LIB_4_CRYPTO += -framework Security -framework CoreFoundation
+endif
 endif
 ifdef NEEDS_LIBICONV
      ifdef ICONVDIR
@@ -1413,7 +1416,6 @@ ifdef PPC_SHA1
      LIB_H += ppc/sha1.h
 else
 ifdef APPLE_COMMON_CRYPTO
-     LIB_4_CRYPTO += -framework Security -framework CoreFoundation
      COMPAT_CFLAGS += -DCOMMON_DIGEST_FOR_OPENSSL
      SHA1_HEADER = <CommonCrypto/CommonDigest.h>
 else
Hmph.

So the people previously tested this must have built imap-send
without blk-sha1, which not just linked with these libs but also
included the <CommonCrypto/CommonDigest.h> header file and defined
the -DCOMMON_DIGEST_FOR_OPENSSL preprocessor macro.  Building with
blk-sha1 would not have worked for them.
Now we always link with these libraries, even when building with
blk-sha1.  Do the COMPAT_CFLAGS and SHA1_HEADER pieces only needed
when using the SHA1 digest implementation from CommonCrypto and
nothing imap-send uses?
LIB_4_CRYPTO is used by imap-send only, and these libraries are needed
for the base64 git_CC_EVP_(Encode|Decode), so unconditionally adding
these libraries there is correct.

COMPAT_CFLAGS and SHA1_HEADER enable the common crypto SHA1 only.
BLK_SHA1 provides its own SHA1 so they're not needed there.

I tested the tip of da/darwin (pu) w/ and w/out BLK_SHA1.

Tested-by: David Aguilar <redacted>
-- 
David
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help