Repository: redis/redis

Issue:
[BUG] hiredis Makefile needs similar SSL detection as found in src/Makefile
When trying to compile redis on an M1, the test in the hiredis `Makefile` uses a hard-coded pathname for the openssl 
includes and library files which is wrong using the latest version of Homebrew on Apple Silicon (it should be something like `/opt/homebrew/Cellar/openssl\@1.1/1.1.1k/`) 

**To reproduce**

Clone redis from GH and try to compile.

**Expected behavior**

Should compile w/o issues.

**Additional information**

Homebrew version is 3.2.5, redis branch is unstable.


Discussion:

Patch:
diff --git a/src/Makefile b/src/Makefile
index 428e0bd342b..0d011fb45ad 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -121,13 +121,15 @@ ifeq ($(uname_S),Darwin)
 	# must be referenced explicitly during build.
 ifeq ($(uname_M),arm64)
 	# Homebrew arm64 uses /opt/homebrew as HOMEBREW_PREFIX
-	OPENSSL_CFLAGS=-I/opt/homebrew/opt/openssl/include
-	OPENSSL_LDFLAGS=-L/opt/homebrew/opt/openssl/lib
+	OPENSSL_PREFIX=/opt/homebrew/opt/openssl
 else
 	# Homebrew x86/ppc uses /usr/local as HOMEBREW_PREFIX
-	OPENSSL_CFLAGS=-I/usr/local/opt/openssl/include
-	OPENSSL_LDFLAGS=-L/usr/local/opt/openssl/lib
+	OPENSSL_PREFIX=/usr/local/opt/openssl
 endif
+OPENSSL_CFLAGS=-I$(OPENSSL_PREFIX)/include
+OPENSSL_LDFLAGS=-L$(OPENSSL_PREFIX)/lib
+# Also export OPENSSL_PREFIX so it ends up in deps sub-Makefiles
+export OPENSSL_PREFIX
 else
 ifeq ($(uname_S),AIX)
         # AIX