Skip to content

Commit f99575e

Browse files
fhunlethvladdu
authored andcommitted
Apply Erlang patch to build on OSX Big Sur
This applies erlang/otp@f1044ef which currently exists in `master` to fix an error when configuring the build on OSX Big Sur. See erlang/otp#2871 for details. Fixes kerl#346. Tested with this configuration. - OSX 11.0.1 - OTP 23.1.4 and 23.1.5
1 parent 36a6315 commit f99575e

File tree

1 file changed

+74
-0
lines changed

1 file changed

+74
-0
lines changed

kerl

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,7 @@ maybe_patch() {
602602
maybe_patch_darwin "$release"
603603
# Catalina and clang require a "no-weaks-import" flag during build
604604
maybe_patch_catalina "$release" "$2"
605+
maybe_patch_bigsur "$release"
605606
;;
606607
SunOS)
607608
maybe_patch_sunos "$release"
@@ -731,6 +732,79 @@ index 3ba8216a19..d7cebc5ebc 100644
731732
_END_PATCH
732733
}
733734

735+
# https://github.com/erlang/otp/commit/f1044ef9e35da26f276b8127640e177d67aade6a.diff
736+
maybe_patch_bigsur() {
737+
release="$1"
738+
if is_osx_bigsur && \
739+
[[ "$release" -lt 24 ]]; then
740+
apply_bigsur_remove_version_check_patch >>"$LOGFILE"
741+
fi
742+
}
743+
744+
is_osx_bigsur() {
745+
[[ $(uname -r) == "20"* ]]
746+
}
747+
748+
apply_bigsur_remove_version_check_patch() {
749+
patch -p1 <<'_END_PATCH'
750+
diff --git a/make/configure.in b/make/configure.in
751+
index 898aa40c4a0..ee2fa840cf8 100644
752+
--- a/make/configure.in
753+
+++ b/make/configure.in
754+
@@ -387,50 +387,6 @@ if test X${enable_native_libs} = Xyes -a X${enable_hipe} != Xno; then
755+
fi
756+
AC_SUBST(NATIVE_LIBS_ENABLED)
757+
758+
-if test $CROSS_COMPILING = no; then
759+
- case $host_os in
760+
- darwin*)
761+
- macosx_version=`sw_vers -productVersion`
762+
- test $? -eq 0 || {
763+
- AC_MSG_ERROR([Failed to execute 'sw_vers'; please provide it in PATH])
764+
- }
765+
- [case "$macosx_version" in
766+
- [1-9][0-9].[0-9])
767+
- int_macosx_version=`echo $macosx_version | sed 's|\([^\.]*\)\.\([^\.]*\)|\10\200|'`;;
768+
- [1-9][0-9].[0-9].[0-9])
769+
- int_macosx_version=`echo $macosx_version | sed 's|\([^\.]*\)\.\([^\.]*\)\.\([^\.]*\)|\1\2\3|'`;;
770+
- [1-9][0-9].[1-9][0-9])
771+
- int_macosx_version=`echo $macosx_version | sed 's|\([^\.]*\)\.\([^\.]*\)|\1\200|'`;;
772+
- [1-9][0-9].[1-9][0-9].[0-9])
773+
- int_macosx_version=`echo $macosx_version | sed 's|\([^\.]*\)\.\([^\.]*\)\.\([^\.]*\)|\1\20\3|'`;;
774+
- [1-9][0-9].[1-9][0-9].[1-9][0-9])
775+
- int_macosx_version=`echo $macosx_version | sed 's|\([^\.]*\)\.\([^\.]*\)\.\([^\.]*\)|\1\2\3|'`;;
776+
- *)
777+
- int_macosx_version=unexpected;;
778+
- esac]
779+
- test $int_macosx_version != unexpected || {
780+
- AC_MSG_ERROR([Unexpected MacOSX version ($macosx_version) returned by 'sw_vers -productVersion'; this configure script probably needs to be updated])
781+
- }
782+
- AC_TRY_COMPILE([
783+
-#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > $int_macosx_version
784+
-#error Compiling for a newer MacOSX version...
785+
-#endif
786+
- ], [;],
787+
- [],
788+
- [AC_MSG_ERROR([
789+
-
790+
- You are natively building Erlang/OTP for a later version of MacOSX
791+
- than current version ($macosx_version). You either need to
792+
- cross-build Erlang/OTP, or set the environment variable
793+
- MACOSX_DEPLOYMENT_TARGET to $macosx_version (or a lower version).
794+
-
795+
-])])
796+
- ;;
797+
- *)
798+
- ;;
799+
- esac
800+
-fi
801+
-
802+
ERL_DED
803+
804+
AC_CONFIG_FILES([../Makefile output.mk ../make/$host/otp_ded.mk:../make/otp_ded.mk.in])
805+
_END_PATCH
806+
}
807+
734808
maybe_patch_sunos() {
735809
if [ "$1" -le 14 ]; then
736810
apply_solaris_networking_patch >>"$LOGFILE"

0 commit comments

Comments
 (0)