diff options
-rwxr-xr-x | kerl | 46 |
1 files changed, 41 insertions, 5 deletions
@@ -544,6 +544,42 @@ do_normal_build() list_add builds "$1,$2" } +_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*) + # Make sure we don't overwrite values that someone who + # knows better than us set. + if [ -z "$DED_LD" ]; then + DED_LD="clang" + fi + if [ -z "$CC" ]; then + CC="clang" + fi + if [ -z "$DED_LDFLAGS" ]; then + host=$(./erts/autoconf/config.guess) + DED_LDFLAGS="-m64 -bundle -bundle_loader ${ERL_TOP}/bin/$host/beam.smp" + fi + CFLAGS="$CFLAGS" DED_LD="$DED_LD" CC="$CC" DED_LDFLAGS="$DED_LDFLAGS" $@ + ;; + *) + CFLAGS="$CFLAGS" $@ + ;; + esac + ;; + *) + CFLAGS="$CFLAGS" $@ + ;; + esac + +} + _do_build() { case "$KERL_SYSTEM" in @@ -560,7 +596,7 @@ _do_build() fi case "$OSVERSION" in - 16*|15*) + 17*|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 @@ -628,15 +664,15 @@ _do_build() fi if [ -n "$KERL_USE_AUTOCONF" ]; then ./otp_build autoconf $KERL_CONFIGURE_OPTIONS >> "$LOGFILE" 2>&1 && \ - CFLAGS="$CFLAGS" ./otp_build configure $KERL_CONFIGURE_OPTIONS >> "$LOGFILE" 2>&1 + _flags ./otp_build configure $KERL_CONFIGURE_OPTIONS >> "$LOGFILE" 2>&1 else - CFLAGS="$CFLAGS" ./otp_build configure $KERL_CONFIGURE_OPTIONS >> "$LOGFILE" 2>&1 + _flags ./otp_build configure $KERL_CONFIGURE_OPTIONS >> "$LOGFILE" 2>&1 fi echo -n $KERL_CONFIGURE_OPTIONS | grep "--enable-native-libs" 1>/dev/null 2>&1 if [ $? -ne 0 ]; then make clean >> "$LOGFILE" 2>&1 - CFLAGS="$CFLAGS" ./otp_build configure $KERL_CONFIGURE_OPTIONS >> "$LOGFILE" 2>&1 + _flags ./otp_build configure $KERL_CONFIGURE_OPTIONS >> "$LOGFILE" 2>&1 fi if [ $? -ne 0 ]; then show_logfile "Configure failed." "$LOGFILE" @@ -671,7 +707,7 @@ _do_build() done fi - CFLAGS="$CFLAGS" ./otp_build boot -a $KERL_CONFIGURE_OPTIONS >> "$LOGFILE" 2>&1 + _flags ./otp_build boot -a $KERL_CONFIGURE_OPTIONS >> "$LOGFILE" 2>&1 if [ $? -ne 0 ]; then show_logfile "Build failed." "$LOGFILE" list_remove builds "$1 $2" |