Do not use fixed python executable name and use AM_PROG_PYTHON

On many systems now python executable it is python3.
On my system it the case and by this muild 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() nmacro cllows avoide tha by hecks current version of the
python and allw 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 geberate instaleable scripts on duting build process like
it is now in backend/Makefile.am.

Currently minum version of required vesion of the python is python >= 3.
merge-requests/540/head
Your Name 2020-09-13 20:17:43 +01:00
rodzic b89b9b1350
commit 0f7ce3fe7a
2 zmienionych plików z 3 dodań i 2 usunięć

Wyświetl plik

@ -947,10 +947,10 @@ $(srcdir)/pixma/pixma.c: \
$(srcdir)/pixma/pixma_sane_options.h:
@echo Generating $@ from $(@D)/pixma.c
@(cd $(@D); python scripts/pixma_gen_options.py h < pixma.c > $(@F))
@(cd $(@D); $(PYTHON) scripts/pixma_gen_options.py h < pixma.c > $(@F))
$(srcdir)/pixma/pixma_sane_options.c:
@echo Generating $@ from $(@D)/pixma.c
@(cd $(@D); python scripts/pixma_gen_options.py < pixma.c > $(@F))
@(cd $(@D); $(PYTHON) scripts/pixma_gen_options.py < pixma.c > $(@F))
EXTRA_DIST += pixma/pixma_sane_options.c
EXTRA_DIST += pixma/pixma_sane_options.h

Wyświetl plik

@ -36,6 +36,7 @@ dnl ******************************************************************
AC_PROG_CC
AC_PROG_CXX
AM_PROG_CC_C_O
AM_PATH_PYTHON(3)
sane_save_CC=$CC
AC_PROG_CC_C99 dnl enables extensions to ISO C99 :-(
AS_IF([test xno != "x$ac_cv_prog_cc_c99"],