1From a2021f0bc0f029dfa05dcca5db3d2ec77904d41a Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 30 Mar 2017 12:33:51 -0700
4Subject: [PATCH] Use ARPCFLAGS for package specific compiler flags
5
6This leaves room for setting CFLAGS in environment
7which OE uses to pass tweaks
8
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10---
11 Makefile            | 15 +++++++--------
12 extensions/Makefile |  5 ++++-
13 2 files changed, 11 insertions(+), 9 deletions(-)
14
15diff --git a/Makefile b/Makefile
16index 7bead0d..336db6b 100644
17--- a/Makefile
18+++ b/Makefile
19@@ -7,15 +7,13 @@ LIBDIR:=$(PREFIX)/lib
20 BINDIR:=$(PREFIX)/sbin
21 MANDIR:=$(PREFIX)/man
22 man8dir=$(MANDIR)/man8
23-INITDIR:=/etc/rc.d/init.d
24+INITDIR:=/etc/init.d
25 SYSCONFIGDIR:=/etc/sysconfig
26 DESTDIR:=
27
28 MANS = arptables.8 arptables-save.8 arptables-restore.8
29
30-COPT_FLAGS:=-O2
31-CFLAGS:=$(COPT_FLAGS) -Wall -Wunused -I$(KERNEL_DIR)/include/ -Iinclude/ -DARPTABLES_VERSION=\"$(ARPTABLES_VERSION)\" #-g -DDEBUG #-pg # -DARPTC_DEBUG
32-
33+ARPCFLAGS:=-Wall -Wunused -I$(KERNEL_DIR)/include/ -Iinclude/ -DARPTABLES_VERSION=\"$(ARPTABLES_VERSION)\"
34 ifndef ARPT_LIBDIR
35 ARPT_LIBDIR:=$(LIBDIR)/arptables
36 endif
37@@ -25,13 +23,13 @@ include extensions/Makefile
38 all: arptables libarptc/libarptc.a
39
40 arptables.o: arptables.c
41-	$(CC) $(CFLAGS) -c -o $@ $<
42+	$(CC) $(ARPCFLAGS) $(CFLAGS) -c -o $@ $<
43
44 arptables-standalone.o: arptables-standalone.c
45-	$(CC) $(CFLAGS) -c -o $@ $<
46+	$(CC) $(ARPCFLAGS) $(CFLAGS) -c -o $@ $<
47
48 libarptc/libarptc.o: libarptc/libarptc.c libarptc/libarptc_incl.c
49-	$(CC) $(CFLAGS) -c -o $@ $<
50+	$(CC) $(ARPCFLAGS) $(CFLAGS) -c -o $@ $<
51
52 libarptc/libarptc.a: libarptc/libarptc.o
53 	$(AR) rcs $@ $<
54@@ -53,7 +51,8 @@ scripts: arptables-save arptables-restore arptables.sysv
55 	install -m 0755 arptables-restore_ $(DESTDIR)$(BINDIR)/arptables-restore
56 	cat arptables.sysv | sed 's/__EXEC_PATH__/$(tmp1)/g' | sed 's/__SYSCONFIG__/$(tmp2)/g' > arptables.sysv_
57 	if [ "$(DESTDIR)" != "" ]; then mkdir -p $(DESTDIR)$(INITDIR); fi
58-	if test -d $(DESTDIR)$(INITDIR); then install -m 0755 arptables.sysv_ $(DESTDIR)$(INITDIR)/arptables; fi
59+	install -d $(DESTDIR)$(INITDIR)
60+	install -m 0755 arptables.sysv_ $(DESTDIR)$(INITDIR)/arptables
61 	rm -f arptables-save_ arptables-restore_ arptables.sysv_
62
63 .PHONY: install-man
64diff --git a/extensions/Makefile b/extensions/Makefile
65index 0189cc9..b046425 100644
66--- a/extensions/Makefile
67+++ b/extensions/Makefile
68@@ -4,4 +4,7 @@ EXT_FUNC+=standard mangle CLASSIFY MARK
69 EXT_OBJS+=$(foreach T,$(EXT_FUNC), extensions/arpt_$(T).o)
70
71 extensions/ebt_%.o: extensions/arpt_%.c include/arptables.h include/arptables_common.h
72-	$(CC) $(CFLAGS) $(PROGSPECS) -c -o $@ $<
73+	$(CC) $(CFLAGS) $(ARPCFLAGS) $(PROGSPECS) -c -o $@ $<
74+
75+extensions/arpt_%.o: extensions/arpt_%.c include/arptables.h include/arptables_common.h
76+	$(CC) $(CFLAGS) $(ARPCFLAGS) $(PROGSPECS) -c -o $@ $<
77--
782.12.1
79
80