stx-metal: add patches to fix build failures on CentOS
[pti/rtp.git] / meta-stx / recipes-core / stx-metal / files / 0007-mtce-do-not-use-which-to-check-CC.patch
1 From 840f382ee691596474966f74bd1be37722bbc91c Mon Sep 17 00:00:00 2001
2 From: Jackie Huang <jackie.huang@windriver.com>
3 Date: Tue, 9 Jun 2020 20:52:31 +0800
4 Subject: [PATCH] mtce: do not use which to check CC
5
6 Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
7 ---
8  mtce-common/src/common/Makefile | 4 +---
9  mtce/src/common/Makefile        | 4 +---
10  mtce/src/public/Makefile        | 4 +---
11  3 files changed, 3 insertions(+), 9 deletions(-)
12
13 diff --git a/mtce-common/src/common/Makefile b/mtce-common/src/common/Makefile
14 index e0a5574..d44eef6 100755
15 --- a/mtce-common/src/common/Makefile
16 +++ b/mtce-common/src/common/Makefile
17 @@ -54,9 +54,7 @@ CCFLAGS = -g -O2 -Wall -Wextra -Werror -std=c++11
18  STATIC_ANALYSIS_TOOL = cppcheck
19  STATIC_ANALYSIS_TOOL_EXISTS = $(shell [[ -e `which $(STATIC_ANALYSIS_TOOL)` ]] && echo 1 || echo 0)
20  
21 -ifeq (,$(shell which ${CC}))
22 -CC=g++
23 -endif
24 +CC ?= g++
25  
26  .cpp.o:
27         $(CXX) $(CCFLAGS) $(INCLUDES) $(EXTRACCFLAGS) -c $< -o $@
28 diff --git a/mtce/src/common/Makefile b/mtce/src/common/Makefile
29 index 229a1a3..f797724 100755
30 --- a/mtce/src/common/Makefile
31 +++ b/mtce/src/common/Makefile
32 @@ -17,9 +17,7 @@ CCFLAGS = -g -O2 -Wall -Wextra -Werror -std=c++11
33  STATIC_ANALYSIS_TOOL = cppcheck
34  STATIC_ANALYSIS_TOOL_EXISTS = $(shell [[ -e `which $(STATIC_ANALYSIS_TOOL)` ]] && echo 1 || echo 0)
35  
36 -ifeq (,$(shell which ${CC}))
37 -CC=g++
38 -endif
39 +CC ?= g++
40  
41  .cpp.o:
42         $(CXX) $(CCFLAGS) $(INCLUDES) $(EXTRACCFLAGS) -c $< -o $@
43 diff --git a/mtce/src/public/Makefile b/mtce/src/public/Makefile
44 index 403638f..7dd80e4 100644
45 --- a/mtce/src/public/Makefile
46 +++ b/mtce/src/public/Makefile
47 @@ -13,9 +13,7 @@ LDFLAGS = -shared
48  CFLAGS = -fPIC -g -O2 -Wall -Wextra -Werror
49  TARGET_LIB = libamon.so
50  lib: build
51 -ifeq (,$(shell which ${CC}))
52 -CC=gcc
53 -endif
54 +CC ?= gcc
55  
56  STATIC_ANALYSIS_TOOL = cppcheck
57  STATIC_ANALYSIS_TOOL_EXISTS = $(shell [[ -e `which $(STATIC_ANALYSIS_TOOL)` ]] && echo 1 || echo 0)
58 -- 
59 2.7.4
60