1 --- a/extensions/GNUmakefile.in
2 +++ b/extensions/GNUmakefile.in
4 pfx_build_mod := $(filter-out @blacklist_modules@,${pfx_build_mod})
5 pf4_build_mod := $(filter-out @blacklist_modules@,${pf4_build_mod})
6 pf6_build_mod := $(filter-out @blacklist_modules@,${pf6_build_mod})
7 -pfx_objs := $(patsubst %,libxt_%.o,${pfx_build_mod})
8 -pf4_objs := $(patsubst %,libipt_%.o,${pf4_build_mod})
9 -pf6_objs := $(patsubst %,libip6t_%.o,${pf6_build_mod})
11 +ifdef BUILTIN_MODULES
12 +pfx_build_static := $(filter $(BUILTIN_MODULES),${pfx_build_mod})
13 +pf4_build_static := $(filter $(BUILTIN_MODULES),${pf4_build_mod})
14 +pf6_build_static := $(filter $(BUILTIN_MODULES),${pf6_build_mod})
16 +@ENABLE_STATIC_TRUE@ pfx_build_static := $(pfx_build_mod)
17 +@ENABLE_STATIC_TRUE@ pf4_build_static := $(pf4_build_mod)
18 +@ENABLE_STATIC_TRUE@ pf6_build_static := $(pf6_build_mod)
21 +pfx_build_mod := $(filter-out $(pfx_build_static),$(pfx_build_mod))
22 +pf4_build_mod := $(filter-out $(pf4_build_static),$(pf4_build_mod))
23 +pf6_build_mod := $(filter-out $(pf6_build_static),$(pf6_build_mod))
25 +pfx_objs := $(patsubst %,libxt_%.o,${pfx_build_static})
26 +pf4_objs := $(patsubst %,libipt_%.o,${pf4_build_static})
27 +pf6_objs := $(patsubst %,libip6t_%.o,${pf6_build_static})
28 pfx_solibs := $(patsubst %,libxt_%.so,${pfx_build_mod})
29 pf4_solibs := $(patsubst %,libipt_%.so,${pf4_build_mod})
30 pf6_solibs := $(patsubst %,libip6t_%.so,${pf6_build_mod})
32 targets := libext4.a libext6.a matches4.man matches6.man \
33 targets4.man targets6.man
35 -@ENABLE_STATIC_TRUE@ libext4_objs := ${pfx_objs} ${pf4_objs}
36 -@ENABLE_STATIC_TRUE@ libext6_objs := ${pfx_objs} ${pf6_objs}
37 -@ENABLE_STATIC_FALSE@ targets += ${pfx_solibs} ${pf4_solibs} ${pf6_solibs}
38 -@ENABLE_STATIC_FALSE@ targets_install += ${pfx_solibs} ${pf4_solibs} ${pf6_solibs}
39 +libext4_objs := ${pfx_objs} ${pf4_objs}
40 +libext6_objs := ${pfx_objs} ${pf6_objs}
41 +targets += ${pfx_solibs} ${pf4_solibs} ${pf6_solibs}
42 +targets_install += ${pfx_solibs} ${pf4_solibs} ${pf6_solibs}
47 libext6.a: initext6.o ${libext6_objs}
48 ${AM_VERBOSE_AR} ${AR} crs $@ $^;
50 -initext_func := $(addprefix xt_,${pfx_build_mod}) $(addprefix ipt_,${pf4_build_mod})
51 -initext6_func := $(addprefix xt_,${pfx_build_mod}) $(addprefix ip6t_,${pf6_build_mod})
52 +initext_func := $(addprefix xt_,${pfx_build_static}) $(addprefix ipt_,${pf4_build_static})
53 +initext6_func := $(addprefix xt_,${pfx_build_static}) $(addprefix ip6t_,${pf6_build_static})
56 @echo "${initext_func}" >$@.tmp; \