From d9d22fbf75061651ab8cbe376234dc9a45ab4873 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20S=C3=B6ntgen?= Date: Mon, 2 Jul 2012 13:44:52 +0200 Subject: [PATCH] Pistachio: fix usage of wrong python version The CML2 configuration system calls 'evn python' and expects version 2.x. So we check if python2 is installed when preparing Pistachio and use the found version instead. Fixes #264. --- base-pistachio/Makefile | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/base-pistachio/Makefile b/base-pistachio/Makefile index 27465a149d..19a98dd3d2 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::