9c53c2bfed287bbb12db20fb05d8ada190247c3d
[openwrt/openwrt.git] / package / network / utils / iptables / patches / 200-configurable_builtin.patch
1 --- a/extensions/GNUmakefile.in
2 +++ b/extensions/GNUmakefile.in
3 @@ -50,11 +50,31 @@ pfb_build_mod := $(filter-out @blacklist
4 pfa_build_mod := $(filter-out @blacklist_modules@ @blacklist_a_modules@,${pfa_build_mod})
5 pf4_build_mod := $(filter-out @blacklist_modules@ @blacklist_4_modules@,${pf4_build_mod})
6 pf6_build_mod := $(filter-out @blacklist_modules@ @blacklist_6_modules@,${pf6_build_mod})
7 -pfx_objs := $(patsubst %,libxt_%.o,${pfx_build_mod})
8 -pfb_objs := $(patsubst %,libebt_%.o,${pfb_build_mod})
9 -pfa_objs := $(patsubst %,libarpt_%.o,${pfa_build_mod})
10 -pf4_objs := $(patsubst %,libipt_%.o,${pf4_build_mod})
11 -pf6_objs := $(patsubst %,libip6t_%.o,${pf6_build_mod})
12 +ifdef BUILTIN_MODULES
13 +pfx_build_static := $(filter $(BUILTIN_MODULES),${pfx_build_mod})
14 +pfb_build_static := $(filter $(BUILTIN_MODULES),${pfb_build_mod})
15 +pfa_build_static := $(filter $(BUILTIN_MODULES),${pfa_build_mod})
16 +pf4_build_static := $(filter $(BUILTIN_MODULES),${pf4_build_mod})
17 +pf6_build_static := $(filter $(BUILTIN_MODULES),${pf6_build_mod})
18 +else
19 +@ENABLE_STATIC_TRUE@ pfx_build_static := $(pfx_build_mod)
20 +@ENABLE_STATIC_TRUE@ pfb_build_static := $(pfb_build_mod)
21 +@ENABLE_STATIC_TRUE@ pfa_build_static := $(pfa_build_mod)
22 +@ENABLE_STATIC_TRUE@ pf4_build_static := $(pf4_build_mod)
23 +@ENABLE_STATIC_TRUE@ pf6_build_static := $(pf6_build_mod)
24 +endif
25 +
26 +pfx_build_mod := $(filter-out $(pfx_build_static),$(pfx_build_mod))
27 +pfb_build_mod := $(filter-out $(pfb_build_static),$(pfb_build_mod))
28 +pfa_build_mod := $(filter-out $(pfa_build_static),$(pfa_build_mod))
29 +pf4_build_mod := $(filter-out $(pf4_build_static),$(pf4_build_mod))
30 +pf6_build_mod := $(filter-out $(pf6_build_static),$(pf6_build_mod))
31 +
32 +pfx_objs := $(patsubst %,libxt_%.o,${pfx_build_static})
33 +pfb_objs := $(patsubst %,libebt_%.o,${pfb_build_static})
34 +pfa_objs := $(patsubst %,libarpt_%.o,${pfa_build_static})
35 +pf4_objs := $(patsubst %,libipt_%.o,${pf4_build_static})
36 +pf6_objs := $(patsubst %,libip6t_%.o,${pf6_build_static})
37 pfx_solibs := $(patsubst %,libxt_%.so,${pfx_build_mod} ${pfx_symlinks})
38 pfb_solibs := $(patsubst %,libebt_%.so,${pfb_build_mod})
39 pfa_solibs := $(patsubst %,libarpt_%.so,${pfa_build_mod})
40 @@ -67,13 +87,13 @@ pf6_solibs := $(patsubst %,libip6t_%.
41 #
42 targets := libext.a libext4.a libext6.a libext_ebt.a libext_arpt.a matches.man targets.man
43 targets_install :=
44 -@ENABLE_STATIC_TRUE@ libext_objs := ${pfx_objs}
45 -@ENABLE_STATIC_TRUE@ libext_ebt_objs := ${pfb_objs}
46 -@ENABLE_STATIC_TRUE@ libext_arpt_objs := ${pfa_objs}
47 -@ENABLE_STATIC_TRUE@ libext4_objs := ${pf4_objs}
48 -@ENABLE_STATIC_TRUE@ libext6_objs := ${pf6_objs}
49 -@ENABLE_STATIC_FALSE@ targets += ${pfx_solibs} ${pfb_solibs} ${pf4_solibs} ${pf6_solibs} ${pfa_solibs}
50 -@ENABLE_STATIC_FALSE@ targets_install += ${pfx_solibs} ${pfb_solibs} ${pf4_solibs} ${pf6_solibs} ${pfa_solibs}
51 +libext_objs := ${pfx_objs}
52 +libext_ebt_objs := ${pfb_objs}
53 +libext_arpt_objs := ${pfa_objs}
54 +libext4_objs := ${pf4_objs}
55 +libext6_objs := ${pf6_objs}
56 +targets += ${pfx_solibs} ${pfb_solibs} ${pf4_solibs} ${pf6_solibs} ${pfa_solibs}
57 +targets_install := $(strip ${pfx_solibs} ${pfb_solibs} ${pf4_solibs} ${pf6_solibs} ${pfa_solibs})
58
59 .SECONDARY:
60
61 @@ -141,11 +161,11 @@ libext4.a: initext4.o ${libext4_objs}
62 libext6.a: initext6.o ${libext6_objs}
63 ${AM_VERBOSE_AR} ${AR} crs $@ $^;
64
65 -initext_func := $(addprefix xt_,${pfx_build_mod})
66 -initextb_func := $(addprefix ebt_,${pfb_build_mod})
67 -initexta_func := $(addprefix arpt_,${pfa_build_mod})
68 -initext4_func := $(addprefix ipt_,${pf4_build_mod})
69 -initext6_func := $(addprefix ip6t_,${pf6_build_mod})
70 +initext_func := $(addprefix xt_,${pfx_build_static})
71 +initextb_func := $(addprefix ebt_,${pfb_build_static})
72 +initexta_func := $(addprefix arpt_,${pfa_build_static})
73 +initext4_func := $(addprefix ipt_,${pf4_build_static})
74 +initext6_func := $(addprefix ip6t_,${pf6_build_static})
75
76 .initext.dd: FORCE
77 @echo "${initext_func}" >$@.tmp; \