From 111e9d54c1c5bd57d65d09549831cb6c4a37f530 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Wed, 4 Jul 2018 09:55:52 -0700 Subject: [PATCH] Make python interpreter used to run gentpl.py configurable gentpl.py is python2/3-agnostic, but there's no way to cause it to be run with any interpreter other than 'python', it's just hard-coded into Makefile.common that way. Adjust that to allow a make variable PYTHONBIN to be set to the desired interpreter. This will make it easier in situations where we specifically want to build with 'python2' or 'python3' or whatever. Signed-off-by: Adam Williamson --- conf/Makefile.common | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/conf/Makefile.common b/conf/Makefile.common index 311da61c6..a6e05cd91 100644 --- a/conf/Makefile.common +++ b/conf/Makefile.common @@ -5,6 +5,9 @@ CFLAGS_PLATFORM= export LC_COLLATE := C unexport LC_ALL +# default python is 'python', can be overridden +PYTHONBIN = python + # Platform specific options if COND_sparc64_ieee1275 LDFLAGS_PLATFORM = -Wl,-melf64_sparc @@ -128,11 +131,11 @@ BUILT_SOURCES = .PRECIOUS: $(top_srcdir)/Makefile.util.am $(top_srcdir)/Makefile.util.am: $(top_srcdir)/gentpl.py $(top_srcdir)/Makefile.util.def $(top_srcdir)/Makefile.utilgcry.def - python $^ > address@hidden || (rm -f address@hidden; exit 1) + $(PYTHONBIN) $^ > address@hidden || (rm -f address@hidden; exit 1) mv address@hidden $@ .PRECIOUS: $(top_srcdir)/grub-core/Makefile.core.am $(top_srcdir)/grub-core/Makefile.core.am: $(top_srcdir)/gentpl.py $(top_srcdir)/grub-core/Makefile.core.def $(top_srcdir)/grub-core/Makefile.gcry.def if [ "x$$GRUB_CONTRIB" != x ]; then echo "You need to run ./autogen.sh manually." >&2; exit 1; fi - python $^ > address@hidden || (rm -f address@hidden; exit 1) + $(PYTHONBIN) $^ > address@hidden || (rm -f address@hidden; exit 1) mv address@hidden $@ -- 2.18.0.rc2