[Buildroot] [PATCH 1/2] Makefile.in: add host python2 binary detection

Samuel Martin s.martin49 at gmail.com
Tue May 8 20:45:48 UTC 2012


Signed-off-by: Samuel Martin <s.martin49 at gmail.com>

diff --git a/package/Makefile.in b/package/Makefile.in
index df7042c..84968da 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -151,6 +151,18 @@ FLEX:=$(shell which flex || type -p flex)
 BISON:=$(shell which bison || type -p bison)
 SED:=$(shell which sed || type -p sed) -i -e
 
+PYTHON2:=$(shell \
+	which python &>/dev/null && \
+		python --version 2>&1 | grep -qE 'Python 2\.[6-7]*' && \
+		which python || \
+	which python2 &>/dev/null && \
+		python2 --version 2>&1 | grep -qE 'Python 2\.[6-7]*' && \
+		which python2 || \
+	echo $(HOST_DIR)/usr/bin/python)
+HOST_PYTHON2:=$(shell \
+	test $(PYTHON2) != $(HOST_DIR)/usr/bin/python || \
+	echo host-python)
+
 HOST_CFLAGS   ?= -O2
 HOST_CFLAGS   += -I$(HOST_DIR)/include -I$(HOST_DIR)/usr/include
 HOST_CXXFLAGS += -I$(HOST_DIR)/include -I$(HOST_DIR)/usr/include
-- 
1.7.10.1



More information about the buildroot mailing list