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