Skip to content

Do not use fixed python executable name and use AM_PROG_PYTHON

Tomasz Kłoczko requested to merge kloczek/backends:master into master

On many systems now python executable it is python3. On my system it the case and by this build failed with:

make[2]: Leaving directory '/home/tkloczko/rpmbuild/BUILD/backends-1.0.31/backend'
make[2]: Entering directory '/home/tkloczko/rpmbuild/BUILD/backends-1.0.31/backend'
Generating pixma/pixma_sane_options.h from pixma/pixma.c
/bin/sh: python: command not found
make[2]: *** [Makefile:7317: pixma/pixma_sane_options.h] Error 127
make[2]: Leaving directory '/home/tkloczko/rpmbuild/BUILD/backends-1.0.31/backend'
make[2]: *** Waiting for unfinished jobs....

Using AM_PROG_PYTHON() macro allows avoid that by checks current version of the python and allow to use custom python executable by execute configure by:

$ PYTHON=</some/python> ./configure <params>

AM_PROG_PYTHON aclocal macro propagates to automake files $(PYTHON) variable which could be used on generate installable scripts on during build process like it is now in backend/Makefile.am.

Currently minimum version of required version of the python is python >= 3.

Edited by Tomasz Kłoczko

Merge request reports