From: Christoph Egger Subject: [PATCH][XEN] Use $(PYTHON) when compiling xen kernel Date: Thu, 9 Jul 2009 15:35:51 +0200 Message-ID: <200907091535.51508.Christoph.Egger@amd.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Boundary-00=_3IfVKT5KCpQObAF" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --Boundary-00=_3IfVKT5KCpQObAF Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi! When compiling xen kernel, attached patch makes build system use of $(PYTHON). Signed-off-by: Christoph Egger -- ---to satisfy European Law for business letters: Advanced Micro Devices GmbH Karl-Hammerschmidt-Str. 34, 85609 Dornach b. Muenchen Geschaeftsfuehrer: Thomas M. McCoy, Giuliano Meroni Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen Registergericht Muenchen, HRB Nr. 43632 --Boundary-00=_3IfVKT5KCpQObAF Content-Type: text/x-diff; charset="us-ascii"; name="xen_python.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="xen_python.diff" diff -r 4b6e4bb7b7b4 xen/include/Makefile --- a/xen/include/Makefile Thu Jul 09 08:52:31 2009 +0100 +++ b/xen/include/Makefile Thu Jul 09 15:33:34 2009 +0200 @@ -52,7 +52,7 @@ compat/%.h: compat/%.i Makefile $(if $(filter-out compat/arch-%.h,$@),echo "#include <$(patsubst compat/%,public/%,$@)>" >>$@.new;) \ $(if $(prefix-y),echo "$(prefix-y)" >>$@.new;) \ grep -v '^# [0-9]' $< | \ - $(BASEDIR)/tools/compat-build-header.py | uniq >>$@.new; \ + $(PYTHON) $(BASEDIR)/tools/compat-build-header.py | uniq >>$@.new; \ $(if $(suffix-y),echo "$(suffix-y)" >>$@.new;) \ echo "#endif /* $$id */" >>$@.new mv -f $@.new $@ @@ -63,10 +63,11 @@ compat/%.i: compat/%.c Makefile compat/%.c: public/%.h xlat.lst Makefile mkdir -p $(@D) grep -v 'DEFINE_XEN_GUEST_HANDLE(long)' $< | \ - $(BASEDIR)/tools/compat-build-source.py >$@.new + $(PYTHON) $(BASEDIR)/tools/compat-build-source.py >$@.new mv -f $@.new $@ compat/xlat.h: xlat.lst $(filter-out compat/xlat.h,$(headers-y)) $(BASEDIR)/tools/get-fields.sh Makefile + export PYTHON=$(PYTHON); \ grep -v '^[ ]*#' xlat.lst | \ while read what name hdr; do \ $(SHELL) $(BASEDIR)/tools/get-fields.sh "$$what" compat_$$name $$(echo compat/$$hdr | sed 's,@arch@,$(compat-arch-y),g') || exit $$?; \ diff -r 4b6e4bb7b7b4 xen/tools/get-fields.sh --- a/xen/tools/get-fields.sh Thu Jul 09 08:52:31 2009 +0100 +++ b/xen/tools/get-fields.sh Thu Jul 09 15:33:34 2009 +0200 @@ -5,6 +5,13 @@ SED=sed if test -x /usr/xpg4/bin/sed; then SED=/usr/xpg4/bin/sed fi +if test -z ${PYTHON}; then + PYTHON=`/usr/bin/env python` +fi +if test -z ${PYTHON}; then + echo "Python not found" + exit 1 +fi get_fields () { @@ -129,7 +136,7 @@ handle_field () fi elif [ -z "$(echo "$5" | $SED 's,[^{}],,g')" ] then - local tag=$(echo "$5" | python -c ' + local tag=$(echo "$5" | ${PYTHON} -c ' import re,sys for line in sys.stdin.readlines(): print re.subn(r"\s*(struct|union)\s+(compat_)?(\w+)\s.*", r"\3", line)[0].rstrip() --Boundary-00=_3IfVKT5KCpQObAF Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --Boundary-00=_3IfVKT5KCpQObAF--