92f5485399f72b7879b016164687c71a29a25bfe
[openwrt/openwrt.git] / package / network / utils / iptables / patches / 600-shared-libext.patch
1 Index: iptables-1.4.21/extensions/GNUmakefile.in
2 ===================================================================
3 --- iptables-1.4.21.orig/extensions/GNUmakefile.in
4 +++ iptables-1.4.21/extensions/GNUmakefile.in
5 @@ -71,7 +71,7 @@ pf6_solibs := $(patsubst %,libip6t_%.
6 #
7 # Building blocks
8 #
9 -targets := libext.a libext4.a libext6.a matches.man targets.man
10 +targets := libiptext.so libiptext4.so libiptext6.so matches.man targets.man
11 targets_install :=
12 libext_objs := ${pfx_objs}
13 libext4_objs := ${pf4_objs}
14 @@ -96,7 +96,7 @@ clean:
15 distclean: clean
16
17 init%.o: init%.c
18 - ${AM_VERBOSE_CC} ${CC} ${AM_CPPFLAGS} ${AM_DEPFLAGS} ${AM_CFLAGS} -D_INIT=$*_init ${CFLAGS} -o $@ -c $<;
19 + ${AM_VERBOSE_CC} ${CC} ${AM_CPPFLAGS} ${AM_DEPFLAGS} ${AM_CFLAGS} -D_INIT=$*_init -DPIC -fPIC ${CFLAGS} -o $@ -c $<;
20
21 -include .*.d
22
23 @@ -130,16 +130,16 @@ xt_statistic_LIBADD = -lm
24 # handling code in the Makefiles.
25 #
26 lib%.o: ${srcdir}/lib%.c
27 - ${AM_VERBOSE_CC} ${CC} ${AM_CPPFLAGS} ${AM_DEPFLAGS} ${AM_CFLAGS} -DNO_SHARED_LIBS=1 -D_INIT=lib$*_init ${CFLAGS} -o $@ -c $<;
28 + ${AM_VERBOSE_CC} ${CC} ${AM_CPPFLAGS} ${AM_DEPFLAGS} ${AM_CFLAGS} -DNO_SHARED_LIBS=1 -D_INIT=lib$*_init -DPIC -fPIC ${CFLAGS} -o $@ -c $<;
29
30 -libext.a: initext.o ${libext_objs}
31 - ${AM_VERBOSE_AR} ${AR} crs $@ $^;
32 +libiptext.so: initext.o ${libext_objs}
33 + ${AM_VERBOSE_CCLD} ${CCLD} ${AM_LDFLAGS} -shared ${LDFLAGS} -o $@ $^ -L../libxtables/.libs -lxtables ${$*_LIBADD};
34
35 -libext4.a: initext4.o ${libext4_objs}
36 - ${AM_VERBOSE_AR} ${AR} crs $@ $^;
37 +libiptext4.so: initext4.o ${libext4_objs}
38 + ${AM_VERBOSE_CCLD} ${CCLD} ${AM_LDFLAGS} -shared ${LDFLAGS} -o $@ $^ -L../libxtables/.libs -lxtables ${$*_LIBADD};
39
40 -libext6.a: initext6.o ${libext6_objs}
41 - ${AM_VERBOSE_AR} ${AR} crs $@ $^;
42 +libiptext6.so: initext6.o ${libext6_objs}
43 + ${AM_VERBOSE_CCLD} ${CCLD} ${AM_LDFLAGS} -shared ${LDFLAGS} -o $@ $^ -L../libxtables/.libs -lxtables ${$*_LIBADD};
44
45 initext_func := $(addprefix xt_,${pfx_build_static})
46 initext4_func := $(addprefix ipt_,${pf4_build_static})
47 Index: iptables-1.4.21/iptables/Makefile.am
48 ===================================================================
49 --- iptables-1.4.21.orig/iptables/Makefile.am
50 +++ iptables-1.4.21/iptables/Makefile.am
51 @@ -5,7 +5,8 @@ AM_CPPFLAGS = ${regular_CPPFLAGS} -
52
53 xtables_multi_SOURCES = xtables-multi.c iptables-xml.c
54 xtables_multi_CFLAGS = ${AM_CFLAGS}
55 -xtables_multi_LDADD = ../extensions/libext.a
56 +xtables_multi_LDADD =
57 +xtables_multi_LDFLAGS = -L../extensions/ -liptext
58 if ENABLE_STATIC
59 xtables_multi_CFLAGS += -DALL_INCLUSIVE
60 endif
61 @@ -13,13 +14,15 @@ if ENABLE_IPV4
62 xtables_multi_SOURCES += iptables-save.c iptables-restore.c \
63 iptables-standalone.c iptables.c
64 xtables_multi_CFLAGS += -DENABLE_IPV4
65 -xtables_multi_LDADD += ../libiptc/libip4tc.la ../extensions/libext4.a
66 +xtables_multi_LDADD += ../libiptc/libip4tc.la
67 +xtables_multi_LDFLAGS += -liptext4
68 endif
69 if ENABLE_IPV6
70 xtables_multi_SOURCES += ip6tables-save.c ip6tables-restore.c \
71 ip6tables-standalone.c ip6tables.c
72 xtables_multi_CFLAGS += -DENABLE_IPV6
73 -xtables_multi_LDADD += ../libiptc/libip6tc.la ../extensions/libext6.a
74 +xtables_multi_LDADD += ../libiptc/libip6tc.la
75 +xtables_multi_LDFLAGS += -liptext6
76 endif
77 xtables_multi_SOURCES += xshared.c
78 xtables_multi_LDADD += ../libxtables/libxtables.la -lm