summaryrefslogtreecommitdiff
path: root/package/ipset/patches/patch-Makefile
blob: e97a5b6a08efb6676b4500c882da2847b3743461 (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
--- ipset-4.1.orig/Makefile	2009-11-11 20:22:42.000000000 +0100
+++ ipset-4.1/Makefile	2011-01-21 13:30:47.148658311 +0100
@@ -64,9 +64,13 @@ ifndef NO_EXTRA_WARN_FLAGS
 endif
 
 ABI_FLAGS:=
-CFLAGS:=$(ABI_FLAGS) $(COPT_FLAGS) $(WARN_FLAGS) -Ikernel/include -I. # -g -DIPSET_DEBUG
+CPPFLAGS?=
+CPPFLAGS+=-Ikernel/include -I.
+CFLAGS?=$(ABI_FLAGS) $(COPT_FLAGS) $(WARN_FLAGS)
 SH_CFLAGS:=$(CFLAGS) -fPIC
-LDFLAGS:=$(ABI_FLAGS)
+LDFLAGS?=$(ABI_FLAGS)
+LIBS?=
+LIBS+=-ldl
 SETTYPES:=ipmap portmap macipmap
 SETTYPES+=iptree iptreemap
 SETTYPES+=iphash nethash ipporthash ipportiphash ipportnethash
@@ -114,14 +118,14 @@ release: clean
 
 #The ipset(8) self
 ipset.o: ipset.c ipset.h
-	$(CC) $(CFLAGS) -DIPSET_VERSION=\"$(IPSET_VERSION)\" -DIPSET_LIB_DIR=\"$(IPSET_LIB_DIR)\" -c -o $@ $<
+	$(CC) $(CPPFLAGS) $(CFLAGS) -DIPSET_VERSION=\"$(IPSET_VERSION)\" -DIPSET_LIB_DIR=\"$(IPSET_LIB_DIR)\" -c -o $@ $<
 
 ipset: ipset.o
-	$(CC) $(CFLAGS) $(LDFLAGS) -rdynamic -o $@ $^ -ldl
+	$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
 
 #Pooltypes
 ipset_%.o: ipset_%.c ipset.h
-	$(CC) $(SH_CFLAGS) -o $@ -c $<
+	$(CC) $(CPPFLAGS) $(SH_CFLAGS) -o $@ -c $<
 
 libipset_%.so: ipset_%.o
 	$(CC) -shared $(LDFLAGS) -o $@ $<