From: "Christoph Egger" Subject: [PATCH] xen: x86_64 build fixes Date: Fri, 19 Oct 2007 15:36:14 +0200 Message-ID: <200710191536.14452.Christoph.Egger@amd.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Boundary-00=_OLLGHZirAKedWv2" 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=_OLLGHZirAKedWv2 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi! Attached patch allows x86_64 build on *BSD. =2D Config.mk: uname -m prints "amd64". Deal with this. =2D do not assume, python is always in /usr/bin =2D get-fields.sh: make it a portable and non-bash specific shell-script Signed-off-by: Christoph Egger =2D-=20 AMD Saxony, Dresden, Germany Operating System Research Center Legal Information: AMD Saxony Limited Liability Company & Co. KG Sitz (Gesch=E4ftsanschrift): Wilschdorfer Landstr. 101, 01109 Dresden, Deutschland Registergericht Dresden: HRA 4896 vertretungsberechtigter Komplement=E4r: AMD Saxony LLC (Sitz Wilmington, Delaware, USA) Gesch=E4ftsf=FChrer der AMD Saxony LLC: Dr. Hans-R. Deppe, Thomas McCoy --Boundary-00=_OLLGHZirAKedWv2 Content-Type: text/plain; charset=us-ascii; name=xen_amd64.diff Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=xen_amd64.diff diff -r 2372f89c0447 Config.mk --- a/Config.mk Mon Oct 15 12:24:35 2007 +0100 +++ b/Config.mk Fri Oct 19 16:52:02 2007 +0200 @@ -4,7 +4,7 @@ debug ?= n debug ?= n XEN_COMPILE_ARCH ?= $(shell uname -m | sed -e s/i.86/x86_32/ \ - -e s/ppc/powerpc/ -e s/i86pc/x86_32/) + -e s/ppc/powerpc/ -e s/i86pc/x86_32/ -e s/amd64/x86_64/) XEN_TARGET_ARCH ?= $(XEN_COMPILE_ARCH) XEN_OS ?= $(shell uname -s) diff -r 2372f89c0447 xen/include/Makefile --- a/xen/include/Makefile Mon Oct 15 12:24:35 2007 +0100 +++ b/xen/include/Makefile Fri Oct 19 16:52:02 2007 +0200 @@ -61,7 +61,7 @@ compat/xlat.h: xlat.lst $(filter-out com compat/xlat.h: xlat.lst $(filter-out compat/xlat.h,$(headers-y)) $(BASEDIR)/tools/get-fields.sh Makefile grep -v '^[ ]*#' xlat.lst | \ while read what name hdr; do \ - /bin/bash $(BASEDIR)/tools/get-fields.sh "$$what" compat_$$name $$(echo compat/$$hdr | sed 's,@arch@,$(compat-arch-y),g') || exit $$?; \ + /bin/sh $(BASEDIR)/tools/get-fields.sh "$$what" compat_$$name $$(echo compat/$$hdr | sed 's,@arch@,$(compat-arch-y),g') || exit $$?; \ done >$@.new mv -f $@.new $@ diff -r 2372f89c0447 xen/tools/compat-build-header.py --- a/xen/tools/compat-build-header.py Mon Oct 15 12:24:35 2007 +0100 +++ b/xen/tools/compat-build-header.py Fri Oct 19 16:52:02 2007 +0200 @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python import re,sys diff -r 2372f89c0447 xen/tools/compat-build-source.py --- a/xen/tools/compat-build-source.py Mon Oct 15 12:24:35 2007 +0100 +++ b/xen/tools/compat-build-source.py Fri Oct 19 16:52:02 2007 +0200 @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python import re,sys diff -r 2372f89c0447 xen/tools/get-fields.sh --- a/xen/tools/get-fields.sh Mon Oct 15 12:24:35 2007 +0100 +++ b/xen/tools/get-fields.sh Fri Oct 19 16:52:02 2007 +0200 @@ -1,11 +1,12 @@ -#!/bin/bash +#!/bin/sh test -n "$1" -a -n "$2" -a -n "$3" set -ef SED=sed -[ -x /usr/xpg4/bin/sed ] && SED=/usr/xpg4/bin/sed - -get_fields() { +test -x /usr/xpg4/bin/sed && SED=/usr/xpg4/bin/sed + +get_fields () +{ local level=1 aggr=0 name= fields= for token in $2 do @@ -24,7 +25,7 @@ get_fields() { return 0 fi ;; - [[:alpha:]_]*) + [a-zA-Z_]*) test $aggr = 0 -o -n "$name" || name="$token" ;; esac @@ -32,7 +33,8 @@ get_fields() { done } -build_enums() { +build_enums () +{ local level=1 kind= fields= members= named= id= token for token in $2 do @@ -64,7 +66,7 @@ build_enums() { named='?' fi ;; - [[:alpha:]]*) + [a-zA-Z]*) id=$token if [ -n "$named" -a -n "${kind#*;}" ] then @@ -85,7 +87,8 @@ build_enums() { done } -handle_field() { +handle_field () +{ if [ -z "$5" ] then echo " \\" @@ -161,7 +164,7 @@ for line in sys.stdin.readlines(): array_type=$token fi ;; - [[:alpha:]]*) + [a-zA-Z]*) id=$token ;; [\,\;]) @@ -202,13 +205,15 @@ for line in sys.stdin.readlines(): fi } -copy_array() { +copy_array () +{ echo " \\" echo "${1}if ((_d_)->$2 != (_s_)->$2) \\" echo -n "$1 memcpy((_d_)->$2, (_s_)->$2, sizeof((_d_)->$2));" } -handle_array() { +handle_array () +{ local i="i$(echo $4 | $SED 's,[^;], ,g' | wc -w | $SED 's,[[:space:]]*,,g')" echo " \\" echo "$1{ \\" @@ -225,7 +230,8 @@ handle_array() { echo -n "$1}" } -build_body() { +build_body () +{ echo echo -n "#define XLAT_$1(_d_, _s_) do {" local level=1 fields= id= array= arrlvl=1 array_type= type= token @@ -270,7 +276,7 @@ build_body() { array_type=$token fi ;; - [[:alpha:]_]*) + [a-zA-Z_]*) if [ -n "$array" ] then array="$array $token" @@ -308,7 +314,8 @@ build_body() { echo "" } -check_field() { +check_field () +{ if [ -z "$(echo "$4" | $SED 's,[^{}],,g')" ] then echo "; \\" @@ -320,7 +327,7 @@ check_field() { case $n in struct|union) ;; - [[:alpha:]_]*) + [a-zA-Z_]*) echo -n " CHECK_$n" break ;; @@ -350,7 +357,7 @@ check_field() { "}") level=$(expr $level - 1) id= ;; - [[:alpha:]]*) + [a-zA-Z]*) id=$token ;; [\,\;]) @@ -366,7 +373,8 @@ check_field() { fi } -build_check() { +build_check () +{ echo echo "#define CHECK_$1 \\" local level=1 fields= kind= id= arrlvl=1 token @@ -395,7 +403,7 @@ build_check() { "]") arrlvl=$(expr $arrlvl - 1) ;; - [[:alpha:]_]*) + [a-zA-Z_]*) test $level != 2 -o $arrlvl != 1 || id=$token ;; [\,\;]) --Boundary-00=_OLLGHZirAKedWv2 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=_OLLGHZirAKedWv2--