aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Allen <[email protected]>2016-04-13 15:10:36 -0500
committerMark Allen <[email protected]>2016-04-13 15:10:36 -0500
commit457987e9e9769f2b7319236c9acf64f75ea878bc (patch)
treecb9e3acbec44f95cdfa2f3e1ac6618a2b4b3f0b2
parentedced9e11a682a9484e7ad7eab2cc248d7cf8279 (diff)
parent0228bfda55bd6d27b2fc76441fd2920a3ca2e615 (diff)
downloadkerl-457987e9e9769f2b7319236c9acf64f75ea878bc.tar.gz
kerl-457987e9e9769f2b7319236c9acf64f75ea878bc.tar.bz2
kerl-457987e9e9769f2b7319236c9acf64f75ea878bc.zip
Merge pull request #117 from mrallen1/darwin15-ssl
If using OS X El Capitan, try to add OpenSSL
-rwxr-xr-xkerl35
1 files changed, 35 insertions, 0 deletions
diff --git a/kerl b/kerl
index 68f3750..119a09e 100755
--- a/kerl
+++ b/kerl
@@ -339,10 +339,45 @@ do_git_build()
list_add builds "git,$3"
}
+get_otp_version()
+{
+ echo $1 | sed $SED_OPT -e 's/R?([0-9]{1,2})[.AB]?[0-9]*/\1/'
+}
+
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*)
+ 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
+ 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
+ if [ $RELVERSION -ge 17 ]
+ then
+ KERL_CONFIGURE_OPTIONS="$KERL_CONFIGURE_OPTIONS --with-ssl --with-ssl-incl=$xc_ssl"
+ else
+ KERL_CONFIGURE_OPTIONS="$KERL_CONFIGURE_OPTIONS --with-ssl=$xc_ssl"
+ fi
+ else
+ 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
+ ;;
+ *)
+ ;;
+ esac
+
if [ "$(gcc --version 2>/dev/null | grep -i -c llvm)" = "1" ]; then
if lion_support "$1"; then
KERL_CONFIGURE_OPTIONS="CFLAGS=-O0 $KERL_CONFIGURE_OPTIONS"