]> git.saurik.com Git - apple/icu.git/blobdiff - makefile
ICU-64260.0.1.tar.gz
[apple/icu.git] / makefile
index 1bea0460c287412ecea07af0e2d463ac6cec4def..de80321defb9763c547d995c5b46960f554dcd90 100644 (file)
--- a/makefile
+++ b/makefile
@@ -1,6 +1,6 @@
 ##
 # Wrapper makefile for ICU
-# Copyright (C) 2003-2017 Apple Inc. All rights reserved.
+# Copyright (C) 2003-2018 Apple Inc. All rights reserved.
 #
 # See http://www.gnu.org/manual/make/html_chapter/make_toc.html#SEC_Contents
 # for documentation on makefiles. Most of this was culled from the ncurses makefile.
@@ -58,7 +58,9 @@
 # Either this should be run indirectly from the VS command prompt via the
 # BuildICUForAAS script or project, using the instructions there (which build
 # both 32-bit and 64-bit), or it should be run from within Cygwin using the
-# following instructions or equivalent (different steps for 32-bit or 64-bit):
+# following instructions or equivalent (different steps for 32-bit or 64-bit
+# targets, details may also differ if you have the 32-bit cygwin install vs the
+# 64-bit one, i.e. cygwin vs cygwin64):
 #
 # 1. From VS command prompt, run vcvarsall.bat to set various environment variables.
 #    For a 32-bit build:
@@ -66,7 +68,7 @@
 #    For a 64-bit build:
 #    > "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
 #
-# 2. Launch Cygwin, e.g.
+# 2. Launch Cygwin, e.g. for the 64-bit cygwin install:
 #    > C:\cygwin64\cygwin.bat
 #
 # 3. Within cygwin, cd to the top level of the ICU sources directory, e.g.
 
 # Sane defaults, which are typically overridden on the command line
 #or by the environment
-WINDOWS=NO
-LINUX=NO
-ARCH64=NO
+ifeq ($(OS),Windows_NT)
+       WINDOWS=YES
+       LINUX=NO
+else
+       WINDOWS=NO
+       LINUX?=$(shell [[ "`uname -s`" == "Linux" ]] && echo YES || echo NO)
+endif
+ARCH64?=YES
 RC_ARCHS=
 ifndef RC_ProjectSourceVersion
 ifdef RC_PROJECTSOURCEVERSION
        RC_ProjectSourceVersion=$(RC_PROJECTSOURCEVERSION)
 endif
 endif
+$(info # RC_XBS=$(RC_XBS))
 $(info # RC_ARCHS=$(RC_ARCHS))
 $(info # RC_ProjectName=$(RC_ProjectName))
 $(info # RC_ProjectSourceVersion=$(RC_ProjectSourceVersion))
@@ -219,19 +227,19 @@ $(info # SDKPATH=$(SDKPATH))
 # This corresponds to MMmAA.(0 | B).T where
 # MM is U_ICU_VERSION_MAJOR_NUM
 # m  is U_ICU_VERSION_MINOR_NUM
-# AA is the Apple delta version 
+# AA is the Apple delta version
 # B  is the Apple branch version (1 or 2 digits)
 # T  is the Apple train code for submissions.
 # Note The value for the SourceVersion property in version.plists will be calculated as
 # (X*10000 + Y*100 + Z).
 # We want ICU_BUILD = 100*AA + B.
-# 
+#
 ifneq "$(RC_ProjectSourceVersion)" ""
        ifeq "$(WINDOWS)" "YES"
-               ICU_BUILD_AA  := $(shell echo $(RC_ProjectSourceVersion) | sed -r -e 's/([0-9]+)([0-9]{2})(\.([0-9])([0-9])?(\.([0-9]{1,2}))?)?/\2/')
-               ICU_BUILD_B1 := $(shell echo $(RC_ProjectSourceVersion) | sed -r -e 's/([0-9]+)([0-9]{2})(\.([0-9])([0-9])?(\.([0-9]{1,2}))?)?/\4/')
-               ICU_BUILD_B2 := $(shell echo $(RC_ProjectSourceVersion) | sed -r -e 's/([0-9]+)([0-9]{2})(\.([0-9])([0-9])?(\.([0-9]{1,2}))?)?/\5/')
-               ICU_TRAIN_CODE := $(shell echo $(RC_ProjectSourceVersion) | sed -r -e 's/([0-9]+)([0-9]{2})(\.([0-9])([0-9])?(\.([0-9]{1,2}))?)?/\7/')
+               ICU_BUILD_AA  := $(shell echo $(RC_ProjectSourceVersion) | /usr/bin/sed -r -e 's/([0-9]+)([0-9]{2})(\.([0-9])([0-9])?(\.([0-9]{1,2}))?)?/\2/')
+               ICU_BUILD_B1 := $(shell echo $(RC_ProjectSourceVersion) | /usr/bin/sed -r -e 's/([0-9]+)([0-9]{2})(\.([0-9])([0-9])?(\.([0-9]{1,2}))?)?/\4/')
+               ICU_BUILD_B2 := $(shell echo $(RC_ProjectSourceVersion) | /usr/bin/sed -r -e 's/([0-9]+)([0-9]{2})(\.([0-9])([0-9])?(\.([0-9]{1,2}))?)?/\5/')
+               ICU_TRAIN_CODE := $(shell echo $(RC_ProjectSourceVersion) | /usr/bin/sed -r -e 's/([0-9]+)([0-9]{2})(\.([0-9])([0-9])?(\.([0-9]{1,2}))?)?/\7/')
        else
                ICU_BUILD_AA  := $(shell echo $(RC_ProjectSourceVersion) | sed -E -e 's/([0-9]+)([0-9]{2})(\.([0-9])([0-9])?(\.([0-9]{1,2}))?)?/\2/')
                ICU_BUILD_B1 := $(shell echo $(RC_ProjectSourceVersion) | sed -E -e 's/([0-9]+)([0-9]{2})(\.([0-9])([0-9])?(\.([0-9]{1,2}))?)?/\4/')
@@ -304,7 +312,7 @@ endif
 ifeq "$(ICU_FOR_APPLE_PLATFORMS)" "YES"
        HOSTCC := $(shell xcrun --sdk macosx --find cc)
        HOSTCXX := $(shell xcrun --sdk macosx --find c++)
-       HOSTSDKPATH := $(shell xcrun --sdk macosx --show-sdk-path)
+       HOSTSDKPATH := $(shell xcrun --sdk macosx.internal --show-sdk-path)
        HOSTISYSROOT = -isysroot $(HOSTSDKPATH)
        ifeq "$(SDKPATH)" "/"
                ISYSROOT:= -isysroot $(HOSTSDKPATH)
@@ -348,8 +356,13 @@ ifeq "$(ICU_FOR_APPLE_PLATFORMS)" "YES"
 else
        ifeq "$(LINUX)" "YES"
                ISYSROOT:=
-               CC := gcc
-               CXX := g++
+               ifeq "$(shell (which clang >& /dev/null && which clang++ >& /dev/null && echo YES) || echo NO)" "YES"
+                       CC := clang
+                       CXX := clang++
+               else
+                       CC := gcc
+                       CXX := g++
+               endif
        endif
        export ICU_FOR_EMBEDDED_TRAINS:=NO
        TVOS:=0
@@ -383,45 +396,45 @@ $(error Cross-builds currently not allowed on Linux)
 endif
 endif
 
-MAC_OS_X_VERSION_MIN_REQUIRED=101200
-OSX_HOST_VERSION_MIN_STRING=10.12
+MAC_OS_X_VERSION_MIN_REQUIRED=101400
+OSX_HOST_VERSION_MIN_STRING=10.14
 
 ifndef IPHONEOS_DEPLOYMENT_TARGET
-       IOS_VERSION_TARGET_STRING=11.0
+       IOS_VERSION_TARGET_STRING=13.0
 else ifeq "$(IPHONEOS_DEPLOYMENT_TARGET)" ""
-       IOS_VERSION_TARGET_STRING=11.0
+       IOS_VERSION_TARGET_STRING=13.0
 else
        IOS_VERSION_TARGET_STRING=$(IPHONEOS_DEPLOYMENT_TARGET)
 endif
 
 ifndef MACOSX_DEPLOYMENT_TARGET
-       OSX_VERSION_TARGET_STRING=10.13
+       OSX_VERSION_TARGET_STRING=10.15
 else ifeq "$(MACOSX_DEPLOYMENT_TARGET)" ""
-       OSX_VERSION_TARGET_STRING=10.13
+       OSX_VERSION_TARGET_STRING=10.15
 else
        OSX_VERSION_TARGET_STRING=$(MACOSX_DEPLOYMENT_TARGET)
 endif
 
 ifndef WATCHOS_DEPLOYMENT_TARGET
-       WATCHOS_VERSION_TARGET_STRING=4.0
+       WATCHOS_VERSION_TARGET_STRING=6.0
 else ifeq "$(WATCHOS_DEPLOYMENT_TARGET)" ""
-       WATCHOS_VERSION_TARGET_STRING=4.0
+       WATCHOS_VERSION_TARGET_STRING=6.0
 else
        WATCHOS_VERSION_TARGET_STRING=$(WATCHOS_DEPLOYMENT_TARGET)
 endif
 
 ifndef TVOS_DEPLOYMENT_TARGET
-       TVOS_VERSION_TARGET_STRING=11.0
+       TVOS_VERSION_TARGET_STRING=13.0
 else ifeq "$(TVOS_DEPLOYMENT_TARGET)" ""
-       TVOS_VERSION_TARGET_STRING=11.0
+       TVOS_VERSION_TARGET_STRING=13.0
 else
        TVOS_VERSION_TARGET_STRING=$(TVOS_DEPLOYMENT_TARGET)
 endif
 
 ifndef BRIDGEOS_DEPLOYMENT_TARGET
-       BRIDGEOS_VERSION_TARGET_STRING=2.0
+       BRIDGEOS_VERSION_TARGET_STRING=3.0
 else ifeq "$(BRIDGEOS_DEPLOYMENT_TARGET)" ""
-       BRIDGEOS_VERSION_TARGET_STRING=2.0
+       BRIDGEOS_VERSION_TARGET_STRING=3.0
 else
        BRIDGEOS_VERSION_TARGET_STRING=$(BRIDGEOS_DEPLOYMENT_TARGET)
 endif
@@ -486,9 +499,18 @@ $(info # buildhost=$(UNAME_PROCESSOR))
 # then it assumes a universal build (ac_cv_c_bigendian=universal) with
 # data file initially built big-endian.
 #
+# darwin releases
+# darwin 17.0.0 2017-Sep: macOS 10.13, iOS 11
+# darwin 17.5.0 2018-Mar: macOS 10.13.4
+# darwin 17.6.0 2018-Jun: macOS 10.13.5
+# darwin 17.7.0 2018-Jul: macOS 10.13.6, iOS 11.4.1
+# darwin 18.0.0 2018-Sep: macOS 10.14, iOS 12
+# darwin 18.2.0 2018-Oct: macOS 10.14.1, iOS 12.1
+# darwin 19.0.0 2019-fall: macOS 10.15, iOS 13
+#
 ifeq "$(CROSS_BUILD)" "YES"
        RC_ARCHS_FIRST=$(shell echo $(RC_ARCHS) | cut -d' ' -f1)
-       TARGET_SPEC=$(RC_ARCHS_FIRST)-apple-darwin16.0.0
+       TARGET_SPEC=$(RC_ARCHS_FIRST)-apple-darwin19.0.0
        ENV_CONFIGURE_ARCHS=-arch $(RC_ARCHS_FIRST)
        ICUPKGTOOLIBS="$(CROSSHOST_OBJROOT)/lib:$(CROSSHOST_OBJROOT)/stubdata"
        ICUPKGTOOL=$(CROSSHOST_OBJROOT)/bin/icupkg
@@ -504,7 +526,7 @@ else ifeq "$(LINUX)" "YES"
        ICUPKGTOOL=$(OBJROOT_CURRENT)/bin/icupkg
        FORCEENDIAN=
 else
-       TARGET_SPEC=$(UNAME_PROCESSOR)-apple-darwin16.0.0
+       TARGET_SPEC=$(UNAME_PROCESSOR)-apple-darwin19.0.0
        ENV_CONFIGURE_ARCHS=
        ICUPKGTOOLIBS="$(OBJROOT_CURRENT)/lib:$(OBJROOT_CURRENT)/stubdata"
        ICUPKGTOOL=$(OBJROOT_CURRENT)/bin/icupkg
@@ -681,8 +703,8 @@ endif
 # The ICU version/subversion should reflect the actual ICU version.
 
 LIB_NAME = icucore
-ICU_VERS = 59
-ICU_SUBVERS = 1
+ICU_VERS = 64
+ICU_SUBVERS = 2
 CORE_VERS = A
 
 ifeq "$(WINDOWS)" "YES"
@@ -698,9 +720,9 @@ ifeq "$(WINDOWS)" "YES"
 else ifeq "$(LINUX)" "YES"
        DYLIB_SUFF = so
        ifeq "$(ARCH64)" "YES"
-               libdir = /usr/lib64/
+               libdir = /usr/local/lib/
        else
-               libdir = /usr/lib/
+               libdir = /usr/local/lib32/
        endif
        winprogdir =
        winintlibdir =
@@ -745,15 +767,19 @@ OPEN_SOURCE_LICENSES_DIR=/usr/local/OpenSourceLicenses/
 B_DATA_FILE=icudt$(ICU_VERS)b.dat
 L_DATA_FILE=icudt$(ICU_VERS)l.dat
 DATA_BUILD_SUBDIR= data/out
+ifeq "$(LINUX)" "YES"
+DATA_INSTALL_DIR=/usr/local/share/icu/
+else
 DATA_INSTALL_DIR=/usr/share/icu/
+endif
 
 # DATA_LOOKUP_DIR is what the target ICU_DATA_DIR gets set to in CFLAGS, CXXFLAGS;
 # DATA_LOOKUP_DIR_BUILDHOST is what any crossbuild host ICU_DATA_DIR gets set to.
 # Formerly we had DATA_LOOKUP_DIR=/var/db/icu/ for embedded non-simulator builds
 # and DATA_LOOKUP_DIR=/usr/share/icu/ for everything else. Now all systems look
 # in the same place for the main data file:
-DATA_LOOKUP_DIR=/usr/share/icu/
-DATA_LOOKUP_DIR_BUILDHOST=/usr/share/icu/
+DATA_LOOKUP_DIR=$(DATA_INSTALL_DIR)
+DATA_LOOKUP_DIR_BUILDHOST=$(DATA_INSTALL_DIR)
 
 # Timezone data file(s)
 # ICU will look for /var/db/timezone/icutz/icutz44l.dat
@@ -820,7 +846,7 @@ ZICTOOL_OBJS = ./tools/tzcode/zic.o ./tools/tzcode/localtime.o ./tools/tzcode/as
 
 RESTOOL = icugenrb
 RESTOOL_OBJS = ./tools/genrb/errmsg.o ./tools/genrb/genrb.o ./tools/genrb/parse.o ./tools/genrb/read.o ./tools/genrb/reslist.o ./tools/genrb/ustr.o \
-                               ./tools/genrb/rbutil.o ./tools/genrb/wrtjava.o ./tools/genrb/rle.o ./tools/genrb/wrtxml.o ./tools/genrb/prscmnts.o
+                               ./tools/genrb/rbutil.o ./tools/genrb/wrtjava.o ./tools/genrb/rle.o ./tools/genrb/wrtxml.o ./tools/genrb/prscmnts.o ./tools/genrb/filterrb.o
 
 # note there is also a symbol ICUPKGTOOL which refers to the one used
 # internally which is linked against the separate uc and i18n libs.
@@ -859,90 +885,126 @@ LIBOVERRIDES=LIBICUDT="-L$(OBJROOT_CURRENT) -l$(LIB_NAME)" \
        LIBICUUC="-L$(OBJROOT_CURRENT) -l$(LIB_NAME)" \
        LIBICUI18N="-L$(OBJROOT_CURRENT) -l$(LIB_NAME)"
 
+CFLAGS_SANITIZER :=
+CXXFLAGS_SANITIZER :=
+LDFLAGS_SANITIZER :=
+ifeq ($(RC_ENABLE_ADDRESS_SANITIZATION),1)
+  $(info Enabling Address Sanitizer)
+  ASAN_FLAGS:=-fsanitize=address
+  CFLAGS_SANITIZER += $(ASAN_FLAGS)
+  CXXFLAGS_SANITIZER += $(ASAN_FLAGS)
+  LDFLAGS_SANITIZER += $(ASAN_FLAGS)
+endif
+
+ifeq ($(RC_ENABLE_UNDEFINED_BEHAVIOR_SANITIZATION),1)
+  $(info Enabling Undefined Behaviour Sanitizer)
+  UBSAN_FLAGS:=-fsanitize=undefined
+  CFLAGS_SANITIZER += $(UBSAN_FLAGS)
+  CXXFLAGS_SANITIZER += $(UBSAN_FLAGS)
+  LDFLAGS_SANITIZER += $(UBSAN_FLAGS)
+endif
+
+ifeq ($(RC_ENABLE_THREAD_SANITIZATION),1)
+  $(info Enabling Thread Sanitizer)
+  TSAN_FLAGS:=-fsanitize=thread
+  CFLAGS_SANITIZER += $(TSAN_FLAGS)
+  CXXFLAGS_SANITIZER += $(TSAN_FLAGS)
+  LDFLAGS_SANITIZER += $(TSAN_FLAGS)
+endif
+LDFLAGS += $(LDFLAGS_SANITIZER)
+
 # For normal Windows builds set the ENV= options here; for debug Windows builds set the ENV_DEBUG=
 # options here and also the update the LINK.EXE lines in the TARGETS section below.
 ifeq "$(WINDOWS)" "YES"
        ifeq "$(ARCH64)" "YES"
-               ENV= CFLAGS="/O2 /Ob2 /MD /GF /GS /Zi /nologo /D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES" \
-                       CXXFLAGS="/O2 /Ob2 /MD /GF /GS /Zi /nologo /D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES /EHsc /Zc:wchar_t" \
+               ENV= CFLAGS="/utf-8 /O2 /Ob2 /MD /GF /GS /Zi /nologo /D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES" \
+                       CXXFLAGS="/utf-8 /O2 /Ob2 /MD /GF /GS /Zi /nologo /D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES /EHsc /Zc:wchar_t /DU_SHOW_CPLUSPLUS_API=1" \
                        LDFLAGS="/NXCOMPAT /DYNAMICBASE /DEBUG /OPT:REF"
        else
-               ENV= CFLAGS="/O2 /Ob2 /MD /GF /GS /Zi /nologo /D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES" \
-                       CXXFLAGS="/O2 /Ob2 /MD /GF /GS /Zi /nologo /D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES /EHsc /Zc:wchar_t" \
+               ENV= CFLAGS="/utf-8 /O2 /Ob2 /MD /GF /GS /Zi /nologo /D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES" \
+                       CXXFLAGS="/utf-8 /O2 /Ob2 /MD /GF /GS /Zi /nologo /D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES /EHsc /Zc:wchar_t /DU_SHOW_CPLUSPLUS_API=1" \
                        LDFLAGS="/NXCOMPAT /SAFESEH /DYNAMICBASE /DEBUG /OPT:REF"
        endif
        ENV_CONFIGURE= CPPFLAGS="-DU_DISABLE_RENAMING=1 $(DEFINE_BUILD_LEVEL)" \
-               CFLAGS="/O2 /Ob2 /MD /GF /GS /nologo /D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES" \
-               CXXFLAGS="/O2 /Ob2 /MD /GF /GS /nologo /D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES /EHsc /Zc:wchar_t"
-       ENV_DEBUG= CFLAGS="/O2 /Ob2 /MDd /GF /GS /Zi /D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES" \
-               CXXFLAGS="/O2 /Ob2 /MDd /GF /GS /Zi /D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES /EHsc" \
+               CFLAGS="/utf-8 /O2 /Ob2 /MD /GF /GS /nologo /D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES" \
+               CXXFLAGS="/utf-8 /O2 /Ob2 /MD /GF /GS /nologo /D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES /EHsc /Zc:wchar_t /DU_SHOW_CPLUSPLUS_API=1"
+       ENV_DEBUG= CFLAGS="/utf-8 /O2 /Ob2 /MDd /GF /GS /Zi /D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES" \
+               CXXFLAGS="/utf-8 /O2 /Ob2 /MDd /GF /GS /Zi /D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES /EHsc /DU_SHOW_CPLUSPLUS_API=1" \
                LDFLAGS="/DEBUG /DYNAMICBASE"
        ENV_PROFILE=
 else ifeq "$(LINUX)" "YES"
        ifeq "$(ARCH64)" "YES"
                ENV_CONFIGURE= APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
+                       LANG="en_US.utf8" \
                        CPPFLAGS="-DU_DISABLE_RENAMING=1 $(DEFINE_BUILD_LEVEL)"  \
                        CC="$(CC)" \
                        CXX="$(CXX)" \
                        CFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DICU_DATA_DIR_PREFIX_ENV_VAR=\"\\\"$(DATA_DIR_PREFIX_ENV_VAR)\\\"\" -m64 -g -Os -fno-exceptions -fvisibility=hidden" \
-                       CXXFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DICU_DATA_DIR_PREFIX_ENV_VAR=\"\\\"$(DATA_DIR_PREFIX_ENV_VAR)\\\"\" -m64 -g -Os -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden" \
+                       CXXFLAGS="-std=c++11 -DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DICU_DATA_DIR_PREFIX_ENV_VAR=\"\\\"$(DATA_DIR_PREFIX_ENV_VAR)\\\"\" -m64 -g -Os -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden" \
                        TZDATA="$(TZDATA)" \
-                       DYLD_LIBRARY_PATH="$(DSTROOT)/usr/local/lib64"
+                       DYLD_LIBRARY_PATH="$(DSTROOT)/usr/local/lib"
 
                ENV= APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
+                       LANG="en_US.utf8" \
                        CC="$(CC)" \
                        CXX="$(CXX)" \
                        CFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DICU_DATA_DIR_PREFIX_ENV_VAR=\"\\\"$(DATA_DIR_PREFIX_ENV_VAR)\\\"\" -m64 -g -Os -fno-exceptions -fvisibility=hidden" \
-                       CXXFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DICU_DATA_DIR_PREFIX_ENV_VAR=\"\\\"$(DATA_DIR_PREFIX_ENV_VAR)\\\"\" -m64 -g -Os -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden" \
+                       CXXFLAGS="-std=c++11 -DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DICU_DATA_DIR_PREFIX_ENV_VAR=\"\\\"$(DATA_DIR_PREFIX_ENV_VAR)\\\"\" -m64 -g -Os -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden" \
                        TZDATA="$(TZDATA)" \
-                       DYLD_LIBRARY_PATH="$(DSTROOT)/usr/local/lib64"
+                       DYLD_LIBRARY_PATH="$(DSTROOT)/usr/local/lib"
 
                ENV_DEBUG= APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
+                       LANG="en_US.utf8" \
                        CC="$(CC)" \
                        CXX="$(CXX)" \
                        CFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DICU_DATA_DIR_PREFIX_ENV_VAR=\"\\\"$(DATA_DIR_PREFIX_ENV_VAR)\\\"\" -m64 -O0 -gfull -fno-exceptions -fvisibility=hidden" \
-                       CXXFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DICU_DATA_DIR_PREFIX_ENV_VAR=\"\\\"$(DATA_DIR_PREFIX_ENV_VAR)\\\"\" -m64 -O0 -gfull -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden" \
+                       CXXFLAGS="-std=c++11 -DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DICU_DATA_DIR_PREFIX_ENV_VAR=\"\\\"$(DATA_DIR_PREFIX_ENV_VAR)\\\"\" -m64 -O0 -gfull -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden" \
                        TZDATA="$(TZDATA)" \
-                       DYLD_LIBRARY_PATH="$(DSTROOT)/usr/local/lib64"
+                       DYLD_LIBRARY_PATH="$(DSTROOT)/usr/local/lib"
 
                ENV_PROFILE= APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
+                       LANG="en_US.utf8" \
                        CC="$(CC)" \
                        CXX="$(CXX)" \
                        CFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DICU_DATA_DIR_PREFIX_ENV_VAR=\"\\\"$(DATA_DIR_PREFIX_ENV_VAR)\\\"\" -m64 -g -Os -pg -fno-exceptions -fvisibility=hidden" \
-                       CXXFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DICU_DATA_DIR_PREFIX_ENV_VAR=\"\\\"$(DATA_DIR_PREFIX_ENV_VAR)\\\"\" -m64 -g -Os -pg -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden" \
+                       CXXFLAGS="-std=c++11 -DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DICU_DATA_DIR_PREFIX_ENV_VAR=\"\\\"$(DATA_DIR_PREFIX_ENV_VAR)\\\"\" -m64 -g -Os -pg -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden" \
                        TZDATA="$(TZDATA)" \
-                       DYLD_LIBRARY_PATH="$(DSTROOT)/usr/local/lib64"
+                       DYLD_LIBRARY_PATH="$(DSTROOT)/usr/local/lib"
        else
                ENV_CONFIGURE= APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
+                       LANG="en_US.utf8" \
                        CPPFLAGS="-DU_DISABLE_RENAMING=1 $(DEFINE_BUILD_LEVEL)" \
                        CC="$(CC)" \
                        CXX="$(CXX)" \
                        CFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DICU_DATA_DIR_PREFIX_ENV_VAR=\"\\\"$(DATA_DIR_PREFIX_ENV_VAR)\\\"\" -m32 -g -Os -fno-exceptions -fvisibility=hidden" \
-                       CXXFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DICU_DATA_DIR_PREFIX_ENV_VAR=\"\\\"$(DATA_DIR_PREFIX_ENV_VAR)\\\"\" -m32 -g -Os -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden" \
+                       CXXFLAGS="-std=c++11 -DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DICU_DATA_DIR_PREFIX_ENV_VAR=\"\\\"$(DATA_DIR_PREFIX_ENV_VAR)\\\"\" -m32 -g -Os -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden" \
                        TZDATA="$(TZDATA)" \
                        DYLD_LIBRARY_PATH="$(DSTROOT)/usr/local/lib"
 
                ENV= APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
+                       LANG="en_US.utf8" \
                        CC="$(CC)" \
                        CXX="$(CXX)" \
                        CFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DICU_DATA_DIR_PREFIX_ENV_VAR=\"\\\"$(DATA_DIR_PREFIX_ENV_VAR)\\\"\" -m32 -g -Os -fno-exceptions -fvisibility=hidden" \
-                       CXXFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DICU_DATA_DIR_PREFIX_ENV_VAR=\"\\\"$(DATA_DIR_PREFIX_ENV_VAR)\\\"\" -m32 -g -Os -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden" \
+                       CXXFLAGS="-std=c++11 -DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DICU_DATA_DIR_PREFIX_ENV_VAR=\"\\\"$(DATA_DIR_PREFIX_ENV_VAR)\\\"\" -m32 -g -Os -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden" \
                        TZDATA="$(TZDATA)" \
                        DYLD_LIBRARY_PATH="$(DSTROOT)/usr/local/lib"
 
                ENV_DEBUG= APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
+                       LANG="en_US.utf8" \
                        CC="$(CC)" \
                        CXX="$(CXX)" \
                        CFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DICU_DATA_DIR_PREFIX_ENV_VAR=\"\\\"$(DATA_DIR_PREFIX_ENV_VAR)\\\"\" -m32 -O0 -gfull -fno-exceptions -fvisibility=hidden" \
-                       CXXFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DICU_DATA_DIR_PREFIX_ENV_VAR=\"\\\"$(DATA_DIR_PREFIX_ENV_VAR)\\\"\" -m32 -O0 -gfull -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden" \
+                       CXXFLAGS="-std=c++11 -DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DICU_DATA_DIR_PREFIX_ENV_VAR=\"\\\"$(DATA_DIR_PREFIX_ENV_VAR)\\\"\" -m32 -O0 -gfull -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden" \
                        TZDATA="$(TZDATA)" \
                        DYLD_LIBRARY_PATH="$(DSTROOT)/usr/local/lib"
 
                ENV_PROFILE= APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
+                       LANG="en_US.utf8" \
                        CC="$(CC)" \
                        CXX="$(CXX)" \
                        CFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DICU_DATA_DIR_PREFIX_ENV_VAR=\"\\\"$(DATA_DIR_PREFIX_ENV_VAR)\\\"\" -m32 -g -Os -pg -fno-exceptions -fvisibility=hidden" \
-                       CXXFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DICU_DATA_DIR_PREFIX_ENV_VAR=\"\\\"$(DATA_DIR_PREFIX_ENV_VAR)\\\"\" -m32 -g -Os -pg -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden" \
+                       CXXFLAGS="-std=c++11 -DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DICU_DATA_DIR_PREFIX_ENV_VAR=\"\\\"$(DATA_DIR_PREFIX_ENV_VAR)\\\"\" -m32 -g -Os -pg -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden" \
                        TZDATA="$(TZDATA)" \
                        DYLD_LIBRARY_PATH="$(DSTROOT)/usr/local/lib"
        endif
@@ -952,8 +1014,8 @@ else
                CPPFLAGS="$(DEFINE_BUILD_LEVEL) -DSTD_INSPIRED -DMAC_OS_X_VERSION_MIN_REQUIRED=$(MAC_OS_X_VERSION_MIN_REQUIRED) $(ISYSROOT) $(ENV_CONFIGURE_ARCHS)" \
                CC="$(CC)" \
                CXX="$(CXX)" \
-               CFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DU_TIMEZONE=timezone -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DU_TIMEZONE_FILES_DIR=\"\\\"$(TZDATA_LOOKUP_DIR)\\\"\" -DU_TIMEZONE_PACKAGE=\"\\\"$(TZDATA_PACKAGE)\\\"\" $(ENV_CONFIGURE_ARCHS) $(ICU_TARGET_VERSION) -g -Os -Wglobal-constructors -fno-exceptions -fvisibility=hidden $(ISYSROOT) $(THUMB_FLAG)" \
-               CXXFLAGS="--std=c++11 -DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DU_TIMEZONE=timezone -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DU_TIMEZONE_FILES_DIR=\"\\\"$(TZDATA_LOOKUP_DIR)\\\"\" -DU_TIMEZONE_PACKAGE=\"\\\"$(TZDATA_PACKAGE)\\\"\" $(ENV_CONFIGURE_ARCHS) $(ICU_TARGET_VERSION) -g -Os -Wglobal-constructors -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden $(ISYSROOT) $(THUMB_FLAG)" \
+               CFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DU_TIMEZONE=timezone -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DU_TIMEZONE_FILES_DIR=\"\\\"$(TZDATA_LOOKUP_DIR)\\\"\" -DU_TIMEZONE_PACKAGE=\"\\\"$(TZDATA_PACKAGE)\\\"\" $(ENV_CONFIGURE_ARCHS) $(ICU_TARGET_VERSION) -g -Os -Wglobal-constructors -fno-exceptions -fvisibility=hidden $(ISYSROOT) $(THUMB_FLAG) $(CFLAGS_SANITIZER)" \
+               CXXFLAGS="--std=c++11 -DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DU_TIMEZONE=timezone -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DU_TIMEZONE_FILES_DIR=\"\\\"$(TZDATA_LOOKUP_DIR)\\\"\" -DU_TIMEZONE_PACKAGE=\"\\\"$(TZDATA_PACKAGE)\\\"\" $(ENV_CONFIGURE_ARCHS) $(ICU_TARGET_VERSION) -g -Os -Wglobal-constructors -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden $(ISYSROOT) $(THUMB_FLAG) $(CXXFLAGS_SANITIZER)" \
                RC_ARCHS="$(RC_ARCHS)" $(FORCEENDIAN)\
                TZDATA="$(TZDATA)" \
                DYLD_LIBRARY_PATH="$(DSTROOT)/usr/local/lib"
@@ -961,8 +1023,8 @@ else
        ENV= APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
                CC="$(CC)" \
                CXX="$(CXX)" \
-               CFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DU_TIMEZONE=timezone -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DU_TIMEZONE_FILES_DIR=\"\\\"$(TZDATA_LOOKUP_DIR)\\\"\" -DU_TIMEZONE_PACKAGE=\"\\\"$(TZDATA_PACKAGE)\\\"\" $(RC_ARCHS:%=-arch %) $(ICU_TARGET_VERSION) -g -Os -Wglobal-constructors -fno-exceptions -fvisibility=hidden $(ISYSROOT) $(THUMB_FLAG)" \
-               CXXFLAGS="--std=c++11 -DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DU_TIMEZONE=timezone -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DU_TIMEZONE_FILES_DIR=\"\\\"$(TZDATA_LOOKUP_DIR)\\\"\" -DU_TIMEZONE_PACKAGE=\"\\\"$(TZDATA_PACKAGE)\\\"\" $(RC_ARCHS:%=-arch %) $(ICU_TARGET_VERSION) -g -Os -Wglobal-constructors -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden $(ISYSROOT) $(THUMB_FLAG)" \
+               CFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DU_TIMEZONE=timezone -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DU_TIMEZONE_FILES_DIR=\"\\\"$(TZDATA_LOOKUP_DIR)\\\"\" -DU_TIMEZONE_PACKAGE=\"\\\"$(TZDATA_PACKAGE)\\\"\" $(RC_ARCHS:%=-arch %) $(ICU_TARGET_VERSION) -g -Os -Wglobal-constructors -fno-exceptions -fvisibility=hidden $(ISYSROOT) $(THUMB_FLAG) $(CFLAGS_SANITIZER)" \
+               CXXFLAGS="--std=c++11 -DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DU_TIMEZONE=timezone -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DU_TIMEZONE_FILES_DIR=\"\\\"$(TZDATA_LOOKUP_DIR)\\\"\" -DU_TIMEZONE_PACKAGE=\"\\\"$(TZDATA_PACKAGE)\\\"\" $(RC_ARCHS:%=-arch %) $(ICU_TARGET_VERSION) -g -Os -Wglobal-constructors -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden $(ISYSROOT) $(THUMB_FLAG) $(CXXFLAGS_SANITIZER)" \
                RC_ARCHS="$(RC_ARCHS)" \
                TZDATA="$(TZDATA)" \
                DYLD_LIBRARY_PATH="$(DSTROOT)/usr/local/lib"
@@ -970,8 +1032,8 @@ else
        ENV_DEBUG= APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
                CC="$(CC)" \
                CXX="$(CXX)" \
-               CFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DU_TIMEZONE=timezone -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DU_TIMEZONE_FILES_DIR=\"\\\"$(TZDATA_LOOKUP_DIR)\\\"\" -DU_TIMEZONE_PACKAGE=\"\\\"$(TZDATA_PACKAGE)\\\"\" $(RC_ARCHS:%=-arch %) $(ICU_TARGET_VERSION) -O0 -gfull -Wglobal-constructors -fno-exceptions -fvisibility=hidden $(ISYSROOT) $(THUMB_FLAG)" \
-               CXXFLAGS="--std=c++11 -DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DU_TIMEZONE=timezone -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DU_TIMEZONE_FILES_DIR=\"\\\"$(TZDATA_LOOKUP_DIR)\\\"\" -DU_TIMEZONE_PACKAGE=\"\\\"$(TZDATA_PACKAGE)\\\"\" $(RC_ARCHS:%=-arch %) $(ICU_TARGET_VERSION) -O0 -gfull -Wglobal-constructors -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden $(ISYSROOT) $(THUMB_FLAG)" \
+               CFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DU_TIMEZONE=timezone -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DU_TIMEZONE_FILES_DIR=\"\\\"$(TZDATA_LOOKUP_DIR)\\\"\" -DU_TIMEZONE_PACKAGE=\"\\\"$(TZDATA_PACKAGE)\\\"\" $(RC_ARCHS:%=-arch %) $(ICU_TARGET_VERSION) -O0 -gfull -Wglobal-constructors -fno-exceptions -fvisibility=hidden $(ISYSROOT) $(THUMB_FLAG) $(CFLAGS_SANITIZER)" \
+               CXXFLAGS="--std=c++11 -DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DU_TIMEZONE=timezone -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DU_TIMEZONE_FILES_DIR=\"\\\"$(TZDATA_LOOKUP_DIR)\\\"\" -DU_TIMEZONE_PACKAGE=\"\\\"$(TZDATA_PACKAGE)\\\"\" $(RC_ARCHS:%=-arch %) $(ICU_TARGET_VERSION) -O0 -gfull -Wglobal-constructors -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden $(ISYSROOT) $(THUMB_FLAG) $(CXXFLAGS_SANITIZER)" \
                RC_ARCHS="$(RC_ARCHS)" \
                TZDATA="$(TZDATA)" \
                DYLD_LIBRARY_PATH="$(DSTROOT)/usr/local/lib"
@@ -979,8 +1041,8 @@ else
        ENV_PROFILE= APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
                CC="$(CC)" \
                CXX="$(CXX)" \
-               CFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DU_TIMEZONE=timezone -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DU_TIMEZONE_FILES_DIR=\"\\\"$(TZDATA_LOOKUP_DIR)\\\"\" -DU_TIMEZONE_PACKAGE=\"\\\"$(TZDATA_PACKAGE)\\\"\" $(RC_ARCHS:%=-arch %) $(ICU_TARGET_VERSION) -g -Os -pg -Wglobal-constructors -fno-exceptions -fvisibility=hidden $(ISYSROOT) $(THUMB_FLAG)" \
-               CXXFLAGS="--std=c++11 -DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DU_TIMEZONE=timezone -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DU_TIMEZONE_FILES_DIR=\"\\\"$(TZDATA_LOOKUP_DIR)\\\"\" -DU_TIMEZONE_PACKAGE=\"\\\"$(TZDATA_PACKAGE)\\\"\" $(RC_ARCHS:%=-arch %) $(ICU_TARGET_VERSION) -g -Os -pg -Wglobal-constructors -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden $(ISYSROOT) $(THUMB_FLAG)" \
+               CFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DU_TIMEZONE=timezone -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DU_TIMEZONE_FILES_DIR=\"\\\"$(TZDATA_LOOKUP_DIR)\\\"\" -DU_TIMEZONE_PACKAGE=\"\\\"$(TZDATA_PACKAGE)\\\"\" $(RC_ARCHS:%=-arch %) $(ICU_TARGET_VERSION) -g -Os -pg -Wglobal-constructors -fno-exceptions -fvisibility=hidden $(ISYSROOT) $(THUMB_FLAG) $(CFLAGS_SANITIZER)" \
+               CXXFLAGS="--std=c++11 -DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DU_TIMEZONE=timezone -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DU_TIMEZONE_FILES_DIR=\"\\\"$(TZDATA_LOOKUP_DIR)\\\"\" -DU_TIMEZONE_PACKAGE=\"\\\"$(TZDATA_PACKAGE)\\\"\" $(RC_ARCHS:%=-arch %) $(ICU_TARGET_VERSION) -g -Os -pg -Wglobal-constructors -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden $(ISYSROOT) $(THUMB_FLAG) $(CXXFLAGS_SANITIZER)" \
                RC_ARCHS="$(RC_ARCHS)" \
                TZDATA="$(TZDATA)" \
                DYLD_LIBRARY_PATH="$(DSTROOT)/usr/local/lib"
@@ -989,16 +1051,16 @@ else
                CPPFLAGS="$(DEFINE_BUILD_LEVEL) -DSTD_INSPIRED -DMAC_OS_X_VERSION_MIN_REQUIRED=$(MAC_OS_X_VERSION_MIN_REQUIRED) $(HOSTISYSROOT)" \
                CC="$(HOSTCC)" \
                CXX="$(HOSTCXX)" \
-               CFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DU_TIMEZONE=timezone -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR_BUILDHOST)\\\"\" -DMAC_OS_X_VERSION_MIN_REQUIRED=$(MAC_OS_X_VERSION_MIN_REQUIRED) -mmacosx-version-min=$(OSX_HOST_VERSION_MIN_STRING) $(HOSTISYSROOT) -g -Os -Wglobal-constructors -fno-exceptions -fvisibility=hidden" \
-               CXXFLAGS="--std=c++11 -DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DU_TIMEZONE=timezone -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR_BUILDHOST)\\\"\" -DMAC_OS_X_VERSION_MIN_REQUIRED=$(MAC_OS_X_VERSION_MIN_REQUIRED) -mmacosx-version-min=$(OSX_HOST_VERSION_MIN_STRING) $(HOSTISYSROOT) -g -Os -Wglobal-constructors -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden" \
+               CFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DU_TIMEZONE=timezone -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR_BUILDHOST)\\\"\" -DMAC_OS_X_VERSION_MIN_REQUIRED=$(MAC_OS_X_VERSION_MIN_REQUIRED) -mmacosx-version-min=$(OSX_HOST_VERSION_MIN_STRING) $(HOSTISYSROOT) -g -Os -Wglobal-constructors -fno-exceptions -fvisibility=hidden $(CFLAGS_SANITIZER)" \
+               CXXFLAGS="--std=c++11 -DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DU_TIMEZONE=timezone -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR_BUILDHOST)\\\"\" -DMAC_OS_X_VERSION_MIN_REQUIRED=$(MAC_OS_X_VERSION_MIN_REQUIRED) -mmacosx-version-min=$(OSX_HOST_VERSION_MIN_STRING) $(HOSTISYSROOT) -g -Os -Wglobal-constructors -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden $(CXXFLAGS_SANITIZER)" \
                TZDATA="$(TZDATA)" \
                DYLD_LIBRARY_PATH="$(DSTROOT)/usr/local/lib"
 
        ENV_BUILDHOST= APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
                CC="$(HOSTCC)" \
                CXX="$(HOSTCXX)" \
-               CFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DU_TIMEZONE=timezone -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR_BUILDHOST)\\\"\" -DMAC_OS_X_VERSION_MIN_REQUIRED=$(MAC_OS_X_VERSION_MIN_REQUIRED) -mmacosx-version-min=$(OSX_HOST_VERSION_MIN_STRING) $(HOSTISYSROOT) -g -Os -Wglobal-constructors -fno-exceptions -fvisibility=hidden" \
-               CXXFLAGS="--std=c++11 -DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DU_TIMEZONE=timezone -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR_BUILDHOST)\\\"\" -DMAC_OS_X_VERSION_MIN_REQUIRED=$(MAC_OS_X_VERSION_MIN_REQUIRED) -mmacosx-version-min=$(OSX_HOST_VERSION_MIN_STRING) $(HOSTISYSROOT) -g -Os -Wglobal-constructors -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden" \
+               CFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DU_TIMEZONE=timezone -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR_BUILDHOST)\\\"\" -DMAC_OS_X_VERSION_MIN_REQUIRED=$(MAC_OS_X_VERSION_MIN_REQUIRED) -mmacosx-version-min=$(OSX_HOST_VERSION_MIN_STRING) $(HOSTISYSROOT) -g -Os -Wglobal-constructors -fno-exceptions -fvisibility=hidden $(CFLAGS_SANITIZER)" \
+               CXXFLAGS="--std=c++11 -DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DU_TIMEZONE=timezone -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR_BUILDHOST)\\\"\" -DMAC_OS_X_VERSION_MIN_REQUIRED=$(MAC_OS_X_VERSION_MIN_REQUIRED) -mmacosx-version-min=$(OSX_HOST_VERSION_MIN_STRING) $(HOSTISYSROOT) -g -Os -Wglobal-constructors -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden $(CXXFLAGS_SANITIZER)" \
                TZDATA="$(TZDATA)" \
                DYLD_LIBRARY_PATH="$(DSTROOT)/usr/local/lib"
 
@@ -1040,12 +1102,13 @@ crossbuildhost icutztoolsforsdk
 #
 # The various patchconfig files should assume the current directory is icuSources.
 #
-# Note that if sources have been installed by installsrc (only run as part of buildit
-# or B&I builds), then
-#    $(SRCROOT)/.git is not present, and
+# Note that if sources have been installed by installsrc (only run as part of buildit or
+# submitproject for Apple platforms, not for Windows/Linux), then
+#    $(SRCROOT)/installsrcNotRunFlag is not present, and
 #    ADJUST_SOURCES has already have been run.
-# Otherwise, if we are doing a local build (e.g. make check, make install), then
-#    $(SRCROOT)/.git is present, and
+# Otherwise, if we are doing a local build (e.g. make check, make install), or if
+# sources were submitted using submitproject for non-Apple platforms (Windows/Linux) then
+#    $(SRCROOT)/installsrcNotRunFlag is present, and
 #    ADJUST_SOURCES has not been run (run it after copying sources to OBJROOT_CURRENT)
 #
 
@@ -1073,7 +1136,7 @@ ADJUST_SOURCES = \
 icu debug profile : $(OBJROOT_CURRENT)/Makefile
        echo "# make for target";
        (cd $(OBJROOT_CURRENT); \
-               $(MAKE) $($(ENV_$@)); \
+               $(MAKE) $($(ENV_$@)) || exit 1; \
                if test "$(WINDOWS)" = "YES"; then \
                        (cd common; \
                                rc.exe /folibicuuc.res $(CPPFLAGS) -DU_RELEASE=1 -D_CRT_SECURE_NO_DEPRECATE -I. -I../i18n \
@@ -1137,9 +1200,12 @@ icu debug profile : $(OBJROOT_CURRENT)/Makefile
                        else \
                                tmpfile=`mktemp -t weakexternal.XXXXXX` || exit 1; \
                                $(NM) -m $(RC_ARCHS:%=-arch %) $(DYLIB_OBJS) | fgrep "weak external" | fgrep -v "undefined" | sed -e 's/.*weak external[^_]*//' | sort | uniq | cat >$$tmpfile; \
+                               if test ! "$(ICU_FOR_EMBEDDED_TRAINS)" = "YES"; then \
+                                       ZIPPERING_LDFLAGS=-Wl,-iosmac_version_min,12.0; \
+                               fi; \
                                $($(ENV_$@)) $(CXX) -current_version $(ICU_VERS).$(ICU_SUBVERS) -compatibility_version 1 -dynamiclib -dynamic \
                                        $(RC_ARCHS:%=-arch %) $(ICU_TARGET_VERSION) -g -Os -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden $(ISYSROOT) $(THUMB_FLAG) \
-                                       $(CXXFLAGS) $(LDFLAGS) -single_module $(SECTORDER_FLAGS) -unexported_symbols_list $$tmpfile -dead_strip \
+                                       $(CXXFLAGS) $(LDFLAGS) $$ZIPPERING_LDFLAGS -single_module $(SECTORDER_FLAGS) -unexported_symbols_list $$tmpfile -dead_strip \
                                        -install_name $(libdir)$($(INSTALLED_DYLIB_$@)) -o ./$($(INSTALLED_DYLIB_$@)) $(DYLIB_OBJS); \
                                if test "$@" = "icu"; then \
                                        ln -fs  $(INSTALLED_DYLIB) $(DYLIB); \
@@ -1172,7 +1238,7 @@ icu debug profile : $(OBJROOT_CURRENT)/Makefile
 crossbuildhost : $(CROSSHOST_OBJROOT)/Makefile
        echo "# make for crossbuild host";
        (cd $(CROSSHOST_OBJROOT); \
-               $(MAKE) $($(ENV_BUILDHOST)); \
+               $(MAKE) $($(ENV_BUILDHOST)) || exit 1; \
        );
 
 # For the install-icutztoolsforsdk target, SDKROOT will always be an OSX SDK root.
@@ -1182,8 +1248,8 @@ crossbuildhost : $(CROSSHOST_OBJROOT)/Makefile
 icutztoolsforsdk : $(OBJROOT_CURRENT)/Makefile
        echo "# make icutztoolsforsdk";
        (cd $(OBJROOT_CURRENT); \
-               if test ! -d $(SRCROOT)/.git ; then patch -N -p1 <$(SRCROOT)/crosshostpatchconfig.txt; fi; \
-               $(MAKE) $($(ENV)); \
+               if test ! -e $(SRCROOT)/installsrcNotRunFlag ; then patch -N -p1 <$(SRCROOT)/crosshostpatchconfig.txt; fi; \
+               $(MAKE) $($(ENV)) || exit 1; \
                echo '# build' $(TOOLS_DYLIB_FORTOOLS) 'linked against' $(LIB_NAME) ; \
                $($(ENV)) $(CXX) -current_version $(ICU_VERS).$(ICU_SUBVERS) -compatibility_version 1 -dynamiclib -dynamic \
                        -g -Os -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden $(ISYSROOT) \
@@ -1244,7 +1310,7 @@ endif
        fi;
        cp -Rpf $(SRCROOT)/icuSources/* $(OBJROOT_CURRENT)/;
        (cd $(OBJROOT_CURRENT); \
-               if test -d $(SRCROOT)/.git ; then $(ADJUST_SOURCES); fi; \
+               if test -e $(SRCROOT)/installsrcNotRunFlag ; then $(ADJUST_SOURCES); fi; \
                if test -f $(TZAUXFILESDIR)/metaZones.txt ; then cp -p $(TZAUXFILESDIR)/metaZones.txt data/misc/; fi; \
                if test -f $(TZAUXFILESDIR)/timezoneTypes.txt ; then cp -p $(TZAUXFILESDIR)/timezoneTypes.txt data/misc/; fi; \
                if test -f $(TZAUXFILESDIR)/windowsZones.txt ; then cp -p $(TZAUXFILESDIR)/windowsZones.txt data/misc/; fi; \
@@ -1275,7 +1341,7 @@ $(CROSSHOST_OBJROOT)/Makefile :
        fi;
        cp -Rpf $(SRCROOT)/icuSources/* $(CROSSHOST_OBJROOT);
        (cd $(CROSSHOST_OBJROOT); \
-               if test -d $(SRCROOT)/.git; then $(ADJUST_SOURCES); fi; \
+               if test -e $(SRCROOT)/installsrcNotRunFlag; then $(ADJUST_SOURCES); fi; \
                if test -f $(TZAUXFILESDIR)/metaZones.txt ; then cp -p $(TZAUXFILESDIR)/metaZones.txt data/misc/; fi; \
                if test -f $(TZAUXFILESDIR)/timezoneTypes.txt ; then cp -p $(TZAUXFILESDIR)/timezoneTypes.txt data/misc/; fi; \
                if test -f $(TZAUXFILESDIR)/windowsZones.txt ; then cp -p $(TZAUXFILESDIR)/windowsZones.txt data/misc/; fi; \
@@ -1294,13 +1360,13 @@ $(CROSSHOST_OBJROOT)/Makefile :
 
 # Since our sources are in icuSources (ignore the ICU subdirectory for now), we wish to
 # copy them to somewhere else. We tar it to stdout, cd to the appropriate directory, and
-# untar from stdin.  We then look for all the CVS directories and remove them. We may have
-# to remove the .cvsignore files also.
+# untar from stdin.
+# Do NOT include installsrcNotRunFlag in the list of files to tar up, that defeats the purpose.
 
 installsrc :
        if test ! -d $(SRCROOT); then mkdir $(SRCROOT); fi;
        if test -d $(SRCROOT)/icuSources ; then rm -rf $(SRCROOT)/icuSources; fi;
-       tar cf - ./makefile ./ICU.plist ./LICENSE ./icuSources ./cldrFiles ./emojiData $(INSTALLSRC_VARFILES) | (cd $(SRCROOT) ; tar xfp -); \
+       tar cf - ./makefile ./ICU.plist ./LICENSE ./icuSources ./cldrFiles ./emojiData ./modules $(INSTALLSRC_VARFILES) | (cd $(SRCROOT) ; tar xfp -); \
        (cd $(SRCROOT)/icuSources; $(ADJUST_SOURCES) );
 
 # This works. Just not for ~ in the DSTROOT. We run configure first (in case it hasn't
@@ -1317,12 +1383,14 @@ endif
 MKINSTALLDIRS=$(SHELL) $(SRCROOT)/icuSources/mkinstalldirs
 INSTALL_DATA=${INSTALL} -m 644
 
-ifeq "$(RC_XBS)" "YES"
-installhdrsint :
-else
+ifneq "$(ICU_FOR_APPLE_PLATFORMS)" "YES"
 installhdrsint : $(OBJROOT_CURRENT)/Makefile
+else ifneq "$(RC_XBS)" "YES"
+installhdrsint : $(OBJROOT_CURRENT)/Makefile
+else
+installhdrsint :
 endif
-       (if test -d $(SRCROOT)/.git; then cd $(OBJROOT_CURRENT); else cd $(SRCROOT)/icuSources/; fi; \
+       (if test -e $(SRCROOT)/installsrcNotRunFlag; then cd $(OBJROOT_CURRENT); else cd $(SRCROOT)/icuSources/; fi; \
                $(MKINSTALLDIRS) $(DSTROOT)/$(PRIVATE_HDR_PREFIX)/include/unicode/; \
                for subdir in $(HDR_MAKE_SUBDIR); do \
                        echo "# Subdir $$subdir"; \
@@ -1350,6 +1418,12 @@ endif
                                                -I $(DSTROOT)/$(HDR_PREFIX)/include/ -I $(SDKPATH)/usr/include/ -E > /dev/null ; \
                                fi; \
                        fi; \
+                       $(INSTALL_DATA) $(SRCROOT)/modules/embedded/module.modulemap $(DSTROOT)/$(HDR_PREFIX)/include/unicode/ ; \
+                       $(INSTALL_DATA) $(SRCROOT)/modules/embedded/module.private.modulemap $(DSTROOT)/$(PRIVATE_HDR_PREFIX)/include/unicode/ ; \
+               else \
+                       if test "$(ICU_FOR_APPLE_PLATFORMS)" = "YES"; then \
+                               $(INSTALL_DATA) $(SRCROOT)/modules/macos/module.private.modulemap $(DSTROOT)/$(PRIVATE_HDR_PREFIX)/include/unicode/ ; \
+                       fi; \
                fi; \
        );
 
@@ -1379,6 +1453,9 @@ install : installhdrsint icu
                fi; \
                $(INSTALL) -b -m 0755 $(OBJROOT_CURRENT)/$(INSTALLED_DYLIB) $(DSTROOT)/$(libdir)$(INSTALLED_DYLIB); \
                if test "$(LINUX)" = "YES"; then \
+                       if test ! -d $(SYMROOT_CURRENT)/; then \
+                               $(INSTALL) -d -m 0755 $(SYMROOT_CURRENT)/; \
+                       fi; \
                        cp $(OBJROOT_CURRENT)/$(INSTALLED_DYLIB) $(SYMROOT_CURRENT)/$(INSTALLED_DYLIB); \
                        strip -x -S $(DSTROOT)/$(libdir)$(INSTALLED_DYLIB); \
                else \
@@ -1395,7 +1472,7 @@ install : installhdrsint icu
                        $(INSTALL) -d -m 0755 $(DSTROOT)/$(DATA_INSTALL_DIR)/; \
                fi; \
                if test -f $(OBJROOT_CURRENT)/$(L_DATA_FILE); then \
-                       $(INSTALL) -b -m 0644  $(OBJROOT_CURRENT)/$(L_DATA_FILE) $(DSTROOT)/$(DATA_INSTALL_DIR)$(L_DATA_FILE); \
+                       $(INSTALL) -b -m 0444  $(OBJROOT_CURRENT)/$(L_DATA_FILE) $(DSTROOT)/$(DATA_INSTALL_DIR)$(L_DATA_FILE); \
                fi; \
                if test -f $(OBJROOT_CURRENT)/$(TZDATA_FORMAT_FILE); then \
                        $(INSTALL) -b -m 0644  $(OBJROOT_CURRENT)/$(TZDATA_FORMAT_FILE) $(DSTROOT)/$(DATA_INSTALL_DIR)$(TZDATA_FORMAT_FILE); \
@@ -1470,6 +1547,9 @@ install_debug install_profile : $$(DEPEND_$$@)
                fi; \
                $(INSTALL) -b -m 0664 $(OBJROOT_CURRENT)/$($(INSTALLED_DYLIB_$(DEPEND_$@))) $(DSTROOT)/$(libdir)$($(INSTALLED_DYLIB_$(DEPEND_$@))); \
                if test "$(LINUX)" = "YES"; then \
+                       if test ! -d $(SYMROOT_CURRENT)/; then \
+                               $(INSTALL) -d -m 0755 $(SYMROOT_CURRENT)/; \
+                       fi; \
                        cp $(OBJROOT_CURRENT)/$($(INSTALLED_DYLIB_$(DEPEND_$@))) $(SYMROOT_CURRENT)/$($(INSTALLED_DYLIB_$(DEPEND_$@))); \
                        strip -x -S $(DSTROOT)/$(libdir)$($(INSTALLED_DYLIB_$(DEPEND_$@))); \
                else \