summaryrefslogtreecommitdiffstats
path: root/chrome/nacl.gypi
diff options
context:
space:
mode:
authorbradnelson@google.com <bradnelson@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-15 05:46:21 +0000
committerbradnelson@google.com <bradnelson@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-15 05:46:21 +0000
commit1b603aede78ad1452aa09f92c46a8cdd35c90cea (patch)
treef0650b1b4f1db5129aea9df808ee74587bcbf8fb /chrome/nacl.gypi
parent30385d7f8476aca2caa466b0a5db25a15150e1d1 (diff)
downloadchromium_src-1b603aede78ad1452aa09f92c46a8cdd35c90cea.zip
chromium_src-1b603aede78ad1452aa09f92c46a8cdd35c90cea.tar.gz
chromium_src-1b603aede78ad1452aa09f92c46a8cdd35c90cea.tar.bz2
Disable targets in nacl.gypi whjen disable_nacl==1.
BUG=http://code.google.com/p/chromium/issues/detail?id=94518 TEST=None R=phajdan@google.com Review URL: http://codereview.chromium.org/7816003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@101252 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/nacl.gypi')
-rw-r--r--chrome/nacl.gypi520
1 files changed, 266 insertions, 254 deletions
diff --git a/chrome/nacl.gypi b/chrome/nacl.gypi
index 11a2573..6c9e409 100644
--- a/chrome/nacl.gypi
+++ b/chrome/nacl.gypi
@@ -53,119 +53,29 @@
}],
],
},
- 'targets': [
- {
- 'target_name': 'nacl',
- 'type': 'static_library',
- 'variables': {
- 'nacl_target': 1,
- 'irt_build_cmd': [
- 'python', 'build_nacl_irt.py', '--outdir', '<(PRODUCT_DIR)',
- ],
- 'irt_inputs_cmd':
- 'python build_nacl_irt.py --inputs',
- },
- 'dependencies': [
- 'chrome_resources',
- 'chrome_strings',
- 'common',
- '../webkit/support/webkit_support.gyp:glue',
- '../ppapi/native_client/src/trusted/plugin/plugin.gyp:ppGoogleNaClPluginChrome',
- '../native_client/src/trusted/service_runtime/service_runtime.gyp:sel',
- '../native_client/src/trusted/platform_qualify/platform_qualify.gyp:platform_qual_lib',
- ],
- 'direct_dependent_settings': {
- 'defines': [
- 'NACL_BLOCK_SHIFT=5',
- 'NACL_BLOCK_SIZE=32',
- '<@(nacl_defines)',
- ],
- },
- 'conditions': [
- ['OS=="win"', {
- # Windows needs both the x86-32 and x86-64 IRT.
- 'actions': [
- {
- 'action_name': 'nacl_irt',
- 'message': 'Building NaCl IRT',
- 'inputs': [
- '<!@(<(irt_inputs_cmd) --platform=x86-32 --platform=x86-64)',
- ],
- 'outputs': ['<(PRODUCT_DIR)/nacl_irt_x86_32.nexe',
- '<(PRODUCT_DIR)/nacl_irt_x86_64.nexe'],
- 'action': [
- '<@(irt_build_cmd)',
- '--platform', 'x86-32',
- '--platform', 'x86-64',
- ],
- },
- ],
- }],
- ['OS!="win" and target_arch=="ia32"', {
- # Linux-x86-32 and OSX need only the x86-32 IRT.
- 'actions': [
- {
- 'action_name': 'nacl_irt',
- 'message': 'Building NaCl IRT',
- 'inputs': [
- '<!@(<(irt_inputs_cmd) --platform=x86-32)',
- ],
- 'outputs': ['<(PRODUCT_DIR)/nacl_irt_x86_32.nexe'],
- 'action': [
- '<@(irt_build_cmd)', '--platform', 'x86-32',
- ],
- },
- ],
- }],
- ['OS!="win" and target_arch=="x64"', {
- # Linux-x86-64 needs only the x86-64 IRT.
- 'actions': [
- {
- 'action_name': 'nacl_irt',
- 'message': 'Building NaCl IRT',
- 'inputs': [
- '<!@(<(irt_inputs_cmd) --platform=x86-64)',
- ],
- 'outputs': ['<(PRODUCT_DIR)/nacl_irt_x86_64.nexe'],
- 'action': [
- '<@(irt_build_cmd)', '--platform', 'x86-64',
- ],
- },
- ],
- }],
- ],
- },
- ],
'conditions': [
- ['OS=="win"', {
+ ['disable_nacl!=1', {
'targets': [
{
- 'target_name': 'nacl_win64',
+ 'target_name': 'nacl',
'type': 'static_library',
'variables': {
'nacl_target': 1,
+ 'irt_build_cmd': [
+ 'python', 'build_nacl_irt.py', '--outdir', '<(PRODUCT_DIR)',
+ ],
+ 'irt_inputs_cmd':
+ 'python build_nacl_irt.py --inputs',
},
'dependencies': [
- '../native_client/src/trusted/service_runtime/service_runtime.gyp:sel64',
- '../native_client/src/trusted/platform_qualify/platform_qualify.gyp:platform_qual_lib64',
- ],
- 'sources': [
- 'common/nacl_cmd_line.cc',
- 'common/nacl_messages.cc',
- 'nacl/nacl_broker_listener.cc',
- 'nacl/nacl_broker_listener.h',
- ],
- 'include_dirs': [
- '..',
+ 'chrome_resources',
+ 'chrome_strings',
+ 'common',
+ '../webkit/support/webkit_support.gyp:glue',
+ '../ppapi/native_client/src/trusted/plugin/plugin.gyp:ppGoogleNaClPluginChrome',
+ '../native_client/src/trusted/service_runtime/service_runtime.gyp:sel',
+ '../native_client/src/trusted/platform_qualify/platform_qualify.gyp:platform_qual_lib',
],
- 'defines': [
- '<@(nacl_win64_defines)',
- ],
- 'configurations': {
- 'Common_Base': {
- 'msvs_target_platform': 'x64',
- },
- },
'direct_dependent_settings': {
'defines': [
'NACL_BLOCK_SHIFT=5',
@@ -173,178 +83,280 @@
'<@(nacl_defines)',
],
},
- },
- ],
- }],
- ['OS=="linux"', {
- 'targets': [
- {
- 'target_name': 'nacl_helper',
- 'type': 'executable',
- 'include_dirs': [
- '..',
- ],
- 'dependencies': [
- 'nacl',
- ],
- 'sources': [
- 'nacl/nacl_helper_linux.cc',
- ],
'conditions': [
- ['toolkit_uses_gtk == 1', {
- 'dependencies': [
- '../build/linux/system.gyp:gtk',
+ ['OS=="win"', {
+ # Windows needs both the x86-32 and x86-64 IRT.
+ 'actions': [
+ {
+ 'action_name': 'nacl_irt',
+ 'message': 'Building NaCl IRT',
+ 'inputs': [
+ '<!@(<(irt_inputs_cmd) --platform=x86-32 --platform=x86-64)',
+ ],
+ 'outputs': ['<(PRODUCT_DIR)/nacl_irt_x86_32.nexe',
+ '<(PRODUCT_DIR)/nacl_irt_x86_64.nexe'],
+ 'action': [
+ '<@(irt_build_cmd)',
+ '--platform', 'x86-32',
+ '--platform', 'x86-64',
+ ],
+ },
],
}],
- ['os_posix == 1 and OS != "mac"', {
- 'conditions': [
- ['linux_use_tcmalloc==1', {
- 'dependencies': [
- '../base/allocator/allocator.gyp:allocator',
+ ['OS!="win" and target_arch=="ia32"', {
+ # Linux-x86-32 and OSX need only the x86-32 IRT.
+ 'actions': [
+ {
+ 'action_name': 'nacl_irt',
+ 'message': 'Building NaCl IRT',
+ 'inputs': [
+ '<!@(<(irt_inputs_cmd) --platform=x86-32)',
],
- }],
+ 'outputs': ['<(PRODUCT_DIR)/nacl_irt_x86_32.nexe'],
+ 'action': [
+ '<@(irt_build_cmd)', '--platform', 'x86-32',
+ ],
+ },
],
}],
- ],
- 'cflags': ['-fPIE'],
- 'link_settings': {
- 'ldflags': ['-pie'],
- },
- },
- {
- 'target_name': 'nacl_helper_bootstrap_munge_phdr',
- 'type': 'executable',
- 'toolsets': ['host'],
- 'sources': [
- 'nacl/nacl_helper_bootstrap_munge_phdr.c',
- ],
- 'libraries': [
- '-lelf',
- ],
- # This is an ugly kludge because gyp doesn't actually treat
- # host_arch=x64 target_arch=ia32 as proper cross compilation.
- # It still wants to compile the "host" program with -m32 et
- # al. Though a program built that way can indeed run on the
- # x86-64 host, we cannot reliably build this program on such a
- # host because Ubuntu does not provide the full suite of
- # x86-32 libraries in packages that can be installed on an
- # x86-64 host; in particular, libelf is missing. So here we
- # use the hack of eliding all the -m* flags from the
- # compilation lines, getting the command close to what they
- # would be if gyp were to really build properly for the host.
- # TODO(bradnelson): Clean up with proper cross support.
- 'conditions': [
- ['host_arch=="x64"', {
- 'cflags/': [['exclude', '-m.*']],
- 'ldflags/': [['exclude', '-m.*']],
+ ['OS!="win" and target_arch=="x64"', {
+ # Linux-x86-64 needs only the x86-64 IRT.
+ 'actions': [
+ {
+ 'action_name': 'nacl_irt',
+ 'message': 'Building NaCl IRT',
+ 'inputs': [
+ '<!@(<(irt_inputs_cmd) --platform=x86-64)',
+ ],
+ 'outputs': ['<(PRODUCT_DIR)/nacl_irt_x86_64.nexe'],
+ 'action': [
+ '<@(irt_build_cmd)', '--platform', 'x86-64',
+ ],
+ },
+ ],
}],
],
},
- {
- 'target_name': 'nacl_helper_bootstrap_lib',
- 'type': 'static_library',
- 'product_dir': '<(SHARED_INTERMEDIATE_DIR)/chrome',
- 'hard_depencency': 1,
- 'include_dirs': [
- '..',
- ],
- 'sources': [
- 'nacl/nacl_helper_bootstrap_linux.c',
- ],
- 'cflags': [
- # The tiny standalone bootstrap program is incompatible with
- # -fstack-protector, which might be on by default. That switch
- # requires using the standard libc startup code, which we do not.
- '-fno-stack-protector',
- # We don't want to compile it PIC (or its cousin PIE), because
- # it goes at an absolute address anyway, and because any kind
- # of PIC complicates life for the x86-32 assembly code. We
- # append -fno-* flags here instead of using a 'cflags!' stanza
- # to remove -f* flags, just in case some system's compiler
- # defaults to using PIC for everything.
- '-fno-pic', '-fno-PIC',
- '-fno-pie', '-fno-PIE',
- ],
- },
- {
- 'target_name': 'nacl_helper_bootstrap_raw',
- 'type': 'none',
- 'dependencies': [
- 'nacl_helper_bootstrap_lib',
- ],
- 'actions': [
+ ],
+ 'conditions': [
+ ['OS=="win"', {
+ 'targets': [
{
- 'action_name': 'link_with_ld_bfd',
+ 'target_name': 'nacl_win64',
+ 'type': 'static_library',
'variables': {
- 'bootstrap_lib': '<(SHARED_INTERMEDIATE_DIR)/chrome/<(STATIC_LIB_PREFIX)nacl_helper_bootstrap_lib<(STATIC_LIB_SUFFIX)',
- 'linker_script': 'nacl/nacl_helper_bootstrap_linux.x',
+ 'nacl_target': 1,
},
- 'inputs': [
- '<(linker_script)',
- '<(bootstrap_lib)',
- '../tools/ld_bfd/ld',
+ 'dependencies': [
+ '../native_client/src/trusted/service_runtime/service_runtime.gyp:sel64',
+ '../native_client/src/trusted/platform_qualify/platform_qualify.gyp:platform_qual_lib64',
+ ],
+ 'sources': [
+ 'common/nacl_cmd_line.cc',
+ 'common/nacl_messages.cc',
+ 'nacl/nacl_broker_listener.cc',
+ 'nacl/nacl_broker_listener.h',
+ ],
+ 'include_dirs': [
+ '..',
],
- 'outputs': [
- '<(PRODUCT_DIR)/nacl_helper_bootstrap_raw',
+ 'defines': [
+ '<@(nacl_win64_defines)',
+ ],
+ 'configurations': {
+ 'Common_Base': {
+ 'msvs_target_platform': 'x64',
+ },
+ },
+ 'direct_dependent_settings': {
+ 'defines': [
+ 'NACL_BLOCK_SHIFT=5',
+ 'NACL_BLOCK_SIZE=32',
+ '<@(nacl_defines)',
+ ],
+ },
+ },
+ ],
+ }],
+ ['OS=="linux"', {
+ 'targets': [
+ {
+ 'target_name': 'nacl_helper',
+ 'type': 'executable',
+ 'include_dirs': [
+ '..',
+ ],
+ 'dependencies': [
+ 'nacl',
+ ],
+ 'sources': [
+ 'nacl/nacl_helper_linux.cc',
],
- 'message': 'Linking nacl_helper_bootstrap_raw',
'conditions': [
- ['target_arch=="x64"', {
- 'variables': {
- 'linker_emulation': 'elf_x86_64',
- }
+ ['toolkit_uses_gtk == 1', {
+ 'dependencies': [
+ '../build/linux/system.gyp:gtk',
+ ],
}],
- ['target_arch=="ia32"', {
- 'variables': {
- 'linker_emulation': 'elf_i386',
- }
+ ['os_posix == 1 and OS != "mac"', {
+ 'conditions': [
+ ['linux_use_tcmalloc==1', {
+ 'dependencies': [
+ '../base/allocator/allocator.gyp:allocator',
+ ],
+ }],
+ ],
}],
- ['target_arch=="arm"', {
- 'variables': {
- 'linker_emulation': 'armelf_linux_eabi',
- }
+ ],
+ 'cflags': ['-fPIE'],
+ 'link_settings': {
+ 'ldflags': ['-pie'],
+ },
+ },
+ {
+ 'target_name': 'nacl_helper_bootstrap_munge_phdr',
+ 'type': 'executable',
+ 'toolsets': ['host'],
+ 'sources': [
+ 'nacl/nacl_helper_bootstrap_munge_phdr.c',
+ ],
+ 'libraries': [
+ '-lelf',
+ ],
+ # This is an ugly kludge because gyp doesn't actually treat
+ # host_arch=x64 target_arch=ia32 as proper cross compilation.
+ # It still wants to compile the "host" program with -m32 et
+ # al. Though a program built that way can indeed run on the
+ # x86-64 host, we cannot reliably build this program on such a
+ # host because Ubuntu does not provide the full suite of
+ # x86-32 libraries in packages that can be installed on an
+ # x86-64 host; in particular, libelf is missing. So here we
+ # use the hack of eliding all the -m* flags from the
+ # compilation lines, getting the command close to what they
+ # would be if gyp were to really build properly for the host.
+ # TODO(bradnelson): Clean up with proper cross support.
+ 'conditions': [
+ ['host_arch=="x64"', {
+ 'cflags/': [['exclude', '-m.*']],
+ 'ldflags/': [['exclude', '-m.*']],
}],
],
- 'action': ['../tools/ld_bfd/ld',
- '-m', '<(linker_emulation)',
- '--build-id',
- # This program is (almost) entirely standalone. It
- # has its own startup code, so no crt1.o for it. It is
- # statically linked, and on x86 it does not use
- # libc at all. However, on ARM it needs a few (safe)
- # things from libc.
- '-static',
- # Link with custom linker script for special layout.
- '--script=<(linker_script)',
- '-o', '<@(_outputs)',
- # On x86-64, the default page size with some
- # linkers is 2M rather than the real Linux page
- # size of 4K. A larger page size is incompatible
- # with our custom linker script's special layout.
- '-z', 'max-page-size=0x1000',
- '--whole-archive', '<(bootstrap_lib)',
- '--no-whole-archive',
- ],
- }
+ },
+ {
+ 'target_name': 'nacl_helper_bootstrap_lib',
+ 'type': 'static_library',
+ 'product_dir': '<(SHARED_INTERMEDIATE_DIR)/chrome',
+ 'hard_depencency': 1,
+ 'include_dirs': [
+ '..',
+ ],
+ 'sources': [
+ 'nacl/nacl_helper_bootstrap_linux.c',
+ ],
+ 'cflags': [
+ # The tiny standalone bootstrap program is incompatible with
+ # -fstack-protector, which might be on by default. That switch
+ # requires using the standard libc startup code, which we do not.
+ '-fno-stack-protector',
+ # We don't want to compile it PIC (or its cousin PIE), because
+ # it goes at an absolute address anyway, and because any kind
+ # of PIC complicates life for the x86-32 assembly code. We
+ # append -fno-* flags here instead of using a 'cflags!' stanza
+ # to remove -f* flags, just in case some system's compiler
+ # defaults to using PIC for everything.
+ '-fno-pic', '-fno-PIC',
+ '-fno-pie', '-fno-PIE',
+ ],
+ },
+ {
+ 'target_name': 'nacl_helper_bootstrap_raw',
+ 'type': 'none',
+ 'dependencies': [
+ 'nacl_helper_bootstrap_lib',
+ ],
+ 'actions': [
+ {
+ 'action_name': 'link_with_ld_bfd',
+ 'variables': {
+ 'bootstrap_lib': '<(SHARED_INTERMEDIATE_DIR)/chrome/<(STATIC_LIB_PREFIX)nacl_helper_bootstrap_lib<(STATIC_LIB_SUFFIX)',
+ 'linker_script': 'nacl/nacl_helper_bootstrap_linux.x',
+ },
+ 'inputs': [
+ '<(linker_script)',
+ '<(bootstrap_lib)',
+ '../tools/ld_bfd/ld',
+ ],
+ 'outputs': [
+ '<(PRODUCT_DIR)/nacl_helper_bootstrap_raw',
+ ],
+ 'message': 'Linking nacl_helper_bootstrap_raw',
+ 'conditions': [
+ ['target_arch=="x64"', {
+ 'variables': {
+ 'linker_emulation': 'elf_x86_64',
+ }
+ }],
+ ['target_arch=="ia32"', {
+ 'variables': {
+ 'linker_emulation': 'elf_i386',
+ }
+ }],
+ ['target_arch=="arm"', {
+ 'variables': {
+ 'linker_emulation': 'armelf_linux_eabi',
+ }
+ }],
+ ],
+ 'action': ['../tools/ld_bfd/ld',
+ '-m', '<(linker_emulation)',
+ '--build-id',
+ # This program is (almost) entirely standalone. It
+ # has its own startup code, so no crt1.o for it. It is
+ # statically linked, and on x86 it does not use
+ # libc at all. However, on ARM it needs a few (safe)
+ # things from libc.
+ '-static',
+ # Link with custom linker script for special layout.
+ '--script=<(linker_script)',
+ '-o', '<@(_outputs)',
+ # On x86-64, the default page size with some
+ # linkers is 2M rather than the real Linux page
+ # size of 4K. A larger page size is incompatible
+ # with our custom linker script's special layout.
+ '-z', 'max-page-size=0x1000',
+ '--whole-archive', '<(bootstrap_lib)',
+ '--no-whole-archive',
+ ],
+ }
+ ],
+ },
+ {
+ 'target_name': 'nacl_helper_bootstrap',
+ 'dependencies': [
+ 'nacl_helper_bootstrap_raw',
+ 'nacl_helper_bootstrap_munge_phdr#host',
+ ],
+ 'type': 'none',
+ 'actions': [{
+ 'action_name': 'munge_phdr',
+ 'inputs': ['nacl/nacl_helper_bootstrap_munge_phdr.py',
+ '<(PRODUCT_DIR)/nacl_helper_bootstrap_munge_phdr',
+ '<(PRODUCT_DIR)/nacl_helper_bootstrap_raw'],
+ 'outputs': ['<(PRODUCT_DIR)/nacl_helper_bootstrap'],
+ 'message': 'Munging ELF program header',
+ 'action': ['python', '<@(_inputs)', '<@(_outputs)']
+ }],
+ },
],
- },
+ }],
+ ],
+ }, { # else (disable_nacl==1)
+ 'targets': [
{
- 'target_name': 'nacl_helper_bootstrap',
- 'dependencies': [
- 'nacl_helper_bootstrap_raw',
- 'nacl_helper_bootstrap_munge_phdr#host',
- ],
+ 'target_name': 'nacl',
'type': 'none',
- 'actions': [{
- 'action_name': 'munge_phdr',
- 'inputs': ['nacl/nacl_helper_bootstrap_munge_phdr.py',
- '<(PRODUCT_DIR)/nacl_helper_bootstrap_munge_phdr',
- '<(PRODUCT_DIR)/nacl_helper_bootstrap_raw'],
- 'outputs': ['<(PRODUCT_DIR)/nacl_helper_bootstrap'],
- 'message': 'Munging ELF program header',
- 'action': ['python', '<@(_inputs)', '<@(_outputs)']
- }],
- },
+ 'sources': [],
+ },
],
}],
],