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

Re: [PATCH v1 1/2] config.mak.in: set NO_OPENSSL and APPLE_COMMON_CRYPTO for macOS >10.11

From
Lars Schneider <larsxschneider@gmail.com>
Date
Nov 6, 2016, 19:35 UTC
Message-ID
<8C67FF53-C26F-4993-908F-A5183C5E48D9@gmail.com>
In-Reply-To
<20161017095002.bbqyp2hkbuyau66t@sigill.intra.peff.net>
Show 52 quoted lines
> On 17 Oct 2016, at 11:50, Jeff King <peff@peff.net> wrote:
> 
> On Sun, Oct 16, 2016 at 05:25:49PM -0700, larsxschneider@gmail.com wrote:
> 
>> From: Lars Schneider <larsxschneider@gmail.com>
>> 
>> Apple removed the OpenSSL header files in macOS 10.11 and above. OpenSSL
>> was deprecated since macOS 10.7.
>> 
>> Set `NO_OPENSSL` and `APPLE_COMMON_CRYPTO` to `YesPlease` as default for
>> macOS. Make it possible to override this and use OpenSSL by defining
>> `DARWIN_OPENSSL`.
> 
> I like that you gave an override, but I don't think it works in all
> cases:
> 
>> diff --git a/config.mak.uname b/config.mak.uname
>> index b232908..f0c94a9 100644
>> --- a/config.mak.uname
>> +++ b/config.mak.uname
>> @@ -108,6 +108,12 @@ ifeq ($(uname_S),Darwin)
>> 	ifeq ($(shell test "`expr "$(uname_R)" : '\([0-9][0-9]*\)\.'`" -ge 11 && echo 1),1)
>> 		HAVE_GETDELIM = YesPlease
>> 	endif
>> +	ifeq ($(shell test "`expr "$(uname_R)" : '\([0-9][0-9]*\)\.'`" -ge 15 && echo 1),1)
>> +		ifndef DARWIN_OPENSSL
>> +			NO_OPENSSL = YesPlease
>> +			APPLE_COMMON_CRYPTO=YesPlease
>> +		endif
>> +	endif
> 
> This is in config.mak.uname, which gets sourced before config.mak (and
> ifndef is evaluated at the time of parsing). So it would work to do:
> 
>  make DARWIN_OPENSSL=Yep
> 
> but not:
> 
>  echo DARWIN_OPENSSL=Yep >>config.mak
>  make
> 
> I think you'd have to set a flag in config.mak.uname, and then resolve
> it in the Makefile proper like:
> 
>  ifdef DARWIN_OPENSSL
> 	# Overrides AUTO_AVOID_OPENSSL, do nothing.
>  else ifdef AUTO_AVOID_OPENSSL
> 	NO_OPENSSL = YesPlease
> 	APPLE_COMMON_CRYPTO = YesPlease
>  endif
> 
> but that's totally untested.

Good point. I think I found an even easier way to achieve the same. What do you think about the patch below?

Thanks, Lars

-- >8 --
Subject: Makefile: set NO_OPENSSL on macOS by default

Apple removed the OpenSSL header files in macOS 10.11 and above. OpenSSL was deprecated since macOS 10.7.

Set `NO_OPENSSL` and `APPLE_COMMON_CRYPTO` to `YesPlease` as default for macOS. It is possible to override this and use OpenSSL by defining `NO_APPLE_COMMON_CRYPTO`.

Original-patch-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
---
 Makefile | 1 +
 1 file changed, 1 insertion(+)
diff --git a/Makefile b/Makefile
index 9d6c245..f53fcc9 100644
--- a/Makefile
+++ b/Makefile
@@ -1047,6 +1047,7 @@ ifeq ($(uname_S),Darwin)
 		endif
 	endif
 	ifndef NO_APPLE_COMMON_CRYPTO
+		NO_OPENSSL = YesPlease
 		APPLE_COMMON_CRYPTO = YesPlease
 		COMPAT_CFLAGS += -DAPPLE_COMMON_CRYPTO
 	endif
Previous: Jeff KingNext: Jeff King
Message 4 of 35 in “Fix default macOS build locally and on Travis CI”
  1. 0/2 Fix default macOS build locally and on Travis CIlarsxschneider@gmail.com, Oct 17, 2016
  2. 1/2 config.mak.in: set NO_OPENSSL and APPLE_COMMON_CRYPTO for macOS >10.11larsxschneider@gmail.com, Oct 17, 2016
  3. Jeff KingOct 17, 2016
  4. Lars SchneiderNov 6, 2016
  5. Jeff KingNov 7, 2016
  6. Paul SmithNov 7, 2016
  7. Jeff KingNov 7, 2016
  8. Paul SmithNov 7, 2016
  9. Torsten BögershausenNov 9, 2016
  10. Lars SchneiderNov 9, 2016
  11. Torsten BögershausenNov 9, 2016
  12. Makefile: set NO_OPENSSL on macOS by defaultlarsxschneider@gmail.com, Nov 10, 2016
  13. 2/2 travis-ci: disable GIT_TEST_HTTPD for macOSlarsxschneider@gmail.com, Oct 17, 2016
  14. Lars SchneiderNov 6, 2016
  15. Jeff KingNov 7, 2016
  16. Lars SchneiderNov 10, 2016
  17. Jeff KingNov 10, 2016
  18. Junio C HamanoNov 10, 2016
  19. Jeff KingNov 10, 2016
  20. Junio C HamanoNov 10, 2016
  21. Jeff KingNov 10, 2016
  22. Lars SchneiderNov 11, 2016
  23. Jeff KingNov 11, 2016
  24. Lars SchneiderNov 11, 2016
  25. Jeff KingNov 11, 2016
  26. Heiko VoigtNov 15, 2016
  27. Lars SchneiderNov 15, 2016
  28. Jeff KingNov 15, 2016
  29. Heiko VoigtNov 16, 2016
  30. Torsten BögershausenNov 16, 2016
  31. Junio C HamanoNov 9, 2016
  32. Torsten BögershausenNov 10, 2016
  33. Lars SchneiderNov 10, 2016
  34. Junio C HamanoNov 10, 2016
  35. Lars SchneiderNov 11, 2016

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.