+# even for a crossbuild host build, we want to use the target's latest tzdata as pointed to by latest_tzdata.tar.gz
+ifeq "$(shell test -d $(SDKPATH)/usr/local/share/tz && echo YES )" "YES"
+ export TZDATA:=$(SDKPATH)/usr/local/share/tz/$(shell readlink $(SDKPATH)/usr/local/share/tz/latest_tzdata.tar.gz)
+endif
+$(info # TZDATA=$(TZDATA))
+
+ifeq "$(WINDOWS)" "YES"
+ EMBEDDED:=0
+ WATCHOS:=0
+ TVOS:=0
+ SIMULATOROS := 0
+else ifeq "$(LINUX)" "YES"
+ CC := gcc
+ CXX := g++
+ EMBEDDED:=0
+ WATCHOS:=0
+ TVOS:=0
+ SIMULATOROS := 0
+ ISYSROOT =
+else
+ ifeq "$(BUILD_TYPE)" ""
+ HOSTCC := $(shell xcrun -sdk $(SDKPATH) -find cc)
+ HOSTCXX := $(shell xcrun -sdk $(SDKPATH) -find c++)
+ ifeq "$(SDKPATH)" "/"
+ ifneq (,$(findstring XcodeDefault,$(HOSTCC)))
+ HOSTSDKPATH := $(shell xcodebuild -version -sdk macosx Path)
+ else
+ HOSTSDKPATH := $(shell xcodebuild -version -sdk macosx.internal Path)
+ endif
+ else
+ HOSTSDKPATH := $(SDKPATH)
+ endif
+ ISYSROOT:= -isysroot $(HOSTSDKPATH)
+ CC := $(HOSTCC)
+ CXX := $(HOSTCXX)
+ NM := $(shell xcrun -find nm)
+ STRIPCMD := $(shell xcrun -find strip)
+ else
+ HOSTCC := $(shell xcrun -sdk macosx -find cc)
+ HOSTCXX := $(shell xcrun -sdk macosx -find c++)
+ HOSTSDKPATH := $(shell xcodebuild -version -sdk macosx Path)
+ ISYSROOT:= -isysroot $(SDKPATH)
+ CC := $(shell xcrun -sdk $(SDKPATH) -find cc)
+ CXX := $(shell xcrun -sdk $(SDKPATH) -find c++)
+ NM := $(shell xcrun -sdk $(SDKPATH) -find nm)
+ STRIPCMD := $(shell xcrun -sdk $(SDKPATH) -find strip)
+ endif
+ HOSTISYSROOT = -isysroot $(HOSTSDKPATH)
+ EMBEDDED:=$(shell $(CXX) -E -dM -x c $(ISYSROOT) -include TargetConditionals.h /dev/null | fgrep define' 'TARGET_OS_EMBEDDED | cut -d' ' -f3)
+ WATCHOS:=$(shell $(CXX) -E -dM -x c $(ISYSROOT) -include TargetConditionals.h /dev/null | fgrep define' 'TARGET_OS_WATCH | cut -d' ' -f3)
+ TVOS:=$(shell $(CXX) -E -dM -x c $(ISYSROOT) -include TargetConditionals.h /dev/null | fgrep define' 'TARGET_OS_TV | cut -d' ' -f3)
+ SIMULATOROS:=$(shell $(CXX) -E -dM -x c $(ISYSROOT) -include TargetConditionals.h /dev/null | fgrep define' 'TARGET_OS_SIMULATOR | cut -d' ' -f3)
+endif
+DSYMTOOL := /usr/bin/dsymutil
+DSYMSUFFIX := .dSYM
+
+$(info # HOSTCC=$(HOSTCC))
+$(info # HOSTCXX=$(HOSTCXX))
+$(info # HOSTISYSROOT=$(HOSTISYSROOT))
+$(info # CC=$(CC))
+$(info # CXX=$(CXX))
+$(info # ISYSROOT=$(ISYSROOT))
+
+ifeq "$(EMBEDDED)" "1"
+ export APPLE_EMBEDDED=YES
+ DISABLE_DRAFT=YES
+else ifeq "$(RC_INDIGO)" "YES"
+ export APPLE_EMBEDDED=YES
+ DISABLE_DRAFT=YES
+else
+ export APPLE_EMBEDDED=NO
+ DISABLE_DRAFT=NO
+endif
+
+ifeq "$(APPLE_EMBEDDED)" "YES"
+ ifeq "$(WATCHOS)" "1"
+ ICU_TARGET_VERSION := -mwatchos-version-min=$(WATCHOS_VERSION_TARGET_STRING)
+ else ifeq "$(TVOS)" "1"
+ ICU_TARGET_VERSION := -mtvos-version-min=$(TVOS_VERSION_TARGET_STRING)
+ else
+ ICU_TARGET_VERSION := -miphoneos-version-min=$(IOS_VERSION_TARGET_STRING)
+ endif
+else ifeq "$(SIMULATOROS)" "1"
+ ifeq "$(WATCHOS)" "1"
+ ICU_TARGET_VERSION := -mwatchos-simulator-version-min=$(WATCHOS_VERSION_TARGET_STRING)
+ else ifeq "$(TVOS)" "1"
+ ICU_TARGET_VERSION := -mtvos-simulator-version-min=$(TVOS_VERSION_TARGET_STRING)
+ else
+ ICU_TARGET_VERSION := -mios-simulator-version-min=$(IOS_VERSION_TARGET_STRING)
+ endif
+else
+ ICU_TARGET_VERSION :=
+endif
+$(info # ICU_TARGET_VERSION=$(ICU_TARGET_VERSION))
+
+ifeq "$(DISABLE_DRAFT)" "YES"
+ DRAFT_FLAG=--disable-draft
+else
+ DRAFT_FLAG=
+endif
+