Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import os | 5 import os |
| 6 import shutil | 6 import shutil |
| 7 import sys | 7 import sys |
| 8 | 8 |
| 9 | 9 |
| 10 if sys.platform == 'win32': | 10 if sys.platform == 'win32': |
| (...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 445 excluded_warnings = [ | 445 excluded_warnings = [ |
| 446 # TODO: Clean up uses of ext/hash_map and remove this. | 446 # TODO: Clean up uses of ext/hash_map and remove this. |
| 447 # (see unordered_map and base/hash_tables.h) | 447 # (see unordered_map and base/hash_tables.h) |
| 448 '-Wno-deprecated', # Needed for using ext/hash_map on GCC 4.3 | 448 '-Wno-deprecated', # Needed for using ext/hash_map on GCC 4.3 |
| 449 ] | 449 ] |
| 450 linux_env.Append( | 450 linux_env.Append( |
| 451 BUILD_SCONSCRIPTS = [ | 451 BUILD_SCONSCRIPTS = [ |
| 452 '$LIBEVENT_DIR/libevent.scons', | 452 '$LIBEVENT_DIR/libevent.scons', |
| 453 ], | 453 ], |
| 454 CCFLAGS = ['-m32', '-pthread', '-march=i686', '-fno-exceptions'], | 454 CCFLAGS = ['-m32', '-pthread', '-march=i686', '-fno-exceptions'], |
| 455 # GCC will generate ident directives with the GCC version. Accumulate | |
| 456 # these all up and you end up with ~80K repeated in a .comment section. | |
| 457 CCFLAGS_OPTIMIZED = ['-fno-ident'], | |
| 455 CXXFLAGS = ['-Wall', '-Werror', '-march=i686'] + excluded_warnings, | 458 CXXFLAGS = ['-Wall', '-Werror', '-march=i686'] + excluded_warnings, |
| 456 LINKFLAGS = ['-m32', '-pthread'], | 459 LINKFLAGS = ['-m32', '-pthread'], |
| 457 ) | 460 ) |
| 458 | 461 |
| 459 linux_env.Replace( | 462 linux_env.Replace( |
| 460 # Linking of large files uses lots of RAM, so serialize links | 463 # Linking of large files uses lots of RAM, so serialize links |
| 461 # using the handy flock command from util-linux. | 464 # using the handy flock command from util-linux. |
| 462 LINK = 'flock $TARGET_ROOT/linker.lock ' + linux_env['LINK'], | 465 LINK = 'flock $TARGET_ROOT/linker.lock ' + linux_env['LINK'], |
| 463 | 466 |
| 464 # We have several cases where archives depend on each other in a cyclic | 467 # We have several cases where archives depend on each other in a cyclic |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 513 if ARGUMENTS.get('COVERAGE') == '1': | 516 if ARGUMENTS.get('COVERAGE') == '1': |
| 514 linux_env.Append(CCFLAGS=['-fprofile-arcs', '-ftest-coverage']) | 517 linux_env.Append(CCFLAGS=['-fprofile-arcs', '-ftest-coverage']) |
| 515 linux_env.Append(LINKFLAGS=['-fprofile-arcs']) | 518 linux_env.Append(LINKFLAGS=['-fprofile-arcs']) |
| 516 | 519 |
| 517 # Build with support for gprof when PROFILE=1. | 520 # Build with support for gprof when PROFILE=1. |
| 518 if ARGUMENTS.get('PROFILE') == '1': | 521 if ARGUMENTS.get('PROFILE') == '1': |
| 519 linux_env.Append(CCFLAGS=['-pg', '-g']) | 522 linux_env.Append(CCFLAGS=['-pg', '-g']) |
| 520 linux_env.Append(LINKFLAGS=['-pg']) | 523 linux_env.Append(LINKFLAGS=['-pg']) |
| 521 | 524 |
| 522 # Build with symbols (useful for opt builds, for example) when SYMBOLS=1. | 525 # Build with symbols (useful for opt builds, for example) when SYMBOLS=1. |
| 526 # Otherwise if we're building release, strip all symbols from our output. | |
| 523 if ARGUMENTS.get('SYMBOLS') == '1': | 527 if ARGUMENTS.get('SYMBOLS') == '1': |
| 524 linux_env.Append(CCFLAGS=['-g']) | 528 linux_env.Append(CCFLAGS=['-g']) |
| 529 else: | |
| 530 linux_env.Append(CCFLAGS_OPTIMIZED=['-ffunction-sections', '-fdata-sections']) | |
| 531 linux_env.Append(LINKFLAGS_OPTIMIZED=['-Wl,--gc-sections', '-s']) | |
|
Lei Zhang
2009/01/26 22:21:23
FYI, gold does not support --gc-sections.
| |
| 525 | 532 |
| 526 # Build shared libraries (useful for fast links) when SHARED=1. | 533 # Build shared libraries (useful for fast links) when SHARED=1. |
| 527 if ARGUMENTS.get('SHARED') == '1': | 534 if ARGUMENTS.get('SHARED') == '1': |
| 528 linux_env.Replace(COMPONENT_STATIC=False) | 535 linux_env.Replace(COMPONENT_STATIC=False) |
| 529 | 536 |
| 530 # Build with system-provided NSS and GTK. | 537 # Build with system-provided NSS and GTK. |
| 531 if root_env['PLATFORM'] in ['linux', 'linux2', 'posix']: | 538 if root_env['PLATFORM'] in ['linux', 'linux2', 'posix']: |
| 532 try: | 539 try: |
| 533 linux_env.ParseConfig('pkg-config --cflags --libs nss') | 540 linux_env.ParseConfig('pkg-config --cflags --libs nss') |
| 534 linux_env.ParseConfig('pkg-config --cflags --libs gtk+-2.0') | 541 linux_env.ParseConfig('pkg-config --cflags --libs gtk+-2.0') |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 816 'all_libraries', | 823 'all_libraries', |
| 817 'all_languages', | 824 'all_languages', |
| 818 'all_programs', | 825 'all_programs', |
| 819 'all_test_programs', | 826 'all_test_programs', |
| 820 ], projects = [p], | 827 ], projects = [p], |
| 821 COMPONENT_VS_PROJECT_SCRIPT_PATH=( | 828 COMPONENT_VS_PROJECT_SCRIPT_PATH=( |
| 822 'cd $$(ProjectDir)/$VS_PROJECT_TO_MAIN_DIR && hammer.bat'), | 829 'cd $$(ProjectDir)/$VS_PROJECT_TO_MAIN_DIR && hammer.bat'), |
| 823 ) | 830 ) |
| 824 | 831 |
| 825 # ------------------------------------------------------------------------- | 832 # ------------------------------------------------------------------------- |
| OLD | NEW |