dcavalca / rpms / mdadm

Forked from rpms/mdadm 3 years ago
Clone

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

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