From a2021f0bc0f029dfa05dcca5db3d2ec77904d41a Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Thu, 30 Mar 2017 12:33:51 -0700
Subject: [PATCH] Use ARPCFLAGS for package specific compiler flags

This leaves room for setting CFLAGS in environment
which OE uses to pass tweaks

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
Upstream-Status: Pending

 Makefile            | 10 ++++------
 extensions/Makefile |  4 ++++
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/Makefile b/Makefile
index 62ebdf2..cd06813 100644
--- a/Makefile
+++ b/Makefile
@@ -12,9 +12,7 @@ DESTDIR:=
 
 MANS = arptables-legacy.8 arptables-save.8 arptables-restore.8
 
-COPT_FLAGS:=-O2
-CFLAGS:=$(COPT_FLAGS) -Wall -Wunused -I$(KERNEL_DIR)/include/ -Iinclude/ -DARPTABLES_VERSION=\"$(ARPTABLES_VERSION)\" #-g -DDEBUG #-pg # -DARPTC_DEBUG
-
+ARPCFLAGS:=-Wall -Wunused -I$(KERNEL_DIR)/include/ -Iinclude/ -DARPTABLES_VERSION=\"$(ARPTABLES_VERSION)\"
 ifndef ARPT_LIBDIR
 ARPT_LIBDIR:=$(LIBDIR)/arptables
 endif
@@ -24,13 +22,13 @@ include extensions/Makefile
 all: arptables-legacy libarptc/libarptc.a
 
 arptables.o: arptables.c
-	$(CC) $(CFLAGS) -c -o $@ $<
+	$(CC) $(ARPCFLAGS) $(CFLAGS) -c -o $@ $<
 
 arptables-standalone.o: arptables-standalone.c
-	$(CC) $(CFLAGS) -c -o $@ $<
+	$(CC) $(ARPCFLAGS) $(CFLAGS) -c -o $@ $<
 
 libarptc/libarptc.o: libarptc/libarptc.c libarptc/libarptc_incl.c
-	$(CC) $(CFLAGS) -c -o $@ $<
+	$(CC) $(ARPCFLAGS) $(CFLAGS) -c -o $@ $<
 
 libarptc/libarptc.a: libarptc/libarptc.o
 	$(AR) rcs $@ $<
diff --git a/extensions/Makefile b/extensions/Makefile
index 0189cc9..e8af782 100644
--- a/extensions/Makefile
+++ b/extensions/Makefile
@@ -5,3 +5,7 @@ EXT_OBJS+=$(foreach T,$(EXT_FUNC), extensions/arpt_$(T).o)
 
 extensions/ebt_%.o: extensions/arpt_%.c include/arptables.h include/arptables_common.h
 	$(CC) $(CFLAGS) $(PROGSPECS) -c -o $@ $<
+	$(CC) $(CFLAGS) $(ARPCFLAGS) $(PROGSPECS) -c -o $@ $<
+
+extensions/arpt_%.o: extensions/arpt_%.c include/arptables.h include/arptables_common.h
+	$(CC) $(CFLAGS) $(ARPCFLAGS) $(PROGSPECS) -c -o $@ $<
-- 
2.17.1

