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
This commit is contained in:
Dean M Greer 2021-03-29 21:45:29 -04:00
parent dd4f8f329d
commit 5fb7f5496b

View File

@ -50,6 +50,14 @@ if [[ $PLATFORM == CYGWIN* ]]; then
exit 1 exit 1
fi 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() function require()
{ {