200-configurable_builtin.patch 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. --- a/extensions/GNUmakefile.in
  2. +++ b/extensions/GNUmakefile.in
  3. @@ -45,9 +45,24 @@ pfx_symlinks := NOTRACK state
  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})
  10. +
  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})
  15. +else
  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)
  19. +endif
  20. +
  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))
  24. +
  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} ${pfx_symlinks})
  29. pf4_solibs := $(patsubst %,libipt_%.so,${pf4_build_mod})
  30. pf6_solibs := $(patsubst %,libip6t_%.so,${pf6_build_mod})
  31. @@ -58,11 +73,11 @@ pf6_solibs := $(patsubst %,libip6t_%.
  32. #
  33. targets := libext.a libext4.a libext6.a matches.man targets.man
  34. targets_install :=
  35. -@ENABLE_STATIC_TRUE@ libext_objs := ${pfx_objs}
  36. -@ENABLE_STATIC_TRUE@ libext4_objs := ${pf4_objs}
  37. -@ENABLE_STATIC_TRUE@ libext6_objs := ${pf6_objs}
  38. -@ENABLE_STATIC_FALSE@ targets += ${pfx_solibs} ${pf4_solibs} ${pf6_solibs}
  39. -@ENABLE_STATIC_FALSE@ targets_install += ${pfx_solibs} ${pf4_solibs} ${pf6_solibs}
  40. +libext_objs := ${pfx_objs}
  41. +libext4_objs := ${pf4_objs}
  42. +libext6_objs := ${pf6_objs}
  43. +targets += ${pfx_solibs} ${pf4_solibs} ${pf6_solibs}
  44. +targets_install := $(strip ${targets_install} ${pfx_solibs} ${pf4_solibs} ${pf6_solibs})
  45. .SECONDARY:
  46. @@ -126,9 +141,9 @@ libext4.a: initext4.o ${libext4_objs}
  47. libext6.a: initext6.o ${libext6_objs}
  48. ${AM_VERBOSE_AR} ${AR} crs $@ $^;
  49. -initext_func := $(addprefix xt_,${pfx_build_mod})
  50. -initext4_func := $(addprefix ipt_,${pf4_build_mod})
  51. -initext6_func := $(addprefix ip6t_,${pf6_build_mod})
  52. +initext_func := $(addprefix xt_,${pfx_build_static})
  53. +initext4_func := $(addprefix ipt_,${pf4_build_static})
  54. +initext6_func := $(addprefix ip6t_,${pf6_build_static})
  55. .initext.dd: FORCE
  56. @echo "${initext_func}" >$@.tmp; \