+MAC_OS_X_VERSION_MIN_REQUIRED=1060
+MAC_OS_X_VERSION_MIN_STRING=10.6
+
+UNAME_PROCESSOR=$(shell uname -p)
+ifneq "$(RC_ARCHS)" ""
+ ifneq "$(SDKROOT)" ""
+ 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=$(RC_ARCHS:%=-arch %)
+ 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)/lib:$(OBJROOT)/stubdata"
+ ICUPKGTOOL=$(OBJROOT)/bin/icupkg
+ FORCEENDIAN=
+else
+ TARGET_SPEC=$(UNAME_PROCESSOR)-apple-darwin10.0.0
+ ENV_CONFIGURE_ARCHS=
+ ICUPKGTOOLIBS="$(OBJROOT)/lib:$(OBJROOT)/stubdata"
+ ICUPKGTOOL=$(OBJROOT)/bin/icupkg
+ FORCEENDIAN=
+endif
+$(info # TARGET_SPEC=$(TARGET_SPEC))
+$(info # ENV_CONFIGURE_ARCHS=$(ENV_CONFIGURE_ARCHS))
+
+ifeq "$(RC_INDIGO)" "YES"
+ -include /Developer/AppleInternal/Makefiles/Makefile.indigo
+ ifndef SDKROOT
+ SDKROOT=$(INDIGO_PREFIX)
+ endif
+ DEST_ROOT=$(DSTROOT)/$(INDIGO_PREFIX)/
+else
+ DEST_ROOT=$(DSTROOT)
+endif
+$(info # SDKROOT=$(SDKROOT))
+$(info # RC_INDIGO=$(RC_INDIGO))
+$(info # CROSS_BUILD=$(CROSS_BUILD))
+
+SET_MACOSX_MIN_VER :=
+ifeq "$(filter arm armv6 armv7,$(RC_ARCHS))" ""
+ THUMB_FLAG =
+ ifneq "$(SDKROOT)" ""
+ SET_MACOSX_MIN_VER := -mmacosx-version-min=$(MAC_OS_X_VERSION_MIN_STRING)
+ endif
+else
+ THUMB_FLAG = -mthumb
+endif
+
+# even for a crossbuild host build, we want to use the target's tzdata
+export TZDATA:=$(lastword $(wildcard $(SDKROOT)/usr/local/share/tz/tzdata*.tar.gz))
+$(info # TZDATA=$(TZDATA))
+
+ifeq "$(WINDOWS)" "YES"
+ EMBEDDED:=0
+else ifeq "$(LINUX)" "YES"
+ CC := gcc
+ CXX := g++
+ EMBEDDED:=0
+ ISYSROOT =
+else ifeq "$(SDKROOT)" ""
+ CC := $(shell xcrun -find llvm-gcc-4.2)
+ CXX := $(shell xcrun -find llvm-g++-4.2)
+ EMBEDDED:=$(shell $(CXX) -E -dM -x c -include TargetConditionals.h /dev/null | fgrep TARGET_OS_EMBEDDED | cut -d' ' -f3)
+ ISYSROOT =
+else
+ CC := $(shell xcrun -sdk $(SDKROOT) -find gcc)
+ CXX := $(shell xcrun -sdk $(SDKROOT) -find g++)
+ EMBEDDED:=$(shell $(CXX) -E -dM -x c -isysroot $(SDKROOT) -include TargetConditionals.h /dev/null | fgrep TARGET_OS_EMBEDDED | cut -d' ' -f3)
+ ISYSROOT:= -isysroot $(SDKROOT)
+endif
+
+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 "$(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))