OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium 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 """Tool for automatically creating .nmf files from .nexe/.pexe/.bc executables. | 6 """Tool for automatically creating .nmf files from .nexe/.pexe/.bc executables. |
7 | 7 |
8 As well as creating the nmf file this tool can also find and stage | 8 As well as creating the nmf file this tool can also find and stage |
9 any shared libraries dependencies that the executables might have. | 9 any shared libraries dependencies that the executables might have. |
10 """ | 10 """ |
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 parser.add_argument('-D', '--objdump', dest='objdump', | 563 parser.add_argument('-D', '--objdump', dest='objdump', |
564 help='Override the default "objdump" tool used to find ' | 564 help='Override the default "objdump" tool used to find ' |
565 'shared object dependencies', | 565 'shared object dependencies', |
566 metavar='TOOL') | 566 metavar='TOOL') |
567 parser.add_argument('--no-default-libpath', action='store_true', | 567 parser.add_argument('--no-default-libpath', action='store_true', |
568 help="Don't include the SDK default library paths") | 568 help="Don't include the SDK default library paths") |
569 parser.add_argument('--debug-libs', action='store_true', | 569 parser.add_argument('--debug-libs', action='store_true', |
570 help='Legacy option, do not use') | 570 help='Legacy option, do not use') |
571 parser.add_argument('--config', default='Release', | 571 parser.add_argument('--config', default='Release', |
572 help='Use a particular library configuration (normally ' | 572 help='Use a particular library configuration (normally ' |
573 'Debug or Release') | 573 'Debug or Release)') |
574 parser.add_argument('-L', '--library-path', dest='lib_path', | 574 parser.add_argument('-L', '--library-path', dest='lib_path', |
575 action='append', default=[], | 575 action='append', default=[], |
576 help='Add DIRECTORY to library search path', | 576 help='Add DIRECTORY to library search path', |
577 metavar='DIRECTORY') | 577 metavar='DIRECTORY') |
578 parser.add_argument('-P', '--path-prefix', dest='path_prefix', default='', | 578 parser.add_argument('-P', '--path-prefix', dest='path_prefix', default='', |
579 help='Deprecated. An alias for --lib-prefix.', | 579 help='Deprecated. An alias for --lib-prefix.', |
580 metavar='DIRECTORY') | 580 metavar='DIRECTORY') |
581 parser.add_argument('-p', '--lib-prefix', dest='lib_prefix', default='', | 581 parser.add_argument('-p', '--lib-prefix', dest='lib_prefix', default='', |
582 help='A path to prepend to shared libraries in the .nmf', | 582 help='A path to prepend to shared libraries in the .nmf', |
583 metavar='DIRECTORY') | 583 metavar='DIRECTORY') |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
625 if options.verbose: | 625 if options.verbose: |
626 Trace.verbose = True | 626 Trace.verbose = True |
627 if options.debug_mode: | 627 if options.debug_mode: |
628 DebugPrint.debug_mode = True | 628 DebugPrint.debug_mode = True |
629 | 629 |
630 if options.toolchain is not None: | 630 if options.toolchain is not None: |
631 sys.stderr.write('warning: option -t/--toolchain is deprecated.\n') | 631 sys.stderr.write('warning: option -t/--toolchain is deprecated.\n') |
632 if options.debug_libs: | 632 if options.debug_libs: |
633 sys.stderr.write('warning: --debug-libs is deprecated (use --config).\n') | 633 sys.stderr.write('warning: --debug-libs is deprecated (use --config).\n') |
634 # Implement legacy behavior | 634 # Implement legacy behavior |
635 if not options.config: | 635 options.config = 'Debug' |
636 options.config = 'Debug' | |
637 | 636 |
638 canonicalized = ParseExtraFiles(options.extra_files, sys.stderr) | 637 canonicalized = ParseExtraFiles(options.extra_files, sys.stderr) |
639 if canonicalized is None: | 638 if canonicalized is None: |
640 parser.error('Bad --extra-files (-x) argument syntax') | 639 parser.error('Bad --extra-files (-x) argument syntax') |
641 | 640 |
642 remap = {} | 641 remap = {} |
643 for ren in options.name: | 642 for ren in options.name: |
644 parts = ren.split(',') | 643 parts = ren.split(',') |
645 if len(parts) != 2: | 644 if len(parts) != 2: |
646 parser.error('Expecting --name=<orig_arch.so>,<new_name.so>') | 645 parser.error('Expecting --name=<orig_arch.so>,<new_name.so>') |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
705 if __name__ == '__main__': | 704 if __name__ == '__main__': |
706 try: | 705 try: |
707 rtn = main(sys.argv[1:]) | 706 rtn = main(sys.argv[1:]) |
708 except Error, e: | 707 except Error, e: |
709 sys.stderr.write('%s: %s\n' % (os.path.basename(__file__), e)) | 708 sys.stderr.write('%s: %s\n' % (os.path.basename(__file__), e)) |
710 rtn = 1 | 709 rtn = 1 |
711 except KeyboardInterrupt: | 710 except KeyboardInterrupt: |
712 sys.stderr.write('%s: interrupted\n' % os.path.basename(__file__)) | 711 sys.stderr.write('%s: interrupted\n' % os.path.basename(__file__)) |
713 rtn = 1 | 712 rtn = 1 |
714 sys.exit(rtn) | 713 sys.exit(rtn) |
OLD | NEW |