Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / native_client / pnacl / driver / pnacl-ranlib.py
1 #!/usr/bin/python
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.
5
6 from driver_tools import Run, ParseArgs
7 from driver_env import env
8
9 EXTRA_ENV = { 'ARGS': '' }
10 # just pass all args through to 'ARGS' and eventually to the underlying tool
11 PATTERNS = [ ( '(.*)',  "env.append('ARGS', $0)") ]
12
13 def main(argv):
14   if len(argv) == 0:
15     print get_help(argv)
16     return 1
17
18   env.update(EXTRA_ENV)
19   ParseArgs(argv, PATTERNS)
20   Run('"${RANLIB}" --plugin=${GOLD_PLUGIN_SO} ${ARGS}')
21   # only reached in case of no errors
22   return 0
23
24 def get_help(unused_argv):
25   return """
26 Usage: %s [options] archive
27  Generate an index to speed access to archives
28  The options are:
29   @<file>                      Read options from <file>
30   -t                           Update the archive's symbol map timestamp
31   -h --help                    Print this help message
32   -v --version                 Print version information
33 """ % env.getone('SCRIPT_NAME')