configure.ac: refine Python 3 interpreter and dev. libraries detection
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Mon, 29 Jul 2019 19:32:08 +0000 (15:32 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 31 Jul 2019 21:18:07 +0000 (17:18 -0400)
commit419fff0b17e4e304f5a831115cfbcdb85ec34056
tree8352ee740308aec9b280503d0d31bd6a8c3db399
parentbf7fe79ff0134fdcc2ae58427d4cce7190d5dbc1
configure.ac: refine Python 3 interpreter and dev. libraries detection

This patch refines how the `configure` script detects the Python 3
interpreter and development libraries.

The goal is to clean up this part of `configure.ac` and to make the
Python 3 interpreter available as a general tool for testing, even
without building the Python bindings or the Python plugin provider.

Before this patch, `configure` ensures that the Python interpreter and
the development libraries exist and are valid if you use the
`--enable-python-bindings` or `--enable-python-plugins` option.

With this patch, `configure` always tries to find the Python
interpreter. If it finds it, it sets the local `have_python` shell
variable and defines the `HAVE_PYTHON` Automake definition.

If `configure` finds the Python interpreter, it always tries to find
`python-config`. It if finds it, it sets the local `have_python_dev`
shell variable and defines the `HAVE_PYTHON_DEV` Automake definition.
You can still override the include directories and linker flags with the
`PYTHON_INCLUDE` and `PYTHON_LDFLAGS` environment variables.

Now, if you specify the `--enable-python-bindings` or
`--enable-python-plugins` option, `$have_python_dev` must be `yes`.

What used to be `HAVE_PYTHON` (Automake definition) is renamed to
`ENABLE_PYTHON_COMMON_DEPS`: this is defined if we need to build any
common Python dependency. As of this patch, the only one is the internal
`py-common` convenience library.

In the final `configure` report, I added:

* Whether or not the Python interpreter was found and its path.
* Whether or not the `python-config` program (called "development
  libraries") was found and its path.

This patch was only tested manually, locally removing the Python
interpreter, the `python-config` program, and passing the
`--enable-python-bindings` or `--enable-python-plugins` option to test
the different `configure` paths.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: Id0ac60ebc97a9ce2951aee713eccdc24c19d3791
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1799
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Michael Jeanson <mjeanson@efficios.com>
configure.ac
src/py-common/Makefile.am
This page took 0.024429 seconds and 4 git commands to generate.