diff options
author | Andras Becsi <andras.becsi@digia.com> | 2014-03-18 13:16:26 +0100 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2014-03-20 15:55:39 +0100 |
commit | 3f0f86b0caed75241fa71c95a5d73bc0164348c5 (patch) | |
tree | 92b9fb00f2e9e90b0be2262093876d4f43b6cd13 /chromium/build | |
parent | e90d7c4b152c56919d963987e2503f9909a666d2 (diff) | |
download | qtwebengine-chromium-3f0f86b0caed75241fa71c95a5d73bc0164348c5.tar.gz |
Update to new stable branch 1750
This also includes an updated ninja and chromium dependencies
needed on Windows.
Change-Id: Icd597d80ed3fa4425933c9f1334c3c2e31291c42
Reviewed-by: Zoltan Arvai <zarvai@inf.u-szeged.hu>
Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
Diffstat (limited to 'chromium/build')
65 files changed, 4557 insertions, 1175 deletions
diff --git a/chromium/build/all.gyp b/chromium/build/all.gyp index af20d05d051..0942a1c8c1d 100644 --- a/chromium/build/all.gyp +++ b/chromium/build/all.gyp @@ -12,9 +12,11 @@ 'some.gyp:*', '../base/base.gyp:*', '../chrome/chrome.gyp:*', + '../components/components.gyp:*', + '../components/components_tests.gyp:*', '../content/content.gyp:*', + '../content/content_shell_and_tests.gyp:*', '../crypto/crypto.gyp:*', - '../mojo/mojo.gyp:*', '../net/net.gyp:*', '../sdch/sdch.gyp:*', '../sql/sql.gyp:*', @@ -25,6 +27,7 @@ '../third_party/libxml/libxml.gyp:*', '../third_party/sqlite/sqlite.gyp:*', '../third_party/zlib/zlib.gyp:*', + '../ui/accessibility/accessibility.gyp:*', '../ui/snapshot/snapshot.gyp:*', '../ui/ui.gyp:*', '../url/url.gyp:*', @@ -33,15 +36,17 @@ ['OS!="ios"', { 'dependencies': [ '../cc/cc_tests.gyp:*', - '../components/components.gyp:*', '../device/bluetooth/bluetooth.gyp:*', '../device/device_tests.gyp:*', '../device/usb/usb.gyp:*', + '../gin/gin.gyp:*', '../gpu/gpu.gyp:*', '../gpu/tools/tools.gyp:*', '../ipc/ipc.gyp:*', '../jingle/jingle.gyp:*', + '../media/cast/cast.gyp:*', '../media/media.gyp:*', + '../mojo/mojo.gyp:*', '../ppapi/ppapi.gyp:*', '../ppapi/ppapi_internal.gyp:*', '../printing/printing.gyp:*', @@ -62,15 +67,22 @@ '../third_party/qcms/qcms.gyp:*', '../third_party/re2/re2.gyp:re2', '../third_party/WebKit/public/all.gyp:*', + '../tools/gn/gn.gyp:*', '../tools/perf/clear_system_cache/clear_system_cache.gyp:*', '../v8/tools/gyp/v8.gyp:*', + '../webkit/glue/webkit_glue.gyp:*', '../webkit/renderer/compositor_bindings/compositor_bindings_tests.gyp:*', - '../webkit/support/webkit_support.gyp:*', '<(libjpeg_gyp_path):*', ], }, { # 'OS=="ios"' 'dependencies': [ '../ios/ios.gyp:*', + '../ui/ui_unittests.gyp:ui_unittests', + ], + }], + ['OS!="android" and OS!="ios"', { + 'dependencies': [ + '../chrome/tools/profile_reset/jtl_compiler.gyp:*', ], }], ['os_posix==1 and OS!="android" and OS!="ios"', { @@ -112,6 +124,11 @@ '../third_party/mtpd/mtpd.gyp:*', ], }], + ['enable_ipc_fuzzer==1', { + 'dependencies': [ + '../tools/ipc_fuzzer/ipc_fuzzer.gyp:*', + ], + }], ], }], ['use_x11==1', { @@ -136,17 +153,16 @@ 'dependencies': [ # TODO(jschuh) Enable Win64 Memory Watcher. crbug.com/176877 '../tools/memory_watcher/memory_watcher.gyp:*', - # TODO(jschuh) Enable Win64 Chrome Frame. crbug.com/176875 - '../chrome_frame/chrome_frame.gyp:*', ], }], ], 'dependencies': [ + '../chrome_elf/chrome_elf.gyp:*', '../cloud_print/cloud_print.gyp:*', '../courgette/courgette.gyp:*', '../rlz/rlz.gyp:*', '../sandbox/sandbox.gyp:*', - '../third_party/angle_dx11/src/build_angle.gyp:*', + '<(angle_path)/src/build_angle.gyp:*', '../third_party/bspatch/bspatch.gyp:*', ], }, { @@ -186,6 +202,11 @@ '../ui/app_list/app_list.gyp:*', ], }], + ['OS!="android" and OS!="ios"', { + 'dependencies': [ + '../google_apis/gcm/gcm.gyp:*', + ], + }], ], }, # target_name: All { @@ -193,11 +214,10 @@ 'type': 'none', 'conditions': [ ['OS=="win" and fastbuild==0 and target_arch=="ia32"', { - 'dependencies': [ - '../chrome/installer/mini_installer_syzygy.gyp:*', - ], - }, - ], + 'dependencies': [ + '../chrome/installer/mini_installer_syzygy.gyp:*', + ], + }], ], }, # target_name: All_syzygy { @@ -205,11 +225,12 @@ 'type': 'none', 'dependencies': [ '../base/base.gyp:base_unittests', - '../chrome/chrome.gyp:unit_tests', + '../components/components_tests.gyp:components_unittests', '../crypto/crypto.gyp:crypto_unittests', '../net/net.gyp:net_unittests', '../sql/sql.gyp:sql_unittests', - '../ui/ui.gyp:ui_unittests', + '../sync/sync.gyp:sync_unit_tests', + '../ui/ui_unittests.gyp:ui_unittests', '../url/url.gyp:url_unittests', ], 'conditions': [ @@ -217,28 +238,31 @@ 'dependencies': [ '../cc/cc_tests.gyp:cc_unittests', '../chrome/chrome.gyp:browser_tests', - '../chrome/chrome.gyp:chromedriver2_tests', + '../chrome/chrome.gyp:chromedriver_tests', + '../chrome/chrome.gyp:chromedriver_unittests', + # TODO(kkania): Remove these after infra no longer depends on them. '../chrome/chrome.gyp:chromedriver2_unittests', '../chrome/chrome.gyp:interactive_ui_tests', '../chrome/chrome.gyp:sync_integration_tests', + '../chrome/chrome.gyp:unit_tests', '../cloud_print/cloud_print.gyp:cloud_print_unittests', - '../components/components.gyp:components_unittests', - '../content/content.gyp:content_browsertests', - '../content/content.gyp:content_shell', - '../content/content.gyp:content_unittests', + '../content/content_shell_and_tests.gyp:content_browsertests', + '../content/content_shell_and_tests.gyp:content_shell', + '../content/content_shell_and_tests.gyp:content_unittests', '../device/device_tests.gyp:device_unittests', + '../gin/gin.gyp:gin_unittests', '../google_apis/google_apis.gyp:google_apis_unittests', '../gpu/gles2_conform_support/gles2_conform_support.gyp:gles2_conform_support', '../gpu/gpu.gyp:gpu_unittests', '../ipc/ipc.gyp:ipc_tests', '../jingle/jingle.gyp:jingle_unittests', '../media/media.gyp:media_unittests', + '../mojo/mojo.gyp:mojo', '../ppapi/ppapi_internal.gyp:ppapi_unittests', - '../printing/printing.gyp:printing_unittests', '../remoting/remoting.gyp:remoting_unittests', - '../sync/sync.gyp:sync_unit_tests', '../third_party/WebKit/public/all.gyp:all_blink', '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_unittests', + '../third_party/libaddressinput/libaddressinput.gyp:libaddressinput_unittests', '../third_party/libphonenumber/libphonenumber.gyp:libphonenumber_unittests', '../webkit/renderer/compositor_bindings/compositor_bindings_tests.gyp:webkit_compositor_bindings_unittests', ], @@ -251,7 +275,7 @@ # mini_installer_tests depends on mini_installer. This should be # defined in installer.gyp. '../chrome/installer/mini_installer.gyp:mini_installer', - '../chrome_frame/chrome_frame.gyp:npchrome_frame', + '../chrome_elf/chrome_elf.gyp:chrome_elf_unittests', '../courgette/courgette.gyp:courgette_unittests', '../sandbox/sandbox.gyp:sbox_integration_tests', '../sandbox/sandbox.gyp:sbox_unittests', @@ -261,22 +285,6 @@ '../ui/views/views.gyp:views_unittests', ], 'conditions': [ - ['target_arch!="x64"', { - 'dependencies': [ - '../chrome_frame/chrome_frame.gyp:chrome_frame_net_tests', - '../chrome_frame/chrome_frame.gyp:chrome_frame_perftests', - '../chrome_frame/chrome_frame.gyp:chrome_frame_reliability_tests', - '../chrome_frame/chrome_frame.gyp:chrome_frame_tests', - '../chrome_frame/chrome_frame.gyp:chrome_frame_unittests', - ] - }, { # target_arch!="x64" - 'dependencies!': [ - '../chrome_frame/chrome_frame.gyp:npchrome_frame', - ], - 'defines': [ - 'OMIT_CHROME_FRAME', - ], - }], # target_arch=="x64" # remoting_host_installation uses lots of non-trivial GYP that tend # to break because of differences between ninja and msbuild. Make # sure this target is built by the builders on the main waterfall. @@ -286,6 +294,29 @@ '../remoting/remoting.gyp:remoting_host_installation', ], }], + ['asan==1', { + 'variables': { + # Disable incremental linking for all modules. + # 0: inherit, 1: disabled, 2: enabled. + 'msvs_debug_link_incremental': '1', + 'msvs_large_module_debug_link_mode': '1', + # Disable RTC. Syzygy explicitly doesn't support RTC + # instrumented binaries for now. + 'win_debug_RuntimeChecks': '0', + }, + 'defines': [ + # Disable iterator debugging (huge speed boost). + '_HAS_ITERATOR_DEBUGGING=0', + ], + 'msvs_settings': { + 'VCLinkerTool': { + # Enable profile information (necessary for asan + # instrumentation). This is incompatible with incremental + # linking. + 'Profile': 'true', + }, + } + }], ], }], ['OS=="linux"', { @@ -305,6 +336,33 @@ 'chromium_swarm_tests', ], }], + ['OS!="android" and OS!="ios"', { + 'dependencies': [ + '../google_apis/gcm/gcm.gyp:gcm_unit_tests', + ], + }], + ['enable_printing!=0', { + 'dependencies': [ + '../printing/printing.gyp:printing_unittests', + ], + }], + ['use_aura==1', { + 'dependencies': [ + '../ui/aura/aura.gyp:aura_unittests', + '../ui/compositor/compositor.gyp:compositor_unittests', + '../ui/keyboard/keyboard.gyp:keyboard_unittests', + ], + }], + ['use_aura==1 or toolkit_views==1', { + 'dependencies': [ + '../ui/events/events.gyp:events_unittests', + ], + }], + ['use_ash==1', { + 'dependencies': [ + '../ash/ash.gyp:ash_unittests', + ], + }], ], }, # target_name: chromium_builder_tests { @@ -319,11 +377,41 @@ ['OS!="ios"', { 'targets': [ { - 'target_name': 'all_webkit', + 'target_name': 'blink_tests', 'type': 'none', 'dependencies': [ '../third_party/WebKit/public/all.gyp:all_blink', - '../content/content.gyp:content_shell', + '../content/content_shell_and_tests.gyp:content_shell', + ], + 'conditions': [ + ['OS=="win"', { + 'dependencies': [ + '../content/content_shell_and_tests.gyp:content_shell_crash_service', + ], + }, { # OS!="win" + 'dependencies': [ + '../breakpad/breakpad.gyp:minidump_stackwalk', + ], + }], + ['OS=="mac"', { + 'dependencies': [ + '../breakpad/breakpad.gyp:dump_syms#host', + ], + }], + ['OS=="linux"', { + 'dependencies': [ + '../breakpad/breakpad.gyp:dump_syms', + ], + }], + ], + }, # target_name: blink_tests + { + # TODO(jochen): Eventually remove this target after everybody and + # the bots started to use blink_tests only. + 'target_name': 'all_webkit', + 'type': 'none', + 'dependencies': [ + 'blink_tests', ], }, # target_name: all_webkit { @@ -338,11 +426,12 @@ 'target_name': 'chromium_builder_perf', 'type': 'none', 'dependencies': [ - 'chromium_builder_qa', # needed for pyauto '../cc/cc_tests.gyp:cc_perftests', + '../chrome/chrome.gyp:chrome', '../chrome/chrome.gyp:performance_browser_tests', '../chrome/chrome.gyp:performance_ui_tests', '../chrome/chrome.gyp:sync_performance_tests', + '../media/media.gyp:media_perftests', '../tools/perf/clear_system_cache/clear_system_cache.gyp:*', ], 'conditions': [ @@ -356,42 +445,86 @@ '../chrome/chrome.gyp:linux_symbols' ], }], + ['OS=="win"', { + 'dependencies': [ + '../chrome/chrome.gyp:crash_service', + ], + }], + ['OS=="win" and target_arch=="ia32"', { + 'dependencies': [ + '../chrome/chrome.gyp:crash_service_win64', + ], + }], ], }, # target_name: chromium_builder_perf { 'target_name': 'chromium_gpu_builder', 'type': 'none', 'dependencies': [ - '../chrome/chrome.gyp:gpu_tests', + '../chrome/chrome.gyp:chrome', '../chrome/chrome.gyp:performance_browser_tests', '../chrome/chrome.gyp:performance_ui_tests', - '../content/content.gyp:content_browsertests', - '../content/content.gyp:content_gl_tests', + '../content/content_shell_and_tests.gyp:content_browsertests', + '../content/content_shell_and_tests.gyp:content_gl_tests', + '../gpu/gles2_conform_support/gles2_conform_test.gyp:gles2_conform_test', '../gpu/gpu.gyp:gl_tests', + '../gpu/gpu.gyp:angle_unittests', ], 'conditions': [ - ['internal_gles2_conform_tests', { + ['OS!="ios" and OS!="win"', { 'dependencies': [ - '../gpu/gles2_conform_test/gles2_conform_test.gyp:gles2_conform_test', + '../breakpad/breakpad.gyp:minidump_stackwalk', ], - }], # internal_gles2_conform + }], + ['OS=="linux"', { + 'dependencies': [ + '../chrome/chrome.gyp:linux_symbols' + ], + }], + ['OS=="win"', { + 'dependencies': [ + '../chrome/chrome.gyp:crash_service', + ], + }], + ['OS=="win" and target_arch=="ia32"', { + 'dependencies': [ + '../chrome/chrome.gyp:crash_service_win64', + ], + }], ], }, # target_name: chromium_gpu_builder { 'target_name': 'chromium_gpu_debug_builder', 'type': 'none', 'dependencies': [ - '../chrome/chrome.gyp:gpu_tests', - '../content/content.gyp:content_browsertests', - '../content/content.gyp:content_gl_tests', + '../chrome/chrome.gyp:chrome', + '../content/content_shell_and_tests.gyp:content_browsertests', + '../content/content_shell_and_tests.gyp:content_gl_tests', + '../gpu/gles2_conform_support/gles2_conform_test.gyp:gles2_conform_test', '../gpu/gpu.gyp:gl_tests', + '../gpu/gpu.gyp:angle_unittests', ], 'conditions': [ - ['internal_gles2_conform_tests', { + ['OS!="ios" and OS!="win"', { 'dependencies': [ - '../gpu/gles2_conform_test/gles2_conform_test.gyp:gles2_conform_test', + '../breakpad/breakpad.gyp:minidump_stackwalk', ], - }], # internal_gles2_conform + }], + ['OS=="linux"', { + 'dependencies': [ + '../chrome/chrome.gyp:linux_symbols' + ], + }], + ['OS=="win"', { + 'dependencies': [ + '../chrome/chrome.gyp:crash_service', + ], + }], + ['OS=="win" and target_arch=="ia32"', { + 'dependencies': [ + '../chrome/chrome.gyp:crash_service_win64', + ], + }], ], }, # target_name: chromium_gpu_debug_builder { @@ -401,15 +534,9 @@ '../chrome/chrome.gyp:chrome', # Dependencies of pyauto_functional tests. '../remoting/remoting.gyp:remoting_webapp', + '../chrome/chrome.gyp:pyautolib', ], 'conditions': [ - # If you change this condition, make sure you also change it - # in chrome_tests.gypi - ['enable_automation==1 and (OS=="mac" or ((OS=="win" or os_posix==1) and target_arch==python_arch))', { - 'dependencies': [ - '../chrome/chrome.gyp:pyautolib', - ], - }], ['OS=="mac"', { 'dependencies': [ '../remoting/remoting.gyp:remoting_me2me_host_archive', @@ -436,7 +563,7 @@ 'target_name': 'chromium_builder_perf_av', 'type': 'none', 'dependencies': [ - 'all_webkit', # to run layout tests + 'blink_tests', # to run layout tests 'chromium_builder_qa', # needed for perf pyauto tests ], }, # target_name: chromium_builder_perf_av @@ -449,8 +576,8 @@ 'dependencies': [ 'chromium_builder_qa', # needed for perf pyauto tests '../chrome/chrome.gyp:browser_tests', - '../content/content.gyp:content_browsertests', - '../content/content.gyp:content_unittests', + '../content/content_shell_and_tests.gyp:content_browsertests', + '../content/content_shell_and_tests.gyp:content_unittests', '../third_party/libjingle/libjingle.gyp:peerconnection_server', '../third_party/webrtc/tools/tools.gyp:frame_analyzer', '../third_party/webrtc/tools/tools.gyp:rgba_to_i420_converter', @@ -467,9 +594,9 @@ 'target_name': 'chromium_builder_chromedriver', 'type': 'none', 'dependencies': [ - '../chrome/chrome.gyp:chromedriver2_server', - '../chrome/chrome.gyp:chromedriver2_tests', - '../chrome/chrome.gyp:chromedriver2_unittests', + '../chrome/chrome.gyp:chromedriver', + '../chrome/chrome.gyp:chromedriver_tests', + '../chrome/chrome.gyp:chromedriver_unittests', ], }, # target_name: chromium_builder_chromedriver { @@ -478,14 +605,42 @@ 'dependencies': [ '../chrome/chrome.gyp:chrome', - # We refer to content_shell directly rather than all_webkit + # We refer to content_shell directly rather than blink_tests # because we don't want the _unittests binaries. - '../content/content.gyp:content_browsertests', - '../content/content.gyp:content_shell', - - '../net/net.gyp:dns_fuzz_stub', - ], - }, + '../content/content_shell_and_tests.gyp:content_shell', + ], + 'conditions': [ + ['OS!="win"', { + 'dependencies': [ + '../net/net.gyp:dns_fuzz_stub', + '../skia/skia.gyp:filter_fuzz_stub', + ], + }], + ['OS=="linux" and enable_ipc_fuzzer==1', { + 'dependencies': [ + '../tools/ipc_fuzzer/ipc_fuzzer.gyp:*', + ], + }], + ['internal_filter_fuzzer==1', { + 'dependencies': [ + '../skia/tools/clusterfuzz-data/fuzzers/filter_fuzzer/filter_fuzzer.gyp:filter_fuzzer', + ], + }], # internal_filter_fuzzer + ['OS=="win" and fastbuild==0 and target_arch=="ia32"', { + 'dependencies': [ + '../chrome/chrome_syzygy.gyp:chrome_dll_syzygy', + '../content/content_shell_and_tests.gyp:content_shell_syzyasan', + ], + 'conditions': [ + ['chrome_multiple_dll==1', { + 'dependencies': [ + '../chrome/chrome_syzygy.gyp:chrome_child_dll_syzygy', + ], + }], + ], + }], + ], + }, ], # targets }], ['OS=="mac"', { @@ -512,10 +667,11 @@ '../chrome/chrome.gyp:sync_integration_tests', '../chrome/chrome.gyp:unit_tests', '../cloud_print/cloud_print.gyp:cloud_print_unittests', - '../components/components.gyp:components_unittests', - '../content/content.gyp:content_browsertests', - '../content/content.gyp:content_unittests', + '../components/components_tests.gyp:components_unittests', + '../content/content_shell_and_tests.gyp:content_browsertests', + '../content/content_shell_and_tests.gyp:content_unittests', '../device/device_tests.gyp:device_unittests', + '../google_apis/gcm/gcm.gyp:gcm_unit_tests', '../gpu/gpu.gyp:gpu_unittests', '../ipc/ipc.gyp:ipc_tests', '../jingle/jingle.gyp:jingle_unittests', @@ -527,9 +683,10 @@ '../sql/sql.gyp:sql_unittests', '../sync/sync.gyp:sync_unit_tests', '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_unittests', + '../third_party/libaddressinput/libaddressinput.gyp:libaddressinput_unittests', '../third_party/libphonenumber/libphonenumber.gyp:libphonenumber_unittests', '../tools/perf/clear_system_cache/clear_system_cache.gyp:*', - '../ui/ui.gyp:ui_unittests', + '../ui/ui_unittests.gyp:ui_unittests', '../url/url.gyp:url_unittests', '../webkit/renderer/compositor_bindings/compositor_bindings_tests.gyp:webkit_compositor_bindings_unittests', ], @@ -545,10 +702,11 @@ '../chrome/chrome.gyp:sync_integration_tests', '../chrome/chrome.gyp:unit_tests', '../cloud_print/cloud_print.gyp:cloud_print_unittests', - '../components/components.gyp:components_unittests', - '../content/content.gyp:content_browsertests', - '../content/content.gyp:content_unittests', + '../components/components_tests.gyp:components_unittests', + '../content/content_shell_and_tests.gyp:content_browsertests', + '../content/content_shell_and_tests.gyp:content_unittests', '../device/device_tests.gyp:device_unittests', + '../google_apis/gcm/gcm.gyp:gcm_unit_tests', '../gpu/gpu.gyp:gpu_unittests', '../ipc/ipc.gyp:ipc_tests', '../jingle/jingle.gyp:jingle_unittests', @@ -559,9 +717,10 @@ '../sql/sql.gyp:sql_unittests', '../sync/sync.gyp:sync_unit_tests', '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_unittests', + '../third_party/libaddressinput/libaddressinput.gyp:libaddressinput_unittests', '../third_party/libphonenumber/libphonenumber.gyp:libphonenumber_unittests', '../tools/perf/clear_system_cache/clear_system_cache.gyp:*', - '../ui/ui.gyp:ui_unittests', + '../ui/ui_unittests.gyp:ui_unittests', '../url/url.gyp:url_unittests', '../webkit/renderer/compositor_bindings/compositor_bindings_tests.gyp:webkit_compositor_bindings_unittests', ], @@ -580,6 +739,7 @@ '../printing/printing.gyp:printing_unittests', '../remoting/remoting.gyp:remoting_unittests', '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_unittests', + '../third_party/libaddressinput/libaddressinput.gyp:libaddressinput_unittests', '../third_party/libphonenumber/libphonenumber.gyp:libphonenumber_unittests', '../url/url.gyp:url_unittests', ], @@ -599,21 +759,23 @@ '../base/base.gyp:base_unittests', '../chrome/chrome.gyp:unit_tests', '../cloud_print/cloud_print.gyp:cloud_print_unittests', - '../components/components.gyp:components_unittests', - '../content/content.gyp:content_unittests', + '../components/components_tests.gyp:components_unittests', + '../content/content_shell_and_tests.gyp:content_unittests', '../crypto/crypto.gyp:crypto_unittests', '../device/device_tests.gyp:device_unittests', '../ipc/ipc.gyp:ipc_tests', '../jingle/jingle.gyp:jingle_unittests', '../media/media.gyp:media_unittests', '../net/net.gyp:net_unittests', + '../google_apis/gcm/gcm.gyp:gcm_unit_tests', '../printing/printing.gyp:printing_unittests', '../remoting/remoting.gyp:remoting_unittests', '../sql/sql.gyp:sql_unittests', '../sync/sync.gyp:sync_unit_tests', '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_unittests', + '../third_party/libaddressinput/libaddressinput.gyp:libaddressinput_unittests', '../third_party/libphonenumber/libphonenumber.gyp:libphonenumber_unittests', - '../ui/ui.gyp:ui_unittests', + '../ui/ui_unittests.gyp:ui_unittests', '../url/url.gyp:url_unittests', ], }, @@ -638,15 +800,15 @@ '../chrome/chrome.gyp:sync_integration_tests', '../chrome/chrome.gyp:unit_tests', '../cloud_print/cloud_print.gyp:cloud_print_unittests', - '../components/components.gyp:components_unittests', - '../content/content.gyp:content_browsertests', - '../content/content.gyp:content_unittests', + '../components/components_tests.gyp:components_unittests', + '../content/content_shell_and_tests.gyp:content_browsertests', + '../content/content_shell_and_tests.gyp:content_unittests', # mini_installer_tests depends on mini_installer. This should be # defined in installer.gyp. '../chrome/installer/mini_installer.gyp:mini_installer', - '../chrome_frame/chrome_frame.gyp:npchrome_frame', '../courgette/courgette.gyp:courgette_unittests', '../device/device_tests.gyp:device_unittests', + '../google_apis/gcm/gcm.gyp:gcm_unit_tests', '../gpu/gpu.gyp:gpu_unittests', '../ipc/ipc.gyp:ipc_tests', '../jingle/jingle.gyp:jingle_unittests', @@ -657,48 +819,20 @@ '../sql/sql.gyp:sql_unittests', '../sync/sync.gyp:sync_unit_tests', '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_unittests', + '../third_party/libaddressinput/libaddressinput.gyp:libaddressinput_unittests', '../third_party/libphonenumber/libphonenumber.gyp:libphonenumber_unittests', '../tools/perf/clear_system_cache/clear_system_cache.gyp:*', - '../ui/ui.gyp:ui_unittests', + '../ui/events/events.gyp:events_unittests', + '../ui/ui_unittests.gyp:ui_unittests', '../ui/views/views.gyp:views_unittests', '../url/url.gyp:url_unittests', '../webkit/renderer/compositor_bindings/compositor_bindings_tests.gyp:webkit_compositor_bindings_unittests', '../third_party/WebKit/public/blink_test_plugin.gyp:blink_test_plugin', ], - 'conditions': [ - ['target_arch!="x64"', { - 'dependencies': [ - '../chrome_frame/chrome_frame.gyp:chrome_frame_net_tests', - '../chrome_frame/chrome_frame.gyp:chrome_frame_perftests', - '../chrome_frame/chrome_frame.gyp:chrome_frame_reliability_tests', - '../chrome_frame/chrome_frame.gyp:chrome_frame_tests', - '../chrome_frame/chrome_frame.gyp:chrome_frame_unittests', - ] - }, { # target_arch!="x64" - 'dependencies!': [ - '../chrome_frame/chrome_frame.gyp:npchrome_frame', - ], - 'defines': [ - 'OMIT_CHROME_FRAME', - ], - }], # target_arch=="x64" - ], }, { 'target_name': 'chromium_builder_win_cf', 'type': 'none', - 'conditions': [ - ['target_arch!="x64"', { - 'dependencies': [ - '../chrome_frame/chrome_frame.gyp:chrome_frame_net_tests', - '../chrome_frame/chrome_frame.gyp:chrome_frame_perftests', - '../chrome_frame/chrome_frame.gyp:chrome_frame_reliability_tests', - '../chrome_frame/chrome_frame.gyp:chrome_frame_tests', - '../chrome_frame/chrome_frame.gyp:chrome_frame_unittests', - '../chrome_frame/chrome_frame.gyp:npchrome_frame', - ], - }], # target_arch!="x64" - ], }, { 'target_name': 'chromium_builder_dbg_tsan_win', @@ -706,8 +840,8 @@ 'dependencies': [ '../base/base.gyp:base_unittests', '../cloud_print/cloud_print.gyp:cloud_print_unittests', - '../components/components.gyp:components_unittests', - '../content/content.gyp:content_unittests', + '../components/components_tests.gyp:components_unittests', + '../content/content_shell_and_tests.gyp:content_unittests', '../crypto/crypto.gyp:crypto_unittests', '../ipc/ipc.gyp:ipc_tests', '../jingle/jingle.gyp:jingle_unittests', @@ -717,6 +851,7 @@ '../remoting/remoting.gyp:remoting_unittests', '../sql/sql.gyp:sql_unittests', '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_unittests', + '../third_party/libaddressinput/libaddressinput.gyp:libaddressinput_unittests', '../third_party/libphonenumber/libphonenumber.gyp:libphonenumber_unittests', '../url/url.gyp:url_unittests', ], @@ -729,18 +864,20 @@ '../chrome/chrome.gyp:unit_tests', '../chrome/chrome.gyp:browser_tests', '../cloud_print/cloud_print.gyp:cloud_print_unittests', - '../components/components.gyp:components_unittests', - '../content/content.gyp:content_unittests', + '../components/components_tests.gyp:components_unittests', + '../content/content_shell_and_tests.gyp:content_unittests', '../crypto/crypto.gyp:crypto_unittests', '../device/device_tests.gyp:device_unittests', '../ipc/ipc.gyp:ipc_tests', '../jingle/jingle.gyp:jingle_unittests', '../media/media.gyp:media_unittests', '../net/net.gyp:net_unittests', + '../google_apis/gcm/gcm.gyp:gcm_unit_tests', '../printing/printing.gyp:printing_unittests', '../remoting/remoting.gyp:remoting_unittests', '../sql/sql.gyp:sql_unittests', '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_unittests', + '../third_party/libaddressinput/libaddressinput.gyp:libaddressinput_unittests', '../third_party/libphonenumber/libphonenumber.gyp:libphonenumber_unittests', '../url/url.gyp:url_unittests', ], @@ -749,7 +886,7 @@ 'target_name': 'webkit_builder_win', 'type': 'none', 'dependencies': [ - 'all_webkit', + 'blink_tests', ], }, ], # targets @@ -762,22 +899,16 @@ 'dependencies': [ '../chrome/chrome.gyp:crash_service', '../chrome/chrome.gyp:gcapi_dll', - '../chrome/chrome.gyp:policy_templates', + '../chrome/chrome.gyp:pack_policy_templates', '../courgette/courgette.gyp:courgette64', '../chrome/installer/mini_installer.gyp:mini_installer', '../courgette/courgette.gyp:courgette', '../cloud_print/cloud_print.gyp:cloud_print', '../remoting/remoting.gyp:remoting_webapp', '../third_party/widevine/cdm/widevine_cdm.gyp:widevinecdmadapter', + '../chrome/chrome.gyp:pyautolib', ], 'conditions': [ - # If you change this condition, make sure you also change it - # in chrome_tests.gypi - ['enable_automation==1 and (OS=="mac" or (os_posix==1 and target_arch==python_arch))', { - 'dependencies': [ - '../chrome/chrome.gyp:pyautolib', - ], - }], ['internal_pdf', { 'dependencies': [ '../pdf/pdf.gyp:pdf', @@ -786,7 +917,6 @@ ['target_arch=="ia32"', { 'dependencies': [ '../chrome/chrome.gyp:crash_service_win64', - '../chrome_frame/chrome_frame.gyp:npchrome_frame', # Omitting tests from Win64 to speed up cycle times. '../chrome/chrome.gyp:interactive_ui_tests', ], @@ -797,11 +927,6 @@ '../remoting/remoting.gyp:remoting_host_installation', ], }], # component != "shared_library" - ['target_arch=="x64"', { - 'defines': [ - 'OMIT_CHROME_FRAME', - ], - }], # target_arch=="x64" ] }, ], # targets @@ -819,47 +944,30 @@ '../chrome/chrome.gyp:chrome', '../chrome/chrome.gyp:interactive_ui_tests', '../chrome/chrome.gyp:unit_tests', - '../components/components.gyp:components_unittests', - '../content/content.gyp:content_browsertests', - '../content/content.gyp:content_unittests', + '../components/components_tests.gyp:components_unittests', + '../content/content_shell_and_tests.gyp:content_browsertests', + '../content/content_shell_and_tests.gyp:content_unittests', '../device/device_tests.gyp:device_unittests', '../ppapi/ppapi_internal.gyp:ppapi_unittests', '../remoting/remoting.gyp:remoting_unittests', '../ui/app_list/app_list.gyp:*', '../ui/aura/aura.gyp:*', '../ui/compositor/compositor.gyp:*', + '../ui/events/events.gyp:*', '../ui/message_center/message_center.gyp:*', - '../ui/ui.gyp:ui_unittests', + '../ui/ui_unittests.gyp:ui_unittests', '../ui/snapshot/snapshot.gyp:snapshot_unittests', '../ui/views/views.gyp:views', '../ui/views/views.gyp:views_examples_with_content_exe', '../ui/views/views.gyp:views_unittests', '../ui/keyboard/keyboard.gyp:*', '../webkit/renderer/compositor_bindings/compositor_bindings_tests.gyp:webkit_compositor_bindings_unittests', - 'all_webkit', + 'blink_tests', ], 'conditions': [ ['OS=="win"', { 'dependencies': [ '../chrome/chrome.gyp:crash_service', - '../chrome_frame/chrome_frame.gyp:npchrome_frame', - ], - }], - ['OS=="win" and target_arch!="x64"', { - 'dependencies': [ - '../chrome_frame/chrome_frame.gyp:chrome_frame_net_tests', - '../chrome_frame/chrome_frame.gyp:chrome_frame_perftests', - '../chrome_frame/chrome_frame.gyp:chrome_frame_reliability_tests', - '../chrome_frame/chrome_frame.gyp:chrome_frame_tests', - '../chrome_frame/chrome_frame.gyp:chrome_frame_unittests', - ], - }], - ['OS=="win" and target_arch=="x64"', { - 'dependencies!': [ - '../chrome_frame/chrome_frame.gyp:npchrome_frame', - ], - 'defines': [ - 'OMIT_CHROME_FRAME', ], }], ['OS=="win" and target_arch=="ia32"', { @@ -882,15 +990,6 @@ '../sync/sync.gyp:sync_unit_tests', ], }], - ['OS=="mac"', { - # Exclude dependencies that are not currently implemented. - 'dependencies!': [ - '../chrome/chrome.gyp:chrome', - '../chrome/chrome.gyp:unit_tests', - '../device/device_tests.gyp:device_unittests', - '../ui/views/views.gyp:views_unittests', - ], - }], ['chromeos==1', { 'dependencies': [ '../chromeos/chromeos.gyp:chromeos_unittests', diff --git a/chromium/build/all_android.gyp b/chromium/build/all_android.gyp index de6341fa2e9..748571a832f 100644 --- a/chromium/build/all_android.gyp +++ b/chromium/build/all_android.gyp @@ -17,7 +17,8 @@ 'target_name': 'All', 'type': 'none', 'dependencies': [ - '../content/content.gyp:content_shell_apk', + '../content/content_shell_and_tests.gyp:content_shell_apk', + '../mojo/mojo.gyp:mojo_shell_apk', '<@(android_app_targets)', 'android_builder_tests', '../android_webview/android_webview.gyp:android_webview_apk', @@ -30,11 +31,22 @@ ], }, # target_name: All { - 'target_name': 'all_webkit', + 'target_name': 'blink_tests', 'type': 'none', 'dependencies': [ '../third_party/WebKit/public/all.gyp:all_blink', - '../content/content.gyp:content_shell_apk', + '../content/content_shell_and_tests.gyp:content_shell_apk', + '../breakpad/breakpad.gyp:dump_syms#host', + '../breakpad/breakpad.gyp:minidump_stackwalk#host', + ], + }, # target_name: blink_tests + { + # TODO(jochen): Eventually remove this target after everybody and the + # bots started to use blink_tests only. + 'target_name': 'all_webkit', + 'type': 'none', + 'dependencies': [ + 'blink_tests', ], }, # target_name: all_webkit { @@ -63,14 +75,15 @@ '../cc/cc_tests.gyp:cc_perftests_apk', '../cc/cc_tests.gyp:cc_unittests', '../chrome/chrome.gyp:unit_tests', - '../components/components.gyp:components_unittests', - '../content/content.gyp:content_browsertests', - '../content/content.gyp:content_gl_tests', - '../content/content.gyp:content_shell_test_apk', - '../content/content.gyp:content_unittests', + '../components/components_tests.gyp:components_unittests', + '../content/content_shell_and_tests.gyp:content_browsertests', + '../content/content_shell_and_tests.gyp:content_gl_tests', + '../content/content_shell_and_tests.gyp:content_shell_test_apk', + '../content/content_shell_and_tests.gyp:content_unittests', '../gpu/gpu.gyp:gl_tests', '../gpu/gpu.gyp:gpu_unittests', '../ipc/ipc.gyp:ipc_tests', + '../media/media.gyp:media_perftests_apk', '../media/media.gyp:media_unittests', '../net/net.gyp:net_unittests', '../sandbox/sandbox.gyp:sandbox_linux_unittests', @@ -78,9 +91,9 @@ '../sync/sync.gyp:sync_unit_tests', '../third_party/WebKit/public/all.gyp:*', '../tools/android/android_tools.gyp:android_tools', - '../tools/android/device_stats_monitor/device_stats_monitor.gyp:device_stats_monitor', + '../tools/android/android_tools.gyp:memconsumer', '../tools/android/findbugs_plugin/findbugs_plugin.gyp:findbugs_plugin_test', - '../ui/ui.gyp:ui_unittests', + '../ui/ui_unittests.gyp:ui_unittests', # Required by ui_unittests. # TODO(wangxianzhu): It'd better let ui_unittests depend on it, but # this would cause circular gyp dependency which needs refactoring the @@ -95,11 +108,11 @@ '../base/base.gyp:base_unittests_apk', '../cc/cc_tests.gyp:cc_unittests_apk', '../chrome/chrome.gyp:unit_tests_apk', - '../components/components.gyp:components_unittests_apk', - '../content/content.gyp:content_browsertests_apk', - '../content/content.gyp:content_gl_tests_apk', - '../content/content.gyp:content_unittests_apk', - '../content/content.gyp:video_decode_accelerator_unittest_apk', + '../components/components_tests.gyp:components_unittests_apk', + '../content/content_shell_and_tests.gyp:content_browsertests_apk', + '../content/content_shell_and_tests.gyp:content_gl_tests_apk', + '../content/content_shell_and_tests.gyp:content_unittests_apk', + '../content/content_shell_and_tests.gyp:video_decode_accelerator_unittest_apk', '../gpu/gpu.gyp:gl_tests_apk', '../gpu/gpu.gyp:gpu_unittests_apk', '../ipc/ipc.gyp:ipc_tests_apk', @@ -108,7 +121,7 @@ '../sandbox/sandbox.gyp:sandbox_linux_jni_unittests_apk', '../sql/sql.gyp:sql_unittests_apk', '../sync/sync.gyp:sync_unit_tests_apk', - '../ui/ui.gyp:ui_unittests_apk', + '../ui/ui_unittests.gyp:ui_unittests_apk', '../android_webview/android_webview.gyp:android_webview_test_apk', '../chrome/chrome.gyp:chromium_testshell_test_apk', '../chrome/chrome.gyp:chromium_testshell_uiautomator_tests', @@ -122,7 +135,9 @@ 'target_name': 'android_builder_webrtc', 'type': 'none', 'variables': { - # WebRTC tests are normally not built by Chromium bots. + # Set default value for include_tests to '0'. It is normally only + # used in WebRTC GYP files. It is set to '1' only when building + # WebRTC for Android, inside a Chromium checkout. 'include_tests%': 0, }, 'conditions': [ @@ -134,6 +149,24 @@ ], }, # target_name: android_builder_webrtc { + # WebRTC Chromium tests to run on Android. + 'target_name': 'android_builder_chromium_webrtc', + 'type': 'none', + 'dependencies': [ + '../content/content_shell_and_tests.gyp:content_browsertests', + '../tools/android/android_tools.gyp:android_tools', + '../tools/android/android_tools.gyp:memconsumer', + ], + 'conditions': [ + ['"<(gtest_target_type)"=="shared_library"', { + 'dependencies': [ + # Unit test bundles packaged as an apk. + '../content/content_shell_and_tests.gyp:content_browsertests_apk', + ], + }], + ], + }, # target_name: android_builder_chromium_webrtc + { # Experimental / in-progress targets that are expected to fail # but we still try to compile them on bots (turning the stage # orange, not red). diff --git a/chromium/build/android/finalize_apk_action.gypi b/chromium/build/android/finalize_apk_action.gypi index 5ee6043b4ec..b88bbba2cc7 100644 --- a/chromium/build/android/finalize_apk_action.gypi +++ b/chromium/build/android/finalize_apk_action.gypi @@ -18,7 +18,7 @@ # { - 'message': 'Signing/aligning <(_target_name) APK: <(input_apk_path).', + 'message': 'Signing/aligning <(_target_name) APK: <(input_apk_path)', 'variables': { 'inputs': [], 'keystore_path%': '<(DEPTH)/build/android/ant/chromium-debug.keystore', diff --git a/chromium/build/android/instr_action.gypi b/chromium/build/android/instr_action.gypi index 7b159989f3d..fa6d06235ea 100644 --- a/chromium/build/android/instr_action.gypi +++ b/chromium/build/android/instr_action.gypi @@ -22,6 +22,7 @@ '--sources=<(java_in_dir)/src >(additional_src_dirs) >(generated_src_dirs)', '--src-root=<(DEPTH)', '--emma-jar=<(emma_jar)', + '--filter-string=<(emma_filter)', ], 'conditions': [ ['instr_type == "jar"', { diff --git a/chromium/build/android/lint_action.gypi b/chromium/build/android/lint_action.gypi new file mode 100644 index 00000000000..dd0bbd2f984 --- /dev/null +++ b/chromium/build/android/lint_action.gypi @@ -0,0 +1,39 @@ +# Copyright 2013 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# This file is meant to be included into an action to provide a rule to +# run lint on java/class files. + +{ + 'action_name': 'lint_<(_target_name)', + 'message': 'Linting <(_target_name)', + 'variables': { + 'conditions': [ + ['chromium_code != 0 and android_lint != 0 and never_lint == 0', { + 'is_enabled': '--enable', + }, { + 'is_enabled': '', + }] + ] + }, + 'inputs': [ + '<(DEPTH)/build/android/gyp/util/build_utils.py', + '<(DEPTH)/build/android/gyp/lint.py', + '<(DEPTH)/build/android/lint/suppressions.xml', + '<(DEPTH)/build/android/AndroidManifest.xml', + ], + 'action': [ + 'python', '<(DEPTH)/build/android/gyp/lint.py', + '--lint-path=<(android_sdk_root)/tools/lint', + '--config-path=<(DEPTH)/build/android/lint/suppressions.xml', + '--processed-config-path=<(config_path)', + '--manifest-path=<(DEPTH)/build/android/AndroidManifest.xml', + '--result-path=<(result_path)', + '--product-dir=<(PRODUCT_DIR)', + '--src-dirs=>(src_dirs)', + '--classes-dir=<(classes_dir)', + '--stamp=<(stamp_path)', + '<(is_enabled)', + ], +} diff --git a/chromium/build/android/write_ordered_libraries.gypi b/chromium/build/android/write_ordered_libraries.gypi index 2b2450097de..e9b8ba53792 100644 --- a/chromium/build/android/write_ordered_libraries.gypi +++ b/chromium/build/android/write_ordered_libraries.gypi @@ -20,7 +20,7 @@ { 'action_name': 'ordered_libraries_<(_target_name)', - 'message': 'Writing dependency ordered libraries for <(_target_name).', + 'message': 'Writing dependency ordered libraries for <(_target_name)', 'variables': { 'input_libraries%': [], }, diff --git a/chromium/build/apk_test.gypi b/chromium/build/apk_test.gypi index f7748315842..8ec23a21fd1 100644 --- a/chromium/build/apk_test.gypi +++ b/chromium/build/apk_test.gypi @@ -31,7 +31,6 @@ 'intermediate_dir': '<(PRODUCT_DIR)/<(test_suite_name)_apk', 'final_apk_path': '<(intermediate_dir)/<(test_suite_name)-debug.apk', 'java_in_dir': '<(DEPTH)/testing/android/java', - 'android_manifest_path': '<(DEPTH)/testing/android/AndroidManifest.xml', 'native_lib_target': 'lib<(test_suite_name)', # TODO(yfriedman, cjhopman): Support managed installs for gtests. 'gyp_managed_install': 0, diff --git a/chromium/build/build-ctags.sh b/chromium/build/build-ctags.sh new file mode 100755 index 00000000000..825da271d9d --- /dev/null +++ b/chromium/build/build-ctags.sh @@ -0,0 +1,49 @@ +#!/bin/bash + +# Copyright 2013 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +if [[ a"`ctags --version | head -1 | grep \"^Exuberant Ctags\"`" == "a" ]]; then + cat <<EOF + You must be using Exuberant Ctags, not just standard GNU ctags. If you are on + Debian or a related flavor of Linux, you may want to try running + apt-get install exuberant-ctags. +EOF + exit +fi + +CHROME_SRC_DIR="$PWD" + +fail() { + echo "Failed to create ctags for $1" + exit 1 +} + +ctags_cmd() { + echo "ctags --languages=C++ $1 --exclude=.git -R -f .tmp_tags" +} + +build_dir() { + local extraexcludes="" + if [[ a"$1" == "a--extra-excludes" ]]; then + extraexcludes="--exclude=third_party --exclude=build --exclude=out" + shift + fi + + cd "$CHROME_SRC_DIR/$1" || fail $1 + # Redirect error messages so they aren't seen because they are almost always + # errors about components that you just happen to have not built (NaCl, for + # example). + $(ctags_cmd "$extraexcludes") 2> /dev/null || fail $1 + mv -f .tmp_tags .tags +} + +# We always build the top level but leave all submodules as optional. +build_dir --extra-excludes "" "top level" + +# Build any other directies that are listed on the command line. +for dir in $@; do + build_dir "$1" + shift +done diff --git a/chromium/build/build_config.h b/chromium/build/build_config.h index 3ea3ddca4b8..143cf3e5b45 100644 --- a/chromium/build/build_config.h +++ b/chromium/build/build_config.h @@ -31,7 +31,7 @@ #elif defined(__linux__) #define OS_LINUX 1 // Use TOOLKIT_GTK on linux if TOOLKIT_VIEWS isn't defined. -#if !defined(TOOLKIT_VIEWS) && defined(USE_X11) +#if !defined(TOOLKIT_VIEWS) && defined(USE_X11) && !defined(USE_AURA) #define TOOLKIT_GTK #endif #if defined(__GLIBC__) && !defined(__UCLIBC__) @@ -108,6 +108,7 @@ #define ARCH_CPU_LITTLE_ENDIAN 1 #elif defined(__pnacl__) #define ARCH_CPU_32_BITS 1 +#define ARCH_CPU_LITTLE_ENDIAN 1 #elif defined(__MIPSEL__) #define ARCH_CPU_MIPS_FAMILY 1 #define ARCH_CPU_MIPSEL 1 diff --git a/chromium/build/chrome_settings.gypi b/chromium/build/chrome_settings.gypi new file mode 100644 index 00000000000..e9c753554de --- /dev/null +++ b/chromium/build/chrome_settings.gypi @@ -0,0 +1,30 @@ +# Copyright 2013 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# This file contains settings for ../chrome/chrome.gyp that other gyp files +# also use. +{ + 'variables': { + # TODO: remove this helper when we have loops in GYP + 'apply_locales_cmd': ['python', '<(DEPTH)/build/apply_locales.py'], + + 'conditions': [ + ['OS=="mac"', { + 'conditions': [ + ['branding=="Chrome"', { + 'mac_bundle_id': 'com.google.Chrome', + 'mac_creator': 'rimZ', + # The policy .grd file also needs the bundle id. + 'grit_defines': ['-D', 'mac_bundle_id=com.google.Chrome'], + }, { # else: branding!="Chrome" + 'mac_bundle_id': 'org.chromium.Chromium', + 'mac_creator': 'Cr24', + # The policy .grd file also needs the bundle id. + 'grit_defines': ['-D', 'mac_bundle_id=org.chromium.Chromium'], + }], # branding + ], # conditions + }], # OS=="mac" + ], # conditions + }, # variables +} diff --git a/chromium/build/common.croc b/chromium/build/common.croc index ecf29f24375..fde7a8b2982 100644 --- a/chromium/build/common.croc +++ b/chromium/build/common.croc @@ -57,7 +57,7 @@ }, # Don't include output dirs { - 'regexp' : '.*/(Debug|Release|sconsbuild|out|xcodebuild)/', + 'regexp' : '.*/(Debug|Release|out|xcodebuild)/', 'include' : 0, }, # Don't include third-party source diff --git a/chromium/build/common.gypi b/chromium/build/common.gypi index cf5b1962922..e975a96cd52 100644 --- a/chromium/build/common.gypi +++ b/chromium/build/common.gypi @@ -32,6 +32,9 @@ # Use a raw surface abstraction. 'use_ozone%': 0, + + # Configure the build for small devices. See crbug.com/318413 + 'embedded%': 0, }, # Copy conditionally-set variables out one scope. 'chromeos%': '<(chromeos)', @@ -39,6 +42,7 @@ 'use_ash%': '<(use_ash)', 'use_cras%': '<(use_cras)', 'use_ozone%': '<(use_ozone)', + 'embedded%': '<(embedded)', # Whether we are using Views Toolkit 'toolkit_views%': 0, @@ -69,22 +73,24 @@ 'branding%': 'Chromium', 'conditions': [ - # ChromeOS implies ash. - ['chromeos==1', { + # ChromeOS and Windows use Aura and Ash. + ['chromeos==1 or OS=="win"', { 'use_ash%': 1, 'use_aura%': 1, }], - # For now, Windows builds that |use_aura| should also imply using - # ash. This rule should be removed for the future when Windows is - # using the aura windows without the ash interface. - ['use_aura==1 and OS=="win"', { - 'use_ash%': 1, - }], - ['use_ash==1', { + # Ozone uses Aura. + ['use_ozone==1', { 'use_aura%': 1, }], + # Whether we're a traditional desktop unix. + ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and chromeos==0', { + 'desktop_linux%': 1, + }, { + 'desktop_linux%': 0, + }], + # Compute the architecture that we're building on. ['OS=="win" or OS=="mac" or OS=="ios"', { 'host_arch%': 'ia32', @@ -96,14 +102,27 @@ 'host_arch%': '<!(uname -m | sed -e "s/i.86/ia32/;s/x86_64/x64/;s/amd64/x64/;s/arm.*/arm/;s/i86pc/ia32/")', }], + + # Embedded implies ozone. + ['embedded==1', { + 'use_ozone%': 1, + }], + + ['OS=="android"', { + 'android_goma_dir%': '<!(echo "${GOMA_DIR}")', + }, { + 'android_goma_dir%': '' + }], ], }, # Copy conditionally-set variables out one scope. 'chromeos%': '<(chromeos)', + 'desktop_linux%': '<(desktop_linux)', 'use_aura%': '<(use_aura)', 'use_ash%': '<(use_ash)', 'use_cras%': '<(use_cras)', 'use_ozone%': '<(use_ozone)', + 'embedded%': '<(embedded)', 'use_openssl%': '<(use_openssl)', 'enable_viewport%': '<(enable_viewport)', 'enable_hidpi%': '<(enable_hidpi)', @@ -128,7 +147,21 @@ # Set ARM architecture version. 'arm_version%': 7, + # Use aurax11 for clipboard implementation. This is true on linux_aura. + 'use_clipboard_aurax11%': 0, + + # goma settings. + # 1 to use goma. + # If no gomadir is set, it uses the default gomadir. + 'use_goma%': 0, + 'gomadir%': '', + 'conditions': [ + # Ash needs Aura. + ['use_aura==0', { + 'use_ash%': 0, + }], + # Set default value of toolkit_views based on OS. ['OS=="win" or chromeos==1 or use_aura==1', { 'toolkit_views%': 1, @@ -136,20 +169,20 @@ 'toolkit_views%': 0, }], + # Embedded builds use aura without ash or views. + ['embedded==1', { + 'use_aura%': 1, + 'use_ash%': 0, + 'toolkit_views%': 0, + }], + # Set toolkit_uses_gtk for the Chromium browser on Linux. - ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and use_aura==0 and use_ozone==0', { + ['desktop_linux==1 and use_aura==0 and use_ozone==0', { 'toolkit_uses_gtk%': 1, }, { 'toolkit_uses_gtk%': 0, }], - # Whether we're a traditional desktop unix. - ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and chromeos==0', { - 'desktop_linux%': 1, - }, { - 'desktop_linux%': 0, - }], - # Enable HiDPI on Mac OS and Chrome OS. ['OS=="mac" or chromeos==1', { 'enable_hidpi%': 1, @@ -160,8 +193,9 @@ 'enable_touch_ui%': 1, }], - # Enable App Launcher only on ChromeOS, Windows and OSX. - ['use_ash==1 or OS=="win" or OS=="mac"', { + # Enable App Launcher on ChromeOS, Windows and OSX. + # On Linux, enable App Launcher for the Aura build. + ['use_ash==1 or OS=="win" or OS=="mac" or (desktop_linux==1 and use_aura==1)', { 'enable_app_list%': 1, }, { 'enable_app_list%': 0, @@ -172,6 +206,24 @@ }, { 'use_default_render_theme%': 0, }], + + ['use_ozone==1', { + 'use_ozone_evdev%': 1, + }, { + 'use_ozone_evdev%': 0, + }], + + # Set default gomadir. + ['OS=="win"', { + 'gomadir': 'c:\\goma\\goma-win', + }], + ['android_goma_dir!=""', { + 'use_goma': 1, + 'gomadir': '<(android_goma_dir)', + }], + ['OS!="win" and android_goma_dir==""', { + 'gomadir': '<!(/bin/echo -n ${HOME}/goma)', + }], ], }, @@ -186,12 +238,17 @@ 'use_ash%': '<(use_ash)', 'use_cras%': '<(use_cras)', 'use_ozone%': '<(use_ozone)', + 'use_ozone_evdev%': '<(use_ozone_evdev)', + 'use_clipboard_aurax11%': '<(use_clipboard_aurax11)', + 'embedded%': '<(embedded)', 'use_openssl%': '<(use_openssl)', 'enable_viewport%': '<(enable_viewport)', 'enable_hidpi%': '<(enable_hidpi)', 'enable_touch_ui%': '<(enable_touch_ui)', 'android_webview_build%': '<(android_webview_build)', 'google_tv%': '<(google_tv)', + 'use_goma%': '<(use_goma)', + 'gomadir%': '<(gomadir)', 'enable_app_list%': '<(enable_app_list)', 'use_default_render_theme%': '<(use_default_render_theme)', 'buildtype%': '<(buildtype)', @@ -225,7 +282,6 @@ # Python version. 'python_ver%': '2.6', - # Set NEON compilation flags. 'arm_neon%': 1, @@ -310,6 +366,10 @@ # See http://clang.llvm.org/docs/MemorySanitizer.html 'msan%': 0, + # Use the dynamic libraries instrumented by one of the sanitizers + # instead of the standard system libraries. + 'use_instrumented_libraries%': 0, + # Use a modified version of Clang to intercept allocated types and sizes # for allocated objects. clang_type_profiler=1 implies clang=1. # See http://dev.chromium.org/developers/deep-memory-profiler/cpp-object-type-identifier @@ -353,7 +413,7 @@ # 0: Don't specify the version. This option is for the Finch testing. # 1: Use only CLD1. # 2: Use only CLD2. - 'cld_version%': 1, + 'cld_version%': 2, # Enable spell checker. 'enable_spellcheck%': 1, @@ -439,10 +499,13 @@ # Platform sends memory pressure signals natively. 'native_memory_pressure_signals%': 0, + 'data_reduction_fallback_host%' : '', 'spdy_proxy_auth_origin%' : '', 'spdy_proxy_auth_property%' : '', 'spdy_proxy_auth_value%' : '', + 'data_reduction_proxy_probe_url%' : '', 'enable_mdns%' : 0, + 'enable_enhanced_bookmarks%': 0, 'conditions': [ # A flag for POSIX platforms @@ -460,6 +523,8 @@ }], # Set armv7 for backward compatibility. + # TODO(mostynb@opera.com): remove armv7 once all uses are + # removed http://crbug.com/234135 ['arm_version==7', { 'armv7': 1, }, { @@ -473,6 +538,13 @@ 'use_nss%': 0, }], + # libudev usage. This currently only affects the content layer. + ['OS=="linux" and embedded==0', { + 'use_udev%': 1, + }, { + 'use_udev%': 0, + }], + # Flags to use X11 on non-Mac POSIX platforms. ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', { 'use_x11%': 0, @@ -480,13 +552,31 @@ 'use_x11%': 1, }], - # Flags to use pango and glib on non-Mac POSIX platforms. - ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android"', { + ['OS=="linux" and use_aura==1 and chromeos==0', { + 'use_clipboard_aurax11%': 1, + }], + + # Flags to use glib. + ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or embedded==1', { 'use_glib%': 0, - 'use_pango%': 0, }, { 'use_glib%': 1, + }], + + # Flags to use pango and cairo. + ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or embedded==1', { + 'use_pango%': 0, + 'use_cairo%': 0, + }, { 'use_pango%': 1, + 'use_cairo%': 1, + }], + + # DBus usage. + ['OS=="linux" and embedded==0', { + 'use_dbus%': 1, + }, { + 'use_dbus%': 0, }], # We always use skia text rendering in Aura on Windows, since GDI @@ -500,7 +590,7 @@ # on gnome-keyring. If that dependency is disabled, no gnome-keyring # support will be available. This option is useful # for Linux distributions and for Aura. - ['chromeos==1 or use_aura==1', { + ['OS!="linux" or chromeos==1 or use_aura==1', { 'use_gnome_keyring%': 0, }, { 'use_gnome_keyring%': 1, @@ -536,16 +626,8 @@ 'arm_neon_optional%': 1, 'native_discardable_memory%': 1, 'native_memory_pressure_signals%': 1, - }], - - # Enable basic printing for Chrome for Android but disable printing - # completely for WebView. - ['OS=="android" and android_webview_build==0', { 'enable_printing%': 2, }], - ['OS=="android" and android_webview_build==1', { - 'enable_printing%': 0, - }], # Android OS includes support for proprietary codecs regardless of # building Chromium or Google Chrome. We also ship Google Chrome with @@ -556,6 +638,11 @@ 'proprietary_codecs%': 0, }], + ['OS=="mac" or OS=="ios"', { + 'native_discardable_memory%': 1, + 'native_memory_pressure_signals%': 1, + }], + # Enable autofill dialog for Android, Mac and Views-enabled platforms. ['toolkit_views==1 or (OS=="android" and android_webview_build==0) or OS=="mac"', { 'enable_autofill_dialog%': 1 @@ -608,7 +695,7 @@ 'enable_plugin_installation%': 1, }], - ['(OS=="android" and google_tv!=1) or OS=="ios"', { + ['(OS=="android" and google_tv!=1) or OS=="ios" or embedded==1', { 'enable_plugins%': 0, }, { 'enable_plugins%': 1, @@ -632,14 +719,6 @@ 'linux_use_gold_flags%': 0, }], - ['chromeos==1', { - 'linux_use_libgps%': 1, - }, { # chromeos==0 - # Do not use libgps on desktop Linux by default, - # see http://crbug.com/103751. - 'linux_use_libgps%': 0, - }], - ['OS=="android" or OS=="ios"', { 'enable_captive_portal_detection%': 0, }, { @@ -681,7 +760,6 @@ 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/arm-sysroot', }], # OS=="linux" and target_arch=="arm" and chromeos==0 - ['OS=="linux" and branding=="Chrome" and buildtype=="Official" and chromeos==0', { 'conditions': [ ['target_arch=="x64"', { @@ -701,7 +779,7 @@ # Whether tests targets should be run, archived or just have the # dependencies verified. All the tests targets have the '_run' suffix, # e.g. base_unittests_run runs the target base_unittests. The test - # target always calls tools/swarm_client/isolate.py. See the script's + # target always calls tools/swarming_client/isolate.py. See the script's # --help for more information and the valid --mode values. Meant to be # overriden with GYP_DEFINES. # TODO(maruel): Remove the conditions as more configurations are @@ -716,11 +794,13 @@ }, { 'test_isolation_mode%': 'noop', }], - # Whether Android ARM build uses OpenMAX DL FFT. - ['OS=="android" and target_arch=="arm" and android_webview_build==0', { - # Currently only supported on Android ARM, without webview. - # When enabled, this will also enable WebAudio on Android - # ARM. Default is enabled. + # Whether Android ARM or x86 build uses OpenMAX DL FFT. + ['OS=="android" and ((target_arch=="arm" and arm_version >= 7) or target_arch=="ia32") and android_webview_build==0', { + # Currently only supported on Android ARMv7+, or ia32 + # without webview. When enabled, this will also enable + # WebAudio support on Android ARM and ia32. Default is + # enabled. Whether WebAudio is actually available depends + # on runtime settings and flags. 'use_openmax_dl_fft%': 1, }, { 'use_openmax_dl_fft%': 0, @@ -733,9 +813,15 @@ # on android_clang, where we're hitting a weird linker error. # TODO(dpranke): http://crbug.com/266155 . ['OS=="android"', { - 'v8_optimized_debug': 1, + 'v8_optimized_debug%': 1, }, { - 'v8_optimized_debug': 2, + 'v8_optimized_debug%': 2, + }], + + # Disable various features by default on embedded. + ['embedded==1', { + 'remoting%': 0, + 'enable_printing%': 0, }], ], @@ -801,11 +887,16 @@ 'use_cras%': '<(use_cras)', 'use_openssl%': '<(use_openssl)', 'use_nss%': '<(use_nss)', + 'use_udev%': '<(use_udev)', 'os_bsd%': '<(os_bsd)', 'os_posix%': '<(os_posix)', + 'use_dbus%': '<(use_dbus)', 'use_glib%': '<(use_glib)', 'use_pango%': '<(use_pango)', + 'use_cairo%': '<(use_cairo)', 'use_ozone%': '<(use_ozone)', + 'use_ozone_evdev%': '<(use_ozone_evdev)', + 'use_clipboard_aurax11%': '<(use_clipboard_aurax11)', 'toolkit_uses_gtk%': '<(toolkit_uses_gtk)', 'desktop_linux%': '<(desktop_linux)', 'use_x11%': '<(use_x11)', @@ -847,6 +938,7 @@ 'msan%': '<(msan)', 'tsan%': '<(tsan)', 'tsan_blacklist%': '<(tsan_blacklist)', + 'use_instrumented_libraries%': '<(use_instrumented_libraries)', 'clang_type_profiler%': '<(clang_type_profiler)', 'order_profiling%': '<(order_profiling)', 'order_text_section%': '<(order_text_section)', @@ -859,7 +951,6 @@ 'enable_background%': '<(enable_background)', 'linux_use_gold_binary%': '<(linux_use_gold_binary)', 'linux_use_gold_flags%': '<(linux_use_gold_flags)', - 'linux_use_libgps%': '<(linux_use_libgps)', 'use_canvas_skia%': '<(use_canvas_skia)', 'test_isolation_mode%': '<(test_isolation_mode)', 'test_isolation_outdir%': '<(test_isolation_outdir)', @@ -889,12 +980,17 @@ 'enable_managed_users%': '<(enable_managed_users)', 'native_discardable_memory%': '<(native_discardable_memory)', 'native_memory_pressure_signals%': '<(native_memory_pressure_signals)', + 'data_reduction_fallback_host%': '<(data_reduction_fallback_host)', 'spdy_proxy_auth_origin%': '<(spdy_proxy_auth_origin)', 'spdy_proxy_auth_property%': '<(spdy_proxy_auth_property)', 'spdy_proxy_auth_value%': '<(spdy_proxy_auth_value)', + 'data_reduction_proxy_probe_url%': '<(data_reduction_proxy_probe_url)', 'enable_mdns%' : '<(enable_mdns)', - 'v8_optimized_debug': '<(v8_optimized_debug)', + 'enable_enhanced_bookmarks%' : '<(enable_enhanced_bookmarks)', + 'v8_optimized_debug%': '<(v8_optimized_debug)', 'proprietary_codecs%': '<(proprietary_codecs)', + 'use_goma%': '<(use_goma)', + 'gomadir%': '<(gomadir)', # Use system nspr instead of the bundled one. 'use_system_nspr%': 0, @@ -929,18 +1025,20 @@ # The default value for mac_strip in target_defaults. This cannot be # set there, per the comment about variable% in a target_defaults. - 'mac_strip_release%': 1, - - # Set to 1 to enable code coverage. In addition to build changes - # (e.g. extra CFLAGS), also creates a new target in the src/chrome - # project file called "coverage". - # Currently ignored on Windows. - 'coverage%': 0, + 'mac_strip_release%': 0, # Set to 1 to enable java code coverage. Instruments classes during build # to produce .ec files during runtime. 'emma_coverage%': 0, + # EMMA filter string consisting of a list of inclusion/exclusion patterns + # separated with whitespace and/or comma. Only has effect if + # 'emma_coverage=1'. + 'emma_filter%': '', + + # Set to 1 to enable running Android lint on java/class files. + 'android_lint%': 0, + # Set to 1 to force Visual C++ to use legacy debug information format /Z7. # This is useful for parallel compilation tools which can't support /Zi. # Only used on Windows. @@ -1013,8 +1111,6 @@ # Profile without optimizing out stack frames when profiling==1. 'profiling_full_stack_frames%': '0', - # Enable strict glibc debug mode. - 'glibcxx_debug%': 0, # And if we want to dump symbols for Breakpad-enabled builds. 'linux_dump_symbols%': 0, # And if we want to strip the binary after dumping symbols. @@ -1026,13 +1122,6 @@ 'linux_use_tcmalloc%': 1, 'android_use_tcmalloc%': 0, - # Disable TCMalloc's heapchecker. - 'linux_use_heapchecker%': 0, - - # Disable shadow stack keeping used by heapcheck to unwind the stacks - # better. - 'linux_keep_shadow_stacks%': 0, - # Set to 1 to link against libgnome-keyring instead of using dlopen(). 'linux_link_gnome_keyring%': 0, # Set to 1 to link against gsettings APIs instead of using dlopen(). @@ -1050,10 +1139,6 @@ # Enable EGLImage support in OpenMAX 'enable_eglimage%': 1, - # Enable a variable used elsewhere throughout the GYP files to determine - # whether to compile in the sources for the GPU plugin / process. - 'enable_gpu%': 1, - # .gyp files or targets should set chromium_code to 1 if they build # Chromium-specific code, as opposed to external code. This variable is # used to control such things as the set of warnings to enable, and @@ -1071,6 +1156,9 @@ # Set to 1 to compile with the OpenGL ES 2.0 conformance tests. 'internal_gles2_conform_tests%': 0, + # Set to 1 to compile the filter fuzzer. + 'internal_filter_fuzzer%': 0, + # NOTE: When these end up in the Mac bundle, we need to replace '-' for '_' # so Cocoa is happy (http://crbug.com/20441). 'locales': [ @@ -1134,8 +1222,8 @@ # Contains data about the attached devices for gyp_managed_install. 'build_device_config_path': '<(PRODUCT_DIR)/build_devices.cfg', - 'sas_dll_exists': '<!(python <(DEPTH)/build/dir_exists.py <(sas_dll_path))', - 'wix_exists': '<!(python <(DEPTH)/build/dir_exists.py <(wix_path))', + 'sas_dll_exists': '<!(python <(DEPTH)/build/dir_exists.py "<(sas_dll_path)")', + 'wix_exists': '<!(python <(DEPTH)/build/dir_exists.py "<(wix_path)")', 'windows_sdk_default_path': '<(DEPTH)/third_party/platformsdk_win8/files', 'directx_sdk_default_path': '<(DEPTH)/third_party/directxsdk/files', @@ -1159,6 +1247,16 @@ # Relative path to icu.gyp from this file. 'icu_gyp_path': '../third_party/icu/icu.gyp', + # IPC fuzzer is disabled by default. + 'enable_ipc_fuzzer%': 0, + + # Whether or not to use "icu*.dat" file for ICU data. + # Do not use it by default. + 'icu_use_data_file_flag%': 0, + + # Force disable libstdc++ debug mode. + 'disable_glibcxx_debug%': 0, + 'conditions': [ # The version of GCC in use, set later in platforms that use GCC and have # not explicitly chosen to build with clang. Currently, this means all @@ -1210,7 +1308,6 @@ ['OS=="ios"', { 'disable_nacl%': 1, 'enable_background%': 0, - 'enable_gpu%': 0, 'enable_task_manager%': 0, 'icu_use_data_file_flag%': 1, 'use_system_libxml%': 1, @@ -1330,10 +1427,6 @@ # Location of the "readelf" binary. 'android_readelf%' : '<!(/bin/echo -n <(android_toolchain)/*-readelf)', - # Provides an absolute path to PRODUCT_DIR (e.g. out/Release). Used - # to specify the output directory for Ant in the Android build. - 'ant_build_out': '`cd <(PRODUCT_DIR) && pwd -P`', - # Determines whether we should optimize JNI generation at the cost of # breaking assumptions in the build system that when inputs have changed # the outputs should always change as well. This is meant purely for @@ -1380,8 +1473,6 @@ 'use_system_icu%': '<(android_webview_build)', 'use_system_stlport%': '<(android_webview_build)', - 'enable_managed_users%': 0, - # Copy it out one scope. 'android_webview_build%': '<(android_webview_build)', }], # OS=="android" @@ -1393,6 +1484,13 @@ ['OS=="mac"', { # Enable clang on mac by default! 'clang%': 1, + 'conditions': [ + # All Chrome builds have breakpad symbols, but only process the + # symbols from official builds. + ['(branding=="Chrome" and buildtype=="Official")', { + 'mac_strip_release%': 1, + }], + ], }], # OS=="mac" ['OS=="mac" or OS=="ios"', { 'variables': { @@ -1480,8 +1578,10 @@ # .obj files. 'incremental_chrome_dll%': 1, }], - # Don't do incremental linking for large modules on 32-bit. - ['MSVS_OS_BITS==32', { + # Don't do incremental linking for large modules on 32-bit or when + # component=static_library as the toolchain fails due to the size of + # the .ilk files. + ['MSVS_OS_BITS==32 or component=="static_library"', { 'msvs_large_module_debug_link_mode%': '1', # No },{ 'msvs_large_module_debug_link_mode%': '2', # Yes @@ -1539,7 +1639,7 @@ # Options controlling the use of GConf (the classic GNOME configuration # system) and GIO, which contains GSettings (the new GNOME config system). - ['chromeos==1', { + ['chromeos==1 or embedded==1', { 'use_gconf%': 0, 'use_gio%': 0, }, { @@ -1590,6 +1690,11 @@ ['use_titlecase_in_grd_files==1', { 'grit_defines': ['-D', 'use_titlecase'], }], + ['OS=="android" and target_arch=="ia32"', { + # WebAudio on Android/x86 is disabled by default, unlike + # everywhere else, so use appropriate message. + 'grit_defines': ['-D', 'use_webaudio_enable_message'], + }], ['use_third_party_translations==1', { 'grit_defines': ['-D', 'use_third_party_translations'], 'locales': [ @@ -1627,6 +1732,10 @@ ['enable_extensions==1', { 'grit_defines': ['-D', 'enable_extensions'], }], + ['enable_plugins!=0', { + + 'grit_defines': ['-D', 'enable_plugins'], + }], ['enable_printing!=0', { 'grit_defines': ['-D', 'enable_printing'], }], @@ -1651,6 +1760,9 @@ ['enable_mdns==1', { 'grit_defines': ['-D', 'enable_mdns'], }], + ['enable_enhanced_bookmarks==1', { + 'grit_defines': ['-D', 'enable_enhanced_bookmarks'], + }], ['clang_use_chrome_plugins==1 and OS!="win"', { 'clang_chrome_plugins_flags': [ '<!@(<(DEPTH)/tools/clang/scripts/plugin_flags.sh)' @@ -1745,25 +1857,17 @@ 'release_valgrind_build': 1, }], - # Enable RLZ on Win, Mac and ChromeOS. - ['branding=="Chrome" and (OS=="win" or OS=="mac" or chromeos==1)', { + # Enable RLZ on Win, Mac, iOS and ChromeOS. + ['branding=="Chrome" and (OS=="win" or OS=="mac" or OS=="ios" or chromeos==1)', { 'enable_rlz%': 1, }], # Set default compiler flags depending on ARM version. - ['arm_version==5 and android_webview_build==0', { - # Flags suitable for Android emulator - 'arm_arch%': 'armv5te', - 'arm_tune%': 'xscale', - 'arm_fpu%': '', - 'arm_float_abi%': 'soft', - 'arm_thumb%': 0, - }], ['arm_version==6 and android_webview_build==0', { 'arm_arch%': 'armv6', 'arm_tune%': '', - 'arm_fpu%': '', - 'arm_float_abi%': 'soft', + 'arm_fpu%': 'vfp', + 'arm_float_abi%': 'softfp', 'arm_thumb%': 0, }], ['arm_version==7 and android_webview_build==0', { @@ -1776,6 +1880,7 @@ 'arm_fpu%': 'vfpv3-d16', }], ], + # Change the default to hard once the armhf transition is complete. 'arm_float_abi%': 'softfp', 'arm_thumb%': 1, }], @@ -1788,13 +1893,37 @@ 'arm_float_abi%': '', 'arm_thumb%': 0, }], - ], + # Enable brlapi by default for chromeos. + [ 'chromeos==1', { + 'use_brlapi%': 1, + }], + + ['use_ozone==1', { + # This is the default platform + 'ozone_platform%': "test", + + # Enable built-in ozone platforms if ozone is enabled. + 'ozone_platform_dri%': 1, + 'ozone_platform_test%': 1, + }, { # use_ozone==0 + 'ozone_platform_dri%': 0, + 'ozone_platform_test%': 0, + }], + ['OS=="win" and use_goma==1', { + # goma doesn't support pch yet. + 'chromium_win_pch': 0, + # goma doesn't support PDB yet, so win_z7=1 or fastbuild=1. + 'conditions': [ + ['fastbuild==0', { + 'win_z7': 1, + }], + ], + }], + ], - # The path to the ANGLE library. TODO(apatrick): This is to help - # transition to a new version of ANGLE at a new location. After the - # transition is complete, this can be removed. - 'angle_path': '<(DEPTH)/third_party/angle_dx11', + # The path to the ANGLE library. + 'angle_path': '<(DEPTH)/third_party/angle', # List of default apps to install in new profiles. The first list contains # the source files as found in svn. The second list, used only for linux, @@ -1887,7 +2016,7 @@ 'nacl_untrusted_build%': 0, 'pnacl_compile_flags': [ - # pnacl uses the clang compiler so we need to supress all the + # pnacl uses the clang compiler so we need to suppress all the # same warnings as we do for clang. # TODO(sbc): Remove these if/when they are removed from the clang # build. @@ -1919,9 +2048,8 @@ ], }, 'defines': [ - # Set this to use the new DX11 version of ANGLE. - # TODO(apatrick): Remove this when the transition is complete. - 'ANGLE_DX11', + # Don't use deprecated V8 APIs anywhere. + 'V8_DEPRECATION_WARNINGS', ], 'conditions': [ ['(OS=="mac" or OS=="ios") and asan==1', { @@ -1983,9 +2111,15 @@ ['use_ash==1', { 'defines': ['USE_ASH=1'], }], + ['use_cairo==1', { + 'defines': ['USE_CAIRO=1'], + }], ['use_cras==1', { 'defines': ['USE_CRAS=1'], }], + ['use_glib==1', { + 'defines': ['USE_GLIB=1'], + }], ['use_ozone==1', { 'defines': ['USE_OZONE=1'], }], @@ -2001,6 +2135,9 @@ ['use_x11==1', { 'defines': ['USE_X11=1'], }], + ['use_clipboard_aurax11==1', { + 'defines': ['USE_CLIPBOARD_AURAX11=1'], + }], ['use_libcpp==1', { 'defines': ['USE_UNORDERED_CONTAINERS=1'], 'cflags_cc': [ @@ -2008,6 +2145,7 @@ '-Wno-newline-eof', '-Wno-unused-value', '-Wno-unused-variable', + '-Wno-unused-function', '-stdlib=libc++' ], }], @@ -2023,7 +2161,10 @@ 'defines': ['OS_CHROMEOS=1'], }], ['google_tv==1', { - 'defines': ['GOOGLE_TV=1'], + 'defines': [ + 'GOOGLE_TV=1', + 'VIDEO_HOLE=1', + ], }], ['use_xi2_mt!=0 and use_x11==1', { 'defines': ['USE_XI2_MT=<(use_xi2_mt)'], @@ -2037,10 +2178,6 @@ ['profiling==1', { 'defines': ['ENABLE_PROFILING=1'], }], - ['OS=="linux" and glibcxx_debug==1', { - 'defines': ['_GLIBCXX_DEBUG=1',], - 'cflags_cc+': ['-g'], - }], ['remoting==1', { 'defines': ['ENABLE_REMOTING=1'], }], @@ -2068,6 +2205,26 @@ ['enable_hidpi==1', { 'defines': ['ENABLE_HIDPI=1'], }], + ['native_discardable_memory==1', { + 'defines': ['DISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY'], + }], + ['native_memory_pressure_signals==1', { + 'defines': ['SYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE'], + }], + ['use_udev==1', { + 'defines': ['USE_UDEV'], + }], + ['icu_use_data_file_flag==1', { + 'defines': ['ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE'], + }, { # else icu_use_data_file_flag !=1 + 'conditions': [ + ['OS=="win"', { + 'defines': ['ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_SHARED'], + }, { + 'defines': ['ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC'], + }], + ], + }], ['fastbuild!=0', { 'xcode_settings': { 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO', @@ -2159,11 +2316,6 @@ }], ], }], - ['enable_gpu==1', { - 'defines': [ - 'ENABLE_GPU=1', - ], - }], ['use_openssl==1', { 'defines': [ 'USE_OPENSSL=1', @@ -2187,55 +2339,6 @@ 'MEMORY_TOOL_REPLACES_ALLOCATOR', ], }], # asan==1 and OS=="win" - ['coverage!=0', { - 'conditions': [ - ['OS=="mac" or OS=="ios"', { - 'xcode_settings': { - 'GCC_INSTRUMENT_PROGRAM_FLOW_ARCS': 'YES', # -fprofile-arcs - 'GCC_GENERATE_TEST_COVERAGE_FILES': 'YES', # -ftest-coverage - }, - }], - ['OS=="mac"', { - # Add -lgcov for types executable, shared_library, and - # loadable_module; not for static_library. - # This is a delayed conditional. - 'target_conditions': [ - ['_type!="static_library"', { - 'xcode_settings': { 'OTHER_LDFLAGS': [ '-lgcov' ] }, - }], - ], - }], - ['OS=="linux" or OS=="android"', { - 'cflags': [ '-ftest-coverage', - '-fprofile-arcs' ], - 'link_settings': { 'libraries': [ '-lgcov' ] }, - }], - ['OS=="win"', { - 'variables': { - # Disable incremental linking for all modules. - # 0: inherit, 1: disabled, 2: enabled. - 'msvs_debug_link_incremental': '1', - 'msvs_large_module_debug_link_mode': '1', - # Disable RTC. Syzygy explicitly doesn't support RTC instrumented - # binaries for now. - 'win_debug_RuntimeChecks': '0', - }, - 'defines': [ - # Disable iterator debugging (huge speed boost without any - # change in coverage results). - '_HAS_ITERATOR_DEBUGGING=0', - ], - 'msvs_settings': { - 'VCLinkerTool': { - # Enable profile information (necessary for coverage - # instrumentation). This is incompatible with incremental - # linking. - 'Profile': 'true', - }, - } - }], # OS==win - ], # conditions for coverage - }], # coverage!=0 ['OS=="win"', { 'defines': [ '__STD_C', @@ -2244,6 +2347,8 @@ # This define is required to pull in the new Win8 interfaces from # system headers like ShObjIdl.h. 'NTDDI_VERSION=0x06020000', + # This is required for ATL to use XP-safe versions of its functions. + '_USING_V110_SDK71_', ], 'include_dirs': [ '<(DEPTH)/third_party/wtl/include', @@ -2340,6 +2445,10 @@ ['enable_managed_users==1', { 'defines': ['ENABLE_MANAGED_USERS=1'], }], + ['data_reduction_fallback_host != ""', { + 'defines': [ + 'DATA_REDUCTION_FALLBACK_HOST="<(data_reduction_fallback_host)"'], + }], ['spdy_proxy_auth_origin != ""', { 'defines': ['SPDY_PROXY_AUTH_ORIGIN="<(spdy_proxy_auth_origin)"'], }], @@ -2349,9 +2458,19 @@ ['spdy_proxy_auth_value != ""', { 'defines': ['SPDY_PROXY_AUTH_VALUE="<(spdy_proxy_auth_value)"'], }], + ['data_reduction_proxy_probe_url != ""', { + 'defines': [ + 'DATA_REDUCTION_PROXY_PROBE_URL="<(data_reduction_proxy_probe_url)"'], + }], ['enable_mdns==1', { 'defines': ['ENABLE_MDNS=1'], - }] + }], + ['enable_enhanced_bookmarks==1', { + 'defines': ['ENABLE_ENHANCED_BOOKMARKS=1'], + }], + ['enable_ipc_fuzzer==1', { + 'defines': ['ENABLE_IPC_FUZZER=1'], + }], ], # conditions for 'target_defaults' 'target_conditions': [ ['enable_wexit_time_destructors==1', { @@ -2387,8 +2506,7 @@ '-Wno-format', ], 'cflags_cc!': [ - # TODO(fischman): remove this. - # http://code.google.com/p/chromium/issues/detail?id=90453 + # Necessary because llvm.org/PR10448 is WONTFIX (crbug.com/90453). '-Wsign-compare', ] }], @@ -2455,6 +2573,9 @@ # flagged in an iOS build. 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', 'RUN_CLANG_STATIC_ANALYZER': 'NO', + # Several internal ios directories generate numerous warnings for + # -Wobjc-missing-property-synthesis. + 'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'NO', }, }], ], @@ -2520,6 +2641,8 @@ 'odbc32.lib', 'odbccp32.lib', 'delayimp.lib', + 'credui.lib', + 'netapi32.lib', ], }, }, @@ -2530,6 +2653,9 @@ 'VCLinkerTool': { 'TargetMachine': '1', }, + 'VCLibrarianTool': { + 'TargetMachine': '1', + }, }, 'msvs_configuration_platform': 'Win32', }, @@ -2551,6 +2677,7 @@ ['<(windows_sdk_path)/Lib/win8/um/x86'], 'AdditionalLibraryDirectories': ['<(windows_sdk_path)/Lib/win8/um/x64'], + 'TargetMachine': '17', # x64 }, }, }, @@ -2629,6 +2756,12 @@ }], ], }], + ['OS=="linux" and target_arch!="ia32" and disable_glibcxx_debug==0', { + # Enable libstdc++ debugging facilities to help catch problems + # early, see http://crbug.com/65151 . + # TODO(phajdan.jr): Should we enable this for all of POSIX? + 'defines': ['_GLIBCXX_DEBUG=1',], + }], # Disabled on iOS because it was causing a crash on startup. # TODO(michelea): investigate, create a reduced test and possibly # submit a radar. @@ -2720,13 +2853,17 @@ ['win_use_allocator_shim==0', { 'defines': ['NO_TCMALLOC'], }], - ['os_posix==1 and chromium_code==1', { - # Non-chromium code is not guaranteed to compile cleanly - # with _FORTIFY_SOURCE. Also, fortified build may fail - # when optimizations are disabled, so only do that for Release - # build. - 'defines': [ - '_FORTIFY_SOURCE=2', + ['os_posix==1', { + 'target_conditions': [ + ['chromium_code==1', { + # Non-chromium code is not guaranteed to compile cleanly + # with _FORTIFY_SOURCE. Also, fortified build may fail + # when optimizations are disabled, so only do that for Release + # build. + 'defines': [ + '_FORTIFY_SOURCE=2', + ], + }], ], }], ['OS=="linux" or OS=="android"', { @@ -2824,9 +2961,7 @@ # Surprisingly, not covered by -fvisibility=hidden. '-fvisibility-inlines-hidden', # GCC turns on -Wsign-compare for C++ under -Wall, but clang doesn't, - # so we specify it explicitly. - # TODO(fischman): remove this if http://llvm.org/PR10448 obsoletes it. - # http://code.google.com/p/chromium/issues/detail?id=90453 + # so we specify it explicitly. (llvm.org/PR10448, crbug.com/90453) '-Wsign-compare', ], 'ldflags': [ @@ -2962,19 +3097,6 @@ ], }, }, - 'variants': { - 'coverage': { - 'cflags': ['-fprofile-arcs', '-ftest-coverage'], - 'ldflags': ['-fprofile-arcs'], - }, - 'profile': { - 'cflags': ['-pg', '-g'], - 'ldflags': ['-pg'], - }, - 'symbols': { - 'cflags': ['-g'], - }, - }, 'conditions': [ ['target_arch=="ia32"', { 'target_conditions': [ @@ -3139,6 +3261,10 @@ '-fuse-ld=gold', '-Wno-psabi', ], + 'ldflags!': [ + # Clang does not support the following options. + '-fuse-ld=gold', + ], }], ], }], @@ -3198,8 +3324,10 @@ # Don't die on dtoa code that uses a char as an array index. '-Wno-char-subscripts', - # Clang spots more unused functions. - '-Wno-unused-function', + # TODO(thakis): This used to be implied by -Wno-unused-function, + # which we no longer use. Check if it makes sense to remove + # this as well. http://crbug.com/316352 + '-Wno-unneeded-internal-declaration', # Warns on switches on enums that cover all enum values but # also contain a default: branch. Chrome is full of that. @@ -3381,6 +3509,34 @@ }], ], }], + ['use_instrumented_libraries==1', { + 'dependencies': [ + '<(DEPTH)/third_party/instrumented_libraries/instrumented_libraries.gyp:instrumented_libraries', + ], + 'conditions': [ + ['asan==1', { + 'target_conditions': [ + ['_toolset=="target"', { + 'ldflags': [ + # Add RPATH to result binary to make it linking instrumented libraries ($ORIGIN means relative RPATH) + '-Wl,-R,\$$ORIGIN/instrumented_libraries/asan/lib/:\$$ORIGIN/instrumented_libraries/asan/usr/lib/x86_64-linux-gnu/', + '-Wl,-z,origin', + ], + }], + ], + }], + ['msan==1', { + 'target_conditions': [ + ['_toolset=="target"', { + 'ldflags': [ + '-Wl,-R,\$$ORIGIN/instrumented_libraries/msan/lib/:\$$ORIGIN/instrumented_libraries/msan/usr/lib/x86_64-linux-gnu/', + '-Wl,-z,origin', + ], + }], + ], + }], + ], + }], ['order_profiling!=0 and (chromeos==1 or OS=="linux" or OS=="android")', { 'target_conditions' : [ ['_toolset=="target"', { @@ -3415,32 +3571,9 @@ }], ], }], - ['linux_use_heapchecker==1', { - 'variables': {'linux_use_tcmalloc%': 1}, - 'defines': [ - 'USE_HEAPCHECKER', - 'MEMORY_TOOL_REPLACES_ALLOCATOR', - ], - 'conditions': [ - ['component=="shared_library"', { - # See crbug.com/112389 - # TODO(glider): replace with --dynamic-list or something - 'ldflags': ['-rdynamic'], - }], - ], - }], ['linux_use_tcmalloc==0 and android_use_tcmalloc==0', { 'defines': ['NO_TCMALLOC'], }], - ['linux_keep_shadow_stacks==1', { - 'defines': ['KEEP_SHADOW_STACKS'], - 'cflags': [ - '-finstrument-functions', - # Allow mmx intrinsics to inline, so that the compiler can expand - # the intrinsics. - '-finstrument-functions-exclude-file-list=mmintrin.h', - ], - }], ['linux_use_gold_flags==1', { 'target_conditions': [ ['_toolset=="target"', { @@ -3479,15 +3612,9 @@ # unspecified what the cwd is when running the compiler, # so the normal gyp path-munging fails us. This hack # gets the right path. - '-B<(PRODUCT_DIR)/../../third_party/gold', + '-B<!(cd <(DEPTH) && pwd -P)/third_party/gold', ], }], - ['native_discardable_memory', { - 'defines': ['DISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY'], - }], - ['native_memory_pressure_signals', { - 'defines': ['SYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE'], - }], ], }, }], @@ -3709,20 +3836,24 @@ '-Wno-sign-promo', ], }], - ['android_webview_build==1 and chromium_code==0', { - 'cflags': [ - # There is a class of warning which: - # 1) Android always enables and also treats as errors - # 2) Chromium ignores in third party code - # So we re-enable those warnings when building Android. - '-Wno-address', - '-Wno-format-security', - '-Wno-return-type', - '-Wno-sequence-point', + ['android_webview_build==1', { + 'target_conditions': [ + ['chromium_code==0', { + 'cflags': [ + # There is a class of warning which: + # 1) Android always enables and also treats as errors + # 2) Chromium ignores in third party code + # So we re-enable those warnings when building Android. + '-Wno-address', + '-Wno-format-security', + '-Wno-return-type', + '-Wno-sequence-point', + ], + 'cflags_cc': [ + '-Wno-non-virtual-dtor', + ], + }], ], - 'cflags_cc': [ - '-Wno-non-virtual-dtor', - ] }], ['target_arch == "arm"', { 'ldflags': [ @@ -3912,8 +4043,10 @@ # This is required solely for base/third_party/dmg_fp/dtoa.cc. '-Wno-char-subscripts', - # Clang spots more unused functions. - '-Wno-unused-function', + # TODO(thakis): This used to be implied by -Wno-unused-function, + # which we no longer use. Check if it makes sense to remove + # this as well. http://crbug.com/316352 + '-Wno-unneeded-internal-declaration', # Warns on switches on enums that cover all enum values but # also contain a default: branch. Chrome is full of that. @@ -3936,6 +4069,7 @@ '-Wno-newline-eof', '-Wno-unused-value', '-Wno-unused-variable', + '-Wno-unused-function', '-Wno-header-hygiene', ], }], @@ -4209,10 +4343,8 @@ # Don't die on dtoa code that uses a char as an array index. # This is required solely for base/third_party/dmg_fp/dtoa.cc. '-Wno-char-subscripts', - # Clang spots more unused functions. - '-Wno-unused-function', - # See comments on this flag higher up in this file. - '-Wno-unnamed-type-template-args', + # See comment in the mac clang section above for this flag. + '-Wno-unneeded-internal-declaration', # Match OS X clang C++11 warning settings. '-Wno-c++11-narrowing', ], @@ -4222,12 +4354,10 @@ 'xcode_settings': { 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)', + 'ARCHS': [ + 'x86_64' + ], }, - 'conditions': [ - ['"<(GENERATOR)"!="xcode"', { - 'xcode_settings': { 'ARCHS': [ 'x86_64' ] }, - }], - ], }], ['_toolset=="target"', { 'xcode_settings': { @@ -4236,13 +4366,6 @@ # instead set it here for target only. 'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_deployment_target)', }, - 'conditions': [ - ['target_arch=="armv7" and "<(GENERATOR)"!="xcode"', { - 'xcode_settings': { 'ARCHS': [ 'armv7' ]}, - }, { - 'xcode_settings': { 'ARCHS': [ 'i386' ] }, - }], - ], }], ['_type=="executable"', { 'configurations': { @@ -4259,77 +4382,17 @@ }, }, }, - 'conditions': [ - ['"<(GENERATOR)"=="xcode"', { - 'xcode_settings': { - # TODO(justincohen): ninja builds don't support signing yet. - 'conditions': [ - ['chromium_ios_signing', { - # iOS SDK wants everything for device signed. - 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': 'iPhone Developer', - }, { - 'CODE_SIGNING_REQUIRED': 'NO', - 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '', - }], - ], - }, - }], - ['"<(GENERATOR)"=="xcode" and clang!=1', { - 'xcode_settings': { - # It is necessary to link with the -fobjc-arc flag to use - # subscripting on iOS < 6. - 'OTHER_LDFLAGS': [ - '-fobjc-arc', - ], - }, - }], - ['clang==1', { - 'target_conditions': [ - ['_toolset=="target"', { - 'variables': { - 'developer_dir': '<!(xcode-select -print-path)', - 'arc_toolchain_path': '<(developer_dir)/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc', - }, - # It is necessary to force load libarclite from Xcode for - # third_party/llvm-build because libarclite_* is only - # distributed by Xcode. - 'conditions': [ - ['"<(GENERATOR)"=="ninja" and target_arch=="armv7"', { - 'xcode_settings': { - 'OTHER_LDFLAGS': [ - '-force_load', - '<(arc_toolchain_path)/libarclite_iphoneos.a', - ], - }, - }], - ['"<(GENERATOR)"=="ninja" and target_arch!="armv7"', { - 'xcode_settings': { - 'OTHER_LDFLAGS': [ - '-force_load', - '<(arc_toolchain_path)/libarclite_iphonesimulator.a', - ], - }, - }], - # Xcode sets target_arch at compile-time. - ['"<(GENERATOR)"=="xcode"', { - 'xcode_settings': { - 'OTHER_LDFLAGS[arch=armv7]': [ - '$(inherited)', - '-force_load', - '<(arc_toolchain_path)/libarclite_iphoneos.a', - ], - 'OTHER_LDFLAGS[arch=i386]': [ - '$(inherited)', - '-force_load', - '<(arc_toolchain_path)/libarclite_iphonesimulator.a', - ], - }, - }], - ], - }], - ], - }], - ], + 'xcode_settings': { + 'conditions': [ + ['chromium_ios_signing', { + # iOS SDK wants everything for device signed. + 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': 'iPhone Developer', + }, { + 'CODE_SIGNING_REQUIRED': 'NO', + 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '', + }], + ], + }, }], ], # target_conditions }, # target_defaults @@ -4455,6 +4518,23 @@ '<(windows_driver_kit_path)/inc/atl71', '<(windows_driver_kit_path)/inc/mfc42', ], + 'target_conditions': [ + ['chromium_code', { + # Workaround for intsafe in 2010 Express + WDK. + # ATL code uses intsafe.h and both intsafe.h and stdint.h + # define INT8_MIN et al. + # We can't use this workaround in third_party code because + # it has various levels of intolerance for including stdint.h. + 'msvs_system_include_dirs': [ + '<(DEPTH)/build', + ], + 'msvs_settings': { + 'VCCLCompilerTool': { + 'ForcedIncludeFiles': [ 'intsafe_workaround.h', ], + }, + }, + }], + ], }], ], 'msvs_system_include_dirs': [ @@ -4464,6 +4544,7 @@ '$(VSInstallDir)/VC/atlmfc/include', ], 'msvs_cygwin_dirs': ['<(DEPTH)/third_party/cygwin'], + 'msvs_cygwin_shell': 0, 'msvs_disabled_warnings': [4351, 4355, 4396, 4503, 4819, # TODO(maruel): These warnings are level 4. They will be slowly # removed as code is fixed. @@ -4595,9 +4676,6 @@ ['asan==0', { 'AdditionalOptions': ['/largeaddressaware'], }], - ['clang==1', { - 'AdditionalOptions!': ['/safeseh'], - }], ], }, }, @@ -4636,81 +4714,44 @@ }, }], ['clang==1', { - 'conditions': [ - ['OS=="android"', { - # Android could use the goma with clang. - 'make_global_settings': [ - ['CC', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} ${CHROME_SRC}/<(make_clang_dir)/bin/clang)'], - ['CXX', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} ${CHROME_SRC}/<(make_clang_dir)/bin/clang++)'], - ['LINK', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} ${CHROME_SRC}/<(make_clang_dir)/bin/clang++)'], - ['CC.host', '$(CC)'], - ['CXX.host', '$(CXX)'], - ['LINK.host', '$(LINK)'], - ], - }, { - 'make_global_settings': [ - ['CC', '<(make_clang_dir)/bin/clang'], - ['CXX', '<(make_clang_dir)/bin/clang++'], - ['LINK', '$(CXX)'], - ['CC.host', '$(CC)'], - ['CXX.host', '$(CXX)'], - ['LINK.host', '$(LINK)'], - ], - }], + 'make_global_settings': [ + ['CC', '<(make_clang_dir)/bin/clang'], + ['CXX', '<(make_clang_dir)/bin/clang++'], + ['CC.host', '$(CC)'], + ['CXX.host', '$(CXX)'], ], }], ['OS=="android" and clang==0', { # Hardcode the compiler names in the Makefile so that # it won't depend on the environment at make time. 'make_global_settings': [ - ['CC', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} <(android_toolchain)/*-gcc)'], - ['CXX', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} <(android_toolchain)/*-g++)'], - ['LINK', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} <(android_toolchain)/*-gcc)'], - ['CC.host', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} <!(which gcc))'], - ['CXX.host', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} <!(which g++))'], - ['LINK.host', '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} <!(which g++))'], + ['CC', '<!(/bin/echo -n <(android_toolchain)/*-gcc)'], + ['CXX', '<!(/bin/echo -n <(android_toolchain)/*-g++)'], + ['CC.host', '<!(which gcc)'], + ['CXX.host', '<!(which g++)'], ], }], ['OS=="linux" and target_arch=="mipsel"', { 'make_global_settings': [ ['CC', '<(sysroot)/../bin/mipsel-linux-gnu-gcc'], ['CXX', '<(sysroot)/../bin/mipsel-linux-gnu-g++'], - ['LINK', '$(CXX)'], ['CC.host', '<!(which gcc)'], ['CXX.host', '<!(which g++)'], - ['LINK.host', '<!(which g++)'], + ], + }], + + # TODO(yyanagisawa): supports GENERATOR==make + # make generator doesn't support CC_wrapper without CC + # in make_global_settings yet. + ['use_goma==1 and ("<(GENERATOR)"=="ninja" or clang==1)', { + 'make_global_settings': [ + ['CC_wrapper', '<(gomadir)/gomacc'], + ['CXX_wrapper', '<(gomadir)/gomacc'], + ['CC.host_wrapper', '<(gomadir)/gomacc'], + ['CXX.host_wrapper', '<(gomadir)/gomacc'], ], }], ], - 'configurations': { - # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT! - # This block adds *project-wide* configuration settings to each project - # file. It's almost always wrong to put things here. Specify your - # custom |configurations| in target_defaults to add them to targets instead. - 'conditions': [ - ['OS=="ios"', { - 'Debug': { - 'xcode_settings': { - # Enable 'Build Active Architecture Only' for Debug. This - # avoids a project-level warning in Xcode. - # Note that this configuration uses the default VALID_ARCHS value - # because if there is a device connected Xcode sets the active arch - # to the arch of the device. In cases where the device's arch is not - # in VALID_ARCHS (e.g. iPhone5 is armv7s) Xcode complains because it - # can't determine what arch to compile for. - 'ONLY_ACTIVE_ARCH': 'YES', - }, - }, - 'Release': { - 'xcode_settings': { - # Override VALID_ARCHS and omit armv7s. Otherwise Xcode compiles for - # both armv7 and armv7s, doubling the binary size. - 'VALID_ARCHS': 'armv7 i386', - }, - }, - }], - ], - }, 'xcode_settings': { # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT! # This block adds *project-wide* configuration settings to each project @@ -4736,7 +4777,7 @@ ['ios_sdk_path==""', { 'conditions': [ # TODO(justincohen): Ninja only supports simulator for now. - ['"<(GENERATOR)"=="xcode" or ("<(GENERATOR)"=="ninja" and target_arch=="armv7")', { + ['"<(GENERATOR)"=="xcode"', { 'SDKROOT': 'iphoneos<(ios_sdk)', # -isysroot }, { 'SDKROOT': 'iphonesimulator<(ios_sdk)', # -isysroot @@ -4750,11 +4791,20 @@ ['OS=="ios"', { # Target both iPhone and iPad. 'TARGETED_DEVICE_FAMILY': '1,2', - }], - ['target_arch=="x64"', { - 'ARCHS': [ - 'x86_64' - ], + 'VALID_ARCHS': 'armv7 i386', + }, { # OS!="ios" + 'conditions': [ + ['target_arch=="x64"', { + 'ARCHS': [ + 'x86_64' + ], + }], + ['target_arch=="ia32"', { + 'ARCHS': [ + 'i386' + ], + }], + ], }], ], diff --git a/chromium/build/config/BUILD.gn b/chromium/build/config/BUILD.gn new file mode 100644 index 00000000000..37572d93771 --- /dev/null +++ b/chromium/build/config/BUILD.gn @@ -0,0 +1,50 @@ +# Copyright (c) 2013 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +config("my_msvs") { + defines = [ + "CHROMIUM_BUILD", + "TOOLKIT_VIEWS=1", + "USE_LIBJPEG_TURBO=1", + "ENABLE_ONE_CLICK_SIGNIN", + "ENABLE_REMOTING=1", + "ENABLE_WEBRTC=1", + "ENABLE_CONFIGURATION_POLICY", + "ENABLE_INPUT_SPEECH", + "ENABLE_NOTIFICATIONS", + "ENABLE_EGLIMAGE=1", + "ENABLE_TASK_MANAGER=1", + "ENABLE_EXTENSIONS=1", + "ENABLE_PLUGIN_INSTALLATION=1", + "ENABLE_PLUGINS=1", + "ENABLE_SESSION_SERVICE=1", + "ENABLE_THEMES=1", + "ENABLE_AUTOFILL_DIALOG=1", + "ENABLE_BACKGROUND=1", + "ENABLE_AUTOMATION=1", + "ENABLE_GOOGLE_NOW=1", + "ENABLE_PRINTING=1", + "ENABLE_CAPTIVE_PORTAL_DETECTION=1", + "ENABLE_APP_LIST=1", + "ENABLE_MESSAGE_CENTER=1", + "ENABLE_SETTINGS_APP=1", + "ENABLE_MANAGED_USERS=1", + ] +} + +config("feature_flags") { + #defines = +} + +config("debug") { + defines = [ + "_DEBUG", + "DYNAMIC_ANNOTATIONS_ENABLED=1", + "WTF_USE_DYNAMIC_ANNOTATIONS=1", + ] +} + +config("release") { + +} diff --git a/chromium/build/config/BUILDCONFIG.gn b/chromium/build/config/BUILDCONFIG.gn new file mode 100644 index 00000000000..1110970a82a --- /dev/null +++ b/chromium/build/config/BUILDCONFIG.gn @@ -0,0 +1,426 @@ +# Copyright (c) 2013 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# ============================================================================= +# BUILD FLAGS +# ============================================================================= +# +# This block lists input arguments to the build, along with their default +# values. GN requires listing them explicitly so it can validate input and have +# a central place to manage the build flags. +# +# If a value is specified on the command line, it will overwrite the defaults +# given here, otherwise the default will be injected into the root scope. +# +# KEEP IN ALPHABETICAL ORDER and write a good description for everything. +# Use "is_*" names for intrinsic platform descriptions and build modes, and +# "use_*" names for optional features libraries, and configurations. +declare_args() { + # How many symbols to include in the build. This affects the performance of + # the build since the symbols are large and dealing with them is slow. + # 2 means regular build with symbols. + # 1 means minimal symbols, usually enough for backtraces only. + # 0 means no symbols. + symbol_level = 2 + + # Component build. + is_component_build = false + # Debug build. + is_debug = true + + # Set to true when compiling with the Clang compiler. Typically this is used + # to configure warnings. + is_clang = false + + # ASH is enabled. + # TODO(brettw) this should be moved out of the main build config file. + use_ash = false + # Aura is enabled. + # TODO(brettw) this should be moved out of the main build config file. + use_aura = false + # Ozone is enabled. + # TODO(brettw) this should be moved out of the main build config file. + use_ozone = false + + # Forces a 64-bit build on Windows. Does nothing on other platforms. Normally + # we build 32-bit on Windows regardless of the current host OS bit depth. + # Setting this flag will override this logic and generate 64-bit toolchains. + # + # Normally this would get set automatically when you specify a target using + # the 64-bit toolchain. You can also set this on the command line to convert + # the default toolchain to 64-bit. + force_win64 = false + + # Set to true on the command line when invoked by GYP. Build files can key + # off of this to make any GYP-output-specific changes to the build. + is_gyp = false + + # Selects the desired build flavor. Official builds get additional + # processing to prepare for release. Normally you will want to develop and + # test with this flag off. + is_official_build = false + + # Select the desired branding flavor. False means normal Chromium branding, + # true means official Google Chrome branding (requires extra Google-internal + # resources). + is_chrome_branded = false +} + +# ============================================================================= +# OS DEFINITIONS +# ============================================================================= +# +# We set these various is_FOO booleans for convenience in writing OS-based +# conditions. +# +# - is_android, is_chromeos, is_ios, and is_win should be obvious. +# - is_mac is set only for desktop Mac. It is not set on iOS. +# - is_posix is true for mac and any Unix-like system (basically everything +# except Windows). +# - is_linux is true for any Linux variant including Android and ChromeOS. +# +# Do not add more is_* variants here for random lesser-used Unix systems like +# aix or one of the BSDs. If you need to check these, just check the os value +# directly. + +if (os == "win") { + is_android = false + is_chromeos = false + is_ios = false + is_linux = false + is_mac = false + is_nacl = false + is_posix = false + is_win = true +} else if (os == "mac") { + is_android = false + is_chromeos = false + is_ios = false + is_linux = false + is_mac = true + is_nacl = false + is_posix = true + is_win = false + is_clang = true # Always use clang on Mac. +} else if (os == "android") { + is_android = false + is_chromeos = false + is_ios = false + is_linux = true + is_mac = false + is_nacl = false + is_posix = true + is_win = false +} else if (os == "chromeos") { + is_android = false + is_chromeos = true + is_ios = false + is_linux = true + is_mac = false + is_nacl = false + is_posix = true + is_win = false +} else if (os == "nacl") { + # os == "nacl" will be passed by the nacl toolchain definition. It is not + # set by default or on the command line. We treat is as a Posix variant. + is_android = false + is_chromeos = false + is_ios = false + is_linux = false + is_mac = false + is_nacl = true + is_posix = true + is_win = false +} else if (os == "ios") { + is_android = false + is_chromeos = false + is_ios = true + is_linux = false + is_mac = false + is_nacl = false + is_posix = true + is_win = false +} else if (os == "linux") { + is_android = false + is_chromeos = false + is_ios = false + is_linux = true + is_mac = false + is_nacl = false + is_posix = true + is_win = false +} + +# ============================================================================= +# CPU ARCHITECTURE +# ============================================================================= + +if (is_win) { + # Always use 32-bit on Windows, even when compiling on a 64-bit host OS, + # unless the override flag is specified. + if (force_win64) { + cpu_arch = "x64" + } else { + cpu_arch = "x86" + } +} + +# ============================================================================= +# SOURCES FILTERS +# ============================================================================= +# +# These patterns filter out platform-specific files when assigning to the +# sources variable. The magic variable |sources_assignment_filter| is applied +# to each assignment or appending to the sources variable and matches are +# automatcally removed. +# +# We define lists of filters for each platform for all builds so they can +# be used by individual targets if necessary (a target can always change +# sources_assignment_filter on itself if it needs something more specific). +# +# Note that the patterns are NOT regular expressions. Only "*" and "\b" (path +# boundary = end of string or slash) are supported, and the entire string +# muct match the pattern (so you need "*.cc" to match all .cc files, for +# example). + +windows_sources_filters = [ + "*_win.cc", + "*_win.h", + "*_win_unittest.cc", + "*\bwin/*", +] +mac_sources_filters = [ + "*_mac.h", + "*_mac.cc", + "*_mac.mm", + "*_mac_unittest.h", + "*_mac_unittest.cc", + "*_mac_unittest.mm", + "*\bmac/*", + "*_cocoa.h", + "*_cocoa.cc", + "*_cocoa.mm", + "*_cocoa_unittest.h", + "*_cocoa_unittest.cc", + "*_cocoa_unittest.mm", + "*\bcocoa/*", +] +ios_sources_filters = [ + "*_ios.h", + "*_ios.cc", + "*_ios.mm", + "*_ios_unittest.h", + "*_ios_unittest.cc", + "*_ios_unittest.mm", + "*\bios/*", +] +objective_c_sources_filters = [ + "*.mm", +] +linux_sources_filters = [ + "*_linux.h", + "*_linux.cc", + "*_linux_unittest.h", + "*_linux_unittest.cc", + "*\blinux/*", + "*_x11.cc", + "*_x11.h", +] +android_sources_filters = [ + "*_android.h", + "*_android.cc", + "*_android_unittest.h", + "*_android_unittest.cc", + "*\bandroid/*", +] +posix_sources_filters = [ + "*_posix.h", + "*_posix.cc", + "*_posix_unittest.h", + "*_posix_unittest.cc", + "*\bposix/*", +] + +# Construct the full list of sources we're using for this platform. +sources_assignment_filter = [] +if (is_win) { + sources_assignment_filter += posix_sources_filters +} else { + sources_assignment_filter += windows_sources_filters +} +if (!is_mac) { + sources_assignment_filter += mac_sources_filters +} +if (!is_ios) { + sources_assignment_filter += ios_sources_filters +} +if (!is_mac && !is_ios) { + sources_assignment_filter += objective_c_sources_filters +} +if (!is_linux) { + sources_assignment_filter += linux_sources_filters +} +if (!is_android) { + sources_assignment_filter += android_sources_filters +} + +# This is the actual set. +set_sources_assignment_filter(sources_assignment_filter) + +# ============================================================================= +# BUILD OPTIONS +# ============================================================================= + +if (is_component_build) { + component_mode = "shared_library" +} else { + component_mode = "static_library" +} + +toolkit_uses_gtk = is_linux + +# ============================================================================= +# TARGET DEFAULTS +# ============================================================================= +# +# Set up the default configuration for every build target of the given type. +# The values configured here will be automatically set on the scope of the +# corresponding target. Target definitions can add or remove to the settings +# here as needed. + +# Holds all configs used for making native executables and libraries, to avoid +# duplication in each target below. +native_compiler_configs = [ + "//build/config:my_msvs", # TODO(brettw) eraseme + + "//build/config/compiler:compiler", + "//build/config/compiler:chromium_code", + "//build/config/compiler:default_warnings", + "//build/config/compiler:no_rtti", + "//build/config/compiler:runtime_library", +] +if (is_win) { + native_compiler_configs += [ + "//build/config/win:sdk", + ] +} else if (is_clang) { + native_compiler_configs += "//build/config/clang:find_bad_constructs" +} + +# Optimizations and debug checking. +if (is_debug) { + native_compiler_configs += "//build/config:debug" + default_optimization_config = "//build/config/compiler:no_optimize" +} else { + native_compiler_configs += "//build/config:release" + default_optimization_config = "//build/config/compiler:optimize" +} +native_compiler_configs += default_optimization_config + +# Symbol setup. +if (is_clang && (is_linux || is_android)) { + # Clang creates chubby debug information, which makes linking very slow. + # For now, don't create debug information with clang. + # See http://crbug.com/70000 + # TODO(brettw) This just copies GYP. Why not do this on Mac as well? + default_symbols_config = "//build/config/compiler:no_symbols" +} else if (symbol_level == 2) { + default_symbols_config = "//build/config/compiler:symbols" +} else if (symbol_level == 1) { + default_symbols_config = "//build/config/compiler:minimal_symbols" +} else if (symbol_level == 0) { + default_symbols_config = "//build/config/compiler:no_symbols" +} else { + assert(false, "Bad value for symbol_level.") +} +native_compiler_configs += default_symbols_config + +# Windows linker setup for EXEs and DLLs. +if (is_win) { + if (is_debug) { + default_incremental_linking_config = + "//build/config/win:incremental_linking" + } else { + default_incremental_linking_config = + "//build/config/win:no_incremental_linking" + } + windows_linker_configs = [ + default_incremental_linking_config, + "//build/config/win:sdk_link", + "//build/config/win:common_linker_setup", + # Default to console-mode apps. Most of our targets are tests and such + # that shouldn't use the windows subsystem. + "//build/config/win:console", + ] +} + +set_defaults("executable") { + configs = native_compiler_configs + if (is_win) { + configs += windows_linker_configs + } else if (is_mac) { + configs += "//build/config/mac:mac_dynamic_flags" + } else if (is_linux) { + configs += "//build/config/linux:executable_ldconfig" + } +} + +set_defaults("static_library") { + configs = native_compiler_configs +} + +set_defaults("shared_library") { + configs = native_compiler_configs + if (is_win) { + configs += windows_linker_configs + } else if (is_mac) { + configs += "//build/config/mac:mac_dynamic_flags" + } +} + +set_defaults("source_set") { + configs = native_compiler_configs +} + +# ============================================================================== +# TOOLCHAIN SETUP +# ============================================================================== +# +# Here we set the default toolchain, as well as the variable host_toolchain +# which will identify the toolchain corresponding to the local system when +# doing cross-compiles. When not cross-compiling, this will be the same as the +# default toolchain. + +if (is_win) { + if (build_cpu_arch == "x64") { + host_toolchain = "//build/toolchain/win:64" + } else if (build_cpu_arch == "x86") { + host_toolchain = "//build/toolchain/win:32" + } + + if (cpu_arch == "x64") { + set_default_toolchain("//build/toolchain/win:64") + } else if (cpu_arch == "x86") { + set_default_toolchain("//build/toolchain/win:32") + } +} else if (is_linux) { + if (build_cpu_arch == "arm") { + host_toolchain = "//build/toolchain/linux:arm" + } else if (build_cpu_arch == "x86") { + host_toolchain = "//build/toolchain/linux:32" + } else if (build_cpu_arch == "x64") { + host_toolchain = "//build/toolchain/linux:64" + } + + if (build_cpu_arch == "arm") { + set_default_toolchain("//build/toolchain/linux:arm") + } else if (build_cpu_arch == "x86") { + set_default_toolchain("//build/toolchain/linux:32") + } else if (build_cpu_arch == "x64") { + set_default_toolchain("//build/toolchain/linux:64") + } +} else if (is_mac) { + host_toolchain = "//build/toolchain/mac:clang" + set_default_toolchain(host_toolchain) +} diff --git a/chromium/build/config/OWNERS b/chromium/build/config/OWNERS new file mode 100644 index 00000000000..9b79b9a9b50 --- /dev/null +++ b/chromium/build/config/OWNERS @@ -0,0 +1,2 @@ +set noparent +brettw@chromium.org diff --git a/chromium/build/config/clang/BUILD.gn b/chromium/build/config/clang/BUILD.gn new file mode 100644 index 00000000000..d083e86c11b --- /dev/null +++ b/chromium/build/config/clang/BUILD.gn @@ -0,0 +1,18 @@ +# Copyright (c) 2013 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +config("find_bad_constructs") { + cflags = [ + "-Xclang", "-load", + "-Xclang", + + # TODO(brettw) express this in terms of a relative dir from the output. + # for now, assume the output dir is two levels deep under the source + # (like "out/Debug"). + "../../third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.dylib", + + "-Xclang", "-add-plugin", + "-Xclang", "find-bad-constructs", + ] +} diff --git a/chromium/build/config/compiler/BUILD.gn b/chromium/build/config/compiler/BUILD.gn new file mode 100644 index 00000000000..6c5b973fd5c --- /dev/null +++ b/chromium/build/config/compiler/BUILD.gn @@ -0,0 +1,418 @@ +# Copyright (c) 2013 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/linux/sysroot.gni") + +# Base compiler configuration. +config("compiler") { + include_dirs = [ "//", root_gen_dir ] + if (is_win) { + cflags = [ + "/Gy", # Enable function-level linking. + "/GS", # Enable buffer security checking. + "/EHsc", # Assume C functions can't throw exceptions and don't catch + # structured exceptions (only C++ ones). + ] + } else { + # Common GCC compiler flags setup. + # -------------------------------- + cflags = [ + "-fno-strict-aliasing", # See http://crbug.com/32204 + "-fvisibility=hidden", + ] + cflags_c = [ + ] + cflags_cc = [ + "-fno-exceptions", + "-fno-threadsafe-statics", + "-fvisibility-inlines-hidden", + ] + ldflags = [ + ] + + # Stack protection. + # TODO(brettw) why do we have different values for all of these cases? + if (is_mac) { + cflags += "-fstack-protector-all" + } else if (is_chromeos) { + cflags += "-fstack-protector-strong" + } else if (is_linux) { + cflags += [ "-fstack-protector", "--param=ssp-buffer-size=4" ] + } + + if (is_mac) { + # Mac-specific compiler flags setup. + # ---------------------------------- + + # These flags are shared between the C compiler and linker. + common_mac_flags = [ + "-isysroot", sysroot, + "-mmacosx-version-min=10.6", + ] + + # CPU architecture. + if (cpu_arch == "x64") { + common_mac_flags += "-arch x86_64" + } else if (cpu_arch == "x32") { + common_mac_flags += "-arch i386" + } + + cflags += common_mac_flags + [ + # Without this, the constructors and destructors of a C++ object inside + # an Objective C struct won't be called, which is very bad. + "-fobjc-call-cxx-cdtors", + ] + + cflags_c += [ "-std=c99" ] + cflags_cc += [ "-std=gnu++11" ] + + ldflags += common_mac_flags + [ + "-L.", + + # TODO(brettW) I don't understand these options. + "-Wl,-rpath,@loader_path/.", + "-Wl,-rpath,@loader_path/../../..", + ] + } else { + # Non-Mac Posix compiler flags setup. + # ----------------------------------- + + # CPU architecture. We may or may not be doing a cross compile now, so for + # simplicity we always explicitly set the architecture. + if (cpu_arch == "x64") { + cflags += "-m64" + ldflags += "-m64" + } else if (cpu_arch == "x32") { + cflags += "-m32" + ldflags += "-m32" + } + } + + # Linux-specific compiler flags setup. + # ------------------------------------ + if (is_linux) { + cflags += [ + "-fPIC", + "-pthread", + "-pipe", # Use pipes for communicating between sub-processes. Faster. + ] + + # Use gold for linking on 64-bit Linux only (on 32-bit it runs out of + # address space, and it doesn't support cross-compiling). + if (cpu_arch == "x64") { + gold_path = rebase_path("//third_party/gold", ".", root_build_dir) + ldflags += [ + "-B$gold_path", + + # There seems to be a conflict of --icf and -pie in gold which can + # generate crashy binaries. As a security measure, -pie takes + # precendence for now. + # TODO(brettw) common.gypi has this only for target toolset. + #"-Wl,--icf=safe", + "-Wl,--icf=none", + + # Experimentation found that using four linking threads + # saved ~20% of link time. + # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/281527606915bb36 + # Only apply this to the target linker, since the host + # linker might not be gold, but isn't used much anyway. + "-Wl,--threads", + "-Wl,--thread-count=4", + ] + } + + if (sysroot != "") { + cflags += "--sysroot=" + sysroot + ldflags += "--sysroot=" + sysroot + } + + ldflags += [ + "-fPIC", + "-pthread", + "-Wl,-z,noexecstack", + "-Wl,-z,now", + "-Wl,-z,relro", + ] + } + + # Clang-specific compiler flags setup. + # ------------------------------------ + if (is_clang) { + cflags += [ + "-fcolor-diagnostics", + ] + } + } +} + +# runtime_library ------------------------------------------------------------- +# +# Sets the runtime library and associated options. +# +# We don't bother making multiple versions that are toggle-able since there +# is more than one axis of control (which makes it complicated) and there's +# no practical reason for anybody to change this since the CRT must agree. + +config("runtime_library") { + if (is_component_build) { + # Component mode: dynamic CRT. + defines = [ "COMPONENT_BUILD" ] + if (is_win) { + # Since the library is shared, it requires exceptions or will give errors + # about things not matching, so keep exceptions on. + if (is_debug) { + cflags = [ "/MDd" ] + } else { + cflags = [ "/MD" ] + } + } + } else { + # Static CRT. + if (is_win) { + # We don't use exceptions, and when we link statically we can just get + # rid of them entirely. + defines = [ "_HAS_EXCEPTIONS=0" ] + if (is_debug) { + cflags = [ "/MTd" ] + } else { + cflags = [ "/MT" ] + } + } + } + + if (is_win) { + defines += [ + "__STD_C", + "__STDC_CONSTANT_MACROS", + "__STDC_FORMAT_MACROS", + "_CRT_RAND_S", + "_CRT_SECURE_NO_DEPRECATE", + "_SCL_SECURE_NO_DEPRECATE", + "_UNICODE", + "UNICODE", + ] + } +} + +# chromium_code --------------------------------------------------------------- +# +# Toggles between higher and lower warnings for code that is (or isn't) +# part of Chromium. + +config("chromium_code") { + if (is_win) { + cflags = [ + "/W4", # Warning level 4. + "/WX", # Treat warnings as errors. + ] + } else { + cflags = [ + "-Wall", + "-Werror", + + # GCC turns on -Wsign-compare for C++ under -Wall, but clang doesn't, + # so we specify it explicitly. + # TODO(fischman): remove this if http://llvm.org/PR10448 obsoletes it. + # http://code.google.com/p/chromium/issues/detail?id=90453 + "-Wsign-compare", + ] + + # In Chromium code, we define __STDC_foo_MACROS in order to get the + # C99 macros on Mac and Linux. + defines = [ + "__STDC_CONSTANT_MACROS", + "__STDC_FORMAT_MACROS", + ] + + # TODO(brettw) this should also be enabled on Linux but some files + # currently fail. + if (is_mac) { + cflags += "-Wextra" + } + } +} +config("no_chromium_code") { + if (is_win) { + cflags = [ + "/W3", # Warning level 3. + "/wd4800", # Disable warning when forcing value to bool. + ] + defines = [ + "_CRT_NONSTDC_NO_WARNINGS", + "_CRT_NONSTDC_NO_DEPRECATE", + ] + } +} + +# rtti ------------------------------------------------------------------------ +# +# Allows turning Run-Time Type Identification on or off. + +config("rtti") { + if (is_win) { + cflags_cc = [ "/GR" ] + } +} +config("no_rtti") { + if (is_win) { + cflags_cc = [ "/GR-" ] + } else { + cflags_cc = [ "-fno-rtti" ] + } +} + +# Warnings --------------------------------------------------------------------- + +config("default_warnings") { + if (is_win) { + # Please keep ordered and add names if you add more. + cflags = [ + "/wd4018", # Comparing signed and unsigned values. + "/wd4100", # Unreferenced formal function parameter. + "/wd4121", # Alignment of a member was sensitive to packing. + "/wd4125", # Decimal digit terminates octal escape sequence. + "/wd4127", # Conditional expression is constant. + "/wd4130", # Logical operation on address of string constant. + # TODO(brettw) is this necessary? If so, it should probably be on whoever + # is silly enough to be doing this rather than globally. + #"/wd4131", # Function uses old-style declarator. + "/wd4189", # A variable was declared and initialized but never used. + "/wd4201", # Nonstandard extension used: nameless struct/union. + "/wd4238", # Nonstandard extension used: class rvalue used as lvalue. + "/wd4244", # Conversion: possible loss of data. + "/wd4245", # Conversion: signed/unsigned mismatch, + "/wd4251", # Class needs to have dll-interface. + "/wd4310", # Cast truncates constant value. + "/wd4351", # Elements of array will be default initialized. + "/wd4355", # 'this' used in base member initializer list. + "/wd4396", # Inline friend template thing. + "/wd4428", # Universal character name encountered in source. + "/wd4481", # Nonstandard extension: override specifier. + "/wd4503", # Decorated name length exceeded, name was truncated. + "/wd4505", # Unreferenced local function has been removed. + "/wd4510", # Default constructor could not be generated. + "/wd4512", # Assignment operator could not be generated. + "/wd4530", # Exception handler used, but unwind semantics not enabled. + "/wd4610", # Class can never be instantiated, constructor required. + "/wd4611", # C++ object destruction and 'catch'. + "/wd4701", # Potentially uninitialized local variable name used. + "/wd4702", # Unreachable code. + "/wd4706", # Assignment within conditional expression. + "/wd4819", # Character not in the current code page. + ] + } else { + # Common GCC warning setup. + cflags = [ + # Enables. + "-Wendif-labels", # Weird old-style text after an #endif. + + # Disables. + "-Wno-missing-field-initializers", # "struct foo f = {0};" + "-Wno-unused-parameter", # Unused function parameters. + "-Wno-write-strings", + ] + + if (is_mac) { + cflags += [ + "-Wnewline-eof", + ] + } + + # TODO(brettw) Ones below here should be clang-only when we have a flag + # for it. + if (is_clang) { + cflags += [ + "-Wheader-hygiene", + + # This warns on using ints as initializers for floats in + # initializer lists (e.g. |int a = f(); CGSize s = { a, a };|), + # which happens in several places in chrome code. Not sure if + # this is worth fixing. + "-Wno-c++11-narrowing", + + # Don't die on dtoa code that uses a char as an array index. + # This is required solely for base/third_party/dmg_fp/dtoa.cc. + # TODO(brettw) move this to that project then! + "-Wno-char-subscripts", + + # Warns on switches on enums that cover all enum values but + # also contain a default: branch. Chrome is full of that. + "-Wno-covered-switch-default", + + # Clang considers the `register` keyword as deprecated, but e.g. + # code generated by flex (used in angle) contains that keyword. + # http://crbug.com/255186 + "-Wno-deprecated-register", + + # Clang spots more unused functions. + "-Wno-unused-function", + + # Warns when a const char[] is converted to bool. + "-Wstring-conversion", + ] + } + } +} + +# Optimization ----------------------------------------------------------------- + +config("optimize") { + if (is_win) { + cflags = [ + "/O2", + "/Ob2", # Both explicit and auto inlining. + "/Oy-", # Disable omitting frame pointers, must be after /O2. + ] + } else { + if (is_ios) { + cflags = [ "-Os" ] + } else { + cflags = [ "-O2" ] + } + } +} + +config("no_optimize") { + if (is_win) { + cflags = [ + "/Od", # Disable optimization. + "/Ob0", # Disable all inlining (on by default). + "/RTC1", # Runtime checks for stack frame and uninitialized variables. + ] + } else { + cflags = [ "-O0" ] + } +} + +# Symbols ---------------------------------------------------------------------- + +# TODO(brettw) Since this sets ldflags on Windows which is inherited across +# static library boundaries, if you want to remove the default symbol config +# and set a different one on a target, you also have to do it for all static +# libraries that go into that target, which is messed up. Either we need a +# more flexible system for defining linker flags, or we need to separate this +# out into a "symbols_linker" config that is only applied to DLLs and EXEs. +config("symbols") { + if (is_win) { + cflags = [ "/Zi" ] # Produce PDB file, no edit and continue. + ldflags = [ "/DEBUG" ] + } else { + cflags = [ "-g2" ] + } +} + +config("minimal_symbols") { + if (is_win) { + # Linker symbols for backtraces only. + ldflags = [ "/DEBUG" ] + } else { + cflags = [ "-g1" ] + } +} + +config("no_symbols") { + if (!is_win) { + cflags = [ "-g0" ] + } +} diff --git a/chromium/build/config/linux/BUILD.gn b/chromium/build/config/linux/BUILD.gn new file mode 100644 index 00000000000..a7b841c7adc --- /dev/null +++ b/chromium/build/config/linux/BUILD.gn @@ -0,0 +1,61 @@ +# Copyright (c) 2013 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("pkg_config.gni") + +# Sets up the dynamic library search path to include our "lib" directory. +config("executable_ldconfig") { + ldflags = [ + # Want to pass "\$". Need to escape both '\' and '$'. GN will re-escape as + # required for ninja. + "-Wl,-rpath=\\\$ORIGIN/lib/", + + "-Wl,-rpath-link=lib/", + ] +} + +config("fontconfig") { + libs = [ "fontconfig" ] +} + +pkg_config("freetype2") { + packages = [ "freetype2" ] +} + +pkg_config("glib") { + packages = [ "glib-2.0", "gmodule-2.0", "gobject-2.0", "gthread-2.0" ] +} + +pkg_config("gtk") { + # Gtk requires gmodule, but it does not list it as a dependency in some + # misconfigured systems. + packages = [ "gmodule-2.0", "gtk+-2.0", "gthread-2.0" ] + defines = [ "TOOLKIT_GTK" ] +} + +pkg_config("pangocairo") { + packages = [ "pangocairo" ] +} + +pkg_config("udev") { + packages = [ "libudev" ] +} + +config("x11") { + # Don't bother running pkg-config for these X related libraries since it just + # returns the same libs, and forking pkg-config is slow. + defines = [ "USE_X11" ] + libs = [ + "X11", + "Xcomposite", + "Xcursor", + "Xdamage", + "Xext", + "Xfixes", + "Xi", + "Xrender", + "Xss", + "Xtst", + ] +} diff --git a/chromium/build/config/linux/pkg-config.py b/chromium/build/config/linux/pkg-config.py new file mode 100644 index 00000000000..40988d9792e --- /dev/null +++ b/chromium/build/config/linux/pkg-config.py @@ -0,0 +1,76 @@ +# Copyright (c) 2013 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import json +import subprocess +import sys +import re +from optparse import OptionParser + +# This script runs pkg-config, optionally filtering out some results, and +# returns the result. +# +# The result will be [ <includes>, <cflags>, <libs>, <lib_dirs> ] where each +# member is itself a list of strings. +# +# You can filter out matches using "-v <regexp>" where all results from +# pkgconfig matching the given regular expression will be ignored. You can +# specify more than one regular expression my specifying "-v" more than once. + +# If this is run on non-Linux platforms, just return nothing and indicate +# success. This allows us to "kind of emulate" a Linux build from other +# platforms. +if sys.platform.find("linux") == -1: + print "[[],[],[]]" + sys.exit(0) + +parser = OptionParser() +parser.add_option('-v', action='append', dest='strip_out', type='string') +(options, args) = parser.parse_args() + +# Make a list of regular expressions to strip out. +strip_out = [] +if options.strip_out != None: + for regexp in options.strip_out: + strip_out.append(re.compile(regexp)) + +try: + flag_string = subprocess.check_output(["pkg-config", "--cflags", "--libs"] + + args) + # For now just split on spaces to get the args out. This will break if + # pkgconfig returns quoted things with spaces in them, but that doesn't seem + # to happen in practice. + all_flags = flag_string.strip().split(' ') +except: + print "Could not run pkg-config." + sys.exit(1) + +includes = [] +cflags = [] +libs = [] +lib_dirs = [] + +def MatchesAnyRegexp(flag, list_of_regexps): + for regexp in list_of_regexps: + if regexp.search(flag) != None: + return True + return False + +for flag in all_flags[:]: + if len(flag) == 0 or MatchesAnyRegexp(flag, strip_out): + continue; + + if flag[:2] == '-l': + libs.append(flag[2:]) + if flag[:2] == '-L': + lib_dirs.append(flag[2:]) + elif flag[:2] == '-I': + includes.append(flag[2:]) + else: + cflags.append(flag) + +# Output a GN array, the first one is the cflags, the second are the libs. The +# JSON formatter prints GN compatible lists when everything is a list of +# strings. +print json.dumps([includes, cflags, libs, lib_dirs]) diff --git a/chromium/build/config/linux/pkg_config.gni b/chromium/build/config/linux/pkg_config.gni new file mode 100644 index 00000000000..50e21f1d009 --- /dev/null +++ b/chromium/build/config/linux/pkg_config.gni @@ -0,0 +1,30 @@ +# Copyright (c) 2013 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# Defines a config specifying the result of running pkg-config for the given +# packages. Put the package names you want to query in the "packages" variable +# inside the template invocation. +# +# You can also add defines via the "defines" variable. This can be useful to +# add this to the config to pass defines that the library expects to get by +# users of its headers. +# +# Example: +# pkg_config("mything") { +# packages = [ "mything1", "mything2" ] +# defines = [ "ENABLE_AWESOME" ] +# } + +template("pkg_config") { + assert(defined(packages), + "Variable |packages| must be defined to be a list in pkg_config.") + config(target_name) { + pkgresult = exec_script("//build/config/linux/pkg-config.py", + packages, "value") + include_dirs = pkgresult[0] + cflags = pkgresult[1] + libs = pkgresult[2] + lib_dirs = pkgresult[3] + } +} diff --git a/chromium/build/config/linux/sysroot.gni b/chromium/build/config/linux/sysroot.gni new file mode 100644 index 00000000000..78a8790d869 --- /dev/null +++ b/chromium/build/config/linux/sysroot.gni @@ -0,0 +1,27 @@ +# Copyright (c) 2013 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# This header file defines the "sysroot" variable which is the absolute path +# of the sysroot. If no sysroot applies, the variable will be an empty string. + +# For official builds, use the sysroot checked into the internal source repo so +# that the builds work on older versions of Linux. +if (is_linux && is_chrome_branded && is_official_build && !is_chromeos) { + if (cpu_arch == "x64") { + sysroot = rebase_path( + "//chrome/installer/linux/debian_wheezy_amd64-sysroot", ".", "") + } else if (cpu_arch == "x86") { + sysroot = rebase_path( + "//chrome/installer/linux/debian_wheezy_i386-sysroot", ".", "") + } else { + assert(false, + "Official builds on non-x86/64 processors not supported.") + } +} else if (is_mac) { + # Set which SDK to use. + # TODO(brettw) this needs to be configurable somehow. + sysroot = "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk" +} else { + sysroot = "" +} diff --git a/chromium/build/config/mac/BUILD.gn b/chromium/build/config/mac/BUILD.gn new file mode 100644 index 00000000000..78c106aebf9 --- /dev/null +++ b/chromium/build/config/mac/BUILD.gn @@ -0,0 +1,10 @@ +# Copyright (c) 2013 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# On Mac, this is used for everything except static libraries. +config("mac_dynamic_flags") { + ldflags = [ + "-Wl,-search_paths_first", + ] +} diff --git a/chromium/build/config/win/BUILD.gn b/chromium/build/config/win/BUILD.gn new file mode 100644 index 00000000000..8bedbf581cc --- /dev/null +++ b/chromium/build/config/win/BUILD.gn @@ -0,0 +1,145 @@ +# Copyright (c) 2013 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +declare_args() { + # Full path to the Windows SDK, not including a backslash at the end. + windows_sdk_path = "C:\Program Files (x86)\Windows Kits\8.0" + + # Full path to the Visual Studio installation, not including a backslash + # at the end. + visual_studio_path = "C:\Program Files (x86)\Microsoft Visual Studio 10.0" +} + +# Compiler setup for the Windows SDK. Applied to all targets. +config("sdk") { + # The include path is the stuff returned by the script. + #include_dirs = msvc_config[0] TODO(brettw) make this work. + + defines = [ + "_ATL_NO_OPENGL", + "_SECURE_ATL", + "_WIN32_WINNT=0x0602", + "_WINDOWS", + "CERT_CHAIN_PARA_HAS_EXTRA_FIELDS", + "NOMINMAX", + "NTDDI_VERSION=0x06020000", + "PSAPI_VERSION=1", + "WIN32", + "WIN32_LEAN_AND_MEAN", + "WINVER=0x0602", + ] + + # The Windows SDK include directories must be first. They both have a sal.h, + # and the SDK one is newer and the SDK uses some newer features from it not + # present in the Visual Studio one. + include_dirs = [ + "$windows_sdk_path\Include\shared", + "$windows_sdk_path\Include\um", + "$windows_sdk_path\Include\winrt", + "$visual_studio_path\VC\include", + "$visual_studio_path\VC\atlmfc\include", + ] +} + +# Linker flags for Windows SDK setup, this is applied only to EXEs and DLLs. +config("sdk_link") { + if (cpu_arch == "x64") { + ldflags = [ "/MACHINE:X64" ] + lib_dirs = [ + "$windows_sdk_path\Lib\win8\um\x64", + "$visual_studio_path\VC\lib\amd64", + "$visual_studio_path\VC\atlmfc\lib\amd64", + ] + } else { + ldflags = [ + "/MACHINE:X86", + "/SAFESEH", # Not compatible with x64 so use only for x86. + ] + lib_dirs = [ + "$windows_sdk_path\Lib\win8\um\x86", + "$visual_studio_path\VC\lib", + "$visual_studio_path\VC\atlmfc\lib", + ] + #if (!is_asan) { TODO(brettw) Address Sanitizer + # ldflags += "/largeaddressaware" + #} + } +} + +# This default linker setup is provided separately from the SDK setup so +# targets who want different libraries linked can remove this and specify their +# own. +config("common_linker_setup") { + ldflags = [ + "/FIXED:NO", + "/ignore:4199", + "/ignore:4221", + "/NXCOMPAT", + ] + + # ASLR makes debugging with windbg difficult because Chrome.exe and + # Chrome.dll share the same base name. As result, windbg will name the + # Chrome.dll module like chrome_<base address>, where <base address> + # typically changes with each launch. This in turn means that breakpoints in + # Chrome.dll don't stick from one launch to the next. For this reason, we + # turn ASLR off in debug builds. + if (is_debug) { + ldflags += "/DYNAMICBASE:NO" + } else { + ldflags += "/DYNAMICBASE" + } + + # Common libraries. + libs = [ + "advapi32.lib", + "comdlg32.lib", + "dbghelp.lib", + "delayimp.lib", + "dnsapi.lib", + "gdi32.lib", + "kernel32.lib", + "msimg32.lib", + "odbc32.lib", + "odbccp32.lib", + "ole32.lib", + "oleaut32.lib", + "psapi.lib", + "shell32.lib", + "shlwapi.lib", + "user32.lib", + "usp10.lib", + "uuid.lib", + "version.lib", + "wininet.lib", + "winmm.lib", + "winspool.lib", + "ws2_32.lib", + ] + + # Delay loaded DLLs. + ldflags += [ + "/DELAYLOAD:dbghelp.dll", + "/DELAYLOAD:dwmapi.dll", + "/DELAYLOAD:shell32.dll", + "/DELAYLOAD:uxtheme.dll", + ] +} + +# Subsystem -------------------------------------------------------------------- + +config("console") { + ldflags = [ "/SUBSYSTEM:CONSOLE" ] +} +config("windowed") { + ldflags = [ "/SUBSYSTEM:WINDOWS" ] +} + +# Incremental linking ---------------------------------------------------------- + +config("incremental_linking") { + ldflags = [ "/INCREMENTAL" ] +} +config("no_incremental_linking") { + ldflags = [ "/INCREMENTAL:NO" ] +} diff --git a/chromium/build/config/win/get_msvc_config.py b/chromium/build/config/win/get_msvc_config.py new file mode 100644 index 00000000000..01380cd8954 --- /dev/null +++ b/chromium/build/config/win/get_msvc_config.py @@ -0,0 +1,77 @@ +# Copyright (c) 2013 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# This file returns the MSVC config used by the Windows build. +# It's a bit hardcoded right now. I suspect we want to build this functionality +# into GN itself in the future. + +import sys + +# This script expects one parameter: the path to the root output directory. + +# TODO(brettw): do escaping. +def FormatStringForGN(x): + return '"' + x + '"' + +def PrintListOfStrings(x): + print '[' + for i in x: + print FormatStringForGN(i) + ', ' + print ']' + +# GN wants system-absolutepaths to begin in slashes. +sdk_root = '/C:\\Program Files (x86)\\Windows Kits\\8.0\\' +vs_root = '/C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\' + +def GetIncludes(): + return [ + sdk_root + 'Include\\shared', + sdk_root + 'Include\\um', + sdk_root + 'Include\\winrt', + vs_root + 'VC\\atlmfc\\include' + ] + +def _FormatAsEnvironmentBlock(envvar_dict): + """Format as an 'environment block' directly suitable for CreateProcess. + Briefly this is a list of key=value\0, terminated by an additional \0. See + CreateProcess documentation for more details.""" + block = '' + nul = '\0' + for key, value in envvar_dict.iteritems(): + block += key + '=' + value + nul + block += nul + return block + +def WriteEnvFile(file_path, values): + f = open(file_path, "w") + f.write(_FormatAsEnvironmentBlock(values)) + +includes = GetIncludes() + +# Write the environment files. +WriteEnvFile(sys.argv[1] + '\\environment.x86', + { 'TMP': 'C:\\Users\\brettw\\AppData\\Local\\Temp', + 'SYSTEMROOT': 'C:\\Windows', + 'TEMP': 'C:\\Users\\brettw\\AppData\\Local\\Temp', + 'LIB': 'c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\LIB;c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\ATLMFC\\LIB;C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.0A\\lib;c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\LIB;c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\ATLMFC\\LIB;C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.0A\\lib;', + 'LIBPATH': 'C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319;C:\\Windows\\Microsoft.NET\\Framework\\v3.5;c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\LIB;c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\ATLMFC\\LIB;C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319;C:\\Windows\\Microsoft.NET\\Framework\\v3.5;c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\LIB;c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\ATLMFC\\LIB;', + 'PATH': 'C:\\apps\\depot_tools\\python_bin;c:\\Program Files (x86)\\Microsoft F#\\v4.0\\;c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VSTSDB\\Deploy;c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\Common7\\IDE\\;c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\BIN;c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\Common7\\Tools;C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319;C:\\Windows\\Microsoft.NET\\Framework\\v3.5;c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\VCPackages;C:\\Program Files (x86)\\HTML Help Workshop;C:\\Program Files (x86)\\HTML Help Workshop;C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.0A\\bin\\NETFX 4.0 Tools;C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.0A\\bin;C:\\apps\\depot_tools\\python_bin;C:\\apps\\depot_tools\\;C:\\apps\\depot_tools\\;C:\\apps\\depot_tools\\;c:\\Program Files (x86)\\Microsoft F#\\v4.0\\;c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VSTSDB\\Deploy;c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\Common7\\IDE\\;c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\BIN;c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\Common7\\Tools;C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319;C:\\Windows\\Microsoft.NET\\Framework\\v3.5;c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\VCPackages;C:\\Program Files (x86)\\HTML Help Workshop;C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.0A\\bin\\NETFX 4.0 Tools;C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.0A\\bin;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\windows\\corpam;C:\\python_26_amd64\\files;C:\\Windows\\ccmsetup;c:\\Program Files (x86)\\Microsoft SQL Server\\100\\Tools\\Binn\\;c:\\Program Files\\Microsoft SQL Server\\100\\Tools\\Binn\\;c:\\Program Files\\Microsoft SQL Server\\100\\DTS\\Binn\\;c:\\cygwin\\bin;C:\\apps\\;C:\\apps\\depot_tools;C:\\Program Files (x86)\\Windows Kits\\8.0\\Windows Performance Toolkit\\;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files (x86)\\Google\\Cert Installer;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files (x86)\\Google\\google_appengine\\', + 'PATHEXT': '=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC', + 'INCLUDE': 'c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\INCLUDE;c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\ATLMFC\\INCLUDE;C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.0A\\include;c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\INCLUDE;c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\ATLMFC\\INCLUDE;C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.0A\\include;'}) + +WriteEnvFile(sys.argv[1] + '\\environment.x64', + { 'TMP': 'C:\\Users\\brettw\\AppData\\Local\\Temp', + 'SYSTEMROOT': 'C:\\Windows', + 'TEMP': 'C:\\Users\\brettw\\AppData\\Local\\Temp', + 'LIB': 'c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\LIB\\amd64;c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\ATLMFC\\LIB\\amd64;C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.0A\\lib\\x64;c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\LIB;c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\ATLMFC\\LIB;C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.0A\\lib;', + 'LIBPATH': 'C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319;C:\\Windows\\Microsoft.NET\\Framework64\\v3.5;c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\LIB\\amd64;c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\ATLMFC\\LIB\\amd64;C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319;C:\\Windows\\Microsoft.NET\\Framework\\v3.5;c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\LIB;c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\ATLMFC\\LIB;', + 'PATH': 'C:\\apps\\depot_tools\\python_bin;c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\BIN\\amd64;C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319;C:\\Windows\\Microsoft.NET\\Framework64\\v3.5;c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\VCPackages;c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\Common7\\IDE;c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\Common7\\Tools;C:\\Program Files (x86)\\HTML Help Workshop;C:\\Program Files (x86)\\HTML Help Workshop;C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.0A\\bin\\NETFX 4.0 Tools\\x64;C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.0A\\bin\\x64;C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.0A\\bin;C:\\apps\\depot_tools\\python_bin;C:\\apps\\depot_tools\\;C:\\apps\\depot_tools\\;C:\\apps\\depot_tools\\;c:\\Program Files (x86)\\Microsoft F#\\v4.0\\;c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VSTSDB\\Deploy;c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\Common7\\IDE\\;c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\BIN;c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\Common7\\Tools;C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319;C:\\Windows\\Microsoft.NET\\Framework\\v3.5;c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\VCPackages;C:\\Program Files (x86)\\HTML Help Workshop;C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.0A\\bin\\NETFX 4.0 Tools;C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.0A\\bin;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\windows\\corpam;C:\\python_26_amd64\\files;C:\\Windows\\ccmsetup;c:\\Program Files (x86)\\Microsoft SQL Server\\100\\Tools\\Binn\\;c:\\Program Files\\Microsoft SQL Server\\100\\Tools\\Binn\\;c:\\Program Files\\Microsoft SQL Server\\100\\DTS\\Binn\\;c:\\cygwin\\bin;C:\\apps\\;C:\\apps\\depot_tools;C:\\Program Files (x86)\\Windows Kits\\8.0\\Windows Performance Toolkit\\;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files (x86)\\Google\\Cert Installer;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files (x86)\\Google\\google_appengine\\', + 'PATHEXT': '.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC', + 'INCLUDE': 'c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\INCLUDE;c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\ATLMFC\\INCLUDE;C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.0A\\include;c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\INCLUDE;c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\ATLMFC\\INCLUDE;C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.0A\\include;'}) + +# Return the includes and such. +print '[' +PrintListOfStrings(includes) +print ']' + diff --git a/chromium/build/config/win/get_msvc_config_real.py b/chromium/build/config/win/get_msvc_config_real.py new file mode 100644 index 00000000000..a209d7ff8a1 --- /dev/null +++ b/chromium/build/config/win/get_msvc_config_real.py @@ -0,0 +1,575 @@ +# Copyright (c) 2013 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# This file copies the logic from GYP to find the MSVC configuration. It's not +# currently used because it is too slow. We will probably build this +# functionality into the C++ code in the future. + +"""Handle version information related to Visual Stuio.""" + +import errno +import os +import re +import subprocess +import sys + +class VisualStudioVersion(object): + """Information regarding a version of Visual Studio.""" + + def __init__(self, short_name, description, + solution_version, project_version, flat_sln, uses_vcxproj, + path, sdk_based, default_toolset=None): + self.short_name = short_name + self.description = description + self.solution_version = solution_version + self.project_version = project_version + self.flat_sln = flat_sln + self.uses_vcxproj = uses_vcxproj + self.path = path + self.sdk_based = sdk_based + self.default_toolset = default_toolset + + def ShortName(self): + return self.short_name + + def Description(self): + """Get the full description of the version.""" + return self.description + + def SolutionVersion(self): + """Get the version number of the sln files.""" + return self.solution_version + + def ProjectVersion(self): + """Get the version number of the vcproj or vcxproj files.""" + return self.project_version + + def FlatSolution(self): + return self.flat_sln + + def UsesVcxproj(self): + """Returns true if this version uses a vcxproj file.""" + return self.uses_vcxproj + + def ProjectExtension(self): + """Returns the file extension for the project.""" + return self.uses_vcxproj and '.vcxproj' or '.vcproj' + + def Path(self): + """Returns the path to Visual Studio installation.""" + return self.path + + def ToolPath(self, tool): + """Returns the path to a given compiler tool. """ + return os.path.normpath(os.path.join(self.path, "VC/bin", tool)) + + def DefaultToolset(self): + """Returns the msbuild toolset version that will be used in the absence + of a user override.""" + return self.default_toolset + + def SetupScript(self, target_arch): + """Returns a command (with arguments) to be used to set up the + environment.""" + # Check if we are running in the SDK command line environment and use + # the setup script from the SDK if so. |target_arch| should be either + # 'x86' or 'x64'. + assert target_arch in ('x86', 'x64') + sdk_dir = os.environ.get('WindowsSDKDir') + if self.sdk_based and sdk_dir: + return [os.path.normpath(os.path.join(sdk_dir, 'Bin/SetEnv.Cmd')), + '/' + target_arch] + else: + # We don't use VC/vcvarsall.bat for x86 because vcvarsall calls + # vcvars32, which it can only find if VS??COMNTOOLS is set, which it + # isn't always. + if target_arch == 'x86': + return [os.path.normpath( + os.path.join(self.path, 'Common7/Tools/vsvars32.bat'))] + else: + assert target_arch == 'x64' + arg = 'x86_amd64' + if (os.environ.get('PROCESSOR_ARCHITECTURE') == 'AMD64' or + os.environ.get('PROCESSOR_ARCHITEW6432') == 'AMD64'): + # Use the 64-on-64 compiler if we can. + arg = 'amd64' + return [os.path.normpath( + os.path.join(self.path, 'VC/vcvarsall.bat')), arg] + + +def _RegistryQueryBase(sysdir, key, value): + """Use reg.exe to read a particular key. + + While ideally we might use the win32 module, we would like gyp to be + python neutral, so for instance cygwin python lacks this module. + + Arguments: + sysdir: The system subdirectory to attempt to launch reg.exe from. + key: The registry key to read from. + value: The particular value to read. + Return: + stdout from reg.exe, or None for failure. + """ + # Skip if not on Windows or Python Win32 setup issue + if sys.platform not in ('win32', 'cygwin'): + return None + # Setup params to pass to and attempt to launch reg.exe + cmd = [os.path.join(os.environ.get('WINDIR', ''), sysdir, 'reg.exe'), + 'query', key] + if value: + cmd.extend(['/v', value]) + p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + # Obtain the stdout from reg.exe, reading to the end so p.returncode is valid + # Note that the error text may be in [1] in some cases + text = p.communicate()[0] + # Check return code from reg.exe; officially 0==success and 1==error + if p.returncode: + return None + return text + + +def _RegistryQuery(key, value=None): + """Use reg.exe to read a particular key through _RegistryQueryBase. + + First tries to launch from %WinDir%\Sysnative to avoid WoW64 redirection. If + that fails, it falls back to System32. Sysnative is available on Vista and + up and available on Windows Server 2003 and XP through KB patch 942589. Note + that Sysnative will always fail if using 64-bit python due to it being a + virtual directory and System32 will work correctly in the first place. + + KB 942589 - http://support.microsoft.com/kb/942589/en-us. + + Arguments: + key: The registry key. + value: The particular registry value to read (optional). + Return: + stdout from reg.exe, or None for failure. + """ + text = None + try: + text = _RegistryQueryBase('Sysnative', key, value) + except OSError, e: + if e.errno == errno.ENOENT: + text = _RegistryQueryBase('System32', key, value) + else: + raise + return text + + +def _RegistryGetValue(key, value): + """Use reg.exe to obtain the value of a registry key. + + Args: + key: The registry key. + value: The particular registry value to read. + Return: + contents of the registry key's value, or None on failure. + """ + text = _RegistryQuery(key, value) + if not text: + return None + # Extract value. + match = re.search(r'REG_\w+\s+([^\r]+)\r\n', text) + if not match: + return None + return match.group(1) + + +def _RegistryKeyExists(key): + """Use reg.exe to see if a key exists. + + Args: + key: The registry key to check. + Return: + True if the key exists + """ + if not _RegistryQuery(key): + return False + return True + + +def _CreateVersion(name, path, sdk_based=False): + """Sets up MSVS project generation. + + Setup is based off the GYP_MSVS_VERSION environment variable or whatever is + autodetected if GYP_MSVS_VERSION is not explicitly specified. If a version is + passed in that doesn't match a value in versions python will throw a error. + """ + if path: + path = os.path.normpath(path) + versions = { + '2013': VisualStudioVersion('2013', + 'Visual Studio 2013', + solution_version='13.00', + project_version='4.0', + flat_sln=False, + uses_vcxproj=True, + path=path, + sdk_based=sdk_based, + default_toolset='v110'), + '2013e': VisualStudioVersion('2013e', + 'Visual Studio 2013', + solution_version='13.00', + project_version='4.0', + flat_sln=True, + uses_vcxproj=True, + path=path, + sdk_based=sdk_based, + default_toolset='v110'), + '2012': VisualStudioVersion('2012', + 'Visual Studio 2012', + solution_version='12.00', + project_version='4.0', + flat_sln=False, + uses_vcxproj=True, + path=path, + sdk_based=sdk_based, + default_toolset='v110'), + '2012e': VisualStudioVersion('2012e', + 'Visual Studio 2012', + solution_version='12.00', + project_version='4.0', + flat_sln=True, + uses_vcxproj=True, + path=path, + sdk_based=sdk_based, + default_toolset='v110'), + '2010': VisualStudioVersion('2010', + 'Visual Studio 2010', + solution_version='11.00', + project_version='4.0', + flat_sln=False, + uses_vcxproj=True, + path=path, + sdk_based=sdk_based), + '2010e': VisualStudioVersion('2010e', + 'Visual Studio 2010', + solution_version='11.00', + project_version='4.0', + flat_sln=True, + uses_vcxproj=True, + path=path, + sdk_based=sdk_based), + '2008': VisualStudioVersion('2008', + 'Visual Studio 2008', + solution_version='10.00', + project_version='9.00', + flat_sln=False, + uses_vcxproj=False, + path=path, + sdk_based=sdk_based), + '2008e': VisualStudioVersion('2008e', + 'Visual Studio 2008', + solution_version='10.00', + project_version='9.00', + flat_sln=True, + uses_vcxproj=False, + path=path, + sdk_based=sdk_based), + '2005': VisualStudioVersion('2005', + 'Visual Studio 2005', + solution_version='9.00', + project_version='8.00', + flat_sln=False, + uses_vcxproj=False, + path=path, + sdk_based=sdk_based), + '2005e': VisualStudioVersion('2005e', + 'Visual Studio 2005', + solution_version='9.00', + project_version='8.00', + flat_sln=True, + uses_vcxproj=False, + path=path, + sdk_based=sdk_based), + } + return versions[str(name)] + + +def _ConvertToCygpath(path): + """Convert to cygwin path if we are using cygwin.""" + if sys.platform == 'cygwin': + p = subprocess.Popen(['cygpath', path], stdout=subprocess.PIPE) + path = p.communicate()[0].strip() + return path + + +def _DetectVisualStudioVersions(versions_to_check, force_express): + """Collect the list of installed visual studio versions. + + Returns: + A list of visual studio versions installed in descending order of + usage preference. + Base this on the registry and a quick check if devenv.exe exists. + Only versions 8-10 are considered. + Possibilities are: + 2005(e) - Visual Studio 2005 (8) + 2008(e) - Visual Studio 2008 (9) + 2010(e) - Visual Studio 2010 (10) + 2012(e) - Visual Studio 2012 (11) + 2013(e) - Visual Studio 2013 (11) + Where (e) is e for express editions of MSVS and blank otherwise. + """ + version_to_year = { + '8.0': '2005', + '9.0': '2008', + '10.0': '2010', + '11.0': '2012', + '12.0': '2013', + } + versions = [] + for version in versions_to_check: + # Old method of searching for which VS version is installed + # We don't use the 2010-encouraged-way because we also want to get the + # path to the binaries, which it doesn't offer. + keys = [r'HKLM\Software\Microsoft\VisualStudio\%s' % version, + r'HKLM\Software\Wow6432Node\Microsoft\VisualStudio\%s' % version, + r'HKLM\Software\Microsoft\VCExpress\%s' % version, + r'HKLM\Software\Wow6432Node\Microsoft\VCExpress\%s' % version] + for index in range(len(keys)): + path = _RegistryGetValue(keys[index], 'InstallDir') + if not path: + continue + path = _ConvertToCygpath(path) + # Check for full. + full_path = os.path.join(path, 'devenv.exe') + express_path = os.path.join(path, 'vcexpress.exe') + if not force_express and os.path.exists(full_path): + # Add this one. + versions.append(_CreateVersion(version_to_year[version], + os.path.join(path, '..', '..'))) + # Check for express. + elif os.path.exists(express_path): + # Add this one. + versions.append(_CreateVersion(version_to_year[version] + 'e', + os.path.join(path, '..', '..'))) + + # The old method above does not work when only SDK is installed. + keys = [r'HKLM\Software\Microsoft\VisualStudio\SxS\VC7', + r'HKLM\Software\Wow6432Node\Microsoft\VisualStudio\SxS\VC7'] + for index in range(len(keys)): + path = _RegistryGetValue(keys[index], version) + if not path: + continue + path = _ConvertToCygpath(path) + versions.append(_CreateVersion(version_to_year[version] + 'e', + os.path.join(path, '..'), sdk_based=True)) + + return versions + + +def SelectVisualStudioVersion(version='auto'): + """Select which version of Visual Studio projects to generate. + + Arguments: + version: Hook to allow caller to force a particular version (vs auto). + Returns: + An object representing a visual studio project format version. + """ + # In auto mode, check environment variable for override. + if version == 'auto': + version = os.environ.get('GYP_MSVS_VERSION', 'auto') + version_map = { + 'auto': ('10.0', '9.0', '8.0', '11.0'), + '2005': ('8.0',), + '2005e': ('8.0',), + '2008': ('9.0',), + '2008e': ('9.0',), + '2010': ('10.0',), + '2010e': ('10.0',), + '2012': ('11.0',), + '2012e': ('11.0',), + '2013': ('12.0',), + '2013e': ('12.0',), + } + override_path = os.environ.get('GYP_MSVS_OVERRIDE_PATH') + if override_path: + msvs_version = os.environ.get('GYP_MSVS_VERSION') + if not msvs_version or 'e' not in msvs_version: + raise ValueError('GYP_MSVS_OVERRIDE_PATH requires GYP_MSVS_VERSION to be ' + 'set to an "e" version (e.g. 2010e)') + return _CreateVersion(msvs_version, override_path, sdk_based=True) + version = str(version) + versions = _DetectVisualStudioVersions(version_map[version], 'e' in version) + if not versions: + if version == 'auto': + # Default to 2005 if we couldn't find anything + return _CreateVersion('2005', None) + else: + return _CreateVersion(version, None) + return versions[0] + +def GenerateEnvironmentFiles(toplevel_build_dir, generator_flags, open_out): + """It's not sufficient to have the absolute path to the compiler, linker, + etc. on Windows, as those tools rely on .dlls being in the PATH. We also + need to support both x86 and x64 compilers within the same build (to support + msvs_target_platform hackery). Different architectures require a different + compiler binary, and different supporting environment variables (INCLUDE, + LIB, LIBPATH). So, we extract the environment here, wrap all invocations + of compiler tools (cl, link, lib, rc, midl, etc.) via win_tool.py which + sets up the environment, and then we do not prefix the compiler with + an absolute path, instead preferring something like "cl.exe" in the rule + which will then run whichever the environment setup has put in the path. + When the following procedure to generate environment files does not + meet your requirement (e.g. for custom toolchains), you can pass + "-G ninja_use_custom_environment_files" to the gyp to suppress file + generation and use custom environment files prepared by yourself.""" + archs = ('x86', 'x64') + if generator_flags.get('ninja_use_custom_environment_files', 0): + cl_paths = {} + for arch in archs: + cl_paths[arch] = 'cl.exe' + return cl_paths + vs = GetVSVersion(generator_flags) + cl_paths = {} + for arch in archs: + # Extract environment variables for subprocesses. + args = vs.SetupScript(arch) + args.extend(('&&', 'set')) + popen = subprocess.Popen( + args, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + variables, _ = popen.communicate() + env = _ExtractImportantEnvironment(variables) + env_block = _FormatAsEnvironmentBlock(env) + f = open_out(os.path.join(toplevel_build_dir, 'environment.' + arch), 'wb') + f.write(env_block) + f.close() + + # Find cl.exe location for this architecture. + args = vs.SetupScript(arch) + args.extend(('&&', + 'for', '%i', 'in', '(cl.exe)', 'do', '@echo', 'LOC:%~$PATH:i')) + popen = subprocess.Popen(args, shell=True, stdout=subprocess.PIPE) + output, _ = popen.communicate() + cl_paths[arch] = _ExtractCLPath(output) + return cl_paths + +def OpenOutput(path, mode='w'): + """Open |path| for writing, creating directories if necessary.""" + try: + os.makedirs(os.path.dirname(path)) + except OSError: + pass + return open(path, mode) + +vs_version = None +def GetVSVersion(generator_flags): + global vs_version + if not vs_version: + vs_version = SelectVisualStudioVersion( + generator_flags.get('msvs_version', 'auto')) + return vs_version + +def _ExtractImportantEnvironment(output_of_set): + """Extracts environment variables required for the toolchain to run from + a textual dump output by the cmd.exe 'set' command.""" + envvars_to_save = ( + 'goma_.*', # TODO(scottmg): This is ugly, but needed for goma. + 'include', + 'lib', + 'libpath', + 'path', + 'pathext', + 'systemroot', + 'temp', + 'tmp', + ) + env = {} + for line in output_of_set.splitlines(): + for envvar in envvars_to_save: + if re.match(envvar + '=', line.lower()): + var, setting = line.split('=', 1) + if envvar == 'path': + # Our own rules (for running gyp-win-tool) and other actions in + # Chromium rely on python being in the path. Add the path to this + # python here so that if it's not in the path when ninja is run + # later, python will still be found. + setting = os.path.dirname(sys.executable) + os.pathsep + setting + env[var.upper()] = setting + break + for required in ('SYSTEMROOT', 'TEMP', 'TMP'): + if required not in env: + raise Exception('Environment variable "%s" ' + 'required to be set to valid path' % required) + return env + +def _FormatAsEnvironmentBlock(envvar_dict): + """Format as an 'environment block' directly suitable for CreateProcess. + Briefly this is a list of key=value\0, terminated by an additional \0. See + CreateProcess documentation for more details.""" + block = '' + nul = '\0' + for key, value in envvar_dict.iteritems(): + block += key + '=' + value + nul + block += nul + return block + + +def GenerateEnvironmentFiles(toplevel_build_dir, generator_flags): + """It's not sufficient to have the absolute path to the compiler, linker, + etc. on Windows, as those tools rely on .dlls being in the PATH. We also + need to support both x86 and x64 compilers within the same build (to support + msvs_target_platform hackery). Different architectures require a different + compiler binary, and different supporting environment variables (INCLUDE, + LIB, LIBPATH). So, we extract the environment here, wrap all invocations + of compiler tools (cl, link, lib, rc, midl, etc.) via win_tool.py which + sets up the environment, and then we do not prefix the compiler with + an absolute path, instead preferring something like "cl.exe" in the rule + which will then run whichever the environment setup has put in the path. + When the following procedure to generate environment files does not + meet your requirement (e.g. for custom toolchains), you can pass + "-G ninja_use_custom_environment_files" to the gyp to suppress file + generation and use custom environment files prepared by yourself.""" + archs = ('x86', 'x64') + if generator_flags.get('ninja_use_custom_environment_files', 0): + cl_paths = {} + for arch in archs: + cl_paths[arch] = 'cl.exe' + return cl_paths + vs = GetVSVersion(generator_flags) + cl_paths = {} + for arch in archs: + # Extract environment variables for subprocesses. + args = vs.SetupScript(arch) + args.extend(('&&', 'set')) + popen = subprocess.Popen( + args, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + variables, _ = popen.communicate() + env = _ExtractImportantEnvironment(variables) + env_block = _FormatAsEnvironmentBlock(env) + f = OpenOutput(os.path.join(toplevel_build_dir, 'environment.' + arch), 'wb') + f.write(env_block) + f.close() + + # Find cl.exe location for this architecture. + args = vs.SetupScript(arch) + args.extend(('&&', + 'for', '%i', 'in', '(cl.exe)', 'do', '@echo', 'LOC:%~$PATH:i')) + popen = subprocess.Popen(args, shell=True, stdout=subprocess.PIPE) + output, _ = popen.communicate() + cl_paths[arch] = _ExtractCLPath(output) + return cl_paths + +def _ExtractCLPath(output_of_where): + """Gets the path to cl.exe based on the output of calling the environment + setup batch file, followed by the equivalent of `where`.""" + # Take the first line, as that's the first found in the PATH. + for line in output_of_where.strip().splitlines(): + if line.startswith('LOC:'): + return line[len('LOC:'):].strip() + +#print SelectVisualStudioVersion().DefaultToolset() +#GenerateEnvironmentFiles("D:\\src\\src1\\src\\out\\gn\\eraseme", {}) +#print '"', GetVSVersion({}).Path(), '"' +print '"', GetVSVersion({}).sdk_based, '"' + +#------------------------------------------------------------------------------- + +version_info = { + '2010': { + 'includes': [ + 'VC\\atlmfc\\include', + ], + }, +} diff --git a/chromium/build/extract_from_cab.py b/chromium/build/extract_from_cab.py index 1c928af36f9..080370ca9ad 100755 --- a/chromium/build/extract_from_cab.py +++ b/chromium/build/extract_from_cab.py @@ -12,7 +12,7 @@ import sys import tempfile def run_quiet(*args): - """Run 'expand' supressing noisy output. Returns returncode from process.""" + """Run 'expand' suppressing noisy output. Returns returncode from process.""" popen = subprocess.Popen(args, stdout=subprocess.PIPE) out, _ = popen.communicate() if popen.returncode: diff --git a/chromium/build/filename_rules.gypi b/chromium/build/filename_rules.gypi index cf8c3572e50..9bb76c50da3 100644 --- a/chromium/build/filename_rules.gypi +++ b/chromium/build/filename_rules.gypi @@ -68,6 +68,7 @@ ['exclude', '_(x|x11)(_unittest)?\\.(h|cc)$'], ['exclude', '(^|/)x11_[^/]*\\.(h|cc)$'], ['exclude', '(^|/)x11/'], + ['exclude', '(^|/)x/'], ], }], ['<(toolkit_uses_gtk)!=1 or >(nacl_untrusted_build)==1', { @@ -91,15 +92,34 @@ ['<(use_aura)==0 or OS!="win" or >(nacl_untrusted_build)==1', { 'sources/': [ ['exclude', '_aurawin\\.(h|cc)$'] ] }], + ['<(use_aura)==0 or OS!="linux" or >(nacl_untrusted_build)==1', { + 'sources/': [ ['exclude', '_auralinux\\.(h|cc)$'] ] + }], ['<(use_ash)==0 or >(nacl_untrusted_build)==1', { 'sources/': [ ['exclude', '_ash(_browsertest|_unittest)?\\.(h|cc)$'], ['exclude', '(^|/)ash/'], ] }], + ['<(use_ash)==0 or OS!="win" or >(nacl_untrusted_build)==1', { + 'sources/': [ ['exclude', '_ashwin\\.(h|cc)$'] ] + }], ['<(use_ozone)==0 or >(nacl_untrusted_build)==1', { 'sources/': [ ['exclude', '_ozone(_browsertest|_unittest)?\\.(h|cc)$'], ['exclude', '(^|/)ozone/'], ] }], + ['<(use_ozone_evdev)==0 or >(nacl_untrusted_build)==1', { + 'sources/': [ ['exclude', '_evdev(_browsertest|_unittest)?\\.(h|cc)$'], + ['exclude', '(^|/)evdev/'], + ] + }], + ['<(ozone_platform_dri)==0 or >(nacl_untrusted_build)==1', { + 'sources/': [ ['exclude', '_dri(_browsertest|_unittest)?\\.(h|cc)$'], + ['exclude', '(^|/)dri/'], + ] + }], + ['<(use_pango)==0', { + 'sources/': [ ['exclude', '(^|_)pango(_util|_browsertest|_unittest)?\\.(h|cc)$'], ], + }], ] } diff --git a/chromium/build/get_landmines.py b/chromium/build/get_landmines.py index 05c9de69628..113b37ce380 100755 --- a/chromium/build/get_landmines.py +++ b/chromium/build/get_landmines.py @@ -37,6 +37,9 @@ def print_landmines(target): print 'Builders switching from make to ninja will clobber on this.' if platform() == 'mac': print 'Switching from bundle to unbundled dylib (issue 14743002).' + if platform() in ('win', 'mac'): + print ('Improper dependency for create_nmf.py broke in r240802, ' + 'fixed in r240860.') if (platform() == 'win' and builder() == 'ninja' and gyp_msvs_version() == '2012' and gyp_defines().get('target_arch') == 'x64' and diff --git a/chromium/build/gyp_chromium b/chromium/build/gyp_chromium index 56cfcf34d86..e8aee14af64 100755 --- a/chromium/build/gyp_chromium +++ b/chromium/build/gyp_chromium @@ -10,8 +10,10 @@ import glob import gyp_helper import os +import pipes import shlex import subprocess +import string import sys script_dir = os.path.dirname(os.path.realpath(__file__)) @@ -20,18 +22,20 @@ chrome_src = os.path.abspath(os.path.join(script_dir, os.pardir)) sys.path.insert(0, os.path.join(chrome_src, 'tools', 'gyp', 'pylib')) import gyp +# Assume this file is in a one-level-deep subdirectory of the source root. +SRC_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + # Add paths so that pymod_do_main(...) can import files. sys.path.insert(1, os.path.join(chrome_src, 'tools', 'generate_shim_headers')) sys.path.insert(1, os.path.join(chrome_src, 'tools', 'grit')) sys.path.insert(1, os.path.join(chrome_src, 'chrome', 'tools', 'build')) sys.path.insert(1, os.path.join(chrome_src, 'native_client', 'build')) +sys.path.insert(1, os.path.join(chrome_src, 'native_client_sdk', 'src', + 'build_tools')) sys.path.insert(1, os.path.join(chrome_src, 'remoting', 'tools', 'build')) +sys.path.insert(1, os.path.join(chrome_src, 'third_party', 'liblouis')) sys.path.insert(1, os.path.join(chrome_src, 'third_party', 'WebKit', - 'Source', 'core', 'scripts')) -# TODO(adamk): Remove this line once core.gyp is no longer a directory -sys.path.insert(1, os.path.join(chrome_src, 'third_party', 'WebKit', - 'Source', 'core', 'core.gyp', 'scripts')) - + 'Source', 'build', 'scripts')) # On Windows, Psyco shortens warm runs of build/gyp_chromium by about # 20 seconds on a z600 machine with 12 GB of RAM, from 90 down to 70 @@ -52,10 +56,91 @@ if sys.platform == 'win32': else: psyco = None -def additional_include_files(args=[]): + +def GetSupplementalFiles(): + """Returns a list of the supplemental files that are included in all GYP + sources.""" + return glob.glob(os.path.join(chrome_src, '*', 'supplement.gypi')) + + +def FormatKeyForGN(key): + """Returns the given GYP key reformatted for GN. + + GYP dictionary keys can be almost anything, but in GN they are identifiers + and must follow the same rules. This reformats such keys to be valid GN + identifiers.""" + return ''.join([c if c in string.ascii_letters else '_' for c in key]) + + +def EscapeStringForGN(s): + """Converts a string to a GN string literal.""" + # Escape $ characters which have special meaning to GN. + return '"' + s.replace('$', '\\$').replace('"', '\\"') + '"' + + +def GetGypVarsForGN(supplemental_files): + """Returns a dictionary of all GYP vars that we will be passing to GN.""" + vars_dict = {} + + for supplement in supplemental_files: + with open(supplement, 'r') as f: + try: + file_data = eval(f.read(), {'__builtins__': None}, None) + except SyntaxError, e: + e.filename = os.path.abspath(supplement) + raise + variables = file_data.get('variables', []) + for v in variables: + vars_dict[FormatKeyForGN(v)] = EscapeStringForGN(str(variables[v])) + + env_string = os.environ.get('GYP_DEFINES', '') + items = shlex.split(env_string) + for item in items: + tokens = item.split('=', 1) + # Some GYP variables have hyphens, which we don't support. + key = FormatKeyForGN(tokens[0]) + if len(tokens) == 2: + vars_dict[key] = tokens[1] + else: + # No value supplied, treat it as a boolean and set it. + vars_dict[key] = 'true' + + return vars_dict + + +def GetArgsStringForGN(supplemental_files): + """Returns the args to pass to GN. + Based on a subset of the GYP variables that have been rewritten a bit.""" + + vars_dict = GetGypVarsForGN(supplemental_files) + gn_args = '' + + # These tuples of (key, value, gn_arg_string) use the gn_arg_string for + # gn when the key is set to the given value in the GYP arguments. + remap_cases = [ + ('branding', 'Chrome', 'is_chrome_branded=true'), + ('buildtype', 'Official', 'is_official_build=true'), + ('component', 'shared_library', 'is_component_build=true'), + ] + for i in remap_cases: + if i[0] in vars_dict and vars_dict[i[0]] == i[1]: + gn_args += ' ' + i[2] + + # These string arguments get passed directly. + for v in ['windows_sdk_path']: + if v in vars_dict: + gn_args += ' ' + v + '=' + EscapeStringForGN(vars_dict[v]) + + # Set the GYP flag so BUILD files know they're being invoked in GYP mode. + gn_args += ' is_gyp=true' + return gn_args.strip() + + +def additional_include_files(supplemental_files, args=[]): """ - Returns a list of additional (.gypi) files to include, without - duplicating ones that are already specified on the command line. + Returns a list of additional (.gypi) files to include, without duplicating + ones that are already specified on the command line. The list of supplemental + include files is passed in as an argument. """ # Determine the include files specified on the command line. # This doesn't cover all the different option formats you can use, @@ -75,15 +160,50 @@ def additional_include_files(args=[]): AddInclude(os.path.join(script_dir, 'common.gypi')) # Optionally add supplemental .gypi files if present. - supplements = glob.glob(os.path.join(chrome_src, '*', 'supplement.gypi')) - for supplement in supplements: + for supplement in supplemental_files: AddInclude(supplement) return result + +def RunGN(supplemental_includes): + """Runs GN, returning True if it succeeded, printing an error and returning + false if not.""" + + # The binaries in platform-specific subdirectories in src/tools/gn/bin. + gnpath = SRC_DIR + '/tools/gn/bin/' + if sys.platform in ('cygwin', 'win32'): + gnpath += 'win/gn.exe' + elif sys.platform.startswith('linux'): + # On Linux we have 32-bit and 64-bit versions. + if subprocess.check_output(["getconf", "LONG_BIT"]).find("64") >= 0: + gnpath += 'linux/gn' + else: + gnpath += 'linux/gn32' + elif sys.platform == 'darwin': + gnpath += 'mac/gn' + else: + print 'Unknown platform for GN: ', sys.platform + return False + + print 'Generating gyp files from GN...' + + # Need to pass both the source root (the bots don't run this command from + # within the source tree) as well as set the is_gyp value so the BUILD files + # to know they're being run under GYP. + args = [gnpath, 'gyp', '-q', + '--root=' + chrome_src, + '--args=' + GetArgsStringForGN(supplemental_includes)] + return subprocess.call(args) == 0 + + if __name__ == '__main__': args = sys.argv[1:] + if int(os.environ.get('GYP_CHROMIUM_NO_ACTION', 0)): + print 'Skipping gyp_chromium due to GYP_CHROMIUM_NO_ACTION env var.' + sys.exit(0) + # Use the Psyco JIT if available. if psyco: psyco.profile() @@ -123,7 +243,13 @@ if __name__ == '__main__': else: args.append(os.path.join(script_dir, 'all.gyp')) - args.extend(['-I' + i for i in additional_include_files(args)]) + supplemental_includes = GetSupplementalFiles() + + if not RunGN(supplemental_includes): + sys.exit(1) + + args.extend( + ['-I' + i for i in additional_include_files(supplemental_includes, args)]) # There shouldn't be a circular dependency relationship between .gyp files, # but in Chromium's .gyp files, on non-Mac platforms, circular relationships @@ -138,11 +264,49 @@ if __name__ == '__main__': args.append('--no-circular-check') # Default to ninja on linux, but only if no generator has explicitly been set. + # Also default to ninja on mac, but only when not building chrome/ios. # . -f / --format has precedence over the env var, no need to check for it # . set the env var only if it hasn't been set yet # . chromium.gyp_env has been applied to os.environ at this point already if sys.platform.startswith('linux') and not os.environ.get('GYP_GENERATORS'): os.environ['GYP_GENERATORS'] = 'ninja' + elif sys.platform == 'darwin' and not os.environ.get('GYP_GENERATORS') and \ + not 'OS=ios' in os.environ.get('GYP_DEFINES', []): + os.environ['GYP_GENERATORS'] = 'ninja' + + # If using ninja on windows, and not opting out of the the automatic + # toolchain, then set up variables for the automatic toolchain. Opt-out is + # on by default, for now. + if (sys.platform in ('win32', 'cygwin') and + os.environ.get('GYP_GENERATORS') == 'ninja' and + os.environ.get('GYP_MSVS_USE_SYSTEM_TOOLCHAIN', '1') != '1'): + # For now, call the acquisition script here so that there's only one + # opt-in step required. This will be moved to a separate DEPS step once + # it's on by default. + subprocess.check_call([ + sys.executable, + os.path.normpath(os.path.join(script_dir, '..', 'tools', 'win', + 'toolchain', + 'get_toolchain_if_necessary.py'))]) + toolchain = os.path.normpath(os.path.join( + script_dir, '..', 'third_party', 'win_toolchain', 'files')) + os.environ['GYP_MSVS_OVERRIDE_PATH'] = toolchain + os.environ['GYP_MSVS_VERSION'] = '2013' + # We need to make sure windows_sdk_path is set to the automated toolchain + # values in GYP_DEFINES, but don't want to override any other values there. + gyp_defines_dict = gyp.NameValueListToDict(gyp.ShlexEnv('GYP_DEFINES')) + win8sdk = os.path.join(toolchain, 'win8sdk') + gyp_defines_dict['windows_sdk_path'] = win8sdk + os.environ['WINDOWSSDKDIR'] = win8sdk + os.environ['GYP_DEFINES'] = ' '.join('%s=%s' % (k, pipes.quote(str(v))) + for k, v in gyp_defines_dict.iteritems()) + # Include the VS runtime in the PATH in case it's not machine-installed. + runtime_path = ';'.join( + os.path.normpath(os.path.join( + script_dir, '..', 'third_party', 'win_toolchain', 'files', s)) + for s in ('sys64', 'sys32')) + os.environ['PATH'] = runtime_path + os.environ['PATH'] + print('Using automatic toolchain in %s.' % toolchain) # If CHROMIUM_GYP_SYNTAX_CHECK is set to 1, it will invoke gyp with --check # to enfore syntax checking. diff --git a/chromium/build/install-build-deps-android.sh b/chromium/build/install-build-deps-android.sh index 9417b1a76ab..73e534a2869 100755 --- a/chromium/build/install-build-deps-android.sh +++ b/chromium/build/install-build-deps-android.sh @@ -44,7 +44,7 @@ sudo apt-get -f install # be installed manually on late-model versions. # common -sudo apt-get -y install lighttpd python-pexpect xvfb x11-utils +sudo apt-get -y install checkstyle lighttpd python-pexpect xvfb x11-utils # Few binaries in the Android SDK require 32-bit libraries on the host. sudo apt-get -y install lib32z1 g++-multilib diff --git a/chromium/build/install-build-deps.sh b/chromium/build/install-build-deps.sh index 8296cb8928c..48e2c76dcce 100755 --- a/chromium/build/install-build-deps.sh +++ b/chromium/build/install-build-deps.sh @@ -17,6 +17,10 @@ usage() { echo "--[no-]chromeos-fonts: enable or disable installation of Chrome OS"\ "fonts" echo "--no-prompt: silently select standard options/defaults" + echo "--quick-check: quickly try to determine if dependencies are installed" + echo " (this avoids interactive prompts and sudo commands," + echo " so might not be 100% accurate)" + echo "--unsupported: attempt installation even on unsupported systems" echo "Script will prompt interactively if options not given." exit 1 } @@ -41,23 +45,24 @@ do --no-prompt) do_default=1 do_quietly="-qq --assume-yes" ;; + --quick-check) do_quick_check=1;; --unsupported) do_unsupported=1;; *) usage;; esac shift done -ubuntu_versions="10\.04|10\.10|11\.04|11\.10|12\.04|12\.10|13\.04" -ubuntu_codenames="lucid|maverick|natty|oneiric|precise|quantal|raring" +ubuntu_versions="12\.04|12\.10|13\.04" +ubuntu_codenames="precise|quantal|raring" ubuntu_issue="Ubuntu ($ubuntu_versions|$ubuntu_codenames)" # GCEL is an Ubuntu-derived VM image used on Google Compute Engine; /etc/issue # doesn't contain a version number so just trust that the user knows what # they're doing. gcel_issue="^GCEL" -if [ 0 -eq "${do_unsupported-0}" ] ; then +if [ 0 -eq "${do_unsupported-0}" ] && [ 0 -eq "${do_quick_check-0}" ] ; then if ! egrep -q "($ubuntu_issue|$gcel_issue)" /etc/issue; then - echo "ERROR: Only Ubuntu 10.04 (lucid) through 13.04 (raring) are"\ + echo "ERROR: Only Ubuntu 12.04 (precise) through 13.04 (raring) are"\ "currently supported" >&2 exit 1 fi @@ -68,42 +73,42 @@ if [ 0 -eq "${do_unsupported-0}" ] ; then fi fi -if [ "x$(id -u)" != x0 ]; then +if [ "x$(id -u)" != x0 ] && [ 0 -eq "${do_quick_check-0}" ]; then echo "Running as non-root user." echo "You might have to enter your password one or more times for 'sudo'." echo fi # Packages needed for chromeos only -chromeos_dev_list="libbluetooth-dev libbrlapi-dev" - -# Packages need for development -dev_list="apache2.2-bin bison curl elfutils fakeroot flex g++ gperf - language-pack-fr libapache2-mod-php5 libasound2-dev libbrlapi-dev - libbz2-dev libcairo2-dev libcups2-dev libcurl4-gnutls-dev libelf-dev - libgconf2-dev libgl1-mesa-dev libglib2.0-dev libglu1-mesa-dev - libgnome-keyring-dev libgtk2.0-dev libkrb5-dev libnspr4-dev - libnss3-dev libpam0g-dev libpci-dev libpulse-dev libsctp-dev - libspeechd-dev libsqlite3-dev libssl-dev libudev-dev libwww-perl - libxslt1-dev libxss-dev libxt-dev libxtst-dev mesa-common-dev - metacity patch perl php5-cgi pkg-config python python-cherrypy3 - python-dev python-psutil rpm ruby subversion ttf-dejavu-core - ttf-indic-fonts ttf-kochi-gothic ttf-kochi-mincho ttf-thai-tlwg - wdiff git-core - $chromeos_dev_list" +chromeos_dev_list="libbluetooth-dev" + +# Packages needed for development +dev_list="apache2.2-bin bison curl elfutils fakeroot flex g++ git-core gperf + language-pack-da language-pack-fr language-pack-he + language-pack-zh-hant libapache2-mod-php5 libasound2-dev libbrlapi-dev + libbz2-dev libcairo2-dev libcap-dev libcups2-dev libcurl4-gnutls-dev + libdrm-dev libelf-dev libgconf2-dev libgl1-mesa-dev libglib2.0-dev + libglu1-mesa-dev libgnome-keyring-dev libgtk2.0-dev libkrb5-dev + libnspr4-dev libnss3-dev libpam0g-dev libpci-dev libpulse-dev + libsctp-dev libspeechd-dev libsqlite3-dev libssl-dev libudev-dev + libwww-perl libxslt1-dev libxss-dev libxt-dev libxtst-dev + mesa-common-dev openbox patch perl php5-cgi pkg-config python + python-cherrypy3 python-dev python-psutil rpm ruby subversion + ttf-dejavu-core ttf-indic-fonts ttf-kochi-gothic ttf-kochi-mincho + ttf-thai-tlwg wdiff xfonts-mathml $chromeos_dev_list" # 64-bit systems need a minimum set of 32-bit compat packages for the pre-built # NaCl binaries. These are always needed, regardless of whether or not we want # the full 32-bit "cross-compile" support (--lib32). -if [ "$(uname -m)" = "x86_64" ]; then +if file /sbin/init | grep -q 'ELF 64-bit'; then dev_list="${dev_list} libc6-i386 lib32gcc1 lib32stdc++6" fi # Run-time libraries required by chromeos only -chromeos_lib_list="libpulse0 libbz2-1.0 libcurl4-gnutls-dev" +chromeos_lib_list="libpulse0 libbz2-1.0" # Full list of required run-time libraries -lib_list="libatk1.0-0 libc6 libasound2 libcairo2 libcups2 libexpat1 +lib_list="libatk1.0-0 libc6 libasound2 libcairo2 libcap2 libcups2 libexpat1 libfontconfig1 libfreetype6 libglib2.0-0 libgnome-keyring0 libgtk2.0-0 libpam0g libpango1.0-0 libpci3 libpcre3 libpixman-1-0 libpng12-0 libspeechd2 libstdc++6 libsqlite3-0 libx11-6 @@ -117,16 +122,27 @@ dbg_list="libatk1.0-dbg libc6-dbg libcairo2-dbg libfontconfig1-dbg libpixman-1-0-dbg libsqlite3-0-dbg libx11-6-dbg libxau6-dbg libxcb1-dbg libxcomposite1-dbg libxcursor1-dbg libxdamage1-dbg libxdmcp6-dbg libxext6-dbg libxfixes3-dbg libxi6-dbg libxinerama1-dbg - libxrandr2-dbg libxrender1-dbg libxtst6-dbg zlib1g-dbg" - -# arm cross toolchain packages needed to build chrome on arm -arm_list="libc6-armel-cross libc6-dev-armel-cross libgcc1-armel-cross - libgomp1-armel-cross linux-libc-dev-armel-cross - libgcc1-dbg-armel-cross libgomp1-dbg-armel-cross - binutils-arm-linux-gnueabi cpp-arm-linux-gnueabi - gcc-arm-linux-gnueabi g++-arm-linux-gnueabi - libmudflap0-dbg-armel-cross" - + libxrandr2-dbg libxrender1-dbg libxtst6-dbg zlib1g-dbg + libstdc++6-4.6-dbg" + +# arm cross toolchain packages needed to build chrome on armhf +arm_list="libc6-armhf-cross libc6-dev-armhf-cross libgcc1-armhf-cross + libgomp1-armhf-cross linux-libc-dev-armhf-cross + libgcc1-dbg-armhf-cross libgomp1-dbg-armhf-cross + binutils-arm-linux-gnueabihf cpp-arm-linux-gnueabihf + gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf + libmudflap0-dbg-armhf-cross" + +# Old armel cross toolchain packages +armel_list="libc6-armel-cross libc6-dev-armel-cross libgcc1-armel-cross + libgomp1-armel-cross linux-libc-dev-armel-cross + libgcc1-dbg-armel-cross libgomp1-dbg-armel-cross + binutils-arm-linux-gnueabi cpp-arm-linux-gnueabi + gcc-arm-linux-gnueabi g++-arm-linux-gnueabi + libmudflap0-dbg-armel-cross" + +# TODO(sbc): remove armel once the armhf transition is complete +arm_list="$arm_list $armel_list" # Some package names have changed over time if package_exists ttf-mscorefonts-installer; then @@ -158,7 +174,7 @@ else fi -# Some packages are only needed, if the distribution actually supports +# Some packages are only needed if the distribution actually supports # installing them. if package_exists appmenu-gtk; then lib_list="$lib_list appmenu-gtk" @@ -172,6 +188,7 @@ fi # Users can abort the function by pressing CTRL-C. This will call "exit 1". yes_no() { if [ 0 -ne "${do_default-0}" ] ; then + [ $1 -eq 0 ] && echo "Y" || echo "N" return $1 fi local c @@ -202,7 +219,7 @@ yes_no() { done } -if test "$do_inst_syms" = "" +if test "$do_inst_syms" = "" && test 0 -eq ${do_quick_check-0} then echo "This script installs all tools and libraries needed to build Chromium." echo "" @@ -215,32 +232,72 @@ then fi fi if test "$do_inst_syms" = "1"; then - echo "Installing debugging symbols." + echo "Including debugging symbols." else - echo "Skipping installation of debugging symbols." + echo "Skipping debugging symbols." dbg_list= fi # When cross building for arm on 64-bit systems the host binaries # that are part of v8 need to be compiled with -m32 which means # that basic multilib support is needed. -if [ "$(uname -m)" = "x86_64" ]; then +if file /sbin/init | grep -q 'ELF 64-bit'; then arm_list="$arm_list g++-multilib" fi -if test "$do_inst_arm" = "1"; then +if test "$do_inst_arm" = "1" ; then . /etc/lsb-release - if test "$DISTRIB_CODENAME" != "precise"; then + if ! [ "${DISTRIB_CODENAME}" = "precise" -o \ + 1 -eq "${do_unsupported-0}" ]; then echo "ERROR: Installing the ARM cross toolchain is only available on" \ "Ubuntu precise." >&2 exit 1 fi - echo "Installing ARM cross toolchain." + echo "Including ARM cross toolchain." else - echo "Skipping installation of ARM cross toolchain." + echo "Skipping ARM cross toolchain." arm_list= fi +packages="$(echo "${dev_list} ${lib_list} ${dbg_list} ${arm_list}" | \ + tr " " "\n" | sort -u | tr "\n" " ")" + +if [ 1 -eq "${do_quick_check-0}" ] ; then + failed_check="$(dpkg-query -W -f '${PackageSpec}:${Status}\n' \ + ${packages} 2>&1 | grep -v "ok installed" || :)" + if [ -n "${failed_check}" ]; then + echo + nomatch="$(echo "${failed_check}" | \ + sed -e "s/^No packages found matching \(.*\).$/\1/;t;d")" + missing="$(echo "${failed_check}" | \ + sed -e "/^No packages found matching/d;s/^\(.*\):.*$/\1/")" + if [ "$nomatch" ]; then + # Distinguish between packages that actually aren't available to the + # system (i.e. not in any repo) and packages that just aren't known to + # dpkg (i.e. managed by apt). + unknown="" + for p in ${nomatch}; do + if apt-cache show ${p} > /dev/null 2>&1; then + missing="${p}\n${missing}" + else + unknown="${p}\n${unknown}" + fi + done + if [ -n "${unknown}" ]; then + echo "WARNING: The following packages are unknown to your system" + echo "(maybe missing a repo or need to 'sudo apt-get update'):" + echo -e "${unknown}" | sed -e "s/^/ /" + fi + fi + if [ -n "${missing}" ]; then + echo "WARNING: The following packages are not installed:" + echo -e "${missing}" | sed -e "s/^/ /" + fi + exit 1 + fi + exit 0 +fi + sudo apt-get update # We initially run "apt-get" with the --reinstall option and parse its output. @@ -248,7 +305,6 @@ sudo apt-get update # without accidentally promoting any packages from "auto" to "manual". # We then re-run "apt-get" with just the list of missing packages. echo "Finding missing packages..." -packages="${dev_list} ${lib_list} ${dbg_list} ${arm_list}" # Intentionally leaving $packages unquoted so it's more readable. echo "Packages required: " $packages echo @@ -307,7 +363,7 @@ else fi # Install 32bit backwards compatibility support for 64bit systems -if [ "$(uname -m)" = "x86_64" ]; then +if file /sbin/init | grep -q 'ELF 64-bit'; then if test "$do_inst_lib32" != "1" then echo "NOTE: If you were expecting the option to install 32bit libs," @@ -329,7 +385,9 @@ if [ "$(uname -m)" = "x86_64" ]; then # There are other ways to achieve the same goal. But resetting the # variable is the best way to document the intended behavior -- and to # allow us to gradually deprecate and then remove the obsolete code. - do_inst_lib32= + if test "${do_default-0}" -ne 1; then + do_inst_lib32= + fi fi echo "WARNING" @@ -342,10 +400,12 @@ if [ "$(uname -m)" = "x86_64" ]; then echo "The code for installing 32bit libraries on a 64bit system is" echo "unmaintained and might not work with modern versions of Ubuntu" echo "or Debian." - echo - echo -n "Are you sure you want to proceed (y/N) " - if yes_no 1; then - do_inst_lib32=1 + if test "$do_inst_lib32" != "" ; then + echo + echo -n "Are you sure you want to proceed (y/N) " + if yes_no 1; then + do_inst_lib32=1 + fi fi if test "$do_inst_lib32" != "1" then diff --git a/chromium/build/ios/grit_whitelist.txt b/chromium/build/ios/grit_whitelist.txt index bcdb3f36462..d2f832fe0c5 100644 --- a/chromium/build/ios/grit_whitelist.txt +++ b/chromium/build/ios/grit_whitelist.txt @@ -1,3 +1,6 @@ +IDR_ABOUT_DOM_DISTILLER_CSS +IDR_ABOUT_DOM_DISTILLER_HTML +IDR_ABOUT_DOM_DISTILLER_JS IDR_ABOUT_VERSION_CSS IDR_ABOUT_VERSION_HTML IDR_ABOUT_VERSION_JS @@ -42,6 +45,9 @@ IDR_PRERENDER IDR_PRINTER_FAVICON IDR_PRODUCT_LOGO_26 IDR_SAD_TAB +IDR_SIGNIN_INTERNALS_INDEX_HTML +IDR_SIGNIN_INTERNALS_INDEX_JS +IDR_SSL_BLOCKING_HTML IDR_SSL_ROAD_BLOCK_HTML IDR_SYNC_INTERNALS_ABOUT_JS IDR_SYNC_INTERNALS_CHROME_SYNC_JS @@ -93,6 +99,7 @@ IDS_APP_LAUNCHER_OPEN_IN_LABEL_MOBILE IDS_APP_LAUNCHER_OPEN_ONCE_BUTTON_MOBILE IDS_APP_UNTITLED_SHORTCUT_FILE_NAME IDS_AUTOCOMPLETE_SEARCH_DESCRIPTION +IDS_AUTOFILL_ADDRESS_LINE_SEPARATOR IDS_AUTOFILL_ADDRESS_SUMMARY_SEPARATOR IDS_AUTOFILL_CC_AMEX IDS_AUTOFILL_CC_DINERS @@ -239,6 +246,13 @@ IDS_DEFAULT_TAB_TITLE IDS_DELETE IDS_DISABLE_TOUCH_ADJUSTMENT_DESCRIPTION IDS_DISABLE_TOUCH_ADJUSTMENT_NAME +IDS_DOM_DISTILLER_TITLE +IDS_DOM_DISTILLER_WEBUI_ENTRY_ADD +IDS_DOM_DISTILLER_WEBUI_ENTRY_ADD_FAILED +IDS_DOM_DISTILLER_WEBUI_ENTRY_URL +IDS_DOM_DISTILLER_WEBUI_FETCHING_ENTRIES +IDS_DOM_DISTILLER_WEBUI_REFRESH +IDS_DOM_DISTILLER_WEBUI_TITLE IDS_DONE IDS_EDIT_FIND_MAC IDS_EMPTY_KEYWORD_VALUE @@ -246,8 +260,6 @@ IDS_ENABLE_BACKLOADER_DESCRIPTION IDS_ENABLE_BACKLOADER_NAME IDS_ENABLE_BEZEL_TOUCH_DESCRIPTION IDS_ENABLE_BEZEL_TOUCH_NAME -IDS_ENABLE_SCREENSAVER_EXTENSION_DESCRIPTION -IDS_ENABLE_SCREENSAVER_EXTENSION_NAME IDS_ENABLE_TAB_CAPTURE_DESCRIPTION IDS_ENABLE_TAB_CAPTURE_NAME IDS_ERRORPAGES_BUTTON_LESS @@ -420,8 +432,6 @@ IDS_FLAGS_ASH_DISABLE_PER_APP_LAUNCHER_DESCRIPTION IDS_FLAGS_ASH_DISABLE_PER_APP_LAUNCHER_NAME IDS_FLAGS_ASH_IMMERSIVE_FULLSCREEN_DESCRIPTION IDS_FLAGS_ASH_IMMERSIVE_FULLSCREEN_NAME -IDS_FLAGS_ASH_NEW_LOCK_ANIMATIONS -IDS_FLAGS_ASH_NEW_LOCK_ANIMATIONS_DESCRIPTION IDS_FLAGS_CAPTIVE_PORTAL_DETECTOR_DESCRIPTION IDS_FLAGS_CAPTIVE_PORTAL_DETECTOR_NAME IDS_FLAGS_CHROME_CAPTIVE_PORTAL_DETECTOR @@ -436,8 +446,6 @@ IDS_FLAGS_COMPOSITING_FOR_TRANSITION_DESCRIPTION IDS_FLAGS_COMPOSITING_FOR_TRANSITION_NAME IDS_FLAGS_CONFLICTS_CHECK_DESCRIPTION IDS_FLAGS_CONFLICTS_CHECK_NAME -IDS_FLAGS_CSS_SHADERS_DESCRIPTION -IDS_FLAGS_CSS_SHADERS_NAME IDS_FLAGS_DEBUG_PACKED_APP_DESCRIPTION IDS_FLAGS_DEBUG_PACKED_APP_NAME IDS_FLAGS_DEBUG_SHORTCUTS_DESCRIPTION @@ -630,6 +638,8 @@ IDS_FLAGS_FORCE_FULLSCREEN_APP_DESCRIPTION IDS_FLAGS_FORCE_FULLSCREEN_APP_NAME IDS_FLAGS_FORCE_HIGH_DPI_DESCRIPTION IDS_FLAGS_FORCE_HIGH_DPI_NAME +IDS_FLAGS_FORCE_UNIVERSAL_ACCELERATED_OVERFLOW_SCROLL_MODE_DESCRIPTION +IDS_FLAGS_FORCE_UNIVERSAL_ACCELERATED_OVERFLOW_SCROLL_MODE_NAME IDS_FLAGS_FULL_HISTORY_SYNC_DESCRIPTION IDS_FLAGS_FULL_HISTORY_SYNC_NAME IDS_FLAGS_HIDE_LAUNCHER_ALIGNMENT_MENU_DESCRIPTION @@ -989,6 +999,7 @@ IDS_SYNC_PASSPHRASE_MSG_EXPLICIT_POSTFIX IDS_SYNC_PASSPHRASE_MSG_EXPLICIT_PREFIX IDS_SYNC_PASSPHRASE_SECTION_TITLE IDS_SYNC_PASSWORD_SYNC_ATTENTION +IDS_SYNC_PROMO_NTP_BUBBLE_MESSAGE IDS_SYNC_PROMO_TAB_TITLE IDS_SYNC_RELOGIN_LINK_LABEL IDS_SYNC_SERVER_IS_UNREACHABLE diff --git a/chromium/build/isolate.gypi b/chromium/build/isolate.gypi index 76882c786ea..2c667de5712 100644 --- a/chromium/build/isolate.gypi +++ b/chromium/build/isolate.gypi @@ -33,6 +33,9 @@ # # The generated .isolated file will be: # <(PRODUCT_DIR)/foo_test.isolated +# +# See http://dev.chromium.org/developers/testing/isolated-testing/for-swes +# for more information. { 'rules': [ @@ -41,9 +44,8 @@ 'extension': 'isolate', 'inputs': [ # Files that are known to be involved in this step. - '<(DEPTH)/tools/swarm_client/isolate.py', - '<(DEPTH)/tools/swarm_client/run_isolated.py', - '<(DEPTH)/tools/swarm_client/googletest/run_test_cases.py', + '<(DEPTH)/tools/swarming_client/isolate.py', + '<(DEPTH)/tools/swarming_client/run_isolated.py', # Disable file tracking by the build driver for now. This means the # project must have the proper build-time dependency for their runtime @@ -60,39 +62,36 @@ 'outputs': [ '<(PRODUCT_DIR)/<(RULE_INPUT_ROOT).isolated', ], + 'action': [ + 'python', + '<(DEPTH)/tools/swarming_client/isolate.py', + '<(test_isolation_mode)', + # Variables should use the -V FOO=<(FOO) form so frequent values, + # like '0' or '1', aren't stripped out by GYP. + '--path-variable', 'PRODUCT_DIR', '<(PRODUCT_DIR) ', + '--config-variable', 'OS=<(OS)', + '--result', '<@(_outputs)', + '--isolate', '<(RULE_INPUT_PATH)', + ], 'conditions': [ - ["test_isolation_outdir==''", { + # Note: When gyp merges lists, it appends them to the old value. + ['OS=="mac"', { + # <(mac_product_name) can contain a space, so don't use FOO=<(FOO) + # form. 'action': [ - 'python', - '<(DEPTH)/tools/swarm_client/isolate.py', - '<(test_isolation_mode)', - # GYP will eliminate duplicate arguments so '<(PRODUCT_DIR)' cannot - # be provided twice. To work around this behavior, append '/'. - # - # Also have a space after <(PRODUCT_DIR) or visual studio will - # escape the argument wrappping " with the \ and merge it into - # the following arguments. - # - # Other variables should use the -V FOO=<(FOO) form so frequent - # values, like '0' or '1', aren't stripped out by GYP. - '--outdir', '<(PRODUCT_DIR)/ ', - '--variable', 'PRODUCT_DIR', '<(PRODUCT_DIR) ', - '--variable', 'OS=<(OS)', - '--result', '<@(_outputs)', - '--isolate', '<(RULE_INPUT_PATH)', + '--extra-variable', 'mac_product_name', '<(mac_product_name)', ], + }], + ["test_isolation_outdir==''", { + # GYP will eliminate duplicate arguments so '<(PRODUCT_DIR)' cannot + # be provided twice. To work around this behavior, append '/'. + # + # Also have a space after <(PRODUCT_DIR) or visual studio will + # escape the argument wrappping " with the \ and merge it into + # the following arguments. + 'action': [ '--outdir', '<(PRODUCT_DIR)/ ' ], }, { - 'action': [ - 'python', - '<(DEPTH)/tools/swarm_client/isolate.py', - '<(test_isolation_mode)', - '--outdir', '<(test_isolation_outdir)', - # See comment above. - '--variable', 'PRODUCT_DIR', '<(PRODUCT_DIR) ', - '--variable', 'OS=<(OS)', - '--result', '<@(_outputs)', - '--isolate', '<(RULE_INPUT_PATH)', - ], + 'action': [ '--outdir', '<(test_isolation_outdir)' ], }], ['test_isolation_fail_on_missing == 0', { 'action': ['--ignore_broken_items'], diff --git a/chromium/build/java.gypi b/chromium/build/java.gypi index 2e03bab7cce..b3daebbee60 100644 --- a/chromium/build/java.gypi +++ b/chromium/build/java.gypi @@ -44,6 +44,7 @@ # res_extra_dirs - A list of extra directories containing Android resources. # These directories may be generated at build time. # res_extra_files - A list of the files in res_extra_dirs. +# never_lint - Set to 1 to not run lint on this target. { 'dependencies': [ @@ -73,6 +74,10 @@ 'intermediate_dir': '<(SHARED_INTERMEDIATE_DIR)/<(_target_name)', 'classes_dir': '<(intermediate_dir)/classes', 'compile_stamp': '<(intermediate_dir)/compile.stamp', + 'lint_stamp': '<(intermediate_dir)/lint.stamp', + 'lint_result': '<(intermediate_dir)/lint_result.xml', + 'lint_config': '<(intermediate_dir)/lint_config.xml', + 'never_lint%': 0, 'proguard_config%': '', 'proguard_preprocess%': '0', 'variables': { @@ -308,6 +313,24 @@ ] }, { + 'variables': { + 'src_dirs': [ + '<(java_in_dir)/src', + '>@(additional_src_dirs)', + ], + 'stamp_path': '<(lint_stamp)', + 'result_path': '<(lint_result)', + 'config_path': '<(lint_config)', + }, + 'inputs': [ + '<(compile_stamp)', + ], + 'outputs': [ + '<(lint_stamp)', + ], + 'includes': [ 'android/lint_action.gypi' ], + }, + { 'action_name': 'jar_<(_target_name)', 'message': 'Creating <(_target_name) jar', 'inputs': [ diff --git a/chromium/build/java_apk.gypi b/chromium/build/java_apk.gypi index 81984472af7..5ca61e3794e 100644 --- a/chromium/build/java_apk.gypi +++ b/chromium/build/java_apk.gypi @@ -48,7 +48,12 @@ # strings.xml files, if any. # library_manifest_paths'- Paths to additional AndroidManifest.xml files from # libraries. - +# use_content_linker - Enable the content dynamic linker that allows sharing the +# RELRO section of the native libraries between the different processes. +# enable_content_linker_tests - Enable the content dynamic linker test support +# code. This allows a test APK to inject a Linker.TestRunner instance at +# runtime. Should only be used by the content_linker_test_apk target!! +# never_lint - Set to 1 to not run lint on this target. { 'variables': { 'additional_input_paths': [], @@ -85,8 +90,12 @@ 'native_libraries_java_stamp': '<(intermediate_dir)/native_libraries_java.stamp', 'native_libraries_template_data_dir': '<(intermediate_dir)/native_libraries/', 'native_libraries_template_data_file': '<(native_libraries_template_data_dir)/native_libraries_array.h', - 'native_libraries_template_data_stamp': '<(intermediate_dir)/native_libraries_template_data.stamp', + 'native_libraries_template_version_file': '<(native_libraries_template_data_dir)/native_libraries_version.h', 'compile_stamp': '<(intermediate_dir)/compile.stamp', + 'lint_stamp': '<(intermediate_dir)/lint.stamp', + 'lint_result': '<(intermediate_dir)/lint_result.xml', + 'lint_config': '<(intermediate_dir)/lint_config.xml', + 'never_lint%': 0, 'instr_stamp': '<(intermediate_dir)/instr.stamp', 'jar_stamp': '<(intermediate_dir)/jar.stamp', 'obfuscate_stamp': '<(intermediate_dir)/obfuscate.stamp', @@ -116,6 +125,10 @@ 'variables': { 'variables': { 'native_lib_target%': '', + 'native_lib_version_name%': '', + 'use_content_linker%': 0, + 'enable_content_linker_tests%': 0, + 'is_test_apk%': 0, }, 'conditions': [ ['gyp_managed_install == 1 and native_lib_target != ""', { @@ -128,10 +141,18 @@ }, { 'apk_package_native_libs_dir': '<(intermediate_dir)/libs', }], + ['is_test_apk == 0 and emma_coverage != 0', { + 'emma_instrument': 1, + },{ + 'emma_instrument': 0, + }], ], }, 'native_lib_target%': '', - 'emma_instrument': '<(emma_coverage)', + 'native_lib_version_name%': '', + 'use_content_linker%': 0, + 'enable_content_linker_tests%': 0, + 'emma_instrument': '<(emma_instrument)', 'apk_package_native_libs_dir': '<(apk_package_native_libs_dir)', 'unsigned_standalone_apk_path': '<(unsigned_standalone_apk_path)', 'extra_native_libs': [], @@ -164,6 +185,11 @@ '<(DEPTH)/build/android/setup.gyp:copy_system_libraries', ], }], + ['use_content_linker == 1', { + 'dependencies': [ + '<(DEPTH)/content/content.gyp:content_android_linker', + ], + }], ['native_lib_target != ""', { 'variables': { 'compile_input_paths': [ '<(native_libraries_java_stamp)' ], @@ -190,38 +216,85 @@ 'actions': [ { 'variables': { + 'conditions': [ + ['use_content_linker == 1', { + 'variables': { + 'linker_input_libraries': [ + '<(SHARED_LIB_DIR)/libcontent_android_linker.>(android_product_extension)', + ], + } + }, { + 'variables': { + 'linker_input_libraries': [], + }, + }], + ], 'input_libraries': [ '<@(native_libs_paths)', '<@(extra_native_libs)', + '<@(linker_input_libraries)', ], }, 'includes': ['../build/android/write_ordered_libraries.gypi'], }, { 'action_name': 'native_libraries_template_data_<(_target_name)', - 'message': 'Creating native_libraries_list.h for <(_target_name).', + 'message': 'Creating native_libraries_list.h for <(_target_name)', 'inputs': [ '<(DEPTH)/build/android/gyp/util/build_utils.py', '<(DEPTH)/build/android/gyp/create_native_libraries_header.py', '<(ordered_libraries_file)', ], 'outputs': [ - '<(native_libraries_template_data_stamp)', + '<(native_libraries_template_data_file)', + '<(native_libraries_template_version_file)', ], 'action': [ 'python', '<(DEPTH)/build/android/gyp/create_native_libraries_header.py', '--ordered-libraries=<(ordered_libraries_file)', - '--output=<(native_libraries_template_data_file)', - '--stamp=<(native_libraries_template_data_stamp)', + '--version-name=<(native_lib_version_name)', + '--native-library-list=<(native_libraries_template_data_file)', + '--version-output=<(native_libraries_template_version_file)', ], }, { 'action_name': 'native_libraries_<(_target_name)', + 'variables': { + 'conditions': [ + ['use_content_linker == 1', { + 'variables': { + 'linker_gcc_preprocess_defines': [ + '--defines', 'ENABLE_CONTENT_LINKER', + ], + } + }, { + 'variables': { + 'linker_gcc_preprocess_defines': [], + }, + }], + ['enable_content_linker_tests == 1', { + 'variables': { + 'linker_tests_gcc_preprocess_defines': [ + '--defines', 'ENABLE_CONTENT_LINKER_TESTS', + ], + } + }, { + 'variables': { + 'linker_tests_gcc_preprocess_defines': [], + }, + }], + ], + 'gcc_preprocess_defines': [ + '<@(linker_gcc_preprocess_defines)', + '<@(linker_tests_gcc_preprocess_defines)', + ], + }, 'message': 'Creating NativeLibraries.java for <(_target_name).', 'inputs': [ '<(DEPTH)/build/android/gyp/util/build_utils.py', '<(DEPTH)/build/android/gyp/gcc_preprocess.py', - '<(native_libraries_template_data_stamp)', + '<(native_libraries_template_data_file)', + '<(native_libraries_template_version_file)', '<(native_libraries_template)', ], 'outputs': [ @@ -233,6 +306,7 @@ '--output=<(native_libraries_java_file)', '--template=<(native_libraries_template)', '--stamp=<(native_libraries_java_stamp)', + '<@(gcc_preprocess_defines)', ], }, { @@ -483,6 +557,24 @@ ], }, { + 'variables': { + 'src_dirs': [ + '<(java_in_dir)/src', + '>@(additional_src_dirs)', + ], + 'stamp_path': '<(lint_stamp)', + 'result_path': '<(lint_result)', + 'config_path': '<(lint_config)', + }, + 'inputs': [ + '<(compile_stamp)', + ], + 'outputs': [ + '<(lint_stamp)', + ], + 'includes': [ 'android/lint_action.gypi' ], + }, + { 'action_name': 'instr_classes_<(_target_name)', 'message': 'Instrumenting <(_target_name) classes', 'variables': { @@ -491,12 +583,12 @@ 'stamp_path': '<(instr_stamp)', 'instr_type': 'classes', }, - 'outputs': [ - '<(instr_stamp)', - ], 'inputs': [ '<(compile_stamp)', ], + 'outputs': [ + '<(instr_stamp)', + ], 'includes': [ 'android/instr_action.gypi' ], }, { diff --git a/chromium/build/jni_generator.gypi b/chromium/build/jni_generator.gypi index 680a0eebbf6..a6c8364d44c 100644 --- a/chromium/build/jni_generator.gypi +++ b/chromium/build/jni_generator.gypi @@ -31,6 +31,7 @@ 'variables': { 'jni_generator': '<(DEPTH)/base/android/jni_generator/jni_generator.py', 'jni_generator_jarjar_file%': '', + 'jni_generator_ptr_type%': 'int', }, 'rules': [ { @@ -52,6 +53,8 @@ '<(optimize_jni_generation)', '--jarjar', '<(jni_generator_jarjar_file)', + '--ptr_type', + '<(jni_generator_ptr_type)', ], 'message': 'Generating JNI bindings from <(RULE_INPUT_PATH)', 'process_outputs_as_sources': 1, diff --git a/chromium/build/json_schema_bundle_compile.gypi b/chromium/build/json_schema_bundle_compile.gypi index b6107cf770d..630e9c6ad2e 100644 --- a/chromium/build/json_schema_bundle_compile.gypi +++ b/chromium/build/json_schema_bundle_compile.gypi @@ -28,6 +28,7 @@ '<(api_gen_dir)/model.py', '<(api_gen_dir)/util_cc_helper.py', '<@(schema_files)', + '<@(non_compiled_schema_files)', ], 'outputs': [ '<(SHARED_INTERMEDIATE_DIR)/<(cc_dir)/generated_api.h', @@ -43,6 +44,7 @@ '--namespace=<(root_namespace)', '--generator=cpp-bundle', '<@(schema_files)', + '<@(non_compiled_schema_files)', ], 'message': 'Generating C++ API bundle code', 'process_outputs_as_sources': 1, diff --git a/chromium/build/landmine_utils.py b/chromium/build/landmine_utils.py index 021fc9b7113..4b8b2571915 100644 --- a/chromium/build/landmine_utils.py +++ b/chromium/build/landmine_utils.py @@ -109,6 +109,6 @@ def builder(): elif IsLinux(): return 'ninja' elif IsMac(): - return 'xcode' + return 'ninja' else: assert False, 'Don\'t know what builder we\'re using!' diff --git a/chromium/build/landmines.py b/chromium/build/landmines.py index 91b4fa9e60d..7b4c5b5ecc6 100755 --- a/chromium/build/landmines.py +++ b/chromium/build/landmines.py @@ -47,8 +47,6 @@ def get_target_build_dir(build_tool, target, is_iphone=False): ret = os.path.join(SRC_DIR, 'out', target) elif build_tool in ['msvs', 'vs', 'ib']: ret = os.path.join(SRC_DIR, 'build', target) - elif build_tool == 'scons': - ret = os.path.join(SRC_DIR, 'sconsbuild', target) else: raise NotImplementedError('Unexpected GYP_GENERATORS (%s)' % build_tool) return os.path.abspath(ret) diff --git a/chromium/build/linux/install-arm-sysroot.py b/chromium/build/linux/install-arm-sysroot.py index 56be4a578d8..76d073e47a2 100755 --- a/chromium/build/linux/install-arm-sysroot.py +++ b/chromium/build/linux/install-arm-sysroot.py @@ -3,16 +3,27 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -# Script to install ARM root image for cross building of ARM chrome on linux. -# This script can be run manually but is more often run as part of gclient -# hooks. When run from hooks this script should be a no-op on non-linux -# platforms. +"""Script to install ARM root image for cross building of ARM chrome on linux. +This script can be run manually but is more often run as part of gclient +hooks. When run from hooks this script should be a no-op on non-linux +platforms. -# The sysroot image could be constructed from scratch based on the current -# state or precise/arm but for consistency we currently use a pre-built root -# image which was originally designed for building trusted NaCl code. The image -# will normally need to be rebuilt every time chrome's build dependancies are -# changed. +The sysroot image could be constructed from scratch based on the current +state or precise/arm but for consistency we currently use a pre-built root +image which was originally designed for building trusted NaCl code. The image +will normally need to be rebuilt every time chrome's build dependancies are +changed. + +Steps to rebuild the arm sysroot image: + +- cd $SRC/native_client +- ./tools/trusted_cross_toolchains/trusted-toolchain-creator.armel.precise.sh \ + UpdatePackageLists +- ./tools/trusted_cross_toolchains/trusted-toolchain-creator.armel.precise.sh \ + BuildJail $SRC/out/arm-sysroot.tar.gz +- gsutil cp -a public-read $SRC/out/arm-sysroot.tar.gz \ + nativeclient-archive2/toolchain/$NACL_REV/sysroot-arm-trusted.tgz +""" import os import shutil @@ -23,9 +34,8 @@ import sys SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) URL_PREFIX = 'https://commondatastorage.googleapis.com' URL_PATH = 'nativeclient-archive2/toolchain' -REVISION = 10991 -TARBALL = 'naclsdk_linux_arm-trusted.tgz' - +REVISION = 12356 +TARBALL = 'sysroot-arm-trusted.tgz' def main(args): if '--linux-only' in args: diff --git a/chromium/build/linux/system.gyp b/chromium/build/linux/system.gyp index 68e4d36e28a..4a7e857efc1 100644 --- a/chromium/build/linux/system.gyp +++ b/chromium/build/linux/system.gyp @@ -34,6 +34,27 @@ # added back to Chrome OS. Don't try to use GTK on Chrome OS. 'targets': [ { + 'target_name': 'gdk', + 'type': 'none', + 'conditions': [ + ['_toolset=="target"', { + 'direct_dependent_settings': { + 'cflags': [ + '<!@(<(pkg-config) --cflags gdk-2.0)', + ], + }, + 'link_settings': { + 'ldflags': [ + '<!@(<(pkg-config) --libs-only-L --libs-only-other gdk-2.0)', + ], + 'libraries': [ + '<!@(<(pkg-config) --libs-only-l gdk-2.0)', + ], + }, + }], + ], + }, + { 'target_name': 'gtk', 'type': 'none', 'toolsets': ['host', 'target'], @@ -95,202 +116,78 @@ }], ], }, - { - 'target_name': 'gdk', - 'type': 'none', - 'conditions': [ - ['_toolset=="target"', { - 'direct_dependent_settings': { - 'cflags': [ - '<!@(<(pkg-config) --cflags gdk-2.0)', - ], - }, - 'link_settings': { - 'ldflags': [ - '<!@(<(pkg-config) --libs-only-L --libs-only-other gdk-2.0)', - ], - 'libraries': [ - '<!@(<(pkg-config) --libs-only-l gdk-2.0)', - ], - }, - }], - ], - }, ], # targets }], - ['linux_use_libgps==1', { - 'targets': [ - { - 'target_name': 'libgps', - 'type': 'static_library', - 'all_dependent_settings': { - 'defines': [ - 'USE_LIBGPS', - ], - 'include_dirs': [ - '<(SHARED_INTERMEDIATE_DIR)', - ], - 'conditions': [ - ['linux_link_libgps==1', { - 'cflags': [ - '<!@(<(pkg-config) --cflags libgps)', - ], - 'link_settings': { - 'ldflags': [ - '<!@(<(pkg-config) --libs-only-L --libs-only-other libgps)', - ], - 'libraries': [ - '<!@(<(pkg-config) --libs-only-l libgps)', - ], - } - }], - ], - }, - 'include_dirs': [ - '../..', - ], - 'hard_dependency': 1, - 'actions': [ - { - 'variables': { - 'output_h': '<(SHARED_INTERMEDIATE_DIR)/library_loaders/libgps.h', - 'output_cc': '<(INTERMEDIATE_DIR)/libgps_loader.cc', - 'generator': '../../tools/generate_library_loader/generate_library_loader.py', - }, - 'action_name': 'generate_libgps_loader', - 'inputs': [ - '<(generator)', - ], - 'outputs': [ - '<(output_h)', - '<(output_cc)', - ], - 'action': ['python', - '<(generator)', - '--name', 'LibGpsLoader', - '--output-h', '<(output_h)', - '--output-cc', '<(output_cc)', - '--header', '<gps.h>', - '--bundled-header', '"third_party/gpsd/release-3.1/gps.h"', - '--link-directly=<(linux_link_libgps)', - 'gps_open', - 'gps_close', - 'gps_read', - # We don't use gps_shm_read() directly, just to make - # sure that libgps has the shared memory support. - 'gps_shm_read', - ], - 'message': 'Generating libgps library loader.', - 'process_outputs_as_sources': 1, - }, - ], - }, - ], - }], ], # conditions 'targets': [ { - 'target_name': 'ssl', + 'target_name': 'dbus', 'type': 'none', - 'conditions': [ - ['_toolset=="target"', { - 'conditions': [ - ['use_openssl==1', { - 'dependencies': [ - '../../third_party/openssl/openssl.gyp:openssl', - ], - }], - ['use_openssl==0 and use_system_ssl==0', { - 'dependencies': [ - '../../net/third_party/nss/ssl.gyp:libssl', - ], - 'direct_dependent_settings': { - 'include_dirs+': [ - # We need for our local copies of the libssl3 headers to come - # before other includes, as we are shadowing system headers. - '<(DEPTH)/net/third_party/nss/ssl', - ], - 'cflags': [ - '<!@(<(pkg-config) --cflags nss)', - ], - }, - 'link_settings': { - 'ldflags': [ - '<!@(<(pkg-config) --libs-only-L --libs-only-other nss)', - ], - 'libraries': [ - '<!@(<(pkg-config) --libs-only-l nss | sed -e "s/-lssl3//")', - ], - }, - }], - ['use_openssl==0 and use_system_ssl==1', { - 'direct_dependent_settings': { - 'cflags': [ - '<!@(<(pkg-config) --cflags nss)', - ], - 'defines': [ - 'USE_SYSTEM_SSL', - ], - }, - 'link_settings': { - 'ldflags': [ - '<!@(<(pkg-config) --libs-only-L --libs-only-other nss)', - ], - 'libraries': [ - '<!@(<(pkg-config) --libs-only-l nss)', - ], - }, - }], - ['use_openssl==0 and clang==1', { - 'direct_dependent_settings': { - 'cflags': [ - # There is a broken header guard in /usr/include/nss/secmod.h: - # https://bugzilla.mozilla.org/show_bug.cgi?id=884072 - '-Wno-header-guard', - ], - }, - }], - ] - }], - ], + 'direct_dependent_settings': { + 'cflags': [ + '<!@(<(pkg-config) --cflags dbus-1)', + ], + }, + 'link_settings': { + 'ldflags': [ + '<!@(<(pkg-config) --libs-only-L --libs-only-other dbus-1)', + ], + 'libraries': [ + '<!@(<(pkg-config) --libs-only-l dbus-1)', + ], + }, }, { - 'target_name': 'freetype2', + 'target_name': 'dridrm', + 'type': 'none', + 'direct_dependent_settings': { + 'cflags': [ + '<!@(<(pkg-config) --cflags libdrm)', + ], + }, + 'link_settings': { + 'libraries': [ + '<!@(<(pkg-config) --libs-only-l libdrm)', + ], + }, + }, + { + 'target_name': 'fontconfig', 'type': 'none', 'conditions': [ ['_toolset=="target"', { 'direct_dependent_settings': { 'cflags': [ - '<!@(<(pkg-config) --cflags freetype2)', + '<!@(<(pkg-config) --cflags fontconfig)', ], }, 'link_settings': { 'ldflags': [ - '<!@(<(pkg-config) --libs-only-L --libs-only-other freetype2)', + '<!@(<(pkg-config) --libs-only-L --libs-only-other fontconfig)', ], 'libraries': [ - '<!@(<(pkg-config) --libs-only-l freetype2)', + '<!@(<(pkg-config) --libs-only-l fontconfig)', ], }, }], ], }, { - 'target_name': 'fontconfig', + 'target_name': 'freetype2', 'type': 'none', 'conditions': [ ['_toolset=="target"', { 'direct_dependent_settings': { 'cflags': [ - '<!@(<(pkg-config) --cflags fontconfig)', + '<!@(<(pkg-config) --cflags freetype2)', ], }, 'link_settings': { 'ldflags': [ - '<!@(<(pkg-config) --libs-only-L --libs-only-other fontconfig)', + '<!@(<(pkg-config) --libs-only-L --libs-only-other freetype2)', ], 'libraries': [ - '<!@(<(pkg-config) --libs-only-l fontconfig)', + '<!@(<(pkg-config) --libs-only-l freetype2)', ], }, }], @@ -388,7 +285,7 @@ 'g_settings_get_strv', 'g_settings_list_schemas', ], - 'message': 'Generating libgio library loader.', + 'message': 'Generating libgio library loader', 'process_outputs_as_sources': 1, }, ], @@ -396,6 +293,217 @@ ], }, { + 'target_name': 'glib', + 'type': 'none', + 'toolsets': ['host', 'target'], + 'variables': { + 'glib_packages': 'glib-2.0 gmodule-2.0 gobject-2.0 gthread-2.0', + }, + 'conditions': [ + ['_toolset=="target"', { + 'direct_dependent_settings': { + 'cflags': [ + '<!@(<(pkg-config) --cflags <(glib_packages))', + ], + }, + 'link_settings': { + 'ldflags': [ + '<!@(<(pkg-config) --libs-only-L --libs-only-other <(glib_packages))', + ], + 'libraries': [ + '<!@(<(pkg-config) --libs-only-l <(glib_packages))', + ], + }, + }, { + 'direct_dependent_settings': { + 'cflags': [ + '<!@(pkg-config --cflags <(glib_packages))', + ], + }, + 'link_settings': { + 'ldflags': [ + '<!@(pkg-config --libs-only-L --libs-only-other <(glib_packages))', + ], + 'libraries': [ + '<!@(pkg-config --libs-only-l <(glib_packages))', + ], + }, + }], + ['use_x11==1', { + 'link_settings': { + 'libraries': [ '-lXtst' ] + } + }], + ], + }, + { + 'target_name': 'gnome_keyring', + 'type': 'none', + 'conditions': [ + ['use_gnome_keyring==1', { + 'direct_dependent_settings': { + 'cflags': [ + '<!@(<(pkg-config) --cflags gnome-keyring-1)', + ], + 'defines': [ + 'USE_GNOME_KEYRING', + ], + 'conditions': [ + ['linux_link_gnome_keyring==0', { + 'defines': ['DLOPEN_GNOME_KEYRING'], + }], + ], + }, + 'conditions': [ + ['linux_link_gnome_keyring!=0', { + 'link_settings': { + 'ldflags': [ + '<!@(<(pkg-config) --libs-only-L --libs-only-other gnome-keyring-1)', + ], + 'libraries': [ + '<!@(<(pkg-config) --libs-only-l gnome-keyring-1)', + ], + }, + }, { + 'conditions': [ + ['OS=="linux"', { + 'link_settings': { + 'libraries': [ + '-ldl', + ], + }, + }], + ], + }], + ], + }], + ], + }, + { + # The unit tests use a few convenience functions from the GNOME + # Keyring library directly. We ignore linux_link_gnome_keyring and + # link directly in this version of the target to allow this. + # *** Do not use this target in the main binary! *** + 'target_name': 'gnome_keyring_direct', + 'type': 'none', + 'conditions': [ + ['use_gnome_keyring==1', { + 'direct_dependent_settings': { + 'cflags': [ + '<!@(<(pkg-config) --cflags gnome-keyring-1)', + ], + 'defines': [ + 'USE_GNOME_KEYRING', + ], + 'conditions': [ + ['linux_link_gnome_keyring==0', { + 'defines': ['DLOPEN_GNOME_KEYRING'], + }], + ], + }, + 'link_settings': { + 'ldflags': [ + '<!@(<(pkg-config) --libs-only-L --libs-only-other gnome-keyring-1)', + ], + 'libraries': [ + '<!@(<(pkg-config) --libs-only-l gnome-keyring-1)', + ], + }, + }], + ], + }, + { + 'target_name': 'libbrlapi', + 'type': 'static_library', + 'dependencies': [ + '../../base/base.gyp:base', + ], + 'all_dependent_settings': { + 'include_dirs': [ + '<(SHARED_INTERMEDIATE_DIR)', + ], + 'defines': [ + 'USE_BRLAPI', + ], + 'conditions': [ + ['linux_link_libbrlapi==1', { + 'link_settings': { + 'libraries': [ + '-lbrlapi', + ], + } + }], + ], + }, + 'hard_dependency': 1, + 'actions': [ + { + 'variables': { + 'output_h': '<(SHARED_INTERMEDIATE_DIR)/library_loaders/libbrlapi.h', + 'output_cc': '<(INTERMEDIATE_DIR)/libbrlapi_loader.cc', + 'generator': '../../tools/generate_library_loader/generate_library_loader.py', + }, + 'action_name': 'generate_brlapi_loader', + 'inputs': [ + '<(generator)', + ], + 'outputs': [ + '<(output_h)', + '<(output_cc)', + ], + 'action': ['python', + '<(generator)', + '--name', 'LibBrlapiLoader', + '--output-h', '<(output_h)', + '--output-cc', '<(output_cc)', + '--header', '<brlapi.h>', + '--link-directly=<(linux_link_libbrlapi)', + 'brlapi_getHandleSize', + 'brlapi_error_location', + 'brlapi_expandKeyCode', + 'brlapi_strerror', + 'brlapi__acceptKeys', + 'brlapi__openConnection', + 'brlapi__closeConnection', + 'brlapi__getDisplaySize', + 'brlapi__enterTtyModeWithPath', + 'brlapi__leaveTtyMode', + 'brlapi__writeDots', + 'brlapi__readKey', + ], + 'message': 'Generating libbrlapi library loader', + 'process_outputs_as_sources': 1, + }, + ], + }, + { + 'target_name': 'libcap', + 'type': 'none', + 'link_settings': { + 'libraries': [ + '-lcap', + ], + }, + }, + { + 'target_name': 'libgcrypt', + 'type': 'none', + 'conditions': [ + ['_toolset=="target" and use_cups==1', { + 'direct_dependent_settings': { + 'cflags': [ + '<!@(libgcrypt-config --cflags)', + ], + }, + 'link_settings': { + 'libraries': [ + '<!@(libgcrypt-config --libs)', + ], + }, + }], + ], + }, + { 'target_name': 'libpci', 'type': 'static_library', 'cflags': [ @@ -454,12 +562,21 @@ 'pci_fill_info', 'pci_lookup_name', ], - 'message': 'Generating libpci library loader.', + 'message': 'Generating libpci library loader', 'process_outputs_as_sources': 1, }, ], }, { + 'target_name': 'libresolv', + 'type': 'none', + 'link_settings': { + 'libraries': [ + '-lresolv', + ], + }, + }, + { 'target_name': 'libspeechd', 'type': 'static_library', 'direct_dependent_settings': { @@ -533,370 +650,243 @@ 'spd_list_modules', 'spd_set_output_module', ], - 'message': 'Generating libspeechd library loader.', - 'process_outputs_as_sources': 1, - }, - ], - }, - { - 'target_name': 'libbrlapi', - 'type': 'static_library', - 'dependencies': [ - '../../base/base.gyp:base', - ], - 'all_dependent_settings': { - 'include_dirs': [ - '<(SHARED_INTERMEDIATE_DIR)', - ], - 'defines': [ - 'USE_BRLAPI', - ], - 'conditions': [ - ['linux_link_libbrlapi==1', { - 'link_settings': { - 'libraries': [ - '-lbrlapi', - ], - } - }], - ], - }, - 'hard_dependency': 1, - 'actions': [ - { - 'variables': { - 'output_h': '<(SHARED_INTERMEDIATE_DIR)/library_loaders/libbrlapi.h', - 'output_cc': '<(INTERMEDIATE_DIR)/libbrlapi_loader.cc', - 'generator': '../../tools/generate_library_loader/generate_library_loader.py', - }, - 'action_name': 'generate_brlapi_loader', - 'inputs': [ - '<(generator)', - ], - 'outputs': [ - '<(output_h)', - '<(output_cc)', - ], - 'action': ['python', - '<(generator)', - '--name', 'LibBrlapiLoader', - '--output-h', '<(output_h)', - '--output-cc', '<(output_cc)', - '--header', '<brlapi.h>', - '--link-directly=<(linux_link_libbrlapi)', - 'brlapi_getHandleSize', - 'brlapi_error_location', - 'brlapi_expandKeyCode', - 'brlapi_strerror', - 'brlapi__acceptKeys', - 'brlapi__openConnection', - 'brlapi__closeConnection', - 'brlapi__getDisplaySize', - 'brlapi__enterTtyModeWithPath', - 'brlapi__leaveTtyMode', - 'brlapi__writeDots', - 'brlapi__readKey', - ], - 'message': 'Generating libbrlapi library loader.', + 'message': 'Generating libspeechd library loader', 'process_outputs_as_sources': 1, }, ], }, { - 'target_name': 'x11', + 'target_name': 'pangocairo', 'type': 'none', 'toolsets': ['host', 'target'], 'conditions': [ ['_toolset=="target"', { 'direct_dependent_settings': { 'cflags': [ - '<!@(<(pkg-config) --cflags x11)', + '<!@(<(pkg-config) --cflags pangocairo pangoft2)', ], }, 'link_settings': { 'ldflags': [ - '<!@(<(pkg-config) --libs-only-L --libs-only-other x11 xi)', + '<!@(<(pkg-config) --libs-only-L --libs-only-other pangocairo pangoft2)', ], 'libraries': [ - '<!@(<(pkg-config) --libs-only-l x11 xi)', + '<!@(<(pkg-config) --libs-only-l pangocairo pangoft2)', ], }, }, { 'direct_dependent_settings': { 'cflags': [ - '<!@(pkg-config --cflags x11)', + '<!@(pkg-config --cflags pangocairo pangoft2)', ], }, 'link_settings': { 'ldflags': [ - '<!@(pkg-config --libs-only-L --libs-only-other x11 xi)', + '<!@(pkg-config --libs-only-L --libs-only-other pangocairo pangoft2)', ], 'libraries': [ - '<!@(pkg-config --libs-only-l x11 xi)', + '<!@(pkg-config --libs-only-l pangocairo pangoft2)', ], }, }], ], }, { - 'target_name': 'xext', + 'target_name': 'ssl', 'type': 'none', 'conditions': [ ['_toolset=="target"', { - 'direct_dependent_settings': { - 'cflags': [ - '<!@(<(pkg-config) --cflags xext)', - ], - }, - 'link_settings': { - 'ldflags': [ - '<!@(<(pkg-config) --libs-only-L --libs-only-other xext)', - ], - 'libraries': [ - '<!@(<(pkg-config) --libs-only-l xext)', - ], - }, + 'conditions': [ + ['use_openssl==1', { + 'dependencies': [ + '../../third_party/openssl/openssl.gyp:openssl', + ], + }], + ['use_openssl==0 and use_system_ssl==0', { + 'dependencies': [ + '../../net/third_party/nss/ssl.gyp:libssl', + ], + 'direct_dependent_settings': { + 'include_dirs+': [ + # We need for our local copies of the libssl3 headers to come + # before other includes, as we are shadowing system headers. + '<(DEPTH)/net/third_party/nss/ssl', + ], + 'cflags': [ + '<!@(<(pkg-config) --cflags nss)', + ], + }, + 'link_settings': { + 'ldflags': [ + '<!@(<(pkg-config) --libs-only-L --libs-only-other nss)', + ], + 'libraries': [ + '<!@(<(pkg-config) --libs-only-l nss | sed -e "s/-lssl3//")', + ], + }, + }], + ['use_openssl==0 and use_system_ssl==1', { + 'direct_dependent_settings': { + 'cflags': [ + '<!@(<(pkg-config) --cflags nss)', + ], + 'defines': [ + 'USE_SYSTEM_SSL', + ], + }, + 'link_settings': { + 'ldflags': [ + '<!@(<(pkg-config) --libs-only-L --libs-only-other nss)', + ], + 'libraries': [ + '<!@(<(pkg-config) --libs-only-l nss)', + ], + }, + }], + ['use_openssl==0 and clang==1', { + 'direct_dependent_settings': { + 'cflags': [ + # There is a broken header guard in /usr/include/nss/secmod.h: + # https://bugzilla.mozilla.org/show_bug.cgi?id=884072 + '-Wno-header-guard', + ], + }, + }], + ] }], ], }, { - 'target_name': 'xfixes', + 'target_name': 'udev', 'type': 'none', 'conditions': [ - ['_toolset=="target"', { + # libudev is not available on *BSD + ['_toolset=="target" and os_bsd!=1', { 'direct_dependent_settings': { 'cflags': [ - '<!@(<(pkg-config) --cflags xfixes)', + '<!@(<(pkg-config) --cflags libudev)' ], }, 'link_settings': { 'ldflags': [ - '<!@(<(pkg-config) --libs-only-L --libs-only-other xfixes)', + '<!@(<(pkg-config) --libs-only-L --libs-only-other libudev)', ], 'libraries': [ - '<!@(<(pkg-config) --libs-only-l xfixes)', + '<!@(<(pkg-config) --libs-only-l libudev)', ], }, }], ], }, { - 'target_name': 'libgcrypt', + 'target_name': 'x11', 'type': 'none', + 'toolsets': ['host', 'target'], 'conditions': [ - ['_toolset=="target" and use_cups==1', { + ['_toolset=="target"', { 'direct_dependent_settings': { 'cflags': [ - '<!@(libgcrypt-config --cflags)', + '<!@(<(pkg-config) --cflags x11)', ], }, 'link_settings': { + 'ldflags': [ + '<!@(<(pkg-config) --libs-only-L --libs-only-other x11 xi)', + ], 'libraries': [ - '<!@(libgcrypt-config --libs)', + '<!@(<(pkg-config) --libs-only-l x11 xi)', ], }, - }], - ], - }, - { - 'target_name': 'gnome_keyring', - 'type': 'none', - 'conditions': [ - ['use_gnome_keyring==1', { + }, { 'direct_dependent_settings': { 'cflags': [ - '<!@(<(pkg-config) --cflags gnome-keyring-1)', + '<!@(pkg-config --cflags x11)', ], - 'defines': [ - 'USE_GNOME_KEYRING', + }, + 'link_settings': { + 'ldflags': [ + '<!@(pkg-config --libs-only-L --libs-only-other x11 xi)', ], - 'conditions': [ - ['linux_link_gnome_keyring==0', { - 'defines': ['DLOPEN_GNOME_KEYRING'], - }], + 'libraries': [ + '<!@(pkg-config --libs-only-l x11 xi)', ], }, - 'conditions': [ - ['linux_link_gnome_keyring!=0', { - 'link_settings': { - 'ldflags': [ - '<!@(<(pkg-config) --libs-only-L --libs-only-other gnome-keyring-1)', - ], - 'libraries': [ - '<!@(<(pkg-config) --libs-only-l gnome-keyring-1)', - ], - }, - }, { - 'conditions': [ - ['OS=="linux"', { - 'link_settings': { - 'libraries': [ - '-ldl', - ], - }, - }], - ], - }], - ], }], ], }, { - # The unit tests use a few convenience functions from the GNOME - # Keyring library directly. We ignore linux_link_gnome_keyring and - # link directly in this version of the target to allow this. - # *** Do not use this target in the main binary! *** - 'target_name': 'gnome_keyring_direct', + 'target_name': 'xext', 'type': 'none', 'conditions': [ - ['use_gnome_keyring==1', { + ['_toolset=="target"', { 'direct_dependent_settings': { 'cflags': [ - '<!@(<(pkg-config) --cflags gnome-keyring-1)', - ], - 'defines': [ - 'USE_GNOME_KEYRING', - ], - 'conditions': [ - ['linux_link_gnome_keyring==0', { - 'defines': ['DLOPEN_GNOME_KEYRING'], - }], + '<!@(<(pkg-config) --cflags xext)', ], }, 'link_settings': { 'ldflags': [ - '<!@(<(pkg-config) --libs-only-L --libs-only-other gnome-keyring-1)', + '<!@(<(pkg-config) --libs-only-L --libs-only-other xext)', ], 'libraries': [ - '<!@(<(pkg-config) --libs-only-l gnome-keyring-1)', + '<!@(<(pkg-config) --libs-only-l xext)', ], }, }], ], }, { - 'target_name': 'dbus', - 'type': 'none', - 'direct_dependent_settings': { - 'cflags': [ - '<!@(<(pkg-config) --cflags dbus-1)', - ], - }, - 'link_settings': { - 'ldflags': [ - '<!@(<(pkg-config) --libs-only-L --libs-only-other dbus-1)', - ], - 'libraries': [ - '<!@(<(pkg-config) --libs-only-l dbus-1)', - ], - }, - }, - { - 'target_name': 'glib', + 'target_name': 'xfixes', 'type': 'none', - 'toolsets': ['host', 'target'], - 'variables': { - 'glib_packages': 'glib-2.0 gmodule-2.0 gobject-2.0 gthread-2.0', - }, 'conditions': [ ['_toolset=="target"', { 'direct_dependent_settings': { 'cflags': [ - '<!@(<(pkg-config) --cflags <(glib_packages))', - ], - }, - 'link_settings': { - 'ldflags': [ - '<!@(<(pkg-config) --libs-only-L --libs-only-other <(glib_packages))', - ], - 'libraries': [ - '<!@(<(pkg-config) --libs-only-l <(glib_packages))', - ], - }, - }, { - 'direct_dependent_settings': { - 'cflags': [ - '<!@(pkg-config --cflags <(glib_packages))', + '<!@(<(pkg-config) --cflags xfixes)', ], }, 'link_settings': { 'ldflags': [ - '<!@(pkg-config --libs-only-L --libs-only-other <(glib_packages))', + '<!@(<(pkg-config) --libs-only-L --libs-only-other xfixes)', ], 'libraries': [ - '<!@(pkg-config --libs-only-l <(glib_packages))', + '<!@(<(pkg-config) --libs-only-l xfixes)', ], }, }], - ['use_x11==1', { - 'link_settings': { - 'libraries': [ '-lXtst' ] - } - }], ], }, { - 'target_name': 'pangocairo', + 'target_name': 'xrandr', 'type': 'none', 'toolsets': ['host', 'target'], 'conditions': [ ['_toolset=="target"', { 'direct_dependent_settings': { 'cflags': [ - '<!@(<(pkg-config) --cflags pangocairo pangoft2)', + '<!@(<(pkg-config) --cflags xrandr)', ], }, 'link_settings': { 'ldflags': [ - '<!@(<(pkg-config) --libs-only-L --libs-only-other pangocairo pangoft2)', + '<!@(<(pkg-config) --libs-only-L --libs-only-other xrandr)', ], 'libraries': [ - '<!@(<(pkg-config) --libs-only-l pangocairo pangoft2)', + '<!@(<(pkg-config) --libs-only-l xrandr)', ], }, }, { 'direct_dependent_settings': { 'cflags': [ - '<!@(pkg-config --cflags pangocairo pangoft2)', + '<!@(pkg-config --cflags xrandr)', ], }, 'link_settings': { 'ldflags': [ - '<!@(pkg-config --libs-only-L --libs-only-other pangocairo pangoft2)', + '<!@(pkg-config --libs-only-L --libs-only-other xrandr)', ], 'libraries': [ - '<!@(pkg-config --libs-only-l pangocairo pangoft2)', - ], - }, - }], - ], - }, - { - 'target_name': 'libresolv', - 'type': 'none', - 'link_settings': { - 'libraries': [ - '-lresolv', - ], - }, - }, - { - 'target_name': 'udev', - 'type': 'none', - 'conditions': [ - # libudev is not available on *BSD - ['_toolset=="target" and os_bsd!=1', { - 'direct_dependent_settings': { - 'cflags': [ - '<!@(<(pkg-config) --cflags libudev)' - ], - }, - 'link_settings': { - 'ldflags': [ - '<!@(<(pkg-config) --libs-only-L --libs-only-other libudev)', - ], - 'libraries': [ - '<!@(<(pkg-config) --libs-only-l libudev)', + '<!@(pkg-config --libs-only-l xrandr)', ], }, }], diff --git a/chromium/build/linux/unbundle/icu.gyp b/chromium/build/linux/unbundle/icu.gyp index 03f0ad4744c..16c36df5ae5 100644 --- a/chromium/build/linux/unbundle/icu.gyp +++ b/chromium/build/linux/unbundle/icu.gyp @@ -5,33 +5,45 @@ { 'targets': [ { - 'target_name': 'system_icu', + 'target_name': 'icudata', 'type': 'none', 'direct_dependent_settings': { + 'cflags': [ + '<!@(pkg-config --cflags icu-uc)', + ], 'defines': [ 'U_USING_ICU_NAMESPACE=0', ], }, 'link_settings': { 'ldflags': [ - '<!@(icu-config --ldflags)', + '<!@(pkg-config --libs-only-L --libs-only-other icu-uc)', ], 'libraries': [ - '<!@(icu-config --ldflags-libsonly)', + '<!@(pkg-config --libs-only-l icu-uc)', ], }, }, { - 'target_name': 'icudata', - 'type': 'none', - 'dependencies': ['system_icu'], - 'export_dependent_settings': ['system_icu'], - }, - { 'target_name': 'icui18n', 'type': 'none', - 'dependencies': ['system_icu'], - 'export_dependent_settings': ['system_icu'], + 'toolsets': ['host', 'target'], + 'direct_dependent_settings': { + 'cflags': [ + '<!@(pkg-config --cflags icu-i18n)', + ], + 'defines': [ + 'U_USING_ICU_NAMESPACE=0', + ], + }, + 'link_settings': { + 'ldflags': [ + '<!@(pkg-config --libs-only-L --libs-only-other icu-i18n)', + ], + 'libraries': [ + '<!@(pkg-config --libs-only-l icu-i18n)', + ], + }, 'variables': { 'headers_root_path': 'source/i18n', 'header_filenames': [ @@ -116,8 +128,23 @@ { 'target_name': 'icuuc', 'type': 'none', - 'dependencies': ['system_icu'], - 'export_dependent_settings': ['system_icu'], + 'toolsets': ['host', 'target'], + 'direct_dependent_settings': { + 'cflags': [ + '<!@(pkg-config --cflags icu-uc)', + ], + 'defines': [ + 'U_USING_ICU_NAMESPACE=0', + ], + }, + 'link_settings': { + 'ldflags': [ + '<!@(pkg-config --libs-only-L --libs-only-other icu-uc)', + ], + 'libraries': [ + '<!@(pkg-config --libs-only-l icu-uc)', + ], + }, 'variables': { 'headers_root_path': 'source/common', 'header_filenames': [ diff --git a/chromium/build/mac/copy_asan_runtime_dylib.sh b/chromium/build/mac/copy_asan_runtime_dylib.sh index b67b4346cd5..f221c4a66dd 100755 --- a/chromium/build/mac/copy_asan_runtime_dylib.sh +++ b/chromium/build/mac/copy_asan_runtime_dylib.sh @@ -12,23 +12,36 @@ set -e BINARY="${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}" + +if [[ ! -f "$BINARY" ]]; then + # This is neither an .app bundle nor a standalone executable. + # Most certainly the script has been called for a data bundle. + exit 0 +fi + BINARY_DIR="$(dirname "${BINARY}")" -ASAN_DYLIB_NAME=libclang_rt.asan_osx_dynamic.dylib -ASAN_DYLIB=$(find \ - "${BUILT_PRODUCTS_DIR}/../../third_party/llvm-build/Release+Asserts/lib/clang/" \ - -type f -path "*${ASAN_DYLIB_NAME}") # Find the link to the ASan runtime encoded in the binary. BUILTIN_DYLIB_PATH=$(otool -L "${BINARY}" | \ - sed -Ene 's/^[[:blank:]]+(.*libclang_rt\.asan_osx_dynamic\.dylib).*$/\1/p') + sed -Ene 's/^[[:blank:]]+(.*libclang_rt\.asan_.*_dynamic\.dylib).*$/\1/p') + +if [[ "${BUILTIN_DYLIB_PATH}" == *asan_iossim_dynamic* ]]; then + ASAN_DYLIB_NAME=libclang_rt.asan_iossim_dynamic.dylib +elif [[ "${BUILTIN_DYLIB_PATH}" == *asan_osx_dynamic* ]]; then + ASAN_DYLIB_NAME=libclang_rt.asan_osx_dynamic.dylib +fi if [[ -z "${BUILTIN_DYLIB_PATH}" ]]; then echo "${BINARY} does not depend on the ASan runtime library!" >&2 - # TODO(glider): make this return 1 when we fully switch to the dynamic - # runtime in ASan. - exit 0 + exit 1 fi +# TODO(glider): this doesn't work if we set CC and CXX to override the default +# Clang. +ASAN_DYLIB=$(find \ + "${BUILT_PRODUCTS_DIR}/../../third_party/llvm-build/Release+Asserts/lib/clang/" \ + -type f -path "*${ASAN_DYLIB_NAME}") + DYLIB_BASENAME=$(basename "${ASAN_DYLIB}") if [[ "${DYLIB_BASENAME}" != "${ASAN_DYLIB_NAME}" ]]; then echo "basename(${ASAN_DYLIB}) != ${ASAN_DYLIB_NAME}" >&2 diff --git a/chromium/build/mac/strip_save_dsym b/chromium/build/mac/strip_save_dsym index ef08d831f12..c9cf2266375 100755 --- a/chromium/build/mac/strip_save_dsym +++ b/chromium/build/mac/strip_save_dsym @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # Copyright (c) 2011 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be @@ -276,13 +276,7 @@ def strip_and_make_fake_dsym(macho): # Strip the Mach-O file remove_dsym = True try: - strip_path = "" - if "SYSTEM_DEVELOPER_BIN_DIR" in os.environ: - strip_path = os.environ["SYSTEM_DEVELOPER_BIN_DIR"] - else: - strip_path = "/usr/bin" - strip_path = os.path.join(strip_path, "strip") - strip_cmdline = [strip_path] + sys.argv[1:] + strip_cmdline = ['xcrun', 'strip'] + sys.argv[1:] strip_cmd = subprocess.Popen(strip_cmdline) if strip_cmd.wait() == 0: remove_dsym = False diff --git a/chromium/build/mac/tweak_info_plist.py b/chromium/build/mac/tweak_info_plist.py index eb38acea4e2..0f65e4aed20 100755 --- a/chromium/build/mac/tweak_info_plist.py +++ b/chromium/build/mac/tweak_info_plist.py @@ -204,6 +204,24 @@ def _RemoveBreakpadKeys(plist): 'BreakpadSkipConfirm') +def _TagSuffixes(): + # Keep this list sorted in the order that tag suffix components are to + # appear in a tag value. That is to say, it should be sorted per ASCII. + components = ('32bit', 'full') + assert tuple(sorted(components)) == components + + components_len = len(components) + combinations = 1 << components_len + tag_suffixes = [] + for combination in xrange(0, combinations): + tag_suffix = '' + for component_index in xrange(0, components_len): + if combination & (1 << component_index): + tag_suffix += '-' + components[component_index] + tag_suffixes.append(tag_suffix) + return tag_suffixes + + def _AddKeystoneKeys(plist, bundle_identifier): """Adds the Keystone keys. This must be called AFTER _AddVersionKeys() and also requires the |bundle_identifier| argument (com.example.product).""" @@ -211,6 +229,11 @@ def _AddKeystoneKeys(plist, bundle_identifier): plist['KSProductID'] = bundle_identifier plist['KSUpdateURL'] = 'https://tools.google.com/service/update2' + _RemoveKeys(plist, 'KSChannelID') + for tag_suffix in _TagSuffixes(): + if tag_suffix: + plist['KSChannelID' + tag_suffix] = tag_suffix + def _RemoveKeystoneKeys(plist): """Removes any set Keystone keys.""" @@ -219,6 +242,11 @@ def _RemoveKeystoneKeys(plist): 'KSProductID', 'KSUpdateURL') + tag_keys = [] + for tag_suffix in _TagSuffixes(): + tag_keys.append('KSChannelID' + tag_suffix) + _RemoveKeys(plist, *tag_keys) + def Main(argv): parser = optparse.OptionParser('%prog [options]') diff --git a/chromium/build/mac/verify_no_objc.sh b/chromium/build/mac/verify_no_objc.sh index 955f9befff2..e18a5eafb00 100755 --- a/chromium/build/mac/verify_no_objc.sh +++ b/chromium/build/mac/verify_no_objc.sh @@ -26,10 +26,9 @@ set -eu -otool="${DEVELOPER_BIN_DIR:-/usr/bin}/otool" executable="${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}" -if "${otool}" -arch i386 -o "${executable}" | grep -q '^Contents.*section$'; \ +if xcrun otool -arch i386 -o "${executable}" | grep -q '^Contents.*section$'; \ then echo "${0}: ${executable} has an __OBJC,__image_info section" 2>&1 exit 1 diff --git a/chromium/build/sanitize-mac-build-log.sed b/chromium/build/sanitize-mac-build-log.sed index 3312eac5a86..b4111c7b828 100755..100644 --- a/chromium/build/sanitize-mac-build-log.sed +++ b/chromium/build/sanitize-mac-build-log.sed @@ -1,5 +1,3 @@ -#!/bin/echo Use sanitize-mac-build-log.sh or sed -f - # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. @@ -17,8 +15,8 @@ # Xcode prints a short "compiling foobar.o" line followed by the lengthy # full command line. These deletions drop the command line. \|^ /Developer/usr/bin/|d -\|^ /Developer/Library/PrivateFrameworks/DevToolsCore.framework/|d -\|^ /Developer/Library/Xcode/Plug-ins/CoreBuildTasks.xcplugin/|d +\|^ /Developer/Library/PrivateFrameworks/DevToolsCore\.framework/|d +\|^ /Developer/Library/Xcode/Plug-ins/CoreBuildTasks\.xcplugin/|d # Drop any goma command lines as well. \|^ .*/gomacc |d @@ -28,8 +26,8 @@ \|^ /Users/[^/]*/bin/|d # There's already a nice note for bindings, don't need the command line. -\|^python scripts/rule_binding.py|d +\|^python scripts/rule_binding\.py|d # Shorten the "compiling foobar.o" line. -s|^Distributed-CompileC \(.*\) normal i386 c++ com.apple.compilers.gcc.4_2| CC \1| -s|^CompileC \(.*\) normal i386 c++ com.apple.compilers.gcc.4_2| CC \1| +s|^Distributed-CompileC (.*) normal i386 c\+\+ com\.apple\.compilers\.gcc\.4_2| CC \1| +s|^CompileC (.*) normal i386 c\+\+ com\.apple\.compilers\.gcc\.4_2| CC \1| diff --git a/chromium/build/sanitize-mac-build-log.sh b/chromium/build/sanitize-mac-build-log.sh index dc743fabb51..df5a7af29eb 100755 --- a/chromium/build/sanitize-mac-build-log.sh +++ b/chromium/build/sanitize-mac-build-log.sh @@ -2,5 +2,4 @@ # Copyright (c) 2010 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -sed -f `dirname "${0}"`/`basename "${0}" sh`sed - +sed -r -f `dirname "${0}"`/`basename "${0}" sh`sed diff --git a/chromium/build/sanitize-win-build-log.sed b/chromium/build/sanitize-win-build-log.sed index ce5165422d6..4691b76a63e 100755..100644 --- a/chromium/build/sanitize-win-build-log.sed +++ b/chromium/build/sanitize-win-build-log.sed @@ -1,5 +1,3 @@ -#!/bin/echo Use sanitize-win-build-log.sh or sed -f - # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. @@ -11,8 +9,8 @@ /The operation completed successfully\./d # Drop parallelization indicators on lines. -s/^[0-9]\+>// +s/^[0-9]+>// # Shorten bindings generation lines -s/^.*"\(perl\|[^"]\+perl\.exe\)".*deprecated_generate_bindings\.pl".*\("[^"]\+\.idl"\).*$/ deprecated_generate_bindings \2/ -s/^.*"python".*idl_compiler\.py".*\("[^"]\+\.idl"\).*$/ idl_compiler \1/ +s/^.*"(perl|[^"]+perl\.exe)".*deprecated_generate_bindings\.pl".*("[^"]+\.idl").*$/ deprecated_generate_bindings \2/ +s/^.*"python".*idl_compiler\.py".*("[^"]+\.idl").*$/ idl_compiler \1/ diff --git a/chromium/build/sanitize-win-build-log.sh b/chromium/build/sanitize-win-build-log.sh index dc743fabb51..df5a7af29eb 100755 --- a/chromium/build/sanitize-win-build-log.sh +++ b/chromium/build/sanitize-win-build-log.sh @@ -2,5 +2,4 @@ # Copyright (c) 2010 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -sed -f `dirname "${0}"`/`basename "${0}" sh`sed - +sed -r -f `dirname "${0}"`/`basename "${0}" sh`sed diff --git a/chromium/build/shim_headers.gypi b/chromium/build/shim_headers.gypi index 997a4d0b0f5..56d8d3a7196 100644 --- a/chromium/build/shim_headers.gypi +++ b/chromium/build/shim_headers.gypi @@ -54,7 +54,7 @@ '<@(generator_args)', '--generate', ], - 'message': 'Generating <(_target_name) shim headers.', + 'message': 'Generating <(_target_name) shim headers', }, ], } diff --git a/chromium/build/toolchain/OWNERS b/chromium/build/toolchain/OWNERS new file mode 100644 index 00000000000..9b79b9a9b50 --- /dev/null +++ b/chromium/build/toolchain/OWNERS @@ -0,0 +1,2 @@ +set noparent +brettw@chromium.org diff --git a/chromium/build/toolchain/linux/BUILD.gn b/chromium/build/toolchain/linux/BUILD.gn new file mode 100644 index 00000000000..ffb378beb88 --- /dev/null +++ b/chromium/build/toolchain/linux/BUILD.gn @@ -0,0 +1,180 @@ +# Copyright (c) 2013 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +cc = "gcc" +cxx = "g++" +ar = "ar" +ld = cxx + +# The toolchains below all issue the same commands with some different flags. +# TODO(brettw) it would be nice to have a different way to express this without +# so much duplication. +cc_command = "$cc -MMD -MF \$out.d \$defines \$includes \$cflags \$cflags_c -c \$in -o \$out" +cxx_command = "$cxx -MMD -MF \$out.d \$defines \$includes \$cflags \$cflags_cc -c \$in -o \$out" +alink_command = "rm -f \$out && $ar rcs \$out \$in" +solink_command = "if [ ! -e \$lib -o ! -e \${lib}.TOC ]; then $ld -shared \$ldflags -o \$lib -Wl,-soname=\$soname -Wl,--whole-archive \$in \$solibs -Wl,--no-whole-archive \$libs && { readelf -d \${lib} | grep SONAME ; nm -gD -f p \${lib} | cut -f1-2 -d' '; } > \${lib}.TOC; else $ld -shared \$ldflags -o \$lib -Wl,-soname=\$soname -Wl,--whole-archive \$in \$solibs -Wl,--no-whole-archive \$libs && { readelf -d \${lib} | grep SONAME ; nm -gD -f p \${lib} | cut -f1-2 -d' '; } > \${lib}.tmp && if ! cmp -s \${lib}.tmp \${lib}.TOC; then mv \${lib}.tmp \${lib}.TOC ; fi; fi" +link_command = "$ld \$ldflags -o \$out -Wl,--start-group \$in \$solibs -Wl,--end-group \$libs" +stamp_command = "\${postbuilds}touch \$out" +copy_command = "ln -f \$in \$out 2>/dev/null || (rm -rf \$out && cp -af \$in \$out)" + +# ARM -------------------------------------------------------------------------- + +cc = "arm-linux-gnueabi-gcc" +cxx = "arm-linux-gnueabi-g++" +ar = "arm-linux-gnueabi-ar" +ld = cxx + +toolchain("arm") { + # Make these apply to all tools below. + lib_prefix = "-l" + lib_dir_prefix="-L" + + tool("cc") { + # cflags_pch_c + command = cc_command + description = "CC \$out" + depfile = "\$out.d" + deps = "gcc" + } + tool("cxx") { + # cflags_pch_cc + command = cxx_command + description = "CXX \$out" + depfile = "\$out.d" + deps = "gcc" + } + tool("alink") { + command = alink_command + description = "AR \$out" + } + tool("solink") { + command = solink_command + description = "SOLINK \$lib" + #pool = "link_pool" + restat = "1" + } + tool("link") { + command = link_command + description = "LINK \$out" + #pool = "link_pool" + } + tool("stamp") { + command = stamp_command + description = "STAMP \$out" + } + tool("copy") { + command = copy_command + description = "COPY \$in \$out" + } + + # When invoking this toolchain not as the default one, these args will be + # passed to the build. They are ignored when this is the default toolchain. + toolchain_args() { + cpu_arch = "arm" + } +} + +# 32-bit ----------------------------------------------------------------------- + +toolchain("32") { + # Make these apply to all tools below. + lib_prefix = "-l" + lib_dir_prefix="-L" + + tool("cc") { + # cflags_pch_c + command = cc_command + description = "CC \$out" + depfile = "\$out.d" + deps = "gcc" + } + tool("cxx") { + # cflags_pch_cc + command = cxx_command + description = "CXX \$out" + depfile = "\$out.d" + deps = "gcc" + } + tool("alink") { + command = alink_command + description = "AR \$out" + } + tool("solink") { + command = solink_command + description = "SOLINK \$lib" + #pool = "link_pool" + restat = "1" + } + tool("link") { + command = link_command + description = "LINK \$out" + #pool = "link_pool" + } + tool("stamp") { + command = stamp_command + description = "STAMP \$out" + } + tool("copy") { + command = copy_command + description = "COPY \$in \$out" + } + + # When invoking this toolchain not as the default one, these args will be + # passed to the build. They are ignored when this is the default toolchain. + toolchain_args() { + cpu_arch = "x32" + } +} + +# 64-bit ----------------------------------------------------------------------- + +toolchain("64") { + # Make these apply to all tools below. + lib_prefix = "-l" + lib_dir_prefix="-L" + + tool("cc") { + # cflags_pch_c + command = cc_command + description = "CC \$out" + depfile = "\$out.d" + deps = "gcc" + } + tool("cxx") { + # cflags_pch_cc + command = cxx_command + description = "CXX \$out" + depfile = "\$out.d" + deps = "gcc" + } + tool("alink") { + command = alink_command + description = "AR \$out" + } + tool("solink") { + command = solink_command + description = "SOLINK \$lib" + #pool = "link_pool" + restat = "1" + } + tool("link") { + command = link_command + description = "LINK \$out" + #pool = "link_pool" + } + tool("stamp") { + command = stamp_command + description = "STAMP \$out" + } + tool("copy") { + command = copy_command + description = "COPY \$in \$out" + } + + # When invoking this toolchain not as the default one, these args will be + # passed to the build. They are ignored when this is the default toolchain. + toolchain_args() { + cpu_arch = "x64" + } +} diff --git a/chromium/build/toolchain/mac/BUILD.gn b/chromium/build/toolchain/mac/BUILD.gn new file mode 100644 index 00000000000..b8a3c5eef17 --- /dev/null +++ b/chromium/build/toolchain/mac/BUILD.gn @@ -0,0 +1,82 @@ +# Copyright (c) 2013 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# Should only be running on Mac. +assert(is_mac) + +cc = rebase_path("//third_party/llvm-build/Release+Asserts/bin/clang", ".", root_build_dir) +cxx = rebase_path("//third_party/llvm-build/Release+Asserts/bin/clang++", ".", root_build_dir) +ld = cxx + +# This will copy the gyp-mac-tool to the build directory. We pass in the source +# file of the win tool. +gyp_mac_tool_source = + rebase_path("//tools/gyp/pylib/gyp/mac_tool.py", ".", root_build_dir) +exec_script("setup_toolchain.py", [ gyp_mac_tool_source ], "value") + +toolchain("clang") { + # Make these apply to all tools below. + lib_prefix = "-l" + lib_dir_prefix="-L" + + tool("cc") { + command = "$cc -MMD -MF \$out.d \$defines \$includes \$cflags \$cflags_c \$cflags_pch_c -c \$in -o \$out" + description = "CC \$out" + depfile = "\$out.d" + deps = "gcc" + } + tool("cxx") { + command = "$cxx -MMD -MF \$out.d \$defines \$includes \$cflags \$cflags_cc \$cflags_pch_cc -c \$in -o \$out" + description = "CXX \$out" + depfile = "\$out.d" + deps = "gcc" + } + tool("objc") { + command = "$cc -MMD -MF \$out.d \$defines \$includes \$cflags \$cflags_c \$cflags_objc \$cflags_pch_objc -c \$in -o \$out" + description = "OBJC \$out" + depfile = "\$out.d" + deps = "gcc" + } + tool("objcxx") { + command = "$cxx -MMD -MF \$out.d \$defines \$includes \$cflags \$cflags_cc \$cflags_objcc \$cflags_pch_objcc -c \$in -o \$out" + description = "OBJCXX \$out" + depfile = "\$out.d" + deps = "gcc" + } + tool("alink") { + command = "rm -f \$out && ./gyp-mac-tool filter-libtool libtool \$libtool_flags -static -o \$out \$in \$postbuilds" + description = "LIBTOOL-STATIC \$out, POSTBUILDS" + } + tool("solink") { + command = "if [ ! -e \$lib -o ! -e \${lib}.TOC ] || otool -l \$lib | grep -q LC_REEXPORT_DYLIB ; then $ld -shared \$ldflags -o \$lib \$in \$solibs \$libs \$postbuilds && { otool -l \$lib | grep LC_ID_DYLIB -A 5; nm -gP \$lib | cut -f1-2 -d' ' | grep -v U\$\$; true; } > \${lib}.TOC; else $ld -shared \$ldflags -o \$lib \$in \$solibs \$libs \$postbuilds && { otool -l \$lib | grep LC_ID_DYLIB -A 5; nm -gP \$lib | cut -f1-2 -d' ' | grep -v U\$\$; true; } > \${lib}.tmp && if ! cmp -s \${lib}.tmp \${lib}.TOC; then mv \${lib}.tmp \${lib}.TOC ; fi; fi" + description = "SOLINK \$lib, POSTBUILDS" + #pool = "link_pool" + restat = "1" + } + tool("link") { + command = "$ld \$ldflags -o \$out \$in \$solibs \$libs \$postbuilds" + description = "LINK \$out, POSTBUILDS" + #pool = "link_pool" + } + #tool("infoplist") { + # command = "$cc -E -P -Wno-trigraphs -x c \$defines \$in -o \$out && plutil -convert xml1 \$out \$out" + # description = "INFOPLIST \$out" + #} + #tool("mac_tool") { + # command = "\$env ./gyp-mac-tool \$mactool_cmd \$in \$out" + # description = "MACTOOL \$mactool_cmd \$in" + #} + #tool("package_framework") { + # command = "./gyp-mac-tool package-framework \$out \$version \$postbuilds && touch \$out" + # description = "PACKAGE FRAMEWORK \$out, POSTBUILDS" + #} + tool("stamp") { + command = "\${postbuilds}touch \$out" + description = "STAMP \$out" + } + tool("copy") { + command = "ln -f \$in \$out 2>/dev/null || (rm -rf \$out && cp -af \$in \$out)" + description = "COPY \$in \$out" + } +} diff --git a/chromium/build/toolchain/mac/setup_toolchain.py b/chromium/build/toolchain/mac/setup_toolchain.py new file mode 100644 index 00000000000..431078fb180 --- /dev/null +++ b/chromium/build/toolchain/mac/setup_toolchain.py @@ -0,0 +1,29 @@ +# Copyright (c) 2013 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import os +import stat +import sys + +def CopyTool(source_path): + """Copies the given tool to the current directory, including a warning not + to edit it.""" + with open(source_path) as source_file: + tool_source = source_file.readlines() + + # Add header and write it out to the current directory (which should be the + # root build dir). + out_path = 'gyp-mac-tool' + with open(out_path, 'w') as tool_file: + tool_file.write(''.join([tool_source[0], + '# Generated by setup_toolchain.py do not edit.\n'] + + tool_source[1:])) + st = os.stat(out_path) + os.chmod(out_path, st.st_mode | stat.S_IEXEC) + +# Find the tool source, it's the first argument, and copy it. +if len(sys.argv) != 2: + print "Need one argument (mac_tool source path)." + sys.exit(1) +CopyTool(sys.argv[1]) diff --git a/chromium/build/toolchain/nacl/BUILD.gn b/chromium/build/toolchain/nacl/BUILD.gn new file mode 100644 index 00000000000..fbced9732d7 --- /dev/null +++ b/chromium/build/toolchain/nacl/BUILD.gn @@ -0,0 +1,62 @@ +# Copyright (c) 2013 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + + +toolchain("x86_newlib") { + toolprefix = "gen/sdk/toolchain/linux_x86_newlib/bin/x86_64-nacl-" + cc = toolprefix + "gcc" + cxx = toolprefix + "g++" + ld = toolprefix + "g++" + + tool("cc") { + command = "$cc -MMD -MF \$out.d \$defines \$includes \$cflags \$cflags_c -c \$in -o \$out" + description = "CC(NaCl x86 Newlib) \$out" + depfile = "\$out.d" + deps = "gcc" + } + tool("cxx") { + # cflags_pch_cc + command = "$cxx -MMD -MF \$out.d \$defines \$includes \$cflags \$cflags_cc -c \$in -o \$out" + description = "CXX(NaCl x86 Newlib) \$out" + depfile = "\$out.d" + deps = "gcc" + } + tool("alink") { + command = "rm -f \$out && ${toolprefix}ar rcs \$out \$in" + description = "AR(NaCl x86 Newlib) \$out" + } + tool("solink") { + command = "if [ ! -e \$lib -o ! -e \${lib}.TOC ]; then $ld -shared \$ldflags -o \$lib -Wl,-soname=\$soname -Wl,--whole-archive \$in \$solibs -Wl,--no-whole-archive \$libs && { readelf -d \${lib} | grep SONAME ; nm -gD -f p \${lib} | cut -f1-2 -d' '; } > \${lib}.TOC; else $ld -shared \$ldflags -o \$lib -Wl,-soname=\$soname -Wl,--whole-archive \$in \$solibs -Wl,--no-whole-archive \$libs && { readelf -d \${lib} | grep SONAME ; nm -gD -f p \${lib} | cut -f1-2 -d' '; } > \${lib}.tmp && if ! cmp -s \${lib}.tmp \${lib}.TOC; then mv \${lib}.tmp \${lib}.TOC ; fi; fi" + description = "SOLINK(NaCl x86 Newlib) \$lib" + #pool = "link_pool" + restat = "1" + } + tool("link") { + command = "$ld \$ldflags -o \$out -Wl,--start-group \$in \$solibs -Wl,--end-group \$libs" + description = "LINK(NaCl x86 Newlib) \$out" + #pool = "link_pool" + } + + if (is_win) { + tool("stamp") { + command = "$python_path gyp-win-tool stamp \$out" + description = "STAMP \$out" + } + } else { + tool("stamp") { + command = "touch \$out" + description = "STAMP \$out" + } + } + + toolchain_args() { + # Override the default OS detection. The build config will set the is_* + # flags accordingly. + os = "nacl" + + # Component build not supported in NaCl, since it does not support shared + # libraries. + is_component_build = false + } +} diff --git a/chromium/build/toolchain/win/BUILD.gn b/chromium/build/toolchain/win/BUILD.gn new file mode 100644 index 00000000000..6abf8082daa --- /dev/null +++ b/chromium/build/toolchain/win/BUILD.gn @@ -0,0 +1,154 @@ +# Copyright (c) 2013 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# Should only be running on Windows. +assert(is_win) + +# Setup the Visual Studio state. +# +# Its argument is the location to write the environment files. +# It will write "environment.x86" and "environment.x64" to this directory, +# and return a list to us. +# +# The list contains the include path as its only element. (I'm expecting to +# add more so it's currently a list inside a list.) +#exec_script("get_msvc_config.py", + # [relative_root_output_dir], + # "value") + +# This will save the environment block and and copy the gyp-win-tool to the +# build directory. We pass in the source file of the win tool. +gyp_win_tool_source = + rebase_path("//tools/gyp/pylib/gyp/win_tool.py", ".", root_build_dir) +exec_script("setup_toolchain.py", [ gyp_win_tool_source ], "value") + +stamp_command = "$python_path gyp-win-tool stamp \$out" +copy_command = "$python_path gyp-win-tool recursive-mirror \$in \$out" + +# 32-bit toolchain ------------------------------------------------------------- + +toolchain("32") { + # Make these apply to all tools below. + lib_prefix = "" + lib_dir_prefix="/LIBPATH:" + + cc_command = "ninja -t msvc -e environment.x86 -- cl.exe /nologo /showIncludes /FC @\$out.rsp /c \$in /Fo\$out /Fd\$pdbname" + tool("cc") { + command = cc_command + description = "CC \$out" + rspfile = "\$out.rsp" + rspfile_content = "\$defines \$includes \$cflags \$cflags_c" + deps = "msvc" + } + tool("cxx") { + command = cc_command # Same as above + description = "CXX \$out" + rspfile = "\$out.rsp" + rspfile_content = "\$defines \$includes \$cflags \$cflags_cc" + deps = "msvc" + } + tool("rc") { + command = "$python_path gyp-win-tool rc-wrapper environment.x86 rc.exe \$defines \$includes \$rcflags /fo\$out \$in" + description = "RC \$in" + } + tool("asm") { + command = "$python_path gyp-win-tool asm-wrapper environment.x86 ml.exe \$defines \$includes /c /Fo \$out \$in" + description = "ASM \$in" + } + tool("alink") { + command = "$python_path gyp-win-tool link-wrapper environment.x86 lib.exe /nologo /ignore:4221 /OUT:\$out @\$out.rsp" + description = "LIB \$out" + rspfile = "\$out.rsp" + rspfile_content = "\$in_newline \$libflags" + } + tool("solink") { + command = "cmd /c $python_path gyp-win-tool link-wrapper environment.x86 link.exe /nologo \$implibflag /DLL /OUT:\$dll /PDB:\$dll.pdb @\$dll.rsp && $python_path gyp-win-tool manifest-wrapper environment.x86 cmd /c if exist \$dll.manifest del \$dll.manifest && $python_path gyp-win-tool manifest-wrapper environment.x86 mt.exe -nologo -manifest \$manifests -out:\$dll.manifest" + description = "LINK(DLL) \$dll" + restat = "1" + rspfile = "\$dll.rsp" + rspfile_content = "\$libs \$in_newline \$ldflags" + } + tool("link") { + command = "cmd /c $python_path gyp-win-tool link-wrapper environment.x86 link.exe /nologo /OUT:\$out /PDB:\$out.pdb @\$out.rsp && $python_path gyp-win-tool manifest-wrapper environment.x86 cmd /c if exist \$out.manifest del \$out.manifest && $python_path gyp-win-tool manifest-wrapper environment.x86 mt.exe -nologo -manifest \$manifests -out:\$out.manifest" + description = "LINK \$out" + rspfile = "\$out.rsp" + rspfile_content = "\$in_newline \$libs \$ldflags" + } + tool("stamp") { + command = stamp_command + description = "STAMP \$out" + } + tool("copy") { + command = copy_command + description = "COPY \$in \$out" + } +} + +# 64-bit toolchain ------------------------------------------------------------- + +toolchain("64") { + # Make these apply to all tools below. + lib_prefix = "" + lib_dir_prefix="/LIBPATH:" + + cc_command = "ninja -t msvc -e environment.x64 -- cl.exe /nologo /showIncludes /FC @\$out.rsp /c \$in /Fo\$out /Fd\$pdbname" + tool("cc") { + command = cc_command + description = "CC \$out" + rspfile = "\$out.rsp" + rspfile_content = "\$defines \$includes \$cflags \$cflags_c" + deps = "msvc" + } + tool("cxx") { + command = cc_command # Same as above + description = "CXX \$out" + rspfile = "\$out.rsp" + rspfile_content = "\$defines \$includes \$cflags \$cflags_cc" + deps = "msvc" + } + tool("rc") { + command = "$python_path gyp-win-tool rc-wrapper environment.x64 rc.exe \$defines \$includes \$rcflags /fo\$out \$in" + description = "RC \$in" + } + tool("asm") { + command = "$python_path gyp-win-tool asm-wrapper environment.x64 ml.exe \$defines \$includes /c /Fo \$out \$in" + description = "ASM \$in" + } + tool("alink") { + command = "$python_path gyp-win-tool link-wrapper environment.x64 lib.exe /nologo /ignore:4221 /OUT:\$out @\$out.rsp" + description = "LIB \$out" + rspfile = "\$out.rsp" + rspfile_content = "\$in_newline \$libflags" + } + tool("solink") { + command = "cmd /c $python_path gyp-win-tool link-wrapper environment.x64 link.exe /nologo \$implibflag /DLL /OUT:\$dll /PDB:\$dll.pdb @\$dll.rsp && $python_path gyp-win-tool manifest-wrapper environment.x64 cmd /c if exist \$dll.manifest del \$dll.manifest && $python_path gyp-win-tool manifest-wrapper environment.x64 mt.exe -nologo -manifest \$manifests -out:\$dll.manifest" + description = "LINK(DLL) \$dll" + restat = "1" + rspfile = "\$dll.rsp" + rspfile_content = "\$libs \$in_newline \$ldflags" + } + tool("link") { + command = "cmd /c $python_path gyp-win-tool link-wrapper environment.x64 link.exe /nologo /OUT:\$out /PDB:\$out.pdb @\$out.rsp && $python_path gyp-win-tool manifest-wrapper environment.x64 cmd /c if exist \$out.manifest del \$out.manifest && $python_path gyp-win-tool manifest-wrapper environment.x64 mt.exe -nologo -manifest \$manifests -out:\$out.manifest" + description = "LINK \$out" + rspfile = "\$out.rsp" + rspfile_content = "\$in_newline \$libs \$ldflags" + } + tool("stamp") { + command = stamp_command + description = "STAMP \$out" + } + tool("copy") { + command = copy_command + description = "COPY \$in \$out" + } + + # When invoking this toolchain not as the default one, these args will be + # passed to the build. They are ignored when this is the default toolchain. + toolchain_args() { + cpu_arch = "x64" + # Normally the build config resets the CPU architecture to 32-bits. Setting + # this flag overrides that behavior. + force_win64 = true + } +} diff --git a/chromium/build/toolchain/win/setup_toolchain.py b/chromium/build/toolchain/win/setup_toolchain.py new file mode 100644 index 00000000000..162c2e16cef --- /dev/null +++ b/chromium/build/toolchain/win/setup_toolchain.py @@ -0,0 +1,123 @@ +# Copyright (c) 2013 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import os +import re +import sys + +def ExtractImportantEnvironment(): + """Extracts environment variables required for the toolchain from the + current environment.""" + envvars_to_save = ( + 'goma_.*', # TODO(scottmg): This is ugly, but needed for goma. + 'Path', + 'PATHEXT', + 'SystemRoot', + 'TEMP', + 'TMP', + ) + result = {} + for envvar in envvars_to_save: + if envvar in os.environ: + if envvar == 'Path': + # Our own rules (for running gyp-win-tool) and other actions in + # Chromium rely on python being in the path. Add the path to this + # python here so that if it's not in the path when ninja is run + # later, python will still be found. + result[envvar.upper()] = os.path.dirname(sys.executable) + \ + os.pathsep + os.environ[envvar] + else: + result[envvar.upper()] = os.environ[envvar] + for required in ('SYSTEMROOT', 'TEMP', 'TMP'): + if required not in result: + raise Exception('Environment variable "%s" ' + 'required to be set to valid path' % required) + return result + + +# VC setup will add a path like this in 32-bit mode: +# c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN +# And this in 64-bit mode: +# c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\amd64 +# Note that in 64-bit it's duplicated but the 64-bit one comes first. +# +# What we get as the path when running this will depend on which VS setup +# script you've run. The following two functions try to do this. + +# For 32-bit compiles remove anything that ends in "\VC\WIN\amd64". +def FixupPath32(path): + find_64 = re.compile("VC\\\\BIN\\\\amd64\\\\*$", flags=re.IGNORECASE) + + for i in range(len(path)): + if find_64.search(path[i]): + # Found 32-bit path, insert the 64-bit one immediately before it. + dir_64 = path[i].rstrip("\\") + dir_64 = dir_64[:len(dir_64) - 6] # Trim off "\amd64". + path[i] = dir_64 + break + return path + +# For 64-bit compiles, append anything ending in "\VC\BIN" with "\amd64" as +# long as that thing isn't already in the list, and append it immediately +# before the non-amd64-one. +def FixupPath64(path): + find_32 = re.compile("VC\\\\BIN\\\\*$", flags=re.IGNORECASE) + + for i in range(len(path)): + if find_32.search(path[i]): + # Found 32-bit path, insert the 64-bit one immediately before it. + dir_32 = path[i] + if dir_32[len(dir_32) - 1] == '\\': + dir_64 = dir_32 + "amd64" + else: + dir_64 = dir_32 + "\\amd64" + path.insert(i, dir_64) + break + + return path + + +def FormatAsEnvironmentBlock(envvar_dict): + """Format as an 'environment block' directly suitable for CreateProcess. + Briefly this is a list of key=value\0, terminated by an additional \0. See + CreateProcess documentation for more details.""" + block = '' + nul = '\0' + for key, value in envvar_dict.iteritems(): + block += key + '=' + value + nul + block += nul + return block + +def CopyTool(source_path): + """Copies the given tool to the current directory, including a warning not + to edit it.""" + with open(source_path) as source_file: + tool_source = source_file.readlines() + + # Add header and write it out to the current directory (which should be the + # root build dir). + with open("gyp-win-tool", 'w') as tool_file: + tool_file.write(''.join([tool_source[0], + '# Generated by setup_toolchain.py do not edit.\n'] + + tool_source[1:])) + + +# Find the tool source, it's the first argument, and copy it. +if len(sys.argv) != 2: + print "Need one argument (win_tool source path)." + sys.exit(1) +CopyTool(sys.argv[1]) + +important_env_vars = ExtractImportantEnvironment() +path = important_env_vars["PATH"].split(";") + +important_env_vars["PATH"] = ";".join(FixupPath32(path)) +environ = FormatAsEnvironmentBlock(important_env_vars) +with open('environment.x86', 'wb') as env_file: + env_file.write(environ) + +important_env_vars["PATH"] = ";".join(FixupPath64(path)) +environ = FormatAsEnvironmentBlock(important_env_vars) +with open('environment.x64', 'wb') as env_file: + env_file.write(environ) diff --git a/chromium/build/util/BUILD.gn b/chromium/build/util/BUILD.gn new file mode 100644 index 00000000000..bf704c80b70 --- /dev/null +++ b/chromium/build/util/BUILD.gn @@ -0,0 +1,35 @@ +# Copyright (c) 2013 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# This target generates a "last_change.h" header file in the generated files +# directory that contains a define of the last revision of the source tree +# of the form: +# #define LAST_CHANGE "123456" +# +# The version is a string rather than an integer for extra flexibility (for +# example, we may require git hashes in the future). +# +# All you nede to do is depend on this target, and then from your source code: +# #include "build/util/last_change.h" +custom("last_change") { + script = "//build/util/lastchange.py" + + # This script must be run before targets depending on us. + hard_dep = true + + # Rerun the script any time this file changes. + source_prereqs = [ "//build/util/LASTCHANGE" ] + + output_header = "$target_gen_dir/last_change.h" + outputs = [ output_header ] + + build_relative_src = rebase_path("//", ".", root_build_dir) + build_relative_outputs = rebase_path(output_header, ".", root_build_dir) + + args = [ + "--source-dir=$build_relative_src", + "--header=$build_relative_outputs", + "--version-macro=LAST_CHANGE", + ] +} diff --git a/chromium/build/util/LASTCHANGE b/chromium/build/util/LASTCHANGE index e97726fa4a4..b9510addb6c 100644 --- a/chromium/build/util/LASTCHANGE +++ b/chromium/build/util/LASTCHANGE @@ -1 +1 @@ -LASTCHANGE=238485 +LASTCHANGE=255236 diff --git a/chromium/build/util/LASTCHANGE.blink b/chromium/build/util/LASTCHANGE.blink index ce3faad86f4..2b43df4ca86 100644 --- a/chromium/build/util/LASTCHANGE.blink +++ b/chromium/build/util/LASTCHANGE.blink @@ -1 +1 @@ -LASTCHANGE=163124 +LASTCHANGE=168543 diff --git a/chromium/build/util/OWNERS b/chromium/build/util/OWNERS new file mode 100644 index 00000000000..ecd4e3865ac --- /dev/null +++ b/chromium/build/util/OWNERS @@ -0,0 +1,2 @@ +per-file BUILD.gn=set noparent +per-file BUILD.gn=brettw@chromium.org diff --git a/chromium/build/util/lastchange.py b/chromium/build/util/lastchange.py index 3c1ce28e28a..8d758d2a24f 100755 --- a/chromium/build/util/lastchange.py +++ b/chromium/build/util/lastchange.py @@ -168,6 +168,42 @@ def FetchVersionInfo(default_lastchange, directory=None, version_info = VersionInfo(None, None) return version_info +def GetHeaderGuard(path): + """ + Returns the header #define guard for the given file path. + This treats everything after the last instance of "src/" as being a + relevant part of the guard. If there is no "src/", then the entire path + is used. + """ + src_index = path.rfind('src/') + if src_index != -1: + guard = path[src_index + 4:] + else: + guard = path + guard = guard.upper() + return guard.replace('/', '_').replace('.', '_').replace('\\', '_') + '_' + +def GetHeaderContents(path, define, version): + """ + Returns what the contents of the header file should be that indicate the given + revision. Note that the #define is specified as a string, even though it's + currently always a SVN revision number, in case we need to move to git hashes. + """ + header_guard = GetHeaderGuard(path) + + header_contents = """/* Generated by lastchange.py, do not edit.*/ + +#ifndef %(header_guard)s +#define %(header_guard)s + +#define %(define)s "%(version)s" + +#endif // %(header_guard)s +""" + header_contents = header_contents % { 'header_guard': header_guard, + 'define': define, + 'version': version } + return header_contents def WriteIfChanged(file_name, contents): """ @@ -191,16 +227,26 @@ def main(argv=None): parser = optparse.OptionParser(usage="lastchange.py [options]") parser.add_option("-d", "--default-lastchange", metavar="FILE", - help="default last change input FILE") + help="Default last change input FILE.") + parser.add_option("-m", "--version-macro", + help="Name of C #define when using --header. Defaults to " + + "LAST_CHANGE.", + default="LAST_CHANGE") parser.add_option("-o", "--output", metavar="FILE", - help="write last change to FILE") + help="Write last change to FILE. " + + "Can be combined with --header to write both files.") + parser.add_option("", "--header", metavar="FILE", + help="Write last change to FILE as a C/C++ header. " + + "Can be combined with --output to write both files.") parser.add_option("--revision-only", action='store_true', - help="just print the SVN revision number") + help="Just print the SVN revision number. Overrides any " + + "file-output-related options.") parser.add_option("-s", "--source-dir", metavar="DIR", - help="use repository in the given directory") + help="Use repository in the given directory.") opts, args = parser.parse_args(argv[1:]) out_file = opts.output + header = opts.header while len(args) and out_file is None: if out_file is None: @@ -224,10 +270,15 @@ def main(argv=None): print version_info.revision else: contents = "LASTCHANGE=%s\n" % version_info.revision - if out_file: - WriteIfChanged(out_file, contents) - else: + if not out_file and not opts.header: sys.stdout.write(contents) + else: + if out_file: + WriteIfChanged(out_file, contents) + if header: + WriteIfChanged(header, + GetHeaderContents(header, opts.version_macro, + version_info.revision)) return 0 diff --git a/chromium/build/util/lib/common/perf_tests_results_helper.py b/chromium/build/util/lib/common/perf_tests_results_helper.py index 733cbf91acb..6cb058b2df3 100644 --- a/chromium/build/util/lib/common/perf_tests_results_helper.py +++ b/chromium/build/util/lib/common/perf_tests_results_helper.py @@ -25,12 +25,12 @@ def _EscapePerfResult(s): return re.sub('[\:|=/#&,]', '_', s) -def _Flatten(values): +def FlattenList(values): """Returns a simple list without sub-lists.""" ret = [] for entry in values: if isinstance(entry, list): - ret.extend(_Flatten(entry)) + ret.extend(FlattenList(entry)) else: ret.append(entry) return ret @@ -63,18 +63,26 @@ def GeomMeanAndStdDevFromHistogram(histogram_json): return geom_mean, math.sqrt(sum_of_squares / count) +def _ValueToString(v): + # Special case for floats so we don't print using scientific notation. + if isinstance(v, float): + return '%f' % v + else: + return str(v) + + def _MeanAndStdDevFromList(values): avg = None sd = None if len(values) > 1: try: - value = '[%s]' % ','.join([str(v) for v in values]) + value = '[%s]' % ','.join([_ValueToString(v) for v in values]) avg = sum([float(v) for v in values]) / len(values) sqdiffs = [(float(v) - avg) ** 2 for v in values] variance = sum(sqdiffs) / (len(values) - 1) sd = math.sqrt(variance) except ValueError: - value = ", ".join(values) + value = ', '.join(values) else: value = values[0] return value, avg, sd @@ -92,10 +100,15 @@ def PrintPerfResult(measurement, trace, values, units, The string args may be empty but they must not contain any colons (:) or equals signs (=). + This is parsed by the buildbot using: + http://src.chromium.org/viewvc/chrome/trunk/tools/build/scripts/slave/process_log_utils.py Args: measurement: A description of the quantity being measured, e.g. "vm_peak". + On the dashboard, this maps to a particular graph. Mandatory. trace: A description of the particular data point, e.g. "reference". + On the dashboard, this maps to a particular "line" in the graph. + Mandatory. values: A list of numeric measured values. An N-dimensional list will be flattened and treated as a simple list. units: A description of the units of measure, e.g. "bytes". @@ -115,9 +128,10 @@ def PrintPerfResult(measurement, trace, values, units, result_type == perf_result_data_type.DEFAULT or result_type == perf_result_data_type.INFORMATIONAL): assert isinstance(values, list) - assert len(values) assert '/' not in measurement - value, avg, sd = _MeanAndStdDevFromList(_Flatten(values)) + flattened_values = FlattenList(values) + assert len(flattened_values) + value, avg, sd = _MeanAndStdDevFromList(flattened_values) output = '%s%s: %s%s%s %s' % ( RESULT_TYPES[result_type], _EscapePerfResult(measurement), @@ -134,11 +148,12 @@ def PrintPerfResult(measurement, trace, values, units, # across different histograms. assert len(values) == 1 value = values[0] - output = '%s%s: %s= %s' % ( + output = '%s%s: %s= %s %s' % ( RESULT_TYPES[result_type], _EscapePerfResult(measurement), trace_name, - value) + value, + units) avg, sd = GeomMeanAndStdDevFromHistogram(value) if avg: diff --git a/chromium/build/whitespace_file.txt b/chromium/build/whitespace_file.txt index 83f538de0c3..d217aebcd23 100644 --- a/chromium/build/whitespace_file.txt +++ b/chromium/build/whitespace_file.txt @@ -6,9 +6,9 @@ found in the LICENSE file. This file is used for making non-code changes to trigger buildbot cycles. Make any modification below this line. -====================================================================== +===================================================================== -Let's make a story. Add one sentence for every commit: +Let's make a story. Add one sentence for every commit: CHAPTER 1: It was a dark and blinky night; the rain fell in torrents -- except at @@ -22,10 +22,10 @@ It was a Domo-Kun. "What took you so long?", inquired his wife. Silence. Oblivious to his silence, she continued, "Did Mr. Usagi enjoy the -waffles you brought him?""You know him, he's not one to forego a waffle, +waffles you brought him?" "You know him, he's not one to forego a waffle, no matter how burnt," he snickered. -The pause was filled with the sound of thunder. +The pause was filled with the sound of compile errors. CHAPTER 2: The jelly was as dark as night, and just as runny. @@ -52,7 +52,7 @@ Next time, there won't be any sushi. Why sushi with waffles anyway? It's like adorning breakfast cereal with halibut -- shameful. CHAPTER 4: -The taste of stable sushi in his mouth the next morning was unbearable. He +The taste of stale sushi in his mouth the next morning was unbearable. He wondered where the sushi came from as he attempted to wash the taste away with a bottle of 3000¥ sake. He tries to recall the cook's face. Purple? @@ -74,6 +74,7 @@ AN INFLEXIBLE POSITION SOMETIMES IS A SIGN OF PARALYSIS IT IS MANS FATE TO OUTSMART HIMSELF BEING SURE OF YOURSELF MEANS YOU'RE A FOOL AM NOT +ARE TOO IF AT FIRST YOU DON'T SUCCEED: TRY, EXCEPT, FINALLY - -31 +AND THEN, TIME LEAPT BACKWARDS +A LOT |