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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> On 17 Oct 2016, at 11:50, Jeff King <peff@xxxxxxxx> wrote:
> 
> On Sun, Oct 16, 2016 at 05:25:49PM -0700, larsxschneider@xxxxxxxxx wrote:
> 
>> From: Lars Schneider <larsxschneider@xxxxxxxxx>
>> 
>> 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@xxxxxx>
Signed-off-by: Lars Schneider <larsxschneider@xxxxxxxxx>
---
 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
-- 



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]