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

Arnout Vandecappelle arnout at mind.be
Fri May 11 22:15:30 UTC 2012


On 05/08/12 22:45, Samuel Martin wrote:
>
> 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)
> +

  This is probably better placed in support/dependencies, using the
suitable-host-package infrastructure.  Put the PYTHON2 script in
support/dependencies/check-host-python2.sh, and create a
support/dependencies/check-host-python2.mk containing:

PYTHON2 := python python2
PYTHON2 := $(call suitable-host-package,$(PYTHON2))
ifeq ($(PYTHON2),$(HOST_DIR)/usr/bin/python)
   HOST_PYTHON2 = host-python
endif

  Actually, maybe DEP_PYTHON2 is a better name for the dependency.  Or
NEEDS_PYTHON2.

  Regards,
  Arnout

-- 
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F



More information about the buildroot mailing list