diff --git a/base-pistachio/Makefile b/base-pistachio/Makefile index 27465a149..19a98dd3d 100644 --- a/base-pistachio/Makefile +++ b/base-pistachio/Makefile @@ -22,6 +22,17 @@ $(call check_tool,sed) $(call check_tool,autoheader) $(call check_tool,autoconf) +# +# Determine python version to use for CML2 +# +PYTHON2 := $(notdir $(lastword $(shell which python2 python2.{4,5,6,7,8}))) +ifeq ($(PYTHON2),) +prepare: python_not_installed +python_not_installed: + $(ECHO) "Error: CML2 Configuration System needs Python 2 to be installed" + @false; +endif + # # Print help information by default # @@ -45,6 +56,8 @@ prepare: $(CONTRIB_DIR) $(VERBOSE)sed -i "/LD=/s/^.*$$/LD=\$$(CC)/" $(CONTRIB_DIR)/user/config.mk.in $(ECHO) "applying patches to '$(CONTRIB_DIR)/'" $(VERBOSE)for i in $(PATCHES); do patch -d $(CONTRIB_DIR) -p1 < $$i; done + $(VERBOSE)for i in cmlcompile.py cmlconfigure.py configtrans.py; do \ + sed -i "s/env python/env $(PYTHON2)/" $(CONTRIB_DIR)/contrib/cml2/$$i; done $(VERBOSE)cd $(CONTRIB_DIR)/user; autoheader; autoconf; clean::