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 """NEXE building script | 6 """NEXE building script |
7 | 7 |
8 This module will take a set of source files, include paths, library paths, and | 8 This module will take a set of source files, include paths, library paths, and |
9 additional arguments, and use them to build. | 9 additional arguments, and use them to build. |
10 """ | 10 """ |
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
577 filename, outd)) | 577 filename, outd)) |
578 return True | 578 return True |
579 return False | 579 return False |
580 | 580 |
581 def Compile(self, src): | 581 def Compile(self, src): |
582 """Compile the source with pre-determined options.""" | 582 """Compile the source with pre-determined options.""" |
583 | 583 |
584 _, ext = os.path.splitext(src) | 584 _, ext = os.path.splitext(src) |
585 if ext in ['.c', '.S']: | 585 if ext in ['.c', '.S']: |
586 bin_name = self.GetCCompiler() | 586 bin_name = self.GetCCompiler() |
587 extra = ['-std=gnu99'] | 587 extra = ['-std=gnu99', '-Wstrict-prototypes'] |
588 if self.is_pnacl_toolchain and ext == '.S': | 588 if self.is_pnacl_toolchain and ext == '.S': |
589 extra.append('-arch') | 589 extra.append('-arch') |
590 extra.append(self.arch) | 590 extra.append(self.arch) |
591 elif ext in ['.cc', '.cpp']: | 591 elif ext in ['.cc', '.cpp']: |
592 bin_name = self.GetCXXCompiler() | 592 bin_name = self.GetCXXCompiler() |
593 extra = [] | 593 extra = [] |
594 else: | 594 else: |
595 if ext != '.h': | 595 if ext != '.h': |
596 self.Log('Skipping unknown type %s for %s.' % (ext, src)) | 596 self.Log('Skipping unknown type %s for %s.' % (ext, src)) |
597 return None | 597 return None |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1014 shutil.copy(objs[0], options.name) | 1014 shutil.copy(objs[0], options.name) |
1015 else: | 1015 else: |
1016 build.Generate(objs) | 1016 build.Generate(objs) |
1017 return 0 | 1017 return 0 |
1018 except Error as e: | 1018 except Error as e: |
1019 sys.stderr.write('%s\n' % e) | 1019 sys.stderr.write('%s\n' % e) |
1020 return 1 | 1020 return 1 |
1021 | 1021 |
1022 if __name__ == '__main__': | 1022 if __name__ == '__main__': |
1023 sys.exit(Main(sys.argv)) | 1023 sys.exit(Main(sys.argv)) |
OLD | NEW |