X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;ds=sidebyside;f=m4%2Fbt_python_modules.m4;fp=m4%2Fbt_python_modules.m4;h=e6955fc7079c89668960658ddb0ae180ee44fa40;hb=0235b0db7de5bcacdb3650c92461f2ce5eb2143d;hp=0000000000000000000000000000000000000000;hpb=0f77b5c9dfac44ff6eff8fb66fefadea72846c97;p=babeltrace.git diff --git a/m4/bt_python_modules.m4 b/m4/bt_python_modules.m4 new file mode 100644 index 00000000..e6955fc7 --- /dev/null +++ b/m4/bt_python_modules.m4 @@ -0,0 +1,21 @@ +# SPDX-License-Identifier: FSFULLR +# +# Copyright (C) 2014 Jérémie Galarneau +# +# bt_python_modules.m4 -- Get the Python modules install path + +# While extra Python modules are generaly installed in the Python +# interpreter's "site-packages" directory, Debian prefers using the +# "dist-packages" nomenclature. This macro uses the interpreter +# designated by the PYTHON variable to check the interpreter's PATH +# and sets the PYTHON_MODULES_PATH by taking the prefix into account. + +# AM_PATH_PYTHON_MODULES(PYTHON) +# --------------------------------------------------------------------------- +AC_DEFUN([AM_PATH_PYTHON_MODULES], + [prog="import sys +for path in sys.path: + if path.endswith(\"-packages\"): + print(path[[path.find(\"/lib\"):]]) + break" + PYTHON_MODULES_PATH=`${$1} -c "$prog"`])