qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH V7 1/4] rules: Move cross compilation auto detec


From: Laurent Vivier
Subject: Re: [Qemu-devel] [PATCH V7 1/4] rules: Move cross compilation auto detection functions to rules.mak
Date: Fri, 2 Mar 2018 15:51:29 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

On 28/02/2018 19:02, Wei Huang wrote:
> This patch moves the auto detection functions for cross compilation from
> roms/Makefile to rules.mak. So the functions can be shared among Makefiles
> in QEMU.
> 
> Signed-off-by: Wei Huang <address@hidden>
> Reviewed-by: Andrew Jones <address@hidden>
> ---
>  roms/Makefile | 24 +++++++-----------------
>  rules.mak     | 15 +++++++++++++++
>  2 files changed, 22 insertions(+), 17 deletions(-)
> 
> diff --git a/roms/Makefile b/roms/Makefile
> index b5e5a69e91..e972c65333 100644
> --- a/roms/Makefile
> +++ b/roms/Makefile
> @@ -21,23 +21,6 @@ pxe-rom-virtio   efi-rom-virtio   : DID := 1000
>  pxe-rom-vmxnet3  efi-rom-vmxnet3  : VID := 15ad
>  pxe-rom-vmxnet3  efi-rom-vmxnet3  : DID := 07b0
>  
> -#
> -# cross compiler auto detection
> -#
> -path := $(subst :, ,$(PATH))
> -system := $(shell uname -s | tr "A-Z" "a-z")
> -
> -# first find cross binutils in path
> -find-cross-ld = $(firstword $(wildcard $(patsubst 
> %,%/$(1)-*$(system)*-ld,$(path))))
> -# then check we have cross gcc too
> -find-cross-gcc = $(firstword $(wildcard $(patsubst %ld,%gcc,$(call 
> find-cross-ld,$(1)))))
> -# finally strip off path + toolname so we get the prefix
> -find-cross-prefix = $(subst gcc,,$(notdir $(call find-cross-gcc,$(1))))
> -
> -powerpc64_cross_prefix := $(call find-cross-prefix,powerpc64)
> -powerpc_cross_prefix := $(call find-cross-prefix,powerpc)
> -x86_64_cross_prefix := $(call find-cross-prefix,x86_64)
> -
>  # tag our seabios builds
>  SEABIOS_EXTRAVERSION="-prebuilt.qemu-project.org"
>  
> @@ -66,6 +49,13 @@ default:
>       @echo "  skiboot        -- update skiboot.lid"
>       @echo "  u-boot.e500    -- update u-boot.e500"
>  
> +SRC_PATH=..
> +include $(SRC_PATH)/rules.mak

Did you check it works for not in-tree build?

Something like:

   cd qemu
   mkdir build
   cd build
   ../configure
   make
   ...

for instance in po/Makefile, we have:

  # Set SRC_PATH for in-tree builds without configuration.
  SRC_PATH=..
...
  -include ../config-host.mak
  include $(SRC_PATH)/rules.mak

and config-host.mak defines the absolute path of SRC_PATH

Thanks,
Laurent





reply via email to

[Prev in Thread] Current Thread [Next in Thread]