dcavalca / rpms / mdadm

Forked from rpms/mdadm 3 years ago
Clone

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

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