Python bindings: work around Python 3.5 behaviour change
[babeltrace.git] / m4 / python_modules.m4
CommitLineData
33287b16
JG
1# python_modules.m4 -- Get the Python modules install path
2#
3# Copyright (C) 2014 - Jérémie Galarneau <jeremie.galarneau@efficios.com>
4#
5# This file is free software; the Free Software Foundation gives
6# unlimited permission to copy and/or distribute it, with or without
7# modifications, as long as this notice is preserved.
8
9# While extra Python modules are generaly installed in the Python
10# interpreter's "site-packages" directory, Debian prefers using the
11# "dist-packages" nomenclature. This macro uses the interpreter
12# designated by the PYTHON variable to check the interpreter's PATH
13# and sets the PYTHON_MODULES_PATH by taking the prefix into account.
14
15# AM_PATH_PYTHON_MODULES(PYTHON)
16# ---------------------------------------------------------------------------
17AC_DEFUN([AM_PATH_PYTHON_MODULES],
18 [prog="import sys
19for path in sys.path:
20 if path.endswith(\"-packages\"):
21 print(path[[path.find(\"/lib\"):]])
22 break"
23 PYTHON_MODULES_PATH=`${$1} -c "$prog"`])
This page took 0.022963 seconds and 4 git commands to generate.