Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Side by Side Diff: base/icu38_o3d.scons

Issue 354011: This change kills the SCons build, since we have switched completely... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/o3d/
Patch Set: Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/build.scons ('k') | bitmap/build.scons » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Copyright 2009, Google Inc.
2 # All rights reserved.
3 #
4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions are
6 # met:
7 #
8 # * Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer.
10 # * Redistributions in binary form must reproduce the above
11 # copyright notice, this list of conditions and the following disclaimer
12 # in the documentation and/or other materials provided with the
13 # distribution.
14 # * Neither the name of Google Inc. nor the names of its
15 # contributors may be used to endorse or promote products derived from
16 # this software without specific prior written permission.
17 #
18 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
30 #
31 # This file is based on the icu38.scons file from the Chrome project,
32 # Copyright (c) 2006-2008 The Chromium Authors.
33
34 # Variables to control what does or doesn't get built here:
35 #
36 # CombinedLib
37 # When True, builds a combined libicu.a (or icu.lib) containing
38 # the common, i18n, stubdata and toolutil parts of ICU. When
39 # False, builds those as separate libraries.
40 #
41 # GeneratedDataLib
42 # When True, specifies that we want to build a libicudata.a
43 # (or icudata.lib) library containing the data. When False,
44 # we copy out the icudt38l.dat file or the Chromium icudt38.dll
45 # file.
46 #
47 # Note that we've only verified the behavior that each platform
48 # needs to build the way it currently wants, so don't expect that
49 # you can just change the way a given platform builds without maybe
50 # having to fix things. For example, attempts to set GenerateDataLib
51 # on Windows will need to fix problems executing the utilities that
52 # handle the generation.
53
54 import os
55
56 CombinedLib = True
57 GenerateDataLib = False
58
59 Import('env')
60
61 env = env.Clone(
62 GENERATED_DIR = env.Dir('$ICU38_DIR/generated'),
63 GENCCODE = env.File('$ICU38_DIR/generated/genccode$PROGSUFFIX'),
64 ICUPKG = env.File('$ICU38_DIR/generated/icupkg$PROGSUFFIX'),
65 )
66
67 env.ApplySConscript([
68 '$CHROME_SRC_DIR/build/external_code.scons',
69 ])
70
71 env.Prepend(
72 CPPPATH = [
73 '$ICU38_DIR/source/common',
74 '$ICU38_DIR/public/common',
75 '$ICU38_DIR/source/i18n',
76 '$ICU38_DIR/public/i18n',
77 '$ICU38_DIR/source/tools/toolutil',
78 ],
79 CPPDEFINES = [
80 'U_STATIC_IMPLEMENTATION',
81 ],
82 )
83
84 if env.Bit('mac'):
85 env.FilterOut(CCFLAGS=['-Werror'],
86 CPPDEFINES=['DEBUG'])
87 env['GENCCODE_NAME'] = 'icudt38l'
88 env['GENCCODE_FLAGS'] = '-a gcc-darwin -n $GENCCODE_NAME -e icudt38'
89 env['GENCCODE_SUFFIX'] = '.s'
90
91 if env.Bit('linux'):
92 env['GENCCODE_NAME'] = 'icudt38l'
93 env['GENCCODE_FLAGS'] = '-a gcc -n $GENCCODE_NAME -e icudt38'
94 env['GENCCODE_SUFFIX'] = '.s'
95
96 if env.Bit('windows'):
97 env['GENCCODE_NAME'] = 'icudt38'
98 env['GENCCODE_FLAGS'] = '-e icudt38'
99 env['GENCCODE_SUFFIX'] = '.c'
100
101 if env.Bit('windows'):
102 # /Wd4996 to silence warning about strncpy
103 env.Append(CCFLAGS = ['/WX', '/wd4996'])
104 else:
105 env.Append(
106 CCFLAGS = [
107 # TODO: fix ICU to not depend on this flag.
108 '-fno-strict-aliasing',
109
110 '-Wno-parentheses',
111
112 # See uprv_UnicodeStringDummy at end of source/common/unistr.cpp.
113 '-Wno-unused-function',
114 ]
115 )
116
117 if 'WIN32_LEAN_AND_MEAN' in env['CPPDEFINES']:
118 env['CPPDEFINES'].remove('WIN32_LEAN_AND_MEAN')
119
120 common_input_files = [
121 'source/common/bmpset.cpp',
122 'source/common/brkeng.cpp',
123 'source/common/brkiter.cpp',
124 'source/common/caniter.cpp',
125 'source/common/chariter.cpp',
126 'source/common/cmemory.c',
127 'source/common/cstring.c',
128 'source/common/cwchar.c',
129 'source/common/dictbe.cpp',
130 'source/common/locbased.cpp',
131 'source/common/locid.cpp',
132 'source/common/locmap.c',
133 'source/common/locutil.cpp',
134 'source/common/normlzr.cpp',
135 'source/common/parsepos.cpp',
136 'source/common/propname.cpp',
137 'source/common/punycode.c',
138 'source/common/putil.c',
139 'source/common/rbbi.cpp',
140 'source/common/rbbidata.cpp',
141 'source/common/rbbinode.cpp',
142 'source/common/rbbirb.cpp',
143 'source/common/rbbiscan.cpp',
144 'source/common/rbbisetb.cpp',
145 'source/common/rbbistbl.cpp',
146 'source/common/rbbitblb.cpp',
147 'source/common/resbund.cpp',
148 'source/common/resbund_cnv.cpp',
149 'source/common/ruleiter.cpp',
150 'source/common/schriter.cpp',
151 'source/common/serv.cpp',
152 'source/common/servlk.cpp',
153 'source/common/servlkf.cpp',
154 'source/common/servls.cpp',
155 'source/common/servnotf.cpp',
156 'source/common/servrbf.cpp',
157 'source/common/servslkf.cpp',
158 'source/common/triedict.cpp',
159 'source/common/uarrsort.c',
160 'source/common/ubidi.c',
161 'source/common/ubidi_props.c',
162 'source/common/ubidiln.c',
163 'source/common/ubidiwrt.c',
164 'source/common/ubrk.cpp',
165 'source/common/ucase.c',
166 'source/common/ucasemap.c',
167 'source/common/ucat.c',
168 'source/common/uchar.c',
169 'source/common/uchriter.cpp',
170 'source/common/ucln_cmn.c',
171 'source/common/ucmndata.c',
172 'source/common/ucnv.c',
173 'source/common/ucnv_bld.c',
174 'source/common/ucnv_cb.c',
175 'source/common/ucnv_cnv.c',
176 'source/common/ucnv_err.c',
177 'source/common/ucnv_ext.c',
178 'source/common/ucnv_io.c',
179 'source/common/ucnv_lmb.c',
180 'source/common/ucnv_set.c',
181 'source/common/ucnv_u16.c',
182 'source/common/ucnv_u32.c',
183 'source/common/ucnv_u7.c',
184 'source/common/ucnv_u8.c',
185 'source/common/ucnv2022.c',
186 'source/common/ucnvbocu.c',
187 'source/common/ucnvdisp.c',
188 'source/common/ucnvhz.c',
189 'source/common/ucnvisci.c',
190 'source/common/ucnvlat1.c',
191 'source/common/ucnvmbcs.c',
192 'source/common/ucnvscsu.c',
193 'source/common/ucol_swp.c',
194 'source/common/udata.c',
195 'source/common/udatamem.c',
196 'source/common/udataswp.c',
197 'source/common/uenum.c',
198 'source/common/uhash.c',
199 'source/common/uhash_us.cpp',
200 'source/common/uidna.cpp',
201 'source/common/uinit.c',
202 'source/common/uinvchar.c',
203 'source/common/uiter.cpp',
204 'source/common/uloc.c',
205 'source/common/umapfile.c',
206 'source/common/umath.c',
207 'source/common/umutex.c',
208 'source/common/unames.c',
209 'source/common/unifilt.cpp',
210 'source/common/unifunct.cpp',
211 'source/common/uniset.cpp',
212 'source/common/uniset_props.cpp',
213 'source/common/unisetspan.cpp',
214 'source/common/unistr.cpp',
215 'source/common/unistr_case.cpp',
216 'source/common/unistr_cnv.cpp',
217 'source/common/unistr_props.cpp',
218 'source/common/unorm.cpp',
219 'source/common/unorm_it.c',
220 'source/common/unormcmp.cpp',
221 'source/common/uobject.cpp',
222 'source/common/uprops.c',
223 'source/common/ures_cnv.c',
224 'source/common/uresbund.c',
225 'source/common/uresdata.c',
226 'source/common/usc_impl.c',
227 'source/common/uscript.c',
228 'source/common/uset.cpp',
229 'source/common/uset_props.cpp',
230 'source/common/usetiter.cpp',
231 'source/common/ushape.c',
232 'source/common/usprep.cpp',
233 'source/common/ustack.cpp',
234 'source/common/ustr_cnv.c',
235 'source/common/ustr_wcs.c',
236 'source/common/ustrcase.c',
237 'source/common/ustrenum.cpp',
238 'source/common/ustrfmt.c',
239 'source/common/ustring.c',
240 'source/common/ustrtrns.c',
241 'source/common/utext.cpp',
242 'source/common/utf_impl.c',
243 'source/common/util.cpp',
244 'source/common/util_props.cpp',
245 'source/common/utrace.c',
246 'source/common/utrie.c',
247 'source/common/utypes.c',
248 'source/common/uvector.cpp',
249 'source/common/uvectr32.cpp',
250 'source/common/wintz.c',
251 ]
252
253 i18n_input_files = [
254 'source/i18n/anytrans.cpp',
255 'source/i18n/astro.cpp',
256 'source/i18n/basictz.cpp',
257 'source/i18n/bocsu.c',
258 'source/i18n/buddhcal.cpp',
259 'source/i18n/calendar.cpp',
260 'source/i18n/casetrn.cpp',
261 'source/i18n/choicfmt.cpp',
262 'source/i18n/coleitr.cpp',
263 'source/i18n/coll.cpp',
264 'source/i18n/cpdtrans.cpp',
265 'source/i18n/csdetect.cpp',
266 'source/i18n/csmatch.cpp',
267 'source/i18n/csr2022.cpp',
268 'source/i18n/csrecog.cpp',
269 'source/i18n/csrmbcs.cpp',
270 'source/i18n/csrsbcs.cpp',
271 'source/i18n/csrucode.cpp',
272 'source/i18n/csrutf8.cpp',
273 'source/i18n/curramt.cpp',
274 'source/i18n/currfmt.cpp',
275 'source/i18n/currunit.cpp',
276 'source/i18n/datefmt.cpp',
277 'source/i18n/dcfmtsym.cpp',
278 'source/i18n/decimfmt.cpp',
279 'source/i18n/digitlst.cpp',
280 'source/i18n/dtfmtsym.cpp',
281 'source/i18n/dtrule.cpp',
282 'source/i18n/esctrn.cpp',
283 'source/i18n/fmtable.cpp',
284 'source/i18n/fmtable_cnv.cpp',
285 'source/i18n/format.cpp',
286 'source/i18n/funcrepl.cpp',
287 'source/i18n/gregocal.cpp',
288 'source/i18n/gregoimp.cpp',
289 'source/i18n/hebrwcal.cpp',
290 'source/i18n/indiancal.cpp',
291 'source/i18n/inputext.cpp',
292 'source/i18n/islamcal.cpp',
293 'source/i18n/japancal.cpp',
294 'source/i18n/measfmt.cpp',
295 'source/i18n/measure.cpp',
296 'source/i18n/msgfmt.cpp',
297 'source/i18n/name2uni.cpp',
298 'source/i18n/nfrs.cpp',
299 'source/i18n/nfrule.cpp',
300 'source/i18n/nfsubs.cpp',
301 'source/i18n/nortrans.cpp',
302 'source/i18n/nultrans.cpp',
303 'source/i18n/numfmt.cpp',
304 'source/i18n/olsontz.cpp',
305 'source/i18n/persncal.cpp',
306 'source/i18n/plurfmt.cpp',
307 'source/i18n/plurrule.cpp',
308 'source/i18n/quant.cpp',
309 'source/i18n/rbnf.cpp',
310 'source/i18n/rbt.cpp',
311 'source/i18n/rbt_data.cpp',
312 'source/i18n/rbt_pars.cpp',
313 'source/i18n/rbt_rule.cpp',
314 'source/i18n/rbt_set.cpp',
315 'source/i18n/rbtz.cpp',
316 'source/i18n/regexcmp.cpp',
317 'source/i18n/regexst.cpp',
318 'source/i18n/reldtfmt.cpp',
319 'source/i18n/rematch.cpp',
320 'source/i18n/remtrans.cpp',
321 'source/i18n/repattrn.cpp',
322 'source/i18n/search.cpp',
323 'source/i18n/simpletz.cpp',
324 'source/i18n/smpdtfmt.cpp',
325 'source/i18n/sortkey.cpp',
326 'source/i18n/strmatch.cpp',
327 'source/i18n/strrepl.cpp',
328 'source/i18n/stsearch.cpp',
329 'source/i18n/taiwncal.cpp',
330 'source/i18n/tblcoll.cpp',
331 'source/i18n/timezone.cpp',
332 'source/i18n/titletrn.cpp',
333 'source/i18n/tolowtrn.cpp',
334 'source/i18n/toupptrn.cpp',
335 'source/i18n/translit.cpp',
336 'source/i18n/transreg.cpp',
337 'source/i18n/tridpars.cpp',
338 'source/i18n/tzrule.cpp',
339 'source/i18n/tztrans.cpp',
340 'source/i18n/ucal.cpp',
341 'source/i18n/ucln_in.c',
342 'source/i18n/ucol.cpp',
343 'source/i18n/ucol_bld.cpp',
344 'source/i18n/ucol_cnt.cpp',
345 'source/i18n/ucol_elm.cpp',
346 'source/i18n/ucol_res.cpp',
347 'source/i18n/ucol_sit.cpp',
348 'source/i18n/ucol_tok.cpp',
349 'source/i18n/ucol_wgt.c',
350 'source/i18n/ucoleitr.cpp',
351 'source/i18n/ucsdet.cpp',
352 'source/i18n/ucurr.cpp',
353 'source/i18n/udat.cpp',
354 'source/i18n/ulocdata.c',
355 'source/i18n/umsg.cpp',
356 'source/i18n/unesctrn.cpp',
357 'source/i18n/uni2name.cpp',
358 'source/i18n/unum.cpp',
359 'source/i18n/uregex.cpp',
360 'source/i18n/uregexc.cpp',
361 'source/i18n/usearch.cpp',
362 'source/i18n/utmscale.c',
363 'source/i18n/utrans.cpp',
364 'source/i18n/vtzone.cpp',
365 'source/i18n/windtfmt.cpp',
366 'source/i18n/winnmfmt.cpp',
367 ]
368
369 stubdata_input_files = [
370 'source/stubdata/stubdata.c',
371 ]
372
373 toolutil_input_files = [
374 'source/tools/toolutil/filestrm.c',
375 'source/tools/toolutil/package.cpp',
376 'source/tools/toolutil/pkgitems.cpp',
377 'source/tools/toolutil/propsvec.c',
378 'source/tools/toolutil/swapimpl.cpp',
379 'source/tools/toolutil/toolutil.c',
380 'source/tools/toolutil/toolutil.vcproj',
381 'source/tools/toolutil/ucbuf.c',
382 'source/tools/toolutil/ucm.c',
383 'source/tools/toolutil/ucmstate.c',
384 'source/tools/toolutil/unewdata.c',
385 'source/tools/toolutil/uoptions.c',
386 'source/tools/toolutil/uparse.c',
387 'source/tools/toolutil/writesrc.c',
388 'source/tools/toolutil/xmlparser.cpp',
389 ]
390
391 def MakeObject(env, source, extra_defines):
392 base, ext = os.path.splitext(source)
393 return env.ComponentObject(base, '$ICU38_DIR/' + source,
394 CPPDEFINES = env['CPPDEFINES'] + extra_defines)
395
396
397
398 if CombinedLib:
399
400 if env.Bit('linux'):
401 # U_STATIC_IMPLEMENTATION gets overridden by U_COMBINED_IMPLEMENTATION,
402 # which on linux causes all the symbols to be exported from the shared
403 # library, conflicting with the browser's definition if it uses icu as well
404 # (e.g. Chrome).
405 combined_flag = []
406 else:
407 combined_flag = ['U_COMBINED_IMPLEMENTATION']
408 # These empirically fail to build when U_COMMON_IMPLEMENTATION
409 # isn't defined in addition to U_COMBINED_IMPLEMENTATION. Remove
410 # them from the source file list and re-append them with Nodes
411 # for custom-built object files with both defined.
412
413 need_common_implementation = [
414 'source/common/ubidi.c',
415 'source/common/ubidiln.c',
416 ]
417
418 objects = []
419 for n in need_common_implementation:
420 common_input_files.remove(n)
421 o = MakeObject(env, n, ['U_COMMON_IMPLEMENTATION'] + combined_flag)
422 objects.append(o)
423
424 sources = common_input_files + i18n_input_files + stubdata_input_files
425 objects += [MakeObject(env, n, combined_flag) for n in sources]
426
427 icu_lib = env.ComponentLibrary('icu', objects);
428
429 else:
430
431 common_objects = [MakeObject(env, n, ['U_COMMON_IMPLEMENTATION'])
432 for n in common_input_files]
433 icu_lib = env.ComponentLibrary('icuuc', common_objects)
434
435 i18n_objects = [MakeObject(env, n, ['U_I18N_IMPLEMENTATION'])
436 for n in i18n_input_files]
437 env.ComponentLibrary('icui18n', i18n_objects)
438
439 stubdata_objects = [MakeObject(env, n, []) for n in stubdata_input_files]
440 env.ComponentLibrary('icudata_stub', stubdata_objects)
441
442 toolutil_objects = [MakeObject(env, n, ['U_TOOLUTIL_IMPLEMENTATION'])
443 for n in toolutil_input_files]
444
445 env.ComponentLibrary('icutu', toolutil_objects)
446
447
448 if GenerateDataLib:
449
450 icudata_lst = env.Command(['$GENERATED_DIR/icudata.lst',
451 '$GENERATED_DIR/icudt38l/ucadata.icu'],
452 ['source/data/in/icudt38l.dat'],
453 ('$ICUPKG -d ${TARGETS[1].dir} --list -x "*"'
454 ' $SOURCE > $TARGET'))
455 env.Depends(icudata_lst, '$ICUPKG')
456
457 icudt38_dat = env.Command(['$GENERATED_DIR/${GENCCODE_NAME}.dat'],
458 icudata_lst,
459 ('$ICUPKG -tl -c -s ${SOURCES[1].dir}'
460 ' -a $SOURCE new $TARGET'))
461 env.Depends(icudt38_dat, '$ICUPKG')
462
463 icudt38_src = env.Command(
464 '$GENERATED_DIR/${GENCCODE_NAME}_dat${GENCCODE_SUFFIX}',
465 icudt38_dat,
466 '$GENCCODE $GENCCODE_FLAGS -d ${TARGET.dir} $SOURCE')
467 env.Depends(icudt38_src, '$GENCCODE')
468
469 icu_data = env.ComponentLibrary('icudata', icudt38_src)
470
471 if CombinedLib:
472 lib_list = ['icu']
473 else:
474 lib_list = ['icui18n', 'icutu', 'icuuc', 'icudata_stub']
475
476 env_tools = env.Clone(LIBS = lib_list)
477
478 env_tools.Program(env['GENCCODE'],
479 '$ICU38_DIR/source/tools/genccode/genccode.c')
480 env_tools.Program(env['ICUPKG'], '$ICU38_DIR/source/tools/icupkg/icupkg.cpp')
481
482 else:
483
484 icu_data = None
485
486 # The ICU library isn't useful without the data properly installed.
487 if env.Bit('windows'):
488 icu_data = env.Replicate('$ARTIFACTS_DIR', 'icudt38.dll')
489 else:
490 icu_data = env.Replicate('$ARTIFACTS_DIR',
491 '$ICU38_DIR/source/data/in/icudt38l.dat')
492
493 env.Requires(icu_lib, icu_data)
OLDNEW
« no previous file with comments | « base/build.scons ('k') | bitmap/build.scons » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698