Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / icu / icu.gyp
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 {
6   'includes': [
7     'icu.gypi',
8   ],
9   'variables': {
10     'use_system_icu%': 0,
11     'icu_use_data_file_flag%': 0,
12     'want_separate_host_toolset%': 1,
13   },
14   'target_defaults': {
15     'direct_dependent_settings': {
16       'defines': [
17         # Tell ICU to not insert |using namespace icu;| into its headers,
18         # so that chrome's source explicitly has to use |icu::|.
19         'U_USING_ICU_NAMESPACE=0',
20         # We don't use ICU plugins and dyload is only necessary for them.
21         # NaCl-related builds also fail looking for dlfcn.h when it's enabled.
22         'U_ENABLE_DYLOAD=0',
23       ],
24     },
25     'defines': [
26       'U_USING_ICU_NAMESPACE=0',
27       'HAVE_DLOPEN=0',
28       # Only build encoding coverters and detectors necessary for HTML5.
29       'UCONFIG_NO_NON_HTML5_CONVERSION=1',
30     ],
31     'conditions': [
32       ['component=="static_library"', {
33         'defines': [
34           'U_STATIC_IMPLEMENTATION',
35         ],
36       }],
37       ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \
38          or OS=="netbsd" or OS=="mac" or OS=="android" or OS=="qnx") and \
39         (target_arch=="arm" or target_arch=="ia32" or \
40          target_arch=="mipsel")', {
41         'target_conditions': [
42           ['_toolset=="host"', {
43             'cflags': [ '-m32' ],
44             'ldflags': [ '-m32' ],
45             'asflags': [ '-32' ],
46             'xcode_settings': {
47               'ARCHS': [ 'i386' ],
48             },
49           }],
50         ],
51       }],
52       ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \
53          or OS=="netbsd" or OS=="mac" or OS=="android" or OS=="qnx") and \
54         (target_arch=="arm64" or target_arch=="x64" or \
55          target_arch=="mipsel64")', {
56         'target_conditions': [
57           ['_toolset=="host"', {
58             'cflags': [ '-m64' ],
59             'ldflags': [ '-m64' ],
60             'asflags': [ '-64' ],
61             'xcode_settings': {
62               'ARCHS': [ 'x86_64' ],
63             },
64           }],
65         ],
66       }],
67     ],
68     'include_dirs': [
69       'source/common',
70       'source/i18n',
71     ],
72     'msvs_disabled_warnings': [4005, 4068, 4355, 4996, 4267],
73   },
74   'conditions': [
75     ['use_system_icu==0 or want_separate_host_toolset==1', {
76       'targets': [
77         {
78           'target_name': 'copy_icudtl_dat',
79           'type': 'none',
80           # icudtl.dat is the same for both host/target, so this only supports a
81           # single toolset. If a target requires that the .dat file be copied
82           # to the output directory, it should explicitly depend on this target
83           # with the host toolset (like copy_icudtl_dat#host).
84           'toolsets': [ 'host' ],
85           'copies': [{
86             'destination': '<(PRODUCT_DIR)',
87             'conditions': [
88               ['OS == "android"', {
89                 'files': [
90                   'android/icudtl.dat',
91                 ],
92               } , { # else: OS != android
93                 'files': [
94                   'source/data/in/icudtl.dat',
95                 ],
96               }],
97             ],
98           }],
99         },
100         {
101           'target_name': 'icudata',
102           'type': 'static_library',
103           'defines': [
104             'U_HIDE_DATA_SYMBOL',
105           ],
106           'sources': [
107              # These are hand-generated, but will do for now.  The linux
108              # version is an identical copy of the (mac) icudtl_dat.S file,
109              # modulo removal of the .private_extern and .const directives and
110              # with no leading underscore on the icudt52_dat symbol.
111              'android/icudtl_dat.S',
112              'linux/icudtl_dat.S',
113              'mac/icudtl_dat.S',
114           ],
115           'conditions': [
116             [ 'use_system_icu==1 and want_separate_host_toolset==1', {
117               'toolsets': ['host'],
118             }],
119             [ 'use_system_icu==0 and want_separate_host_toolset==1', {
120               'toolsets': ['host', 'target'],
121             }],
122             [ 'use_system_icu==0 and want_separate_host_toolset==0', {
123               'toolsets': ['target'],
124             }],
125             [ 'OS == "win" and icu_use_data_file_flag==0', {
126               'type': 'none',
127               'copies': [
128                 {
129                   'destination': '<(PRODUCT_DIR)',
130                   'files': [
131                     'windows/icudt.dll',
132                   ],
133                 },
134               ],
135             }],
136             [ 'icu_use_data_file_flag==1', {
137               # Remove any assembly data file.
138               'sources/': [['exclude', 'icudtl_dat']],
139               # Compile in the stub data symbol.
140               'sources': ['source/stubdata/stubdata.c'],
141
142               # Make sure any binary depending on this gets the data file.
143               'conditions': [
144                 ['OS != "ios"', {
145                   'dependencies': [
146                     'copy_icudtl_dat#host',
147                   ],
148                 } , { # else: OS=="ios"
149                   'link_settings': {
150                     'mac_bundle_resources': [
151                       'source/data/in/icudtl.dat',
152                     ],
153                   },
154                 }], # OS!=ios
155               ], # conditions
156             }], # icu_use_data_file_flag
157           ], # conditions
158           'target_conditions': [
159             [ 'OS == "win" or OS == "mac" or OS == "ios" or '
160               '(OS == "android" and (_toolset != "host" or host_os != "linux")) or '
161               '(OS == "qnx" and (_toolset == "host" and host_os != "linux"))', {
162               'sources!': ['linux/icudtl_dat.S'],
163             }],
164             [ 'OS != "android" or _toolset == "host"', {
165               'sources!': ['android/icudtl_dat.S'],
166             }],
167             [ 'OS != "mac" and OS != "ios" and '
168               '((OS != "android" and OS != "qnx") or '
169               '_toolset != "host" or host_os != "mac")', {
170               'sources!': ['mac/icudtl_dat.S'],
171             }],
172           ], # target_conditions
173         },
174         {
175           'target_name': 'icui18n',
176           'type': '<(component)',
177           'sources': [
178             '<@(icui18n_sources)',
179           ],
180           'defines': [
181             'U_I18N_IMPLEMENTATION',
182           ],
183           'dependencies': [
184             'icuuc',
185           ],
186           'direct_dependent_settings': {
187             'include_dirs': [
188               'source/i18n',
189             ],
190           },
191           'variables': {
192             'clang_warning_flags': [
193               # ICU uses its own deprecated functions.
194               '-Wno-deprecated-declarations',
195               # ICU prefers `a && b || c` over `(a && b) || c`.
196               '-Wno-logical-op-parentheses',
197               # ICU has some `unsigned < 0` checks.
198               '-Wno-tautological-compare',
199               # Looks like a real issue, see http://crbug.com/114660
200               '-Wno-return-type-c-linkage',
201             ],
202           },
203           # Since ICU wants to internally use its own deprecated APIs, don't
204           # complain about it.
205           'cflags': [
206             '-Wno-deprecated-declarations',
207           ],
208           'cflags_cc': [
209             '-frtti',
210           ],
211           'xcode_settings': {
212             'GCC_ENABLE_CPP_RTTI': 'YES',       # -frtti
213           },
214           'msvs_settings': {
215             'VCCLCompilerTool': {
216               'RuntimeTypeInfo': 'true',
217             },
218           },
219           'conditions': [
220             [ 'use_system_icu==1 and want_separate_host_toolset==1', {
221               'toolsets': ['host'],
222             }],
223             [ 'use_system_icu==0 and want_separate_host_toolset==1', {
224               'toolsets': ['host', 'target'],
225             }],
226             [ 'use_system_icu==0 and want_separate_host_toolset==0', {
227               'toolsets': ['target'],
228             }],
229             ['OS == "android" and clang==0', {
230                 # Disable sincos() optimization to avoid a linker error since
231                 # Android's math library doesn't have sincos().  Either
232                 # -fno-builtin-sin or -fno-builtin-cos works.
233                 'cflags': [
234                     '-fno-builtin-sin',
235                 ],
236             }],
237             [ 'OS == "win" and clang==1', {
238               # Note: General clang warnings should go in the
239               # clang_warning_flags block above.
240               'msvs_settings': {
241                 'VCCLCompilerTool': {
242                   'AdditionalOptions': [
243                     # See http://bugs.icu-project.org/trac/ticket/11122
244                     '-Wno-inline-new-delete',
245                     '-Wno-implicit-exception-spec-mismatch',
246                   ],
247                 },
248               },
249             }],
250           ], # conditions
251         },
252         {
253           'target_name': 'icuuc',
254           'type': '<(component)',
255           'sources': [
256             '<@(icuuc_sources)',
257           ],
258           'defines': [
259             'U_COMMON_IMPLEMENTATION',
260           ],
261           'dependencies': [
262             'icudata',
263           ],
264           'direct_dependent_settings': {
265             'include_dirs': [
266               'source/common',
267             ],
268             'conditions': [
269               [ 'component=="static_library"', {
270                 'defines': [
271                   'U_STATIC_IMPLEMENTATION',
272                 ],
273               }],
274             ],
275           },
276           'variables': {
277             'clang_warning_flags': [
278               # ICU uses its own deprecated functions.
279               '-Wno-deprecated-declarations',
280               # ICU prefers `a && b || c` over `(a && b) || c`.
281               '-Wno-logical-op-parentheses',
282               # ICU has some `unsigned < 0` checks.
283               '-Wno-tautological-compare',
284               # uresdata.c has switch(RES_GET_TYPE(x)) code. The
285               # RES_GET_TYPE macro returns an UResType enum, but some switch
286               # statement contains case values that aren't part of that
287               # enum (e.g. URES_TABLE32 which is in UResInternalType). This
288               # is on purpose.
289               '-Wno-switch',
290             ],
291           },
292           'cflags': [
293             # Since ICU wants to internally use its own deprecated APIs,
294             # don't complain about it.
295             '-Wno-deprecated-declarations',
296             '-Wno-unused-function',
297           ],
298           'cflags_cc': [
299             '-frtti',
300           ],
301           'xcode_settings': {
302             'GCC_ENABLE_CPP_RTTI': 'YES',       # -frtti
303           },
304           'msvs_settings': {
305             'VCCLCompilerTool': {
306               'RuntimeTypeInfo': 'true',
307             },
308           },
309           'all_dependent_settings': {
310             'msvs_settings': {
311               'VCLinkerTool': {
312                 'AdditionalDependencies': [
313                   'advapi32.lib',
314                 ],
315               },
316             },
317           },
318           'conditions': [
319             [ 'use_system_icu==1 and want_separate_host_toolset==1', {
320               'toolsets': ['host'],
321             }],
322             [ 'use_system_icu==0 and want_separate_host_toolset==1', {
323               'toolsets': ['host', 'target'],
324             }],
325             [ 'use_system_icu==0 and want_separate_host_toolset==0', {
326               'toolsets': ['target'],
327             }],
328             [ 'OS == "win" and icu_use_data_file_flag==0', {
329               'sources': [
330                 'source/stubdata/stubdata.c',
331               ],
332             }],
333             [ 'OS == "win" and clang==1', {
334               # Note: General clang warnings should go in the
335               # clang_warning_flags block above.
336               'msvs_settings': {
337                 'VCCLCompilerTool': {
338                   'AdditionalOptions': [
339                     # See http://bugs.icu-project.org/trac/ticket/11122
340                     '-Wno-inline-new-delete',
341                     '-Wno-implicit-exception-spec-mismatch',
342                   ],
343                 },
344               },
345             }],
346           ], # conditions
347         },
348       ], # targets
349     }],
350     ['use_system_icu==1', {
351       'targets': [
352         {
353           'target_name': 'system_icu',
354           'type': 'none',
355           'conditions': [
356             ['OS=="qnx"', {
357               'link_settings': {
358                 'libraries': [
359                   '-licui18n',
360                   '-licuuc',
361                 ],
362               },
363             }],
364             ['OS!="qnx"', {
365               'link_settings': {
366                 'ldflags': [
367                   '<!@(icu-config --ldflags)',
368                 ],
369                 'libraries': [
370                   '<!@(icu-config --ldflags-libsonly)',
371                 ],
372               },
373             }],
374           ],
375         },
376         {
377           'target_name': 'icudata',
378           'type': 'none',
379           'dependencies': ['system_icu'],
380           'export_dependent_settings': ['system_icu'],
381           'toolsets': ['target'],
382         },
383         {
384           'target_name': 'icui18n',
385           'type': 'none',
386           'dependencies': ['system_icu'],
387           'export_dependent_settings': ['system_icu'],
388           'variables': {
389             'headers_root_path': 'source/i18n',
390             'header_filenames': [
391               # This list can easily be updated using the command below:
392               # find third_party/icu/source/i18n/unicode -iname '*.h' \
393               # -printf "'%p',\n" | \
394               # sed -e 's|third_party/icu/source/i18n/||' | sort -u
395               'unicode/alphaindex.h',
396               'unicode/basictz.h',
397               'unicode/calendar.h',
398               'unicode/choicfmt.h',
399               'unicode/coleitr.h',
400               'unicode/coll.h',
401               'unicode/compactdecimalformat.h',
402               'unicode/curramt.h',
403               'unicode/currpinf.h',
404               'unicode/currunit.h',
405               'unicode/datefmt.h',
406               'unicode/dcfmtsym.h',
407               'unicode/decimfmt.h',
408               'unicode/dtfmtsym.h',
409               'unicode/dtitvfmt.h',
410               'unicode/dtitvinf.h',
411               'unicode/dtptngen.h',
412               'unicode/dtrule.h',
413               'unicode/fieldpos.h',
414               'unicode/fmtable.h',
415               'unicode/format.h',
416               'unicode/fpositer.h',
417               'unicode/gender.h',
418               'unicode/gregocal.h',
419               'unicode/locdspnm.h',
420               'unicode/measfmt.h',
421               'unicode/measunit.h',
422               'unicode/measure.h',
423               'unicode/msgfmt.h',
424               'unicode/numfmt.h',
425               'unicode/numsys.h',
426               'unicode/plurfmt.h',
427               'unicode/plurrule.h',
428               'unicode/rbnf.h',
429               'unicode/rbtz.h',
430               'unicode/regex.h',
431               'unicode/region.h',
432               'unicode/search.h',
433               'unicode/selfmt.h',
434               'unicode/simpletz.h',
435               'unicode/smpdtfmt.h',
436               'unicode/sortkey.h',
437               'unicode/stsearch.h',
438               'unicode/tblcoll.h',
439               'unicode/timezone.h',
440               'unicode/tmunit.h',
441               'unicode/tmutamt.h',
442               'unicode/tmutfmt.h',
443               'unicode/translit.h',
444               'unicode/tzfmt.h',
445               'unicode/tznames.h',
446               'unicode/tzrule.h',
447               'unicode/tztrans.h',
448               'unicode/ucal.h',
449               'unicode/ucoleitr.h',
450               'unicode/ucol.h',
451               'unicode/ucsdet.h',
452               'unicode/ucurr.h',
453               'unicode/udateintervalformat.h',
454               'unicode/udat.h',
455               'unicode/udatpg.h',
456               'unicode/udisplaycontext.h',
457               'unicode/uformattable.h',
458               'unicode/ugender.h',
459               'unicode/uldnames.h',
460               'unicode/ulocdata.h',
461               'unicode/umsg.h',
462               'unicode/unirepl.h',
463               'unicode/unum.h',
464               'unicode/unumsys.h',
465               'unicode/upluralrules.h',
466               'unicode/uregex.h',
467               'unicode/uregion.h',
468               'unicode/usearch.h',
469               'unicode/uspoof.h',
470               'unicode/utmscale.h',
471               'unicode/utrans.h',
472               'unicode/vtzone.h',
473             ],
474           },
475           'includes': [
476             '../../build/shim_headers.gypi',
477           ],
478           'toolsets': ['target'],
479         },
480         {
481           'target_name': 'icuuc',
482           'type': 'none',
483           'dependencies': ['system_icu'],
484           'export_dependent_settings': ['system_icu'],
485           'variables': {
486             'headers_root_path': 'source/common',
487             'header_filenames': [
488               # This list can easily be updated using the command below:
489               # find third_party/icu/source/common/unicode -iname '*.h' \
490               # -printf "'%p',\n" | \
491               # sed -e 's|third_party/icu/source/common/||' | sort -u
492               'unicode/appendable.h',
493               'unicode/brkiter.h',
494               'unicode/bytestream.h',
495               'unicode/bytestriebuilder.h',
496               'unicode/bytestrie.h',
497               'unicode/caniter.h',
498               'unicode/chariter.h',
499               'unicode/dbbi.h',
500               'unicode/docmain.h',
501               'unicode/dtintrv.h',
502               'unicode/enumset.h',
503               'unicode/errorcode.h',
504               'unicode/icudataver.h',
505               'unicode/icuplug.h',
506               'unicode/idna.h',
507               'unicode/listformatter.h',
508               'unicode/localpointer.h',
509               'unicode/locid.h',
510               'unicode/messagepattern.h',
511               'unicode/normalizer2.h',
512               'unicode/normlzr.h',
513               'unicode/parseerr.h',
514               'unicode/parsepos.h',
515               'unicode/platform.h',
516               'unicode/ptypes.h',
517               'unicode/putil.h',
518               'unicode/rbbi.h',
519               'unicode/rep.h',
520               'unicode/resbund.h',
521               'unicode/schriter.h',
522               'unicode/std_string.h',
523               'unicode/strenum.h',
524               'unicode/stringpiece.h',
525               'unicode/stringtriebuilder.h',
526               'unicode/symtable.h',
527               'unicode/ubidi.h',
528               'unicode/ubrk.h',
529               'unicode/ucasemap.h',
530               'unicode/ucat.h',
531               'unicode/uchar.h',
532               'unicode/ucharstriebuilder.h',
533               'unicode/ucharstrie.h',
534               'unicode/uchriter.h',
535               'unicode/uclean.h',
536               'unicode/ucnv_cb.h',
537               'unicode/ucnv_err.h',
538               'unicode/ucnv.h',
539               'unicode/ucnvsel.h',
540               'unicode/uconfig.h',
541               'unicode/udata.h',
542               'unicode/uenum.h',
543               'unicode/uidna.h',
544               'unicode/uiter.h',
545               'unicode/uloc.h',
546               'unicode/umachine.h',
547               'unicode/umisc.h',
548               'unicode/unifilt.h',
549               'unicode/unifunct.h',
550               'unicode/unimatch.h',
551               'unicode/uniset.h',
552               'unicode/unistr.h',
553               'unicode/unorm2.h',
554               'unicode/unorm.h',
555               'unicode/uobject.h',
556               'unicode/urename.h',
557               'unicode/urep.h',
558               'unicode/ures.h',
559               'unicode/uscript.h',
560               'unicode/uset.h',
561               'unicode/usetiter.h',
562               'unicode/ushape.h',
563               'unicode/usprep.h',
564               'unicode/ustring.h',
565               'unicode/ustringtrie.h',
566               'unicode/utext.h',
567               'unicode/utf16.h',
568               'unicode/utf32.h',
569               'unicode/utf8.h',
570               'unicode/utf.h',
571               'unicode/utf_old.h',
572               'unicode/utrace.h',
573               'unicode/utypes.h',
574               'unicode/uvernum.h',
575               'unicode/uversion.h',
576             ],
577           },
578           'includes': [
579             '../../build/shim_headers.gypi',
580           ],
581           'toolsets': ['target'],
582         },
583       ], # targets
584     }],
585   ], # conditions
586 }