Move to kernel style SPDX license identifiers
[babeltrace.git] / m4 / bt_python_modules.m4
diff --git a/m4/bt_python_modules.m4 b/m4/bt_python_modules.m4
new file mode 100644 (file)
index 0000000..e6955fc
--- /dev/null
@@ -0,0 +1,21 @@
+# SPDX-License-Identifier: FSFULLR
+#
+# Copyright (C) 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+#
+# 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"`])
This page took 0.022697 seconds and 4 git commands to generate.