[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [XEN PATCH v2 5/5] Config.mk: evaluate XEN_COMPILE_ARCH and XEN_OS on first use


  • To: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 23 Jun 2023 10:16:43 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=iWkvtyrHe5/Sbquh5vkXjWoZfY1d2Vc+OmaMPHZ/5RA=; b=RjN+R4Yj3SJXXiX0VhIN0NkicMP+G99+OnDuNMQd473Td8bo4PEVc1nuoDNn56hgSDLrXBcKOZnSlitpc5MaTN27tOMkwCqORFuQJSEJx+zRZjNWnS2/DFDxqW/Lnz69/yaIqEqSz8aXGTSnGxkx1eN1msclYzF05Q0Z1g9Wr2JXVxRCaCHY23QmBRGhPXLxW2OtfPFxXBfC3yzcq4OSe9W0BLTcQo/A6mLGVY67f3UgpKUmeAtkO1ZrgqrZfI7wSwaTcVIQg3KEL0qVLAsm6CCSuz8eduVRb5bwF2EdUNgQA2/ifCbBY1AoCiKE0AzODzloeJlNDQXJZ0nmcFBJBw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YM23IHbgegJ+YBPTNDebdBH965wxo4ew6wkfCwUVF/26VasZ61pmqyb4x6TMcAv7LYN2523at8THGoj7SbtvmdsreD5CVsMG9I829py45NETUTCe4S67np4yKzl8ZWezFuYXo7M50er6wicxh7zWnOOnL1j4l4Aefgm9LRC+IIp0qQF0dVAYwX5URgHF38PKJh8WwBYUT0B3fBMQErkryaS+gAG6C/LHnX/tSvBifLUgXAV7CYajBRcR27oFV8ZRV5P+M93LDx0fJOtqYD7rXSJ2xRPVFoy3W3gbtGoRIYtVJcAp/iyF1X+dSLRySx8YCRTerLGpjj3satHAB4CNJw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Jason Andryuk <jandryuk@xxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Fri, 23 Jun 2023 08:17:00 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 22.06.2023 17:30, Anthony PERARD wrote:
> --- a/Config.mk
> +++ b/Config.mk
> @@ -19,13 +19,13 @@ or       = $(if $(strip $(1)),$(1),$(if $(strip 
> $(2)),$(2),$(if $(strip $(3)),$(
>  
>  -include $(XEN_ROOT)/.config
>  
> -XEN_COMPILE_ARCH    ?= $(shell uname -m | sed -e s/i.86/x86_32/ \
> +XEN_COMPILE_ARCH    ?= $(eval XEN_COMPILE_ARCH := $(shell uname -m | sed -e 
> s/i.86/x86_32/ \
>                           -e s/i86pc/x86_32/ -e s/amd64/x86_64/ \
>                           -e s/armv7.*/arm32/ -e s/armv8.*/arm64/ \
> -                         -e s/aarch64/arm64/)
> +                         -e s/aarch64/arm64/))$(XEN_COMPILE_ARCH)

I'd like to suggest to wrap this differently, e.g.

XEN_COMPILE_ARCH    ?= $(eval XEN_COMPILE_ARCH := \
                         $(shell uname -m | \
                                 sed -e s/i.86/x86_32/ \
                                     -e s/i86pc/x86_32/ -e s/amd64/x86_64/ \
                                     -e s/armv7.*/arm32/ -e s/armv8.*/arm64/ \
                                     -e s/aarch64/arm64/) \
                         )$(XEN_COMPILE_ARCH)

>  XEN_TARGET_ARCH     ?= $(XEN_COMPILE_ARCH)
> -XEN_OS              ?= $(shell uname -s)
> +XEN_OS              ?= $(eval XEN_OS := $(shell uname -s))$(XEN_OS)

With these further uses of this same construct as in patch 4, is there
any chance of abstracting (part of, e.g. at least the rhs of the ?=)
the construct into a macro?

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.