1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
11 """Command line utility to retrieve compilation options for python modules'
13 parser
= argparse
.ArgumentParser(
14 description
='Retrieves compilation options for python modules.')
15 parser
.add_argument('--libraries', help='Returns libraries',
17 parser
.add_argument('--includes', help='Returns includes',
19 parser
.add_argument('--library_dirs', help='Returns library_dirs',
21 opts
= parser
.parse_args()
26 python_lib
= sysconfig
.get_config_var('LDLIBRARY')
27 if python_lib
.endswith(".so"):
28 python_lib
= python_lib
[:-3]
29 if python_lib
.startswith("lib"):
30 python_lib
= python_lib
[3:]
32 result
.append(python_lib
)
35 result
.append(sysconfig
.get_config_var('INCLUDEPY'))
38 result
.append(sysconfig
.get_config_var('BINLIBDEST'))
43 if __name__
== '__main__':