[CRIU] [PATCH] build system: make CC/LD derive from HOSTCC/HOSTLD
Cyrill Gorcunov
gorcunov at gmail.com
Thu Oct 27 15:05:56 PDT 2016
On Thu, Oct 27, 2016 at 02:43:46PM -0700, Kir Kolyshkin wrote:
> 1. Move HOSTCC/HOSTLD to nmk (note there are rules in nmk
> that make use of these variables already)
>
> 2. Make CC/LD derive from HOSTCC/HOSTLD
>
> Note that one can still change anything from the command line.
>
> Cc: Cyrill Gorcunov <gorcunov at openvz.org>
> Signed-off-by: Kir Kolyshkin <kir at openvz.org>
> ---
> Makefile | 6 ------
> scripts/nmk/scripts/tools.mk | 8 +++++---
> 2 files changed, 5 insertions(+), 9 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index 7fbb1db..f704601 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -6,12 +6,6 @@ export __nmk_dir
> include $(__nmk_dir)include.mk
> include $(__nmk_dir)macro.mk
>
> -#
> -# To build host helpers.
> -HOSTCC ?= gcc
> -HOSTLD ?= ld
> -export HOSTCC HOSTLD
> -
> CFLAGS += $(USERCFLAGS)
> export CFLAGS
>
> diff --git a/scripts/nmk/scripts/tools.mk b/scripts/nmk/scripts/tools.mk
> index 199a4ba..56dba84 100644
> --- a/scripts/nmk/scripts/tools.mk
> +++ b/scripts/nmk/scripts/tools.mk
> @@ -3,8 +3,10 @@ ifndef ____nmk_defined__tools
> #
> # System tools shorthands
> RM := rm -f
> -LD := $(CROSS_COMPILE)ld
> -CC := $(CROSS_COMPILE)gcc
> +HOSTLD ?= ld
> +LD := $(CROSS_COMPILE)$(HOSTLD)
Worth to make it conditional, ie "?="
If so, do it on top of this patch. Thank you!
Acked-by: Cyrill Gorcunov <gorcunov at openvz.org>
More information about the CRIU
mailing list