From b901d009e9c46affc85aeb01cf04a3a47b21d034 Mon Sep 17 00:00:00 2001
From: Lianbo Jiang <lijiang@redhat.com>
Date: Thu, 21 Feb 2019 10:06:07 +0800
Subject: [PATCH 03/10] Github PR39: support for OpenEmbedded/Yocto
Backport this patch from upstream.
commit 8486d25cea9b68794504fbd9e5c6e294bac6cb07
Author: Lyonel Vincent <lyonel@ezix.org>
Date: Sat Jun 9 12:28:48 2018 +0200
Signed-off-by: Lianbo Jiang <lijiang@redhat.com>
---
src/Makefile | 4 ++--
src/core/Makefile | 2 +-
src/gui/Makefile | 4 ++--
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/Makefile b/src/Makefile
index a627466..e26941c 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -20,7 +20,7 @@ export DATADIR
export SQLITE
export ZLIB
-CXX?=c++
+CXX?=$(CROSS_COMPILE)c++
INCLUDES=-I./core/
DEFINES=-DPREFIX=\"$(PREFIX)\" -DSBINDIR=\"$(SBINDIR)\" -DMANDIR=\"$(MANDIR)\" -DDATADIR=\"$(DATADIR)\"
CXXFLAGS=-g -Wall -g $(INCLUDES) $(DEFINES) $(RPM_OPT_FLAGS)
@@ -30,7 +30,7 @@ endif
ifeq ($(ZLIB), 1)
CXXFLAGS+= -DZLIB $(shell pkg-config --cflags zlib)
endif
-LDFLAGS=-L./core/ -g
+LDFLAGS+=-L./core/ -g
ifneq ($(shell $(LD) --help 2| grep -- --as-needed), )
LDFLAGS+= -Wl,--as-needed
endif
diff --git a/src/core/Makefile b/src/core/Makefile
index 884a963..fbf6027 100644
--- a/src/core/Makefile
+++ b/src/core/Makefile
@@ -1,6 +1,6 @@
PACKAGENAME?=lshw
-CXX=c++
+CXX?=$(CROSS_COMPILE)c++
INCLUDES=
DEFINES=-DPREFIX=\"$(PREFIX)\" -DSBINDIR=\"$(SBINDIR)\" -DMANDIR=\"$(MANDIR)\" -DDATADIR=\"$(DATADIR)\"
CXXFLAGS?=-g -Wall $(INCLUDES) $(DEFINES) $(RPM_OPT_FLAGS)
diff --git a/src/gui/Makefile b/src/gui/Makefile
index 2526c18..74be693 100644
--- a/src/gui/Makefile
+++ b/src/gui/Makefile
@@ -1,7 +1,7 @@
PACKAGENAME?=lshw
-CXX?=c++
-CC?=cc
+CXX?=$(CROSS_COMPILE)c++
+CC?=$(CROSS_COMPILE)cc
STRIP?=strip
OBJCOPY?=objcopy
--
2.17.1