From 5fb7f5496b66ca1a144219ac3e1967839387804e Mon Sep 17 00:00:00 2001 From: Dean M Greer Date: Mon, 29 Mar 2021 21:45:29 -0400 Subject: [PATCH] tools.sh: Workaround hardcoded paths As OpenSSL is expected to be in a standard UNIX location but that's not always the case on macOS, this works around the issue regardless of package manager used as long as pkg-config is installed into $PATH Macports default prefix is /opt/local Homebrew on M1 uses /opt/homebrew --- tools/tools.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/tools.sh b/tools/tools.sh index c54c211..5e4c1aa 100644 --- a/tools/tools.sh +++ b/tools/tools.sh @@ -50,6 +50,14 @@ if [[ $PLATFORM == CYGWIN* ]]; then exit 1 fi +if [[ $PLATFORM == Darwin ]]; then + echo $PATH + CFLAGS_OPENSSL="$(pkg-config --cflags openssl)" + LDFLAGS_OPENSSL="$(pkg-config --libs-only-L openssl)" + export C_INCLUDE_PATH=${CFLAGS_OPENSSL:2} + export CPLUS_INCLUDE_PATH=${CFLAGS_OPENSSL:2} + export LIBRARY_PATH=${LDFLAGS_OPENSSL:2} +fi function require() {