Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1016)

Unified Diff: native_client_sdk/src/tools/create_nmf.py

Issue 10539082: Add DSC files for the various examples. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: native_client_sdk/src/tools/create_nmf.py
===================================================================
--- native_client_sdk/src/tools/create_nmf.py (revision 141376)
+++ native_client_sdk/src/tools/create_nmf.py (working copy)
@@ -94,7 +94,7 @@
def __init__(self, main_files=None, objdump='x86_64-nacl-objdump',
lib_path=None, extra_files=None, lib_prefix=None,
- toolchain=None):
+ toolchain=None, remap={}):
''' Constructor
Args:
@@ -107,7 +107,9 @@
both for staging the libraries and for inclusion into the nmf file.
Examples: ['..'], ['lib_dir']
toolchain: Specify which toolchain newlib|glibc|pnacl which can require
- different forms of the NMF.'''
+ different forms of the NMF.
+ remap: Remaps the library name in the manifest.
+ '''
self.objdump = objdump
self.main_files = main_files or []
self.extra_files = extra_files or []
@@ -116,6 +118,7 @@
self.needed = None
self.lib_prefix = lib_prefix or []
self.toolchain = toolchain
+ self.remap = remap
def GleanFromObjdump(self, files):
@@ -279,9 +282,12 @@
# Otherwise, treat it like another another file named main.nexe.
name = MAIN_NEXE
+ name = self.remap.get(name, name)
fileinfo = manifest[FILES_KEY].get(name, {})
fileinfo[archinfo.arch] = urlinfo
manifest[FILES_KEY][name] = fileinfo
+ print 'need=' + str(need)
binji 2012/06/11 20:22:29 debug spew?
noelallen1 2012/06/11 20:34:38 Done.
+ print 'name=' + str(name)
self.manifest = manifest
def GetManifest(self):
@@ -340,6 +346,9 @@
parser.add_option('-t', '--toolchain', dest='toolchain',
help='Add DIRECTORY to library search path',
default=None, metavar='TOOLCHAIN')
+ parser.add_option('-n', '--name', dest='name',
+ help='Rename FOO as BAR',
+ action='append', default=[], metavar='FOO,BAR')
(options, args) = parser.parse_args(argv)
if not options.toolchain:
@@ -352,10 +361,18 @@
parser.print_usage()
sys.exit(1)
+ remap = {}
+ for ren in options.name:
+ parts = ren.split(',')
+ if len(parts) != 2:
+ ErrorOut('Expecting --name=<orig_arch.so>,<new_name.so>')
+ remap[parts[0]] = parts[1]
+
nmf = NmfUtils(objdump=options.objdump,
main_files=args,
lib_path=options.lib_path,
- toolchain=options.toolchain)
+ toolchain=options.toolchain,
+ remap=remap)
manifest = nmf.GetManifest()
if options.output is None:

Powered by Google App Engine
This is Rietveld 408576698