aboutsummaryrefslogtreecommitdiffstats
path: root/kerl
diff options
context:
space:
mode:
authorMark Allen <[email protected]>2016-04-13 14:58:12 -0500
committerMark Allen <[email protected]>2016-04-13 14:58:12 -0500
commit0228bfda55bd6d27b2fc76441fd2920a3ca2e615 (patch)
treecb9e3acbec44f95cdfa2f3e1ac6618a2b4b3f0b2 /kerl
parentedced9e11a682a9484e7ad7eab2cc248d7cf8279 (diff)
downloadkerl-0228bfda55bd6d27b2fc76441fd2920a3ca2e615.tar.gz
kerl-0228bfda55bd6d27b2fc76441fd2920a3ca2e615.tar.bz2
kerl-0228bfda55bd6d27b2fc76441fd2920a3ca2e615.zip
If using OS X El Capitan, try to add OpenSSL
Diffstat (limited to 'kerl')
-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"