From: Sophie Brun <sophie@freexian.com>
Date: Thu, 19 Jan 2017 16:49:39 +0100
Subject: Fix Makefile to suit our needs

* Inject CPPFLAGS and LDFLAGS where appropriate for better hardening.

Origin: vendor
Last-Update: 2020-06-18
---
 src/Makefile | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/Makefile b/src/Makefile
index c244145..50a2d9a 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -245,7 +245,7 @@ endif
 ##
 
 ifeq ($(UNAME),Linux)
-CFLAGS_NATIVE           := $(CFLAGS)
+CFLAGS_NATIVE           := $(CFLAGS) $(CPPFLAGS)
 CFLAGS_NATIVE           += -DWITH_HWMON
 LFLAGS_NATIVE           := $(LFLAGS)
 LFLAGS_NATIVE           += -lpthread
@@ -256,7 +256,7 @@ endif # Linux
 
 ifeq ($(UNAME),FreeBSD)
 ifndef PORTNAME
-CFLAGS_NATIVE           := $(CFLAGS)
+CFLAGS_NATIVE           := $(CFLAGS) $(CPPFLAGS)
 LFLAGS_NATIVE           := $(LFLAGS)
 LFLAGS_NATIVE           += -lpthread
 LFLAGS_NATIVE           += -lm
@@ -266,7 +266,7 @@ endif # FreeBSD
 
 ifeq ($(UNAME),Darwin)
 export MACOSX_DEPLOYMENT_TARGET=10.9
-CFLAGS_NATIVE           := $(CFLAGS)
+CFLAGS_NATIVE           := $(CFLAGS) $(CPPFLAGS)
 
 ifeq ($(shell test $(PROD_VERS) -le 11; echo $$?), 0)
 CFLAGS_NATIVE           += -DMISSING_CLOCK_GETTIME
@@ -279,7 +279,7 @@ LFLAGS_NATIVE           += -liconv
 endif # Darwin
 
 ifeq ($(UNAME),CYGWIN)
-CFLAGS_NATIVE           := $(CFLAGS)
+CFLAGS_NATIVE           := $(CFLAGS) $(CPPFLAGS)
 CFLAGS_NATIVE           += -DWITH_HWMON
 LFLAGS_NATIVE           := $(LFLAGS)
 LFLAGS_NATIVE           += -Wl,--dynamicbase
@@ -289,7 +289,7 @@ LFLAGS_NATIVE           += -liconv
 endif # CYGWIN
 
 ifeq ($(UNAME),MSYS2)
-CFLAGS_NATIVE           := $(CFLAGS)
+CFLAGS_NATIVE           := $(CFLAGS) $(CPPFLAGS)
 CFLAGS_NATIVE           += -DWITH_HWMON
 LFLAGS_NATIVE           := $(LFLAGS)
 LFLAGS_NATIVE           += -Wl,--dynamicbase
