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
4 # found in the LICENSE file.
6 # IMPORTANT NOTE: If you make local mods to this file, you must run:
7 # % pnacl/build.sh driver
8 # in order for them to take effect in the scons build. This command
9 # updates the copy in the toolchain/ tree.
13 from driver_env import env
19 # just pass all args through to 'ARGS' and eventually to the underlying tool
20 PATTERNS = [ ( '(.*)', "env.append('ARGS', $0)") ]
28 driver_tools.ParseArgs(argv, PATTERNS)
30 # Note: --plugin must come after the command flags, but before the filename.
31 # (definitely confirmed that it cannot go before the command)
32 # for now assume command is just the very first args
33 args = env.get('ARGS')
35 env.set('COMMAND', command)
36 env.set('ARGS', *args)
37 driver_tools.Run('"${AR}" ${COMMAND} --plugin=${GOLD_PLUGIN_SO} ${ARGS}')
38 # only reached in case of no errors
42 def get_help(unused_argv):
44 Usage: %s [-]{dmpqrstx}[abcDfilMNoPsSTuvV] [member-name] [count] archive-file file...
46 d - delete file(s) from the archive
47 m[ab] - move file(s) in the archive
48 p - print file(s) found in the archive
49 q[f] - quick append file(s) to the archive
50 r[ab][f][u] - replace existing or insert new file(s) into the archive
52 t - display contents of archive
53 x[o] - extract file(s) from the archive
54 command specific modifiers:
55 [a] - put file(s) after [member-name]
56 [b] - put file(s) before [member-name] (same as [i])
57 [D] - use zero for timestamps and uids/gids
58 [N] - use instance [count] of name
59 [f] - truncate inserted file names
60 [P] - use full path names when matching
61 [o] - preserve original dates
62 [u] - only replace files that are newer than current archive contents
64 [c] - do not warn if the library had to be created
65 [s] - create an archive index (cf. ranlib)
66 [S] - do not build a symbol table
67 [T] - make a thin archive
69 [V] - display the version number
70 @<file> - read options from <file>
71 """ % env.getone('SCRIPT_NAME')