Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 1 | # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 | # Use of this source code is governed by a BSD-style license that can be |
| 3 | # found in the LICENSE file. |
| 4 | |
| 5 | { |
| 6 | 'includes': [ |
| 7 | '../native_client/build/untrusted.gypi', |
| 8 | ], |
| 9 | 'target_defaults': { |
| 10 | # We need to override the variables in untrusted.gypi outside of a |
| 11 | # target_condition block because the target_condition block in |
| 12 | # untrusted gypi is fully evaluated and interpolated before any of the |
| 13 | # target_condition blocks in this file are expanded. This means that any |
| 14 | # variables overriden inside a target_condition block in this file will not |
| 15 | # affect the values in untrusted.gypi. |
| 16 | 'variables': { |
| 17 | 'test_files': [], |
| 18 | 'generate_nmf%': 1, |
| 19 | 'nacl_newlib_out_dir': '<(PRODUCT_DIR)/>(nexe_destination_dir)/newlib', |
| 20 | 'nacl_glibc_out_dir': '<(PRODUCT_DIR)/>(nexe_destination_dir)/glibc', |
| 21 | 'nacl_pnacl_newlib_out_dir': '<(PRODUCT_DIR)/>(nexe_destination_dir)/pnacl', |
Torne (Richard Coles) | 010d83a | 2014-05-14 12:12:37 +0100 | [diff] [blame] | 22 | 'nacl_pnacl_newlib_nonsfi_out_dir': '<(PRODUCT_DIR)/>(nexe_destination_dir)/nonsfi', |
Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 23 | 'target_conditions': [ |
| 24 | ['nexe_target!=""', { |
| 25 | # These variables are used for nexe building and for library building. |
| 26 | 'out_newlib32%': '>(nacl_newlib_out_dir)/>(nexe_target)_newlib_x86_32.nexe', |
| 27 | 'out_newlib64%': '>(nacl_newlib_out_dir)/>(nexe_target)_newlib_x86_64.nexe', |
| 28 | 'out_newlib_arm%': '>(nacl_newlib_out_dir)/>(nexe_target)_newlib_arm.nexe', |
Ben Murdoch | c5cede9 | 2014-04-10 11:22:14 +0100 | [diff] [blame] | 29 | 'out_newlib_mips%': '>(nacl_newlib_out_dir)/>(nexe_target)_newlib_mips32.nexe', |
Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 30 | 'nmf_newlib%': '>(nacl_newlib_out_dir)/>(nexe_target).nmf', |
| 31 | 'out_glibc32%': '>(nacl_glibc_out_dir)/>(nexe_target)_glibc_x86_32.nexe', |
| 32 | 'out_glibc64%': '>(nacl_glibc_out_dir)/>(nexe_target)_glibc_x86_64.nexe', |
| 33 | 'out_glibc_arm%': '>(nacl_glibc_out_dir)/>(nexe_target)_glibc_arm.nexe', |
| 34 | 'nmf_glibc%': '>(nacl_glibc_out_dir)/>(nexe_target).nmf', |
| 35 | 'out_pnacl_newlib%': '>(nacl_pnacl_newlib_out_dir)/>(nexe_target)_newlib_pnacl.pexe', |
| 36 | 'nmf_pnacl_newlib%': '>(nacl_pnacl_newlib_out_dir)/>(nexe_target).nmf', |
Torne (Richard Coles) | 010d83a | 2014-05-14 12:12:37 +0100 | [diff] [blame] | 37 | 'out_pnacl_newlib_x86_32_nonsfi_nexe': '>(nacl_pnacl_newlib_nonsfi_out_dir)/>(nexe_target)_pnacl_newlib_x32_nonsfi.nexe', |
Torne (Richard Coles) | cedac22 | 2014-06-03 10:58:34 +0100 | [diff] [blame^] | 38 | 'nmf_pnacl_newlib_nonsfi%': '>(nacl_pnacl_newlib_nonsfi_out_dir)/>(nexe_target).nmf', |
Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 39 | }], |
| 40 | ], |
| 41 | }, |
| 42 | 'dependencies': [ |
| 43 | '<(DEPTH)/native_client/src/untrusted/nacl/nacl.gyp:nacl_lib', |
Torne (Richard Coles) | a140131 | 2014-03-18 10:20:56 +0000 | [diff] [blame] | 44 | '<(DEPTH)/ppapi/ppapi_nacl.gyp:ppapi_cpp_lib', |
Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 45 | '<(DEPTH)/ppapi/native_client/native_client.gyp:ppapi_lib', |
| 46 | ], |
| 47 | 'target_conditions': [ |
| 48 | ['test_files!=[] and build_newlib==1', { |
| 49 | 'copies': [ |
| 50 | { |
| 51 | 'destination': '>(nacl_newlib_out_dir)', |
| 52 | 'files': [ |
| 53 | '>@(test_files)', |
| 54 | ], |
| 55 | }, |
| 56 | ], |
| 57 | }], |
Ben Murdoch | c5cede9 | 2014-04-10 11:22:14 +0100 | [diff] [blame] | 58 | ['test_files!=[] and "<(target_arch)"!="arm" and "<(target_arch)"!="mipsel" and disable_glibc==0 and build_glibc==1', { |
Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 59 | 'copies': [ |
| 60 | { |
| 61 | 'destination': '>(nacl_glibc_out_dir)', |
| 62 | 'files': [ |
| 63 | '>@(test_files)', |
| 64 | ], |
| 65 | }, |
| 66 | ], |
| 67 | }], |
Torne (Richard Coles) | cedac22 | 2014-06-03 10:58:34 +0100 | [diff] [blame^] | 68 | # Nonsfi pnacl copy is covered below. |
| 69 | ['test_files!=[] and build_pnacl_newlib==1 and disable_pnacl==0', { |
Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 70 | 'copies': [ |
| 71 | { |
| 72 | 'destination': '>(nacl_pnacl_newlib_out_dir)', |
| 73 | 'files': [ |
| 74 | '>@(test_files)', |
| 75 | ], |
| 76 | }, |
| 77 | ], |
| 78 | }], |
Torne (Richard Coles) | 010d83a | 2014-05-14 12:12:37 +0100 | [diff] [blame] | 79 | ['test_files!=[] and build_pnacl_newlib==1 and enable_x86_32_nonsfi==1', { |
| 80 | 'copies': [ |
| 81 | { |
| 82 | 'destination': '>(nacl_pnacl_newlib_nonsfi_out_dir)', |
| 83 | 'files': [ |
| 84 | '>@(test_files)', |
| 85 | ], |
| 86 | }, |
| 87 | ], |
| 88 | }], |
Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 89 | ['nexe_target!=""', { |
| 90 | 'variables': { |
| 91 | # Patch over the fact that untrusted.gypi doesn't define these in all |
| 92 | # cases. |
| 93 | 'enable_x86_64%': 0, |
| 94 | 'enable_x86_32%': 0, |
| 95 | 'enable_arm%': 0, |
Ben Murdoch | c5cede9 | 2014-04-10 11:22:14 +0100 | [diff] [blame] | 96 | 'enable_mips%': 0, |
Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 97 | 'include_dirs': [ |
| 98 | '<(DEPTH)', |
| 99 | ], |
| 100 | 'link_flags': [ |
| 101 | '-lppapi_cpp', |
| 102 | '-lppapi', |
| 103 | '-pthread', |
| 104 | ], |
| 105 | 'extra_args': [ |
| 106 | '--strip-all', |
| 107 | ], |
Torne (Richard Coles) | 5d1f7b1 | 2014-02-21 12:16:55 +0000 | [diff] [blame] | 108 | 'create_nmf': '<(DEPTH)/native_client_sdk/src/tools/create_nmf.py', |
| 109 | 'create_nmf_args_portable%': [], |
Torne (Richard Coles) | cedac22 | 2014-06-03 10:58:34 +0100 | [diff] [blame^] | 110 | 'create_nonsfi_test_nmf': '<(DEPTH)/ppapi/tests/create_nonsfi_test_nmf.py', |
Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 111 | }, |
| 112 | 'target_conditions': [ |
| 113 | ['generate_nmf==1 and build_newlib==1', { |
| 114 | 'actions': [ |
| 115 | { |
| 116 | 'action_name': 'Generate NEWLIB NMF', |
Torne (Richard Coles) | 5d1f7b1 | 2014-02-21 12:16:55 +0000 | [diff] [blame] | 117 | 'inputs': ['>(create_nmf)'], |
Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 118 | 'outputs': ['>(nmf_newlib)'], |
| 119 | 'action': [ |
| 120 | 'python', |
Torne (Richard Coles) | 5d1f7b1 | 2014-02-21 12:16:55 +0000 | [diff] [blame] | 121 | '>(create_nmf)', |
Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 122 | '--output=>(nmf_newlib)', |
Torne (Richard Coles) | 5d1f7b1 | 2014-02-21 12:16:55 +0000 | [diff] [blame] | 123 | '>@(create_nmf_args_portable)', |
Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 124 | ], |
| 125 | 'target_conditions': [ |
| 126 | ['enable_x86_64==1', { |
| 127 | 'inputs': ['>(out_newlib64)'], |
Torne (Richard Coles) | 5d1f7b1 | 2014-02-21 12:16:55 +0000 | [diff] [blame] | 128 | 'action': ['>(out_newlib64)'], |
Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 129 | }], |
| 130 | ['enable_x86_32==1', { |
| 131 | 'inputs': ['>(out_newlib32)'], |
Torne (Richard Coles) | 5d1f7b1 | 2014-02-21 12:16:55 +0000 | [diff] [blame] | 132 | 'action': ['>(out_newlib32)'], |
Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 133 | }], |
| 134 | ['enable_arm==1', { |
| 135 | 'inputs': ['>(out_newlib_arm)'], |
Torne (Richard Coles) | 5d1f7b1 | 2014-02-21 12:16:55 +0000 | [diff] [blame] | 136 | 'action': ['>(out_newlib_arm)'], |
Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 137 | }], |
Ben Murdoch | c5cede9 | 2014-04-10 11:22:14 +0100 | [diff] [blame] | 138 | ['enable_mips==1', { |
| 139 | 'inputs': ['>(out_newlib_mips)'], |
| 140 | 'action': ['>(out_newlib_mips)'], |
| 141 | }], |
Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 142 | ], |
| 143 | }, |
| 144 | ], |
| 145 | }], |
Ben Murdoch | c5cede9 | 2014-04-10 11:22:14 +0100 | [diff] [blame] | 146 | ['"<(target_arch)"!="arm" and "<(target_arch)"!="mipsel" and generate_nmf==1 and disable_glibc==0 and build_glibc==1', { |
Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 147 | 'variables': { |
| 148 | # NOTE: Use /lib, not /lib64 here; it is a symbolic link which |
| 149 | # doesn't work on Windows. |
| 150 | 'libdir_glibc64': '>(nacl_glibc_tc_root)/x86_64-nacl/lib', |
| 151 | 'libdir_glibc32': '>(nacl_glibc_tc_root)/x86_64-nacl/lib32', |
| 152 | 'nacl_objdump': '>(nacl_glibc_tc_root)/bin/x86_64-nacl-objdump', |
| 153 | }, |
| 154 | 'actions': [ |
| 155 | { |
| 156 | 'action_name': 'Generate GLIBC NMF and copy libs', |
Torne (Richard Coles) | 5d1f7b1 | 2014-02-21 12:16:55 +0000 | [diff] [blame] | 157 | 'inputs': ['>(create_nmf)'], |
Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 158 | # NOTE: There is no explicit dependency for the lib32 |
| 159 | # and lib64 directories created in the PRODUCT_DIR. |
| 160 | # They are created as a side-effect of NMF creation. |
| 161 | 'outputs': ['>(nmf_glibc)'], |
| 162 | 'action': [ |
| 163 | 'python', |
Torne (Richard Coles) | 5d1f7b1 | 2014-02-21 12:16:55 +0000 | [diff] [blame] | 164 | '>(create_nmf)', |
Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 165 | '--objdump=>(nacl_objdump)', |
| 166 | '--output=>(nmf_glibc)', |
| 167 | '--path-prefix=>(nexe_target)_libs', |
| 168 | '--stage-dependencies=<(nacl_glibc_out_dir)', |
Torne (Richard Coles) | 5d1f7b1 | 2014-02-21 12:16:55 +0000 | [diff] [blame] | 169 | '>@(create_nmf_args_portable)', |
Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 170 | ], |
| 171 | 'target_conditions': [ |
| 172 | ['enable_x86_64==1', { |
| 173 | 'inputs': ['>(out_glibc64)'], |
| 174 | 'action': [ |
Torne (Richard Coles) | 5d1f7b1 | 2014-02-21 12:16:55 +0000 | [diff] [blame] | 175 | '>(out_glibc64)', |
Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 176 | '--library-path=>(libdir_glibc64)', |
Torne (Richard Coles) | a36e592 | 2013-08-05 13:57:33 +0100 | [diff] [blame] | 177 | '--library-path=>(tc_lib_dir_glibc64)', |
Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 178 | ], |
| 179 | }], |
| 180 | ['enable_x86_32==1', { |
| 181 | 'inputs': ['>(out_glibc32)'], |
| 182 | 'action': [ |
Torne (Richard Coles) | 5d1f7b1 | 2014-02-21 12:16:55 +0000 | [diff] [blame] | 183 | '>(out_glibc32)', |
Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 184 | '--library-path=>(libdir_glibc32)', |
Torne (Richard Coles) | a36e592 | 2013-08-05 13:57:33 +0100 | [diff] [blame] | 185 | '--library-path=>(tc_lib_dir_glibc32)', |
Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 186 | ], |
| 187 | }], |
| 188 | # TODO(ncbray) handle arm case. We don't have ARM glibc yet. |
| 189 | ], |
| 190 | }, |
| 191 | ], |
| 192 | }], |
| 193 | ['generate_nmf==1 and build_pnacl_newlib==1 and disable_pnacl==0', { |
| 194 | 'actions': [ |
| 195 | { |
| 196 | 'action_name': 'Generate PNACL NEWLIB NMF', |
Torne (Richard Coles) | 5d1f7b1 | 2014-02-21 12:16:55 +0000 | [diff] [blame] | 197 | # NOTE: create_nmf must be first, it is the script python |
| 198 | # executes below. |
| 199 | 'inputs': ['>(create_nmf)', '>(out_pnacl_newlib)'], |
Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 200 | 'outputs': ['>(nmf_pnacl_newlib)'], |
| 201 | 'action': [ |
| 202 | 'python', |
Torne (Richard Coles) | 5d1f7b1 | 2014-02-21 12:16:55 +0000 | [diff] [blame] | 203 | '>(create_nmf)', |
Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 204 | '--output=>(nmf_pnacl_newlib)', |
Torne (Richard Coles) | 5d1f7b1 | 2014-02-21 12:16:55 +0000 | [diff] [blame] | 205 | '>(out_pnacl_newlib)', |
| 206 | '>@(create_nmf_args_portable)', |
Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 207 | ], |
| 208 | }, |
| 209 | ], |
| 210 | }], |
Torne (Richard Coles) | cedac22 | 2014-06-03 10:58:34 +0100 | [diff] [blame^] | 211 | ['generate_nmf==1 and build_pnacl_newlib==1 and disable_pnacl==0 and enable_x86_32_nonsfi==1', { |
| 212 | 'actions': [ |
| 213 | { |
| 214 | 'action_name': 'Generate PNACL NEWLIB nonsfi NMF', |
| 215 | # If we add support for ARM, we should split the dependency on |
| 216 | # out_pnacl_newlib_x86_32_nonsfi_nexe to 'target_conditions', |
| 217 | # similar to build_newlib=1 config declared above. |
| 218 | 'inputs': ['>(create_nonsfi_test_nmf)', |
| 219 | '>(out_pnacl_newlib_x86_32_nonsfi_nexe)'], |
| 220 | 'outputs': ['>(nmf_pnacl_newlib_nonsfi)'], |
| 221 | 'action': [ |
| 222 | 'python', |
| 223 | '>(create_nonsfi_test_nmf)', |
| 224 | '--output=>(nmf_pnacl_newlib_nonsfi)', |
| 225 | '--program=>(out_pnacl_newlib_x86_32_nonsfi_nexe)', |
| 226 | '>@(create_nmf_args_portable)' |
| 227 | ], |
| 228 | }, |
| 229 | ], |
| 230 | }], |
Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 231 | ], |
| 232 | }], |
| 233 | ], |
| 234 | }, |
| 235 | } |