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 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 linux_env.Append( | 504 linux_env.Append( |
505 # We need rt for clock_gettime. | 505 # We need rt for clock_gettime. |
506 LIBS = ['rt'], | 506 LIBS = ['rt'], |
507 | 507 |
508 ICU_LIBS = ['icu'], | 508 ICU_LIBS = ['icu'], |
509 ) | 509 ) |
510 | 510 |
511 # Build an "official" build (DCHECKs completely compiled out, etc). | 511 # Build an "official" build (DCHECKs completely compiled out, etc). |
512 if ARGUMENTS.get('OFFICIAL') == '1': | 512 if ARGUMENTS.get('OFFICIAL') == '1': |
513 linux_env.Append(CPPDEFINES=['OFFICIAL_BUILD']) | 513 linux_env.Append(CPPDEFINES=['OFFICIAL_BUILD']) |
| 514 # Make sure units of code and data go in their own section, and then GC them |
| 515 # in the linker to remove unreferenced data and code. Currently gold doesn't |
| 516 # support --gc-sections, so you'll have to build with the original GNU ld. |
| 517 linux_env.Append(CCFLAGS_OPTIMIZED=['-ffunction-sections', '-fdata-sections']) |
| 518 linux_env.Append(LINKFLAGS_OPTIMIZED=['-Wl,--gc-sections']) |
514 | 519 |
515 # Build with support for gcov when COVERAGE=1. | 520 # Build with support for gcov when COVERAGE=1. |
516 if ARGUMENTS.get('COVERAGE') == '1': | 521 if ARGUMENTS.get('COVERAGE') == '1': |
517 linux_env.Append(CCFLAGS=['-fprofile-arcs', '-ftest-coverage']) | 522 linux_env.Append(CCFLAGS=['-fprofile-arcs', '-ftest-coverage']) |
518 linux_env.Append(LINKFLAGS=['-fprofile-arcs']) | 523 linux_env.Append(LINKFLAGS=['-fprofile-arcs']) |
519 | 524 |
520 # Build with support for gprof when PROFILE=1. | 525 # Build with support for gprof when PROFILE=1. |
521 if ARGUMENTS.get('PROFILE') == '1': | 526 if ARGUMENTS.get('PROFILE') == '1': |
522 linux_env.Append(CCFLAGS=['-pg', '-g']) | 527 linux_env.Append(CCFLAGS=['-pg', '-g']) |
523 linux_env.Append(LINKFLAGS=['-pg']) | 528 linux_env.Append(LINKFLAGS=['-pg']) |
524 | 529 |
525 # Build with symbols (useful for opt builds, for example) when SYMBOLS=1. | 530 # 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. | |
527 if ARGUMENTS.get('SYMBOLS') == '1': | 531 if ARGUMENTS.get('SYMBOLS') == '1': |
528 linux_env.Append(CCFLAGS=['-g']) | 532 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']) | |
532 | 533 |
533 # Build shared libraries (useful for fast links) when SHARED=1. | 534 # Build shared libraries (useful for fast links) when SHARED=1. |
534 if ARGUMENTS.get('SHARED') == '1': | 535 if ARGUMENTS.get('SHARED') == '1': |
535 linux_env.Replace(COMPONENT_STATIC=False) | 536 linux_env.Replace(COMPONENT_STATIC=False) |
536 | 537 |
537 # Build with system-provided NSS and GTK. | 538 # Build with system-provided NSS and GTK. |
538 if root_env['PLATFORM'] in ['linux', 'linux2', 'posix']: | 539 if root_env['PLATFORM'] in ['linux', 'linux2', 'posix']: |
539 try: | 540 try: |
540 linux_env.ParseConfig('pkg-config --cflags --libs nss') | 541 linux_env.ParseConfig('pkg-config --cflags --libs nss') |
541 linux_env.ParseConfig('pkg-config --cflags --libs gtk+-2.0') | 542 linux_env.ParseConfig('pkg-config --cflags --libs gtk+-2.0') |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
823 'all_libraries', | 824 'all_libraries', |
824 'all_languages', | 825 'all_languages', |
825 'all_programs', | 826 'all_programs', |
826 'all_test_programs', | 827 'all_test_programs', |
827 ], projects = [p], | 828 ], projects = [p], |
828 COMPONENT_VS_PROJECT_SCRIPT_PATH=( | 829 COMPONENT_VS_PROJECT_SCRIPT_PATH=( |
829 'cd $$(ProjectDir)/$VS_PROJECT_TO_MAIN_DIR && hammer.bat'), | 830 'cd $$(ProjectDir)/$VS_PROJECT_TO_MAIN_DIR && hammer.bat'), |
830 ) | 831 ) |
831 | 832 |
832 # ------------------------------------------------------------------------- | 833 # ------------------------------------------------------------------------- |
OLD | NEW |