Add support for icu_use_data_file=1 to icu.gyp on Windows/Linux

1. When icu_use_data_file_flag is set to 1 on Windows, we don't need
to copy icudt.dll. Instead, we have to copy icudt*.dat.

2. Put copies statement for icudt*.dat outside link_settings on all platforms.

For static builds on Linux, Windows and Mac,
'copies' should be pulled out of 'link_settings'. Putting it outside
'link_settings' does not hurt shared builds, either.


iOS is the only platform with icu_use_data_file=1 at the moment and
is affected directly by this CL (dropping link_settings).

3. Simplify the condition for mac_bundle_resource by dropping
'OS=="mac" and _mac_bundle' because it's never satisfied here.

4. Rename icudt46l.dat in source/data/in and android to icudtl.dat. This
is to simplify the ICU upgrade process down the road.
With the version number removed, there's no need to change the data filename
in multiple gyp files and windows package configuration files when upgrading
ICU. (the same was done for icudt.dll on Windows a few years ago.)

This CL has to go first before we land the chromium-side changes
to set icu_use_data_file to 1 on
Windows (https://codereview.chromium.org/99473012 ),
Linux ( https://codereview.chromium.org/102413007 ), and
Mac ( https://codereview.chromium.org/109013004 )

The chromium-side change for Mac will follow this, too.

BUG=72633
TEST=None (until this is rolled).
R=mark@chromium.org, scottmg@chromium.org

Review URL: https://codereview.chromium.org/111723007

git-svn-id: http://src.chromium.org/svn/trunk/deps/third_party/icu46@241597 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
diff --git a/README.chromium b/README.chromium
index 6b0b99c..1b065fa 100644
--- a/README.chromium
+++ b/README.chromium
@@ -180,9 +180,10 @@
     (see http://bugs.icu-project.org/trac/ticket/10570 ) and run 'make' again.
 
 
-    - source/data/in/icudt46l.dat : Built on Linux with all the patches
-      above applied. This file will be generated in 
-      {BUILD_DIR_ROOT}/data/out/tmp.
+    - source/data/in/icudtl.dat : Built on Linux with all the patches
+      above applied. icudt46l.dat is generated in 
+      {BUILD_DIR_ROOT}/data/out/tmp and copied to the above location with a
+      version number (46) dropped.
 
     - windows/icudt.dll : With icudt46l.dat in place, all the patches applied
       and header files moved (#11 below), generated by building icudt_build
@@ -192,13 +193,13 @@
       dll name to avoind having to update our build scripts/configuration
       files everytime ICU is upgraded to a new version.
 
-    - {mac,linux}/icudt46l_dat.S : Built on Mac and Linux with all the
+    - {mac,linux}/icudt46l_dat.S : Built on Linux with all the
       patches above (except android/brkitr.patch) applied and checked in.
       This file will be generated in {BUILD_DIR_ROOT}/data/out/tmp.
 
-      Alternatively, one can just generate icudt46l_dat.S on Linux and adopt
-      the header portion to match the current header in mac/icudt46l_dat.S.
-      That is as following without no leading space in each line:
+      mac/icudt46l_dat.S is identical to linux/icudt46l_dat.S. It's made
+      by changing the header portion of the Linux version to read as following
+      (no leading whitespace) : 
 
           .globl _icudt46_dat
           #ifdef U_HIDE_DATA_SYMBOL
@@ -213,6 +214,10 @@
     - android/icudt46l_dat.S : Built on Linux with all the patches above and
       android/brkitr.patch applied and android/patch_locale.sh executed, and
       checked in.
+    - android/icudtl.dat : Generated as icudt46l.dat in 
+      {BUILD_DIR_ROOT}/data/out/tmp along with icudt46l_dat.S and 
+      copied to the above location with '46' dropped in its name.
+
 
 12. Apply the fix found with static analysis tools such as PSV and coverity
 
diff --git a/android/icudt46l.dat b/android/icudtl.dat
similarity index 100%
rename from android/icudt46l.dat
rename to android/icudtl.dat
Binary files differ
diff --git a/icu.gyp b/icu.gyp
index 4d8259a..56e13aa 100644
--- a/icu.gyp
+++ b/icu.gyp
@@ -71,7 +71,7 @@
             }, {
               'toolsets': ['host', 'target'],
             }],
-            [ 'OS == "win"', {
+            [ 'OS == "win" and icu_use_data_file_flag==0', {
               'type': 'none',
               'copies': [
                 {
@@ -82,28 +82,27 @@
                 },
               ],
             }],
-            [ 'OS != "win" and icu_use_data_file_flag', {
+            [ 'icu_use_data_file_flag', {
               # Remove any assembly data file.
               'sources/': [['exclude', 'icudt46l_dat']],
               # Compile in the stub data symbol.
               'sources': ['source/stubdata/stubdata.c'],
+             
               # Make sure any binary depending on this gets the data file.
-              'link_settings': {
-                'target_conditions': [
-                  ['(OS == "mac" and _mac_bundle) or OS=="ios"', {
-                    'mac_bundle_resources': [
-                      'source/data/in/icudt46l.dat',
+              'conditions': [
+                ['OS=="ios"', {
+                  'mac_bundle_resources': [
+                    'source/data/in/icudtl.dat',
+                  ],
+                }, {
+                  'copies': [{
+                    'destination': '<(PRODUCT_DIR)',
+                    'files': [
+                      'source/data/in/icudtl.dat',
                     ],
-                  }, {
-                    'copies': [{
-                      'destination': '<(PRODUCT_DIR)',
-                      'files': [
-                        'source/data/in/icudt46l.dat',
-                      ],
-                    }],
                   }],
-                ],  # target_conditions
-              },  # link_settings
+                }],
+              ],  # target_conditions
             }],
           ],
           'target_conditions': [
diff --git a/source/data/in/icudt46l.dat b/source/data/in/icudtl.dat
similarity index 100%
rename from source/data/in/icudt46l.dat
rename to source/data/in/icudtl.dat
Binary files differ