+MAC_OS_X_VERSION_MIN_REQUIRED=1070
+OSX_HOST_VERSION_MIN_STRING=10.7
+IOS_VERSION_TARGET_STRING=7.0
+OSX_VERSION_TARGET_STRING=10.9
+
+$(info # SRCROOT=$(SRCROOT))
+$(info # DSTROOT=$(DSTROOT))
+$(info # OBJROOT=$(OBJROOT))
+
+# For some reason, under cygwin, bash uname is not found, and
+# sh uname does not produce a result with -p or -m. So we just
+# hardcode here.
+ifeq "$(WINDOWS)" "YES"
+ UNAME_PROCESSOR:=i386
+else
+ UNAME_PROCESSOR:=$(shell uname -p)
+endif
+ifeq "$(SDKROOT)" "/"
+ SDKROOTMOD=
+else
+ SDKROOTMOD=$(SDKROOT)
+endif
+ifneq "$(RC_ARCHS)" ""
+ ifneq "$(SDKROOTMOD)" ""
+ CROSS_BUILD=YES
+ else ifeq "$(RC_INDIGO)" "YES"
+ CROSS_BUILD=YES
+ else
+ CROSS_BUILD=NO
+ endif
+ INSTALLHDRS_ARCH=-arch $(shell echo $(RC_ARCHS) | cut -d' ' -f1)
+else
+ CROSS_BUILD=NO
+ INSTALLHDRS_ARCH=
+endif
+$(info # RC_ARCHS=$(RC_ARCHS))
+$(info # INSTALLHDRS_ARCH=$(INSTALLHDRS_ARCH))
+$(info # buildhost=$(UNAME_PROCESSOR))
+
+# FORCEENDIAN below is to override silly configure behavior in which if
+# __APPLE_CC__ is defined and archs are in { ppc, ppc64, i386, x86_64 }
+# then it assumes a universal build (ac_cv_c_bigendian=universal) with
+# data file initially built big-endian.
+#
+ifeq "$(CROSS_BUILD)" "YES"
+ RC_ARCHS_FIRST=$(shell echo $(RC_ARCHS) | cut -d' ' -f1)
+ TARGET_SPEC=$(RC_ARCHS_FIRST)-apple-darwin10.0.0
+ ENV_CONFIGURE_ARCHS=-arch $(RC_ARCHS_FIRST)
+ ICUPKGTOOLIBS="$(CROSSHOST_OBJROOT)/lib:$(CROSSHOST_OBJROOT)/stubdata"
+ ICUPKGTOOL=$(CROSSHOST_OBJROOT)/bin/icupkg
+ ifeq "$(filter-out i386 x86_64,$(RC_ARCHS))" ""
+ FORCEENDIAN= ac_cv_c_bigendian=no
+ else
+ FORCEENDIAN=
+ endif
+else ifeq "$(LINUX)" "YES"
+ TARGET_SPEC=$(UNAME_PROCESSOR)-unknown-linux-gnu
+ ENV_CONFIGURE_ARCHS=
+ ICUPKGTOOLIBS="$(OBJROOT_CURRENT)/lib:$(OBJROOT_CURRENT)/stubdata"
+ ICUPKGTOOL=$(OBJROOT_CURRENT)/bin/icupkg
+ FORCEENDIAN=
+else
+ TARGET_SPEC=$(UNAME_PROCESSOR)-apple-darwin10.0.0
+ ENV_CONFIGURE_ARCHS=
+ ICUPKGTOOLIBS="$(OBJROOT_CURRENT)/lib:$(OBJROOT_CURRENT)/stubdata"
+ ICUPKGTOOL=$(OBJROOT_CURRENT)/bin/icupkg
+ FORCEENDIAN=
+endif
+$(info # TARGET_SPEC=$(TARGET_SPEC))
+$(info # ENV_CONFIGURE_ARCHS=$(ENV_CONFIGURE_ARCHS))
+
+ifeq "$(RC_INDIGO)" "YES"
+ -include $(DEVELOPER_DIR)/AppleInternal/Makefiles/Makefile.indigo
+ ifndef SDKROOT
+ SDKROOTMOD=$(INDIGO_PREFIX)
+ endif
+ DEST_ROOT=$(DSTROOT)/$(INDIGO_PREFIX)/
+else
+ DEST_ROOT=$(DSTROOT)/
+endif
+$(info # SDKROOTMOD=$(SDKROOTMOD))
+$(info # RC_INDIGO=$(RC_INDIGO))
+$(info # CROSS_BUILD=$(CROSS_BUILD))
+$(info # DEST_ROOT=$(DEST_ROOT))
+
+ICU_TARGET_VERSION_FOR_TZ_EXTRA :=
+ifeq "$(filter arm armv6 armv7 armv7s arm64,$(RC_ARCHS))" ""
+ THUMB_FLAG =
+ ifneq "$(SDKROOTMOD)" ""
+ ICU_TARGET_VERSION_FOR_TZ_EXTRA := -mmacosx-version-min=$(OSX_HOST_VERSION_MIN_STRING)
+ endif
+else
+ THUMB_FLAG = -mthumb
+endif
+
+# even for a crossbuild host build, we want to use the target's latest tzdata as pointed to by latest_tzdata.tar.gz
+export TZDATA:=$(SDKROOTMOD)/usr/local/share/tz/$(shell readlink $(SDKROOTMOD)/usr/local/share/tz/latest_tzdata.tar.gz)
+$(info # TZDATA=$(TZDATA))
+
+ifeq "$(WINDOWS)" "YES"
+ EMBEDDED:=0
+else ifeq "$(LINUX)" "YES"
+ CC := gcc
+ CXX := g++
+ EMBEDDED:=0
+ ISYSROOT =
+else
+ ifeq "$(SDKROOTMOD)" ""
+ HOSTCC := $(shell xcrun -find cc)
+ HOSTCXX := $(shell xcrun -find c++)
+ ifneq (,$(findstring XcodeDefault,$(HOSTCC)))
+ HOSTSDK := $(shell xcodebuild -version -sdk macosx Path)
+ else
+ HOSTSDK := $(shell xcodebuild -version -sdk macosx.internal Path)
+ endif
+ ISYSROOT:= -isysroot $(HOSTSDK)
+ 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++)
+ HOSTSDK := $(shell xcodebuild -version -sdk macosx Path)
+ ISYSROOT:= -isysroot $(SDKROOTMOD)
+ CC := $(shell xcrun -sdk $(SDKROOTMOD) -find cc)
+ CXX := $(shell xcrun -sdk $(SDKROOTMOD) -find c++)
+ NM := $(shell xcrun -sdk $(SDKROOTMOD) -find nm)
+ STRIPCMD := $(shell xcrun -sdk $(SDKROOTMOD) -find strip)
+ endif
+ HOSTISYSROOT = -isysroot $(HOSTSDK)
+ EMBEDDED:=$(shell $(CXX) -E -dM -x c $(ISYSROOT) -include TargetConditionals.h /dev/null | fgrep TARGET_OS_EMBEDDED | 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"
+ ICU_TARGET_VERSION := -miphoneos-version-min=$(IOS_VERSION_TARGET_STRING)
+else
+ ICU_TARGET_VERSION :=
+endif
+$(info # ICU_TARGET_VERSION=$(ICU_TARGET_VERSION))
+
+ifeq "$(DISABLE_DRAFT)" "YES"
+ DRAFT_FLAG=--disable-draft
+else
+ DRAFT_FLAG=
+endif
+
+ifndef RC_ProjectSourceVersion
+ifdef RC_PROJECTSOURCEVERSION
+ RC_ProjectSourceVersion=$(RC_PROJECTSOURCEVERSION)
+endif
+endif
+
+# An Apple submission version (passed in RC_ProjectSourceVersion for official builds) is
+# X[.Y[.Z]]
+# where X is in range 0-214747, Y and Z are in range 0-99 (with no leading zeros).
+# The value for the SourceVersion property in version.plists will be calculated as
+# (X*10000 + Y*100 + Z). So we want U_ICU_VERSION_BUILDLEVEL_NUM to be Y*100 + Z
+ifneq "$(RC_ProjectSourceVersion)" ""
+ ifeq "$(WINDOWS)" "YES"
+ ICU_BUILD_Y := $(shell echo $(RC_ProjectSourceVersion) | sed -r -e 's/([0-9]+)(\.([0-9]{1,2})(\.([0-9])([0-9])?)?)?/\3/')
+ ICU_BUILD_Z1 := $(shell echo $(RC_ProjectSourceVersion) | sed -r -e 's/([0-9]+)(\.([0-9]{1,2})(\.([0-9])([0-9])?)?)?/\5/')
+ ICU_BUILD_Z2 := $(shell echo $(RC_ProjectSourceVersion) | sed -r -e 's/([0-9]+)(\.([0-9]{1,2})(\.([0-9])([0-9])?)?)?/\6/')
+ else
+ ICU_BUILD_Y := $(shell echo $(RC_ProjectSourceVersion) | sed -E -e 's/([0-9]+)(\.([0-9]{1,2})(\.([0-9])([0-9])?)?)?/\3/')
+ ICU_BUILD_Z1 := $(shell echo $(RC_ProjectSourceVersion) | sed -E -e 's/([0-9]+)(\.([0-9]{1,2})(\.([0-9])([0-9])?)?)?/\5/')
+ ICU_BUILD_Z2 := $(shell echo $(RC_ProjectSourceVersion) | sed -E -e 's/([0-9]+)(\.([0-9]{1,2})(\.([0-9])([0-9])?)?)?/\6/')
+ endif
+ ifeq "$(ICU_BUILD_Y)" ""
+ ICU_BUILD := 0
+ else
+ ICU_BUILD := $(subst a,$(ICU_BUILD_Y),abc)
+ ifeq "$(ICU_BUILD_Z1)" ""
+ ICU_BUILD := $(subst b,0,$(ICU_BUILD))
+ ICU_BUILD := $(subst c,0,$(ICU_BUILD))
+ else
+ ifeq "$(ICU_BUILD_Z2)" ""
+ ICU_BUILD := $(subst b,0,$(ICU_BUILD))
+ ICU_BUILD := $(subst c,$(ICU_BUILD_Z1),$(ICU_BUILD))
+ else
+ ICU_BUILD := $(subst b,$(ICU_BUILD_Z1),$(ICU_BUILD))
+ ICU_BUILD := $(subst c,$(ICU_BUILD_Z2),$(ICU_BUILD))
+ endif
+ endif
+ endif
+else
+ ICU_BUILD := 0
+endif
+$(info # ICU_BUILD=$(ICU_BUILD))
+ifeq "$(ICU_BUILD)" "0"
+ DEFINE_BUILD_LEVEL =
+else
+ DEFINE_BUILD_LEVEL =-DU_ICU_VERSION_BUILDLEVEL_NUM=$(ICU_BUILD)
+endif