diff --git a/include/prereq-build.mk b/include/prereq-build.mk index 8d9140a2d2c..d626ab024fe 100644 --- a/include/prereq-build.mk +++ b/include/prereq-build.mk @@ -141,6 +141,8 @@ $(eval $(call SetupHostCommand,wget,Please install GNU 'wget', \ $(eval $(call SetupHostCommand,perl,Please install Perl 5.x, \ perl --version | grep "perl.*v5")) +$(eval $(call CleanupPython3)) + $(eval $(call SetupHostCommand,python,Please install Python 2.x, \ python2.7 -V 2>&1 | grep 'Python 2.7', \ python2 -V 2>&1 | grep 'Python 2', \ diff --git a/include/prereq.mk b/include/prereq.mk index 0f0f2537448..60f1e47c3db 100644 --- a/include/prereq.mk +++ b/include/prereq.mk @@ -66,6 +66,18 @@ define RequireHeader $$(eval $$(call Require,$(1),$(2))) endef +define CleanupPython3 + define Require/python3-cleanup + if [ -f "$(STAGING_DIR_HOST)/bin/python" ] && \ + $(STAGING_DIR_HOST)/bin/python -V 2>&1 | \ + grep -q 'Python 3'; then \ + rm $(STAGING_DIR_HOST)/bin/python; \ + fi + endef + + $$(eval $$(call Require,python3-cleanup)) +endef + define QuoteHostCommand '$(subst ','"'"',$(strip $(1)))' endef