From db6a9aaa44cc8e0cfe1a0823c74ddf0388af0c8e Mon Sep 17 00:00:00 2001 From: Mark Allen Date: Sat, 24 Sep 2016 21:49:19 -0500 Subject: Ask homebrew for openssl location if available --- kerl | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'kerl') diff --git a/kerl b/kerl index 89d042c..38da876 100755 --- a/kerl +++ b/kerl @@ -508,16 +508,19 @@ _do_build() { case "$KERL_SYSTEM" in Darwin) - # Apple removed OpenSSL from El Capitan, but its still in this - # funky location, so set ssl headers to look here OSVERSION=`uname -r` RELVERSION=`get_otp_version "$1"` case "$OSVERSION" in - 15*) + 16*|15*) echo -n $KERL_CONFIGURE_OPTIONS | grep "ssl" 1>/dev/null 2>&1 # Reminder to self: 0 from grep means the string was detected if [ $? -ne 0 ]; then - if [ ! -d /usr/include/openssl -o ! -d /usr/local/include/openssl ]; then + brew_prefix=$(brew --prefix openssl) + if [ -n "$brew_prefix" -a -d "$brew_prefix" ]; then + KERL_CONFIGURE_OPTIONS="$KERL_CONFIGURE_OPTIONS --with-ssl=$brew_prefix" + elif [ ! -d /usr/include/openssl -o ! -d /usr/local/include/openssl ]; then + # Apple removed OpenSSL from El Capitan, but its still in this + # funky location, so set ssl headers to look here xc_ssl='/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-migrator/sdk/MacOSX.sdk/usr' if [ -d "$xc_ssl/include/openssl" ] then @@ -526,7 +529,7 @@ _do_build() echo 'WARNING: No OpenSSL library was found in the usual places. Your Erlang will be built without crypto support!' fi unset xc_ssl - fi + fi fi ;; *) -- cgit v1.2.3