| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. | 2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 from optparse import OptionParser | 6 from optparse import OptionParser |
| 7 import os | 7 import os |
| 8 import subprocess | 8 import subprocess |
| 9 import sys | 9 import sys |
| 10 import tempfile | 10 import tempfile |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 define.startswith('NACL_OSX=') or | 221 define.startswith('NACL_OSX=') or |
| 222 define.startswith('NACL_LINUX=') or | 222 define.startswith('NACL_LINUX=') or |
| 223 define == 'COMPONENT_BUILD' or | 223 define == 'COMPONENT_BUILD' or |
| 224 'WIN32' in define or | 224 'WIN32' in define or |
| 225 'WINDOWS' in define or | 225 'WINDOWS' in define or |
| 226 'WINVER' in define)] | 226 'WINVER' in define)] |
| 227 define_list.extend(['NACL_WINDOWS=0', | 227 define_list.extend(['NACL_WINDOWS=0', |
| 228 'NACL_OSX=0', | 228 'NACL_OSX=0', |
| 229 'NACL_LINUX=0']) | 229 'NACL_LINUX=0']) |
| 230 options += ['-D' + define for define in define_list] | 230 options += ['-D' + define for define in define_list] |
| 231 # TODO(mseaborn): Enable -Werror for ARM/PNaCl when warnings in | |
| 232 # Chromium's PPAPI proxy have been fixed, and move -Werror to | |
| 233 # untrusted.gypi. | |
| 234 # See http://code.google.com/p/nativeclient/issues/detail?id=3108 | |
| 235 if self.mainarch == 'x86': | |
| 236 options.append('-Werror') | |
| 237 self.compile_options = options + ['-I' + name for name in self.inc_paths] | 231 self.compile_options = options + ['-I' + name for name in self.inc_paths] |
| 238 | 232 |
| 239 def BuildLinkOptions(self, options): | 233 def BuildLinkOptions(self, options): |
| 240 """Generates link options, called once by __init__.""" | 234 """Generates link options, called once by __init__.""" |
| 241 options = ArgToList(options) | 235 options = ArgToList(options) |
| 242 if self.outtype == 'nso': | 236 if self.outtype == 'nso': |
| 243 options += ['-Wl,-rpath-link,' + name for name in self.lib_paths] | 237 options += ['-Wl,-rpath-link,' + name for name in self.lib_paths] |
| 244 options += ['-shared'] | 238 options += ['-shared'] |
| 245 options += ['-Wl,-soname,' + os.path.basename(self.name)] | 239 options += ['-Wl,-soname,' + os.path.basename(self.name)] |
| 246 self.link_options = options + ['-L' + name for name in self.lib_paths] | 240 self.link_options = options + ['-L' + name for name in self.lib_paths] |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 582 out = build.Compile(filename) | 576 out = build.Compile(filename) |
| 583 if out: | 577 if out: |
| 584 objs.append(out) | 578 objs.append(out) |
| 585 # Do not link if building an object | 579 # Do not link if building an object |
| 586 if not options.compile_only: | 580 if not options.compile_only: |
| 587 build.Generate(objs) | 581 build.Generate(objs) |
| 588 return 0 | 582 return 0 |
| 589 | 583 |
| 590 if __name__ == '__main__': | 584 if __name__ == '__main__': |
| 591 sys.exit(Main(sys.argv)) | 585 sys.exit(Main(sys.argv)) |
| OLD | NEW |