use CPPFLAGS for -D/-I flags
The standard variable for preprocessor flags (e.g. -I and -D) is CPPFLAGS. The default Makefile rules already use this variable when compiling code, so we only need to convert the name.
This commit is contained in:
parent
30e510ac79
commit
9f687cef9c
|
@ -25,7 +25,7 @@
|
|||
CFLAGS ?= -Os
|
||||
CFLAGS += -fno-strict-aliasing
|
||||
CFLAGS += -fno-common
|
||||
CFLAGS += -D_GNU_SOURCE
|
||||
CPPFLAGS += -D_GNU_SOURCE
|
||||
CFLAGS += -Wall
|
||||
CFLAGS += -Wextra -Wstrict-prototypes -Wdeclaration-after-statement
|
||||
#CFLAGS += -Wno-missing-field-initializers
|
||||
|
@ -66,7 +66,7 @@ IPTABLESVERSION3 := $(shell echo $(IPTABLESVERSION) | cut -d. -f3 )
|
|||
# test if iptables version >= 1.4.3
|
||||
TEST := $(shell [ \( \( $(IPTABLESVERSION1) -ge 1 \) -a \( $(IPTABLESVERSION2) -ge 4 \) \) -a \( $(IPTABLESVERSION3) -ge 3 \) ] && echo 1 )
|
||||
ifeq ($(TEST), 1)
|
||||
CFLAGS += -DIPTABLES_143
|
||||
CPPFLAGS += -DIPTABLES_143
|
||||
endif
|
||||
|
||||
CFLAGS += $(shell $(PKG_CONFIG) --cflags libiptc)
|
||||
|
@ -82,12 +82,12 @@ else # gentoo
|
|||
# see http://miniupnp.tuxfamily.org/forum/viewtopic.php?p=1618
|
||||
# and http://miniupnp.tuxfamily.org/forum/viewtopic.php?p=2183
|
||||
LDLIBS ?= -lip4tc
|
||||
CFLAGS := -DIPTABLES_143 $(CFLAGS)
|
||||
CPPFLAGS := -DIPTABLES_143 $(CPPFLAGS)
|
||||
endif
|
||||
|
||||
ARCH ?= $(shell uname -m | grep -q "x86_64" && echo 64)
|
||||
ifdef IPTABLESPATH
|
||||
CFLAGS := $(CFLAGS) -I$(IPTABLESPATH)/include/
|
||||
CPPFLAGS := $(CPPFLAGS) -I$(IPTABLESPATH)/include/
|
||||
LDFLAGS := $(LDFLAFGS) -L$(IPTABLESPATH)/libiptc/
|
||||
# get iptables version and set IPTABLES_143 macro if needed
|
||||
ifeq ($(TARGET_OPENWRT),)
|
||||
|
@ -98,7 +98,7 @@ IPTABLESVERSION3 := $(shell echo $(IPTABLESVERSION) | cut -d. -f3 )
|
|||
# test if iptables version >= 1.4.3
|
||||
TEST := $(shell [ \( \( $(IPTABLESVERSION1) -ge 1 \) -a \( $(IPTABLESVERSION2) -ge 4 \) \) -a \( $(IPTABLESVERSION3) -ge 3 \) ] && echo 1 )
|
||||
ifeq ($(TEST), 1)
|
||||
CFLAGS := $(CFLAGS) -DIPTABLES_143
|
||||
CPPFLAGS := $(CPPFLAGS) -DIPTABLES_143
|
||||
# the following sucks, but works
|
||||
LDLIBS = $(IPTABLESPATH)/libiptc/.libs/libip4tc.o
|
||||
#LDLIBS = $(IPTABLESPATH)/libiptc/.libs/libiptc.a
|
||||
|
@ -111,7 +111,7 @@ else # ($(TARGET_OPENWRT),)
|
|||
# the following test has to be verified :
|
||||
TEST := $(shell test -f /usr/include/iptables/internal.h && grep -q "\#define IPTABLES_VERSION" /usr/include/iptables/internal.h && echo 1)
|
||||
ifeq ($(TEST), 1)
|
||||
CFLAGS := $(CFLAGS) -DIPTABLES_143
|
||||
CPPFLAGS := $(CPPFLAGS) -DIPTABLES_143
|
||||
LDLIBS = -liptc
|
||||
endif # ($(TEST), 1)
|
||||
TEST_LIB := $(shell test -f /usr/lib$(ARCH)/libiptc.a && echo 1)
|
||||
|
@ -124,7 +124,7 @@ else # ifdef IPTABLESPATH
|
|||
# the following test has to be verified :
|
||||
TEST := $(shell test -f /usr/include/xtables.h && grep -q "XTABLES_VERSION_CODE" /usr/include/xtables.h && echo 1)
|
||||
ifeq ($(TEST), 1)
|
||||
CFLAGS := $(CFLAGS) -DIPTABLES_143
|
||||
CPPFLAGS := $(CPPFLAGS) -DIPTABLES_143
|
||||
LDLIBS = -liptc
|
||||
TESTIP4TC := $(shell test -f /lib/libip4tc.so && echo 1)
|
||||
ifeq ($(TESTIP4TC), 1)
|
||||
|
@ -142,7 +142,7 @@ LDLIBS += -lnfnetlink
|
|||
|
||||
TEST := $(shell $(PKG_CONFIG) --atleast-version=1.0.2 libnetfilter_conntrack && $(PKG_CONFIG) --atleast-version=1.0.3 libmnl && echo 1)
|
||||
ifeq ($(TEST),1)
|
||||
CFLAGS += -DUSE_NFCT
|
||||
CPPFLAGS += -DUSE_NFCT
|
||||
LDLIBS += $(shell $(PKG_CONFIG) --static --libs-only-l libmnl)
|
||||
LDLIBS += $(shell $(PKG_CONFIG) --static --libs-only-l libnetfilter_conntrack)
|
||||
endif # ($(TEST),1)
|
||||
|
|
Loading…
Reference in New Issue