[OpenWrt-Devel] [PATCH] build: rules.mk: allow overriding of HOSTCC and HOSTCXX

Yousong Zhou yszhou4tech at gmail.com
Tue Jul 23 06:57:32 EDT 2019


On Tue, 23 Jul 2019 at 18:23, Petr Štetiar <ynezz at true.cz> wrote:
>
> Currently it's not possible to change the host compiler version during
> devlopment/test/fixing and one has to always hand edit rules.mk which is
> tiresome, so let's allow changing of those variables from make/env vars.
>
> Signed-off-by: Petr Štetiar <ynezz at true.cz>
> ---
>  rules.mk | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/rules.mk b/rules.mk
> index 80cb3d63f449..dc8a1bac8d83 100644
> --- a/rules.mk
> +++ b/rules.mk
> @@ -245,8 +245,8 @@ PKG_CONFIG:=$(STAGING_DIR_HOST)/bin/pkg-config
>
>  export PKG_CONFIG
>
> -HOSTCC:=gcc
> -HOSTCXX:=g++
> +HOSTCC?=gcc
> +HOSTCXX?=g++

Variables specified as command arguments can override `:=` assignment.
But the change is still helpful if such HOSTCC and HOSTCXX are from
environment.

Acked-by: Yousong Zhou <yszhou4tech at gmail.com>

                yousong

_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list