Re: [Buildroot] [PATCH v2 4/8] package/hare: new host package

Baruch Siach via buildroot <[email protected]>
Newsgroups net.busybox.buildroot
Message-ID <877bmpps2n.fsf@tarshish>
Hi Francois,

On Mon, Jul 20 2026, Francois Perrad wrote:
> +ifeq ($(BR2_aarch64),y)
> +HOST_HARE_CONF_OPTS += \
> +	AARCH64_AS=$(TARGET_AS) \
> +	AARCH64_CC=$(TARGET_CC) \
> +	AARCH64_LD=$(TARGET_LD)
> +endif
> +
> +ifeq ($(BR2_RISCV_64),y)
> +HOST_HARE_CONF_OPTS += \
> +	RISCV64_AS=$(TARGET_AS) \
> +	RISCV64_CC=$(TARGET_CC) \
> +	RISCV64_LD=$(TARGET_LD)
> +endif
> +
> +ifeq ($(BR2_x86_64),y)
> +HOST_HARE_CONF_OPTS += \
> +	X86_64_AS=$(TARGET_AS) \
> +	X86_64_CC=$(TARGET_CC) \
> +	X86_64_LD=$(TARGET_LD)
> +endif

I think you can reduce code duplication with something like this
(untested):

ifeq ($(BR2_aarch64),y)
HOST_HARE_TARGET_ARCH = AARCH64
else ifeq ($(BR2_RISCV_64),y)
HOST_HARE_TARGET_ARCH = RISCV64
else ifeq ($(BR2_x86_64),y)
HOST_HARE_TARGET_ARCH = X86_64
endif

HOST_HARE_CONF_OPTS += \
	$(HOST_HARE_TARGET_ARCH)_AS=$(TARGET_AS) \
	$(HOST_HARE_TARGET_ARCH)_CC=$(TARGET_CC) \
	$(HOST_HARE_TARGET_ARCH)_LD=$(TARGET_LD)

Alternatively, instead of HOST_HARE_TARGET_ARCH, you can use a blind
config symbol similar to BR2_PACKAGE_FLUENT_BIT_WASM_ARCH.

baruch

> +
> +define HOST_HARE_CONFIGURE_CMDS
> +	cp $(@D)/configs/linux.mk $(@D)/config.mk
> +endef
> +
> +define HOST_HARE_BUILD_CMDS
> +	$(HOST_MAKE_ENV) $(MAKE) -C $(@D) $(HOST_HARE_CONF_OPTS) all
> +endef
> +
> +define HOST_HARE_INSTALL_CMDS
> +	$(HOST_MAKE_ENV) $(MAKE) -C $(@D) $(HOST_HARE_CONF_OPTS) install
> +endef
> +
> +$(eval $(host-generic-package))

-- 
                                                     ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - [email protected] - tel: +972.52.368.4656, http://www.tkos.co.il -
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.