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.
This commit is contained in:
Josef Söntgen 2012-07-02 13:44:52 +02:00 committed by Norman Feske
parent b8ee4bda81
commit d9d22fbf75
1 changed files with 13 additions and 0 deletions

View File

@ -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::