aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Allen <[email protected]>2017-10-02 16:44:45 -0500
committerMark Allen <[email protected]>2017-10-02 16:44:45 -0500
commit3d0d4a0fbf8f468047ca3be099d1657d0162506c (patch)
treec62f95bd38c0045f5c3f960f359c4a6a21224085
parent1d01b3a696c0cd35b1bec9dbc31bb7b0174a9924 (diff)
downloadkerl-3d0d4a0fbf8f468047ca3be099d1657d0162506c.tar.gz
kerl-3d0d4a0fbf8f468047ca3be099d1657d0162506c.tar.bz2
kerl-3d0d4a0fbf8f468047ca3be099d1657d0162506c.zip
Maybe munge LD and DED flags when macOS >= 10.13
As explained in #230, DED_LDFLAGS must be set correctly for clang 9 to compile various OTP applications correctly including crypto. This patch reworks #230 a little bit so that it's a tiny bit more generalized, in case we run across another situation where this needs to be done for a particular operating system.
-rwxr-xr-xkerl35
1 files changed, 25 insertions, 10 deletions
diff --git a/kerl b/kerl
index 561d727..9bdaedc 100755
--- a/kerl
+++ b/kerl
@@ -538,14 +538,29 @@ do_normal_build()
list_add builds "$1,$2"
}
-_flags(){
- host=$(./erts/autoconf/config.guess)
- DARWIN_VERSION=$(uname -r | sed $SED_OPT -e 's/R?([0-9]{1,2}).+/\1/')
- if [ "$DARWIN_VERSION" -ge 17 ]; then
- CFLAGS="$CFLAGS" DED_LD="clang" CC="clang" DED_LDFLAGS="-m64 -bundle -bundle_loader ${ERL_TOP}/bin/$host/beam.smp" $@
- else
- CFLAGS="$CFLAGS" $@
- fi
+_flags()
+{
+
+ # We need to munge the LD and DED flags for clang 9 shipped with
+ # High Sierra (macOS 10.13)
+ case "$KERL_SYSTEM" in
+ Darwin)
+ osver=$(uname -r)
+ case "$osver" in
+ 17*)
+ host=$(./erts/autoconf/config.guess)
+ CFLAGS="$CFLAGS" DED_LD="clang" CC="clang" DED_LDFLAGS="-m64 -bundle -bundle_loader ${ERL_TOP}/bin/$host/beam.smp" $@
+ ;;
+ *)
+ CFLAGS="$CFLAGS" $@
+ ;;
+ esac
+ ;;
+ *)
+ CFLAGS="$CFLAGS" $@
+ ;;
+ esac
+
}
_do_build()
@@ -562,7 +577,7 @@ _do_build()
if [ $? -ne 0 ]; then
KERL_CONFIGURE_OPTIONS="$KERL_CONFIGURE_OPTIONS --enable-darwin-64bit"
fi
-
+
case "$OSVERSION" in
17*|16*|15*)
echo -n $KERL_CONFIGURE_OPTIONS | grep "ssl" 1>/dev/null 2>&1
@@ -600,7 +615,7 @@ _do_build()
ERL_TOP="$KERL_BUILD_DIR/$2/otp_src_$1"
cd "$ERL_TOP" || exit 1
LOGFILE="$KERL_BUILD_DIR/$2/otp_build_$1.log"
-
+
# Check to see if configuration options need to be stored or have changed
TMPOPT="/tmp/kerloptions.$$"
echo "$CFLAGS" > "$TMPOPT"