200-configurable_builtin.patch 4.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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})
  38. pfb_solibs := $(patsubst %,libebt_%.so,${pfb_build_mod})
  39. pfa_solibs := $(patsubst %,libarpt_%.so,${pfa_build_mod})
  40. @@ -68,14 +88,14 @@ pfx_symlink_files := $(patsubst %,libxt_
  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} ${pfx_symlink_files}
  50. -@ENABLE_STATIC_FALSE@ targets_install += ${pfx_solibs} ${pfb_solibs} ${pf4_solibs} ${pf6_solibs} ${pfa_solibs}
  51. -@ENABLE_STATIC_FALSE@ symlinks_install := ${pfx_symlink_files}
  52. +libext_objs := ${pfx_objs}
  53. +libext_ebt_objs := ${pfb_objs}
  54. +libext_arpt_objs := ${pfa_objs}
  55. +libext4_objs := ${pf4_objs}
  56. +libext6_objs := ${pf6_objs}
  57. +targets += ${pfx_solibs} ${pfb_solibs} ${pf4_solibs} ${pf6_solibs} ${pfa_solibs} ${pfx_symlink_files}
  58. +targets_install := $(strip ${pfx_solibs} ${pfb_solibs} ${pf4_solibs} ${pf6_solibs} ${pfa_solibs})
  59. +symlinks_install := ${pfx_symlink_files}
  60. .SECONDARY:
  61. @@ -163,11 +183,11 @@ libext4.a: initext4.o ${libext4_objs}
  62. libext6.a: initext6.o ${libext6_objs}
  63. ${AM_VERBOSE_AR} ${AR} crs $@ $^;
  64. -initext_func := $(addprefix xt_,${pfx_build_mod})
  65. -initextb_func := $(addprefix ebt_,${pfb_build_mod})
  66. -initexta_func := $(addprefix arpt_,${pfa_build_mod})
  67. -initext4_func := $(addprefix ipt_,${pf4_build_mod})
  68. -initext6_func := $(addprefix ip6t_,${pf6_build_mod})
  69. +initext_func := $(addprefix xt_,${pfx_build_static})
  70. +initextb_func := $(addprefix ebt_,${pfb_build_static})
  71. +initexta_func := $(addprefix arpt_,${pfa_build_static})
  72. +initext4_func := $(addprefix ipt_,${pf4_build_static})
  73. +initext6_func := $(addprefix ip6t_,${pf6_build_static})
  74. .initext.dd: FORCE
  75. @echo "${initext_func}" >$@.tmp; \