Granular version check for arm64 on macOS
@@ -74,12 +74,8 @@ TVOS_AVAILABLE = \
then echo "YES"; else echo "NO"; fi)
MACOSX64_AVAILABLE = \
- $(shell if xcodebuild -version -sdk macosx11.0 >/dev/null 2>&1; \
- then echo "YES"; else echo "NO"; fi)
-
-MACCATALYST64_AVAILABLE = \
- $(shell if [ ${$(xcodebuild -version | grep 'Xcode ' | grep -Eo '[0-9]+\.?[0-9]*')%.*} -ge 12 ]; \
- then echo "YES"; else echo "NO"; fi)
+ $(shell xcodebuild -version | grep '^Xcode ' | grep -Eo '[0-9\.]+' | \
+ awk '{split($0,v,"."); print ((v[1] == 12 && v[2] >= 2) || v[1] > 12) ? "YES" : "NO";}')
ifndef J2OBJC_ARCHS
ifdef ENV_J2OBJC_ARCHS
@@ -94,10 +90,7 @@ ifeq ($(TVOS_AVAILABLE), YES)
J2OBJC_ARCHS += appletvos appletvsimulator
endif
ifeq ($(MACOSX64_AVAILABLE), YES)
-J2OBJC_ARCHS += macosx64
-endif
-ifeq ($(MACCATALYST64_AVAILABLE), YES)
-J2OBJC_ARCHS += maccatalyst64
+J2OBJC_ARCHS += macosx64 maccatalyst64
endif
endif
endif
