summaryrefslogtreecommitdiffstats
path: root/meta-openembedded/meta-networking/recipes-support/arptables/arptables/0001-Use-ARPCFLAGS-for-package-specific-compiler-flags.patch
blob: e8be45e6b6b62c8df5e75a3ecfd43ce8006a5fca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
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>
---
 Makefile            | 15 +++++++--------
 extensions/Makefile |  5 ++++-
 2 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/Makefile b/Makefile
index 7bead0d..336db6b 100644
--- a/Makefile
+++ b/Makefile
@@ -7,15 +7,13 @@ LIBDIR:=$(PREFIX)/lib
 BINDIR:=$(PREFIX)/sbin
 MANDIR:=$(PREFIX)/man
 man8dir=$(MANDIR)/man8
-INITDIR:=/etc/rc.d/init.d
+INITDIR:=/etc/init.d
 SYSCONFIGDIR:=/etc/sysconfig
 DESTDIR:=
 
 MANS = arptables.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
@@ -25,13 +23,13 @@ include extensions/Makefile
 all: arptables 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 $@ $<
@@ -53,7 +51,8 @@ scripts: arptables-save arptables-restore arptables.sysv
 	install -m 0755 arptables-restore_ $(DESTDIR)$(BINDIR)/arptables-restore
 	cat arptables.sysv | sed 's/__EXEC_PATH__/$(tmp1)/g' | sed 's/__SYSCONFIG__/$(tmp2)/g' > arptables.sysv_
 	if [ "$(DESTDIR)" != "" ]; then mkdir -p $(DESTDIR)$(INITDIR); fi
-	if test -d $(DESTDIR)$(INITDIR); then install -m 0755 arptables.sysv_ $(DESTDIR)$(INITDIR)/arptables; fi
+	install -d $(DESTDIR)$(INITDIR)
+	install -m 0755 arptables.sysv_ $(DESTDIR)$(INITDIR)/arptables
 	rm -f arptables-save_ arptables-restore_ arptables.sysv_
 
 .PHONY: install-man
diff --git a/extensions/Makefile b/extensions/Makefile
index 0189cc9..b046425 100644
--- a/extensions/Makefile
+++ b/extensions/Makefile
@@ -4,4 +4,7 @@ EXT_FUNC+=standard mangle CLASSIFY MARK
 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.12.1

OpenPOWER on IntegriCloud