diff options
-rw-r--r-- | base/base.gyp | 138 | ||||
-rw-r--r-- | base/base.gypi | 40 | ||||
-rw-r--r-- | base/base_untrusted.gyp | 35 | ||||
-rw-r--r-- | build/all.gyp | 4 | ||||
-rw-r--r-- | build/common.gypi | 3 | ||||
-rw-r--r-- | build/filename_rules.gypi | 33 |
6 files changed, 148 insertions, 105 deletions
diff --git a/base/base.gyp b/base/base.gyp index 6666640..d3b2021 100644 --- a/base/base.gyp +++ b/base/base.gyp @@ -35,24 +35,22 @@ ], }, 'conditions': [ - [ 'use_glib==1', { + ['use_glib==1', { 'conditions': [ - [ 'chromeos==1', { - 'sources/': [ ['include', '_chromeos\\.cc$'] ] - }, - ], - [ 'linux_use_tcmalloc==0', { + ['chromeos==1', { + 'sources/': [ ['include', '_chromeos\\.cc$'] ] + }], + ['linux_use_tcmalloc==0', { + 'defines': [ + 'NO_TCMALLOC', + ], + 'direct_dependent_settings': { 'defines': [ 'NO_TCMALLOC', ], - 'direct_dependent_settings': { - 'defines': [ - 'NO_TCMALLOC', - ], - }, }, - ], - [ 'toolkit_uses_gtk==1', { + }], + ['toolkit_uses_gtk==1', { 'dependencies': [ '../build/linux/system.gyp:gtk', ], @@ -83,7 +81,7 @@ ['exclude', '_nss\.cc$'], ], }], - [ 'OS == "android" and _toolset == "host"', { + ['OS == "android" and _toolset == "host"', { # Base for host support is the minimum required to run the # ssl false start blacklist tool. It requires further changes # to generically support host builds (and tests). @@ -115,7 +113,7 @@ }], ], }], - [ 'OS == "android" and _toolset == "target"', { + ['OS == "android" and _toolset == "target"', { 'conditions': [ ['target_arch == "ia32"', { 'sources/': [ @@ -146,28 +144,27 @@ 'debug/stack_trace_posix.cc', ], }], - [ 'os_bsd==1', { + ['os_bsd==1', { 'include_dirs': [ '/usr/local/include', ], 'link_settings': { 'libraries': [ '-L/usr/local/lib -lexecinfo', - ], - }, + ], }, - ], - [ 'OS == "linux"', { + }], + ['OS == "linux"', { 'link_settings': { - 'libraries': [ - # We need rt for clock_gettime(). - '-lrt', - # For 'native_library_linux.cc' - '-ldl', - ], - }, + 'libraries': [ + # We need rt for clock_gettime(). + '-lrt', + # For 'native_library_linux.cc' + '-ldl', + ], + }, }], - [ 'OS == "mac"', { + ['OS == "mac"', { 'link_settings': { 'libraries': [ '$(SDKROOT)/System/Library/Frameworks/AppKit.framework', @@ -182,10 +179,10 @@ '../third_party/mach_override/mach_override.gyp:mach_override', ], }], - [ 'OS != "win"', { + ['OS != "win"', { 'dependencies': ['../third_party/libevent/libevent.gyp:libevent'], },], - [ 'component=="shared_library"', { + ['component=="shared_library"', { 'conditions': [ ['OS=="win"', { 'sources!': [ @@ -761,7 +758,7 @@ }, ], 'conditions': [ - [ 'OS == "win"', { + ['OS == "win"', { 'targets': [ { 'target_name': 'base_nacl_win64', @@ -790,7 +787,7 @@ }, }, 'conditions': [ - [ 'component == "shared_library"', { + ['component == "shared_library"', { 'sources!': [ 'debug/debug_on_start_win.cc', ], @@ -825,7 +822,7 @@ }, ], }], - [ 'os_posix==1 and OS!="mac"', { + ['os_posix==1 and OS!="mac"', { 'targets': [ { 'target_name': 'symbolize', @@ -835,7 +832,7 @@ 'chromium_code': 0, }, 'conditions': [ - [ 'OS == "solaris"', { + ['OS == "solaris"', { 'include_dirs': [ '/usr/gnu/include', '/usr/gnu/include/libelf', @@ -942,41 +939,41 @@ ], }], ['OS=="mac"', { - 'targets': [ - { - 'target_name': 'closure_blocks_leopard_compat', - 'sources': [ - 'mac/closure_blocks_leopard_compat.h', - ], - 'conditions': [ - ['mac_sdk == "10.5"', { - 'type': 'shared_library', - 'product_name': 'closure_blocks_leopard_compat_stub', - 'variables': { - # This target controls stripping directly. See below. - 'mac_strip': 0, - }, - 'sources': [ - 'mac/closure_blocks_leopard_compat.S', - ], - 'xcode_settings': { - # These values are taken from libSystem.dylib in the 10.5 - # SDK. Setting LD_DYLIB_INSTALL_NAME causes anything linked - # against this stub library to look for the symbols it - # provides in the real libSystem at runtime. When using ld - # from Xcode 4 or later (ld64-123.2 and up), giving two - # libraries with the same "install name" to the linker will - # cause it to print "ld: warning: dylibs with same install - # name". This is harmless, and ld will behave as intended - # here. - # - # The real library's compatibility version is used, and the - # value of the current version from the SDK is used to make - # it appear as though anything linked against this stub was - # linked against the real thing. - 'LD_DYLIB_INSTALL_NAME': '/usr/lib/libSystem.B.dylib', - 'DYLIB_COMPATIBILITY_VERSION': '1.0.0', - 'DYLIB_CURRENT_VERSION': '111.1.4', + 'targets': [ + { + 'target_name': 'closure_blocks_leopard_compat', + 'sources': [ + 'mac/closure_blocks_leopard_compat.h', + ], + 'conditions': [ + ['mac_sdk == "10.5"', { + 'type': 'shared_library', + 'product_name': 'closure_blocks_leopard_compat_stub', + 'variables': { + # This target controls stripping directly. See below. + 'mac_strip': 0, + }, + 'sources': [ + 'mac/closure_blocks_leopard_compat.S', + ], + 'xcode_settings': { + # These values are taken from libSystem.dylib in the 10.5 + # SDK. Setting LD_DYLIB_INSTALL_NAME causes anything linked + # against this stub library to look for the symbols it + # provides in the real libSystem at runtime. When using ld + # from Xcode 4 or later (ld64-123.2 and up), giving two + # libraries with the same "install name" to the linker will + # cause it to print "ld: warning: dylibs with same install + # name". This is harmless, and ld will behave as intended + # here. + # + # The real library's compatibility version is used, and the + # value of the current version from the SDK is used to make + # it appear as though anything linked against this stub was + # linked against the real thing. + 'LD_DYLIB_INSTALL_NAME': '/usr/lib/libSystem.B.dylib', + 'DYLIB_COMPATIBILITY_VERSION': '1.0.0', + 'DYLIB_CURRENT_VERSION': '111.1.4', # Turn on stripping (yes, even in debug mode), and add the -c # flag. This is what produces a stub library (MH_DYLIB_STUB) @@ -1025,7 +1022,8 @@ 'input_jars_paths': ['<(PRODUCT_DIR)/lib.java/chromium_base.jar',], }, 'includes': [ '../build/apk_test.gypi' ], - }], + }, + ], }], ], } diff --git a/base/base.gypi b/base/base.gypi index 3457c59..b77b4d8 100644 --- a/base/base.gypi +++ b/base/base.gypi @@ -331,7 +331,7 @@ 'synchronization/waitable_event.h', 'synchronization/waitable_event_posix.cc', 'synchronization/waitable_event_watcher.h', - 'synchronization/waitable_event_watcher_posix.cc', + 'synchronization/waitable_event_watcher_posix.cc', 'synchronization/waitable_event_watcher_win.cc', 'synchronization/waitable_event_win.cc', 'system_monitor/system_monitor.cc', @@ -481,8 +481,8 @@ 'mac_framework_dirs': [ '$(SDKROOT)/System/Library/Frameworks/ApplicationServices.framework/Frameworks', ], - 'conditions': [ - [ 'use_glib==0', { + 'target_conditions': [ + ['<(use_glib)==0 or >(nacl_untrusted_build)==1', { 'sources/': [ ['exclude', '^nix/'], ], @@ -492,17 +492,23 @@ 'message_pump_aurax11.cc', ], }], - [ 'toolkit_uses_gtk==0', { - 'sources!': [ 'message_pump_gtk.cc', ], + ['<(toolkit_uses_gtk)==0 or >(nacl_untrusted_build)==1', { + 'sources!': ['message_pump_gtk.cc'], }], - [ 'OS != "linux" and os_bsd != 1', { + ['(OS != "linux" and <(os_bsd) != 1) or >(nacl_untrusted_build)==1', { 'sources!': [ # Not automatically excluded by the *linux.cc rules. 'linux_util.cc', ], }, ], - [ 'OS == "android"', { + ['>(nacl_untrusted_build)==1', { + 'sources!': [ + 'file_util.cc', + 'files/file_path_watcher_kqueue.cc', + ], + }], + ['OS == "android" and >(nacl_untrusted_build)==0', { 'sources!': [ 'files/file_path_watcher_kqueue.cc', 'system_monitor/system_monitor_posix.cc', @@ -514,30 +520,30 @@ ['include', '^worker_pool_linux\\.cc$'], ], }], - [ 'OS != "mac"', { + ['OS != "mac" or >(nacl_untrusted_build)==1', { 'sources!': [ 'mac/scoped_aedesc.h' ], }], # For now, just test the *BSD platforms enough to exclude them. # Subsequent changes will include them further. - [ 'OS != "freebsd"', { + ['OS != "freebsd" or >(nacl_untrusted_build)==1', { 'sources/': [ ['exclude', '_freebsd\\.cc$'] ], }, ], - [ 'OS != "openbsd"', { + ['OS != "openbsd" or >(nacl_untrusted_build)==1', { 'sources/': [ ['exclude', '_openbsd\\.cc$'] ], }, ], - ['OS != "win"', { + ['OS != "win" or >(nacl_untrusted_build)==1', { 'sources/': [ ['exclude', '^win/'] ], }, ], - ['OS != "android"', { + ['OS != "android" or >(nacl_untrusted_build)==1', { 'sources/': [ ['exclude', '^android/'] ], }, ], - [ 'OS == "win"', { + ['OS == "win" and >(nacl_untrusted_build)==0', { 'include_dirs': [ '<(DEPTH)/third_party/wtl/include', ], @@ -553,13 +559,13 @@ 'string16.cc', ], },], - [ 'OS == "linux"', { + ['OS == "linux" and >(nacl_untrusted_build)==0', { 'sources!': [ 'files/file_path_watcher_kqueue.cc', 'files/file_path_watcher_stub.cc', ], }], - [ 'OS == "mac"', { + ['OS == "mac" and >(nacl_untrusted_build)==0', { 'sources/': [ ['exclude', '^files/file_path_watcher_stub\\.cc$'], ['exclude', '^base_paths_posix\\.cc$'], @@ -567,7 +573,7 @@ ['exclude', '^sys_string_conversions_posix\\.cc$'], ], }], - [ 'os_bsd==1', { + ['<(os_bsd)==1 and >(nacl_untrusted_build)==0', { 'sources/': [ ['exclude', '^files/file_path_watcher_linux\\.cc$'], ['exclude', '^files/file_path_watcher_stub\\.cc$'], @@ -577,7 +583,7 @@ ['exclude', '^sys_info_linux\\.cc$'], ], }], - [ 'chromeos != 1', { + ['<(chromeos)!=1 or >(nacl_untrusted_build)==1', { 'sources/': [ ['exclude', '^chromeos/'], ], diff --git a/base/base_untrusted.gyp b/base/base_untrusted.gyp new file mode 100644 index 0000000..917e2170 --- /dev/null +++ b/base/base_untrusted.gyp @@ -0,0 +1,35 @@ +# 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. + +{ + 'variables': { + 'chromium_code': 1, + }, + 'includes': [ + '../native_client/build/untrusted.gypi', + 'base.gypi', + ], + 'conditions': [ + ['disable_nacl_untrusted==0', { + 'targets': [ + { + 'target_name': 'base_untrusted', + 'type': 'none', + 'variables': { + 'base_target': 1, + 'nacl_untrusted_build': 1, + 'nlib_target': 'libbase_untrusted.a', + 'build_glibc': 0, + 'build_newlib': 1, + }, + 'dependencies': [ + '<(DEPTH)/native_client/tools.gyp:prep_toolchain', + '<(DEPTH)/native_client/src/untrusted/pthread/pthread.gyp:pthread_lib', + '<(DEPTH)/native_client/src/untrusted/nacl/nacl.gyp:nacl_lib_newlib', + ], + }, + ], + }], + ], +} diff --git a/build/all.gyp b/build/all.gyp index 7198959..12dcada 100644 --- a/build/all.gyp +++ b/build/all.gyp @@ -11,6 +11,7 @@ 'dependencies': [ 'some.gyp:*', '../base/base.gyp:*', + '../base/base_untrusted.gyp:*', '../chrome/chrome.gyp:*', '../content/content.gyp:*', '../crypto/crypto.gyp:*', @@ -173,6 +174,9 @@ 'type': 'none', 'dependencies': [ '../base/base.gyp:base_unittests', + # TODO(bbudge): drop this when something meaningful depends on + # base_untrusted. + '../base/base_untrusted.gyp:base_untrusted', '../chrome/chrome.gyp:browser_tests', '../chrome/chrome.gyp:interactive_ui_tests', '../chrome/chrome.gyp:safe_browsing_tests', diff --git a/build/common.gypi b/build/common.gypi index b2a7693..b6a0aeb 100644 --- a/build/common.gypi +++ b/build/common.gypi @@ -1235,6 +1235,9 @@ # output files in src/build/VS2010_{Debug,Release}. 'build_dir_prefix%': '', + # Targets are by default not nacl untrusted code. + 'nacl_untrusted_build%': 0, + 'conditions': [ ['OS=="win" and component=="shared_library"', { # See http://msdn.microsoft.com/en-us/library/aa652367.aspx diff --git a/build/filename_rules.gypi b/build/filename_rules.gypi index c6dceea..ec34264 100644 --- a/build/filename_rules.gypi +++ b/build/filename_rules.gypi @@ -7,13 +7,13 @@ # included by common.gypi for chromium_code. { - 'conditions': [ - ['OS!="win"', { + 'target_conditions': [ + ['OS!="win" or >(nacl_untrusted_build)==1', { 'sources/': [ ['exclude', '_win(_unittest)?\\.(h|cc)$'], ['exclude', '(^|/)win/'], ['exclude', '(^|/)win_[^/]*\\.(h|cc)$'] ], }], - ['OS!="mac"', { + ['OS!="mac" or >(nacl_untrusted_build)==1', { 'sources/': [ ['exclude', '_(cocoa|mac)(_unittest)?\\.(h|cc)$'], ['exclude', '(^|/)(cocoa|mac)/'], ['exclude', '\\.mm?$' ] ], @@ -23,13 +23,13 @@ # In case a file is not needed, it is going to be excluded later on. # TODO(evan): the above is not correct; we shouldn't build _linux # files on non-linux. - ['OS!="linux" and OS!="openbsd" and OS!="freebsd"', { + ['OS!="linux" and OS!="openbsd" and OS!="freebsd" or >(nacl_untrusted_build)==1', { 'sources/': [ ['exclude', '_linux(_unittest)?\\.(h|cc)$'], ['exclude', '(^|/)linux/'], ], }], - ['OS!="android" and OS!="linux" and OS!="openbsd" and OS!="freebsd"', { + ['OS!="android" and OS!="linux" and OS!="openbsd" and OS!="freebsd" or >(nacl_untrusted_build)==1', { 'sources/': [ ['exclude', '_linuxish(_unittest)?\\.(h|cc)$'], ['exclude', '(^|/)linuxish/'], @@ -41,51 +41,48 @@ ['exclude', '(^|/)android/'], ], }], - ['OS=="win"', { + ['OS=="win" or >(nacl_untrusted_build)==1', { 'sources/': [ ['exclude', '_posix(_unittest)?\\.(h|cc)$'], ['exclude', '(^|/)posix/'], ], - }], - ['chromeos!=1', { + ['<(chromeos)!=1 or >(nacl_untrusted_build)==1', { 'sources/': [ ['exclude', '_chromeos\\.(h|cc)$'] ] }], - ['OS!="linux" and OS!="openbsd" and OS!="freebsd"', { + ['OS!="linux" and OS!="openbsd" and OS!="freebsd" or >(nacl_untrusted_build)==1', { 'sources/': [ ['exclude', '_xdg(_unittest)?\\.(h|cc)$'], ], }], - - - ['use_x11!=1', { + ['<(use_x11)!=1 or >(nacl_untrusted_build)==1', { 'sources/': [ ['exclude', '_(chromeos|x|x11)(_unittest)?\\.(h|cc)$'], ['exclude', '(^|/)x11_[^/]*\\.(h|cc)$'], ], }], - ['toolkit_uses_gtk!=1', { + ['<(toolkit_uses_gtk)!=1 or >(nacl_untrusted_build)==1', { 'sources/': [ ['exclude', '_gtk(_unittest)?\\.(h|cc)$'], ['exclude', '(^|/)gtk/'], ['exclude', '(^|/)gtk_[^/]*\\.(h|cc)$'], ], }], - ['toolkit_views==0', { + ['<(toolkit_views)==0 or >(nacl_untrusted_build)==1', { 'sources/': [ ['exclude', '_views\\.(h|cc)$'] ] }], - ['use_aura==0', { + ['<(use_aura)==0 or >(nacl_untrusted_build)==1', { 'sources/': [ ['exclude', '_aura(_unittest)?\\.(h|cc)$'], ['exclude', '(^|/)aura/'], ] }], - ['use_aura==0 or use_x11==0', { + ['<(use_aura)==0 or <(use_x11)==0 or >(nacl_untrusted_build)==1', { 'sources/': [ ['exclude', '_aurax11\\.(h|cc)$'] ] }], - ['use_aura==0 or OS!="win"', { + ['<(use_aura)==0 or OS!="win" or >(nacl_untrusted_build)==1', { 'sources/': [ ['exclude', '_aurawin\\.(h|cc)$'] ] }], - ['use_ash==0', { + ['<(use_ash)==0 or >(nacl_untrusted_build)==1', { 'sources/': [ ['exclude', '_ash(_unittest)?\\.(h|cc)$'], ['exclude', '(^|/)ash/'], ] |