| OLD | NEW |
| 1 # Copyright 2009, Google Inc. | 1 # Copyright 2009, Google Inc. |
| 2 # All rights reserved. | 2 # All rights reserved. |
| 3 # | 3 # |
| 4 # Redistribution and use in source and binary forms, with or without | 4 # Redistribution and use in source and binary forms, with or without |
| 5 # modification, are permitted provided that the following conditions are | 5 # modification, are permitted provided that the following conditions are |
| 6 # met: | 6 # met: |
| 7 # | 7 # |
| 8 # * Redistributions of source code must retain the above copyright | 8 # * Redistributions of source code must retain the above copyright |
| 9 # notice, this list of conditions and the following disclaimer. | 9 # notice, this list of conditions and the following disclaimer. |
| 10 # * Redistributions in binary form must reproduce the above | 10 # * Redistributions in binary form must reproduce the above |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 | 390 |
| 391 def MakeObject(env, source, extra_defines): | 391 def MakeObject(env, source, extra_defines): |
| 392 base, ext = os.path.splitext(source) | 392 base, ext = os.path.splitext(source) |
| 393 return env.ComponentObject(base, '$ICU38_DIR/' + source, | 393 return env.ComponentObject(base, '$ICU38_DIR/' + source, |
| 394 CPPDEFINES = env['CPPDEFINES'] + extra_defines) | 394 CPPDEFINES = env['CPPDEFINES'] + extra_defines) |
| 395 | 395 |
| 396 | 396 |
| 397 | 397 |
| 398 if CombinedLib: | 398 if CombinedLib: |
| 399 | 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'] |
| 400 # These empirically fail to build when U_COMMON_IMPLEMENTATION | 408 # These empirically fail to build when U_COMMON_IMPLEMENTATION |
| 401 # isn't defined in addition to U_COMBINED_IMPLEMENTATION. Remove | 409 # isn't defined in addition to U_COMBINED_IMPLEMENTATION. Remove |
| 402 # them from the source file list and re-append them with Nodes | 410 # them from the source file list and re-append them with Nodes |
| 403 # for custom-built object files with both defined. | 411 # for custom-built object files with both defined. |
| 404 | 412 |
| 405 need_common_implementation = [ | 413 need_common_implementation = [ |
| 406 'source/common/ubidi.c', | 414 'source/common/ubidi.c', |
| 407 'source/common/ubidiln.c', | 415 'source/common/ubidiln.c', |
| 408 ] | 416 ] |
| 409 | 417 |
| 410 objects = [] | 418 objects = [] |
| 411 for n in need_common_implementation: | 419 for n in need_common_implementation: |
| 412 common_input_files.remove(n) | 420 common_input_files.remove(n) |
| 413 o = MakeObject(env, n, ['U_COMMON_IMPLEMENTATION', | 421 o = MakeObject(env, n, ['U_COMMON_IMPLEMENTATION'] + combined_flag) |
| 414 'U_COMBINED_IMPLEMENTATION']) | |
| 415 objects.append(o) | 422 objects.append(o) |
| 416 | 423 |
| 417 sources = common_input_files + i18n_input_files + stubdata_input_files | 424 sources = common_input_files + i18n_input_files + stubdata_input_files |
| 418 objects += [MakeObject(env, n, ['U_COMBINED_IMPLEMENTATION']) | 425 objects += [MakeObject(env, n, combined_flag) for n in sources] |
| 419 for n in sources] | |
| 420 | 426 |
| 421 icu_lib = env.ComponentLibrary('icu', objects); | 427 icu_lib = env.ComponentLibrary('icu', objects); |
| 422 | 428 |
| 423 else: | 429 else: |
| 424 | 430 |
| 425 common_objects = [MakeObject(env, n, ['U_COMMON_IMPLEMENTATION']) | 431 common_objects = [MakeObject(env, n, ['U_COMMON_IMPLEMENTATION']) |
| 426 for n in common_input_files] | 432 for n in common_input_files] |
| 427 icu_lib = env.ComponentLibrary('icuuc', common_objects) | 433 icu_lib = env.ComponentLibrary('icuuc', common_objects) |
| 428 | 434 |
| 429 i18n_objects = [MakeObject(env, n, ['U_I18N_IMPLEMENTATION']) | 435 i18n_objects = [MakeObject(env, n, ['U_I18N_IMPLEMENTATION']) |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 icu_data = None | 484 icu_data = None |
| 479 | 485 |
| 480 # The ICU library isn't useful without the data properly installed. | 486 # The ICU library isn't useful without the data properly installed. |
| 481 if env.Bit('windows'): | 487 if env.Bit('windows'): |
| 482 icu_data = env.Replicate('$ARTIFACTS_DIR', 'icudt38.dll') | 488 icu_data = env.Replicate('$ARTIFACTS_DIR', 'icudt38.dll') |
| 483 else: | 489 else: |
| 484 icu_data = env.Replicate('$ARTIFACTS_DIR', | 490 icu_data = env.Replicate('$ARTIFACTS_DIR', |
| 485 '$ICU38_DIR/source/data/in/icudt38l.dat') | 491 '$ICU38_DIR/source/data/in/icudt38l.dat') |
| 486 | 492 |
| 487 env.Requires(icu_lib, icu_data) | 493 env.Requires(icu_lib, icu_data) |
| OLD | NEW |