dcavalca / rpms / mdadm

Forked from rpms/mdadm 3 years ago
Clone

Blame SOURCES/0056-Respect-CROSS_COMPILE-when-CC-is-the-default.patch

8e8941
From aced6fc9542077a69b00d05bc9cd66c12fc34950 Mon Sep 17 00:00:00 2001
8e8941
From: dann frazier <dann.frazier@canonical.com>
8e8941
Date: Mon, 9 Dec 2019 13:54:13 -0700
8e8941
Subject: [RHEL8.2 PATCH 56/61] Respect $(CROSS_COMPILE) when $(CC) is the
8e8941
 default
8e8941
8e8941
Commit 1180ed5 told make to only respect $(CROSS_COMPILE) when $(CC)
8e8941
was unset. But that will never be the case, as make provides
8e8941
a default value for $(CC). Change this logic to respect $(CROSS_COMPILE)
8e8941
when $(CC) is the default. Patch originally by Helmet Grohne.
8e8941
8e8941
Fixes: 1180ed5 ("Makefile: make the CC definition conditional")
8e8941
Signed-off-by: dann frazier <dann.frazier@canonical.com>
8e8941
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
8e8941
---
8e8941
 Makefile | 4 +++-
8e8941
 1 file changed, 3 insertions(+), 1 deletion(-)
8e8941
8e8941
diff --git a/Makefile b/Makefile
8e8941
index dfe00b0..a33319a 100644
8e8941
--- a/Makefile
8e8941
+++ b/Makefile
8e8941
@@ -46,7 +46,9 @@ ifdef COVERITY
8e8941
 COVERITY_FLAGS=-include coverity-gcc-hack.h
8e8941
 endif
8e8941
 
8e8941
-CC ?= $(CROSS_COMPILE)gcc
8e8941
+ifeq ($(origin CC),default)
8e8941
+CC := $(CROSS_COMPILE)gcc
8e8941
+endif
8e8941
 CXFLAGS ?= -ggdb
8e8941
 CWFLAGS = -Wall -Werror -Wstrict-prototypes -Wextra -Wno-unused-parameter
8e8941
 ifdef WARN_UNUSED
8e8941
-- 
8e8941
2.7.5
8e8941