600-shared-libext.patch 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. --- a/extensions/GNUmakefile.in
  2. +++ b/extensions/GNUmakefile.in
  3. @@ -86,7 +86,7 @@ pfx_symlink_files := $(patsubst %,libxt_
  4. #
  5. # Building blocks
  6. #
  7. -targets := libext.a libext4.a libext6.a libext_ebt.a libext_arpt.a matches.man targets.man
  8. +targets := libiptext.so libiptext4.so libiptext6.so libiptext_ebt.so libiptext_arpt.so matches.man targets.man
  9. targets_install :=
  10. libext_objs := ${pfx_objs}
  11. libext_ebt_objs := ${pfb_objs}
  12. @@ -119,7 +119,7 @@ clean:
  13. distclean: clean
  14. init%.o: init%.c
  15. - ${AM_VERBOSE_CC} ${CC} ${AM_CPPFLAGS} ${AM_DEPFLAGS} ${AM_CFLAGS} -D_INIT=$*_init ${CFLAGS} -o $@ -c $<;
  16. + ${AM_VERBOSE_CC} ${CC} ${AM_CPPFLAGS} ${AM_DEPFLAGS} ${AM_CFLAGS} -D_INIT=$*_init -DPIC -fPIC ${CFLAGS} -o $@ -c $<;
  17. -include .*.d
  18. @@ -151,22 +151,22 @@ xt_connlabel_LIBADD = @libnetfilter_conn
  19. # handling code in the Makefiles.
  20. #
  21. lib%.o: ${srcdir}/lib%.c
  22. - ${AM_VERBOSE_CC} ${CC} ${AM_CPPFLAGS} ${AM_DEPFLAGS} ${AM_CFLAGS} -DNO_SHARED_LIBS=1 -D_INIT=lib$*_init ${CFLAGS} -o $@ -c $<;
  23. + ${AM_VERBOSE_CC} ${CC} ${AM_CPPFLAGS} ${AM_DEPFLAGS} ${AM_CFLAGS} -DNO_SHARED_LIBS=1 -D_INIT=lib$*_init -DPIC -fPIC ${CFLAGS} -o $@ -c $<;
  24. -libext.a: initext.o ${libext_objs}
  25. - ${AM_VERBOSE_AR} ${AR} crs $@ $^;
  26. +libiptext.so: initext.o ${libext_objs}
  27. + ${AM_VERBOSE_CCLD} ${CCLD} ${AM_LDFLAGS} -shared ${LDFLAGS} -o $@ $^ -L../libxtables/.libs -lxtables $(foreach obj,$^,${$(patsubst lib%.o,%,$(obj))_LIBADD});
  28. -libext_ebt.a: initextb.o ${libext_ebt_objs}
  29. - ${AM_VERBOSE_AR} ${AR} crs $@ $^;
  30. +libiptext_ebt.so: initextb.o ${libext_ebt_objs}
  31. + ${AM_VERBOSE_CCLD} ${CCLD} ${AM_LDFLAGS} -shared ${LDFLAGS} -o $@ $^ -L../libxtables/.libs -lxtables $(foreach obj,$^,${$(patsubst lib%.o,%,$(obj))_LIBADD});
  32. -libext_arpt.a: initexta.o ${libext_arpt_objs}
  33. - ${AM_VERBOSE_AR} ${AR} crs $@ $^;
  34. +libiptext_arpt.so: initexta.o ${libext_arpt_objs}
  35. + ${AM_VERBOSE_CCLD} ${CCLD} ${AM_LDFLAGS} -shared ${LDFLAGS} -o $@ $^ -L../libxtables/.libs -lxtables $(foreach obj,$^,${$(patsubst lib%.o,%,$(obj))_LIBADD});
  36. -libext4.a: initext4.o ${libext4_objs}
  37. - ${AM_VERBOSE_AR} ${AR} crs $@ $^;
  38. +libiptext4.so: initext4.o ${libext4_objs}
  39. + ${AM_VERBOSE_CCLD} ${CCLD} ${AM_LDFLAGS} -shared ${LDFLAGS} -o $@ $^ -L../libxtables/.libs -lxtables $(foreach obj,$^,${$(patsubst lib%.o,%,$(obj))_LIBADD});
  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 $(foreach obj,$^,${$(patsubst lib%.o,%,$(obj))_LIBADD});
  44. initext_func := $(addprefix xt_,${pfx_build_static})
  45. initextb_func := $(addprefix ebt_,${pfb_build_static})
  46. --- a/iptables/Makefile.am
  47. +++ b/iptables/Makefile.am
  48. @@ -8,19 +8,22 @@ BUILT_SOURCES =
  49. xtables_legacy_multi_SOURCES = xtables-legacy-multi.c iptables-xml.c
  50. xtables_legacy_multi_CFLAGS = ${AM_CFLAGS}
  51. -xtables_legacy_multi_LDADD = ../extensions/libext.a
  52. +xtables_legacy_multi_LDADD =
  53. +xtables_legacy_multi_LDFLAGS = -L../extensions/ -liptext
  54. if ENABLE_STATIC
  55. xtables_legacy_multi_CFLAGS += -DALL_INCLUSIVE
  56. endif
  57. if ENABLE_IPV4
  58. xtables_legacy_multi_SOURCES += iptables-standalone.c iptables.c
  59. xtables_legacy_multi_CFLAGS += -DENABLE_IPV4
  60. -xtables_legacy_multi_LDADD += ../libiptc/libip4tc.la ../extensions/libext4.a
  61. +xtables_legacy_multi_LDADD += ../libiptc/libip4tc.la
  62. +xtables_legacy_multi_LDFLAGS += -liptext4
  63. endif
  64. if ENABLE_IPV6
  65. xtables_legacy_multi_SOURCES += ip6tables-standalone.c ip6tables.c
  66. xtables_legacy_multi_CFLAGS += -DENABLE_IPV6
  67. -xtables_legacy_multi_LDADD += ../libiptc/libip6tc.la ../extensions/libext6.a
  68. +xtables_legacy_multi_LDADD += ../libiptc/libip6tc.la
  69. +xtables_legacy_multi_LDFLAGS += -liptext6
  70. endif
  71. xtables_legacy_multi_SOURCES += xshared.c iptables-restore.c iptables-save.c
  72. xtables_legacy_multi_LDADD += ../libxtables/libxtables.la -lm
  73. @@ -30,7 +33,8 @@ if ENABLE_NFTABLES
  74. BUILT_SOURCES += xtables-config-parser.h
  75. xtables_nft_multi_SOURCES = xtables-nft-multi.c iptables-xml.c
  76. xtables_nft_multi_CFLAGS = ${AM_CFLAGS}
  77. -xtables_nft_multi_LDADD = ../extensions/libext.a ../extensions/libext_ebt.a
  78. +xtables_nft_multi_LDADD =
  79. +xtables_nft_multi_LDFLAGS = -L../extensions/ -liptext -liptext_ebt
  80. if ENABLE_STATIC
  81. xtables_nft_multi_CFLAGS += -DALL_INCLUSIVE
  82. endif
  83. @@ -45,7 +49,8 @@ xtables_nft_multi_SOURCES += xtables-sav
  84. xtables-eb-standalone.c xtables-eb.c \
  85. xtables-eb-translate.c \
  86. xtables-translate.c
  87. -xtables_nft_multi_LDADD += ${libmnl_LIBS} ${libnftnl_LIBS} ${libnetfilter_conntrack_LIBS} ../extensions/libext4.a ../extensions/libext6.a ../extensions/libext_ebt.a ../extensions/libext_arpt.a
  88. +xtables_nft_multi_LDADD += ${libmnl_LIBS} ${libnftnl_LIBS} ${libnetfilter_conntrack_LIBS}
  89. +xtables_nft_multi_LDFLAGS += -liptext4 -liptext6 -liptext_arpt
  90. # yacc and lex generate dirty code
  91. xtables_nft_multi-xtables-config-parser.o xtables_nft_multi-xtables-config-syntax.o: AM_CFLAGS += -Wno-missing-prototypes -Wno-missing-declarations -Wno-implicit-function-declaration -Wno-nested-externs -Wno-undef -Wno-redundant-decls
  92. xtables_nft_multi_SOURCES += xshared.c