1
0

600-shared-libext.patch 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. Index: iptables-1.4.21/extensions/GNUmakefile.in
  2. ===================================================================
  3. --- iptables-1.4.21.orig/extensions/GNUmakefile.in
  4. +++ iptables-1.4.21/extensions/GNUmakefile.in
  5. @@ -71,7 +71,7 @@ pf6_solibs := $(patsubst %,libip6t_%.
  6. #
  7. # Building blocks
  8. #
  9. -targets := libext.a libext4.a libext6.a matches.man targets.man
  10. +targets := libiptext.so libiptext4.so libiptext6.so matches.man targets.man
  11. targets_install :=
  12. libext_objs := ${pfx_objs}
  13. libext4_objs := ${pf4_objs}
  14. @@ -96,7 +96,7 @@ clean:
  15. distclean: clean
  16. init%.o: init%.c
  17. - ${AM_VERBOSE_CC} ${CC} ${AM_CPPFLAGS} ${AM_DEPFLAGS} ${AM_CFLAGS} -D_INIT=$*_init ${CFLAGS} -o $@ -c $<;
  18. + ${AM_VERBOSE_CC} ${CC} ${AM_CPPFLAGS} ${AM_DEPFLAGS} ${AM_CFLAGS} -D_INIT=$*_init -DPIC -fPIC ${CFLAGS} -o $@ -c $<;
  19. -include .*.d
  20. @@ -130,16 +130,16 @@ xt_statistic_LIBADD = -lm
  21. # handling code in the Makefiles.
  22. #
  23. lib%.o: ${srcdir}/lib%.c
  24. - ${AM_VERBOSE_CC} ${CC} ${AM_CPPFLAGS} ${AM_DEPFLAGS} ${AM_CFLAGS} -DNO_SHARED_LIBS=1 -D_INIT=lib$*_init ${CFLAGS} -o $@ -c $<;
  25. + ${AM_VERBOSE_CC} ${CC} ${AM_CPPFLAGS} ${AM_DEPFLAGS} ${AM_CFLAGS} -DNO_SHARED_LIBS=1 -D_INIT=lib$*_init -DPIC -fPIC ${CFLAGS} -o $@ -c $<;
  26. -libext.a: initext.o ${libext_objs}
  27. - ${AM_VERBOSE_AR} ${AR} crs $@ $^;
  28. +libiptext.so: initext.o ${libext_objs}
  29. + ${AM_VERBOSE_CCLD} ${CCLD} ${AM_LDFLAGS} -shared ${LDFLAGS} -o $@ $^ -L../libxtables/.libs -lxtables ${$*_LIBADD};
  30. -libext4.a: initext4.o ${libext4_objs}
  31. - ${AM_VERBOSE_AR} ${AR} crs $@ $^;
  32. +libiptext4.so: initext4.o ${libext4_objs}
  33. + ${AM_VERBOSE_CCLD} ${CCLD} ${AM_LDFLAGS} -shared ${LDFLAGS} -o $@ $^ -L../libxtables/.libs -lxtables ${$*_LIBADD};
  34. -libext6.a: initext6.o ${libext6_objs}
  35. - ${AM_VERBOSE_AR} ${AR} crs $@ $^;
  36. +libiptext6.so: initext6.o ${libext6_objs}
  37. + ${AM_VERBOSE_CCLD} ${CCLD} ${AM_LDFLAGS} -shared ${LDFLAGS} -o $@ $^ -L../libxtables/.libs -lxtables ${$*_LIBADD};
  38. initext_func := $(addprefix xt_,${pfx_build_static})
  39. initext4_func := $(addprefix ipt_,${pf4_build_static})
  40. Index: iptables-1.4.21/iptables/Makefile.am
  41. ===================================================================
  42. --- iptables-1.4.21.orig/iptables/Makefile.am
  43. +++ iptables-1.4.21/iptables/Makefile.am
  44. @@ -5,7 +5,8 @@ AM_CPPFLAGS = ${regular_CPPFLAGS} -
  45. xtables_multi_SOURCES = xtables-multi.c iptables-xml.c
  46. xtables_multi_CFLAGS = ${AM_CFLAGS}
  47. -xtables_multi_LDADD = ../extensions/libext.a
  48. +xtables_multi_LDADD =
  49. +xtables_multi_LDFLAGS = -L../extensions/ -liptext
  50. if ENABLE_STATIC
  51. xtables_multi_CFLAGS += -DALL_INCLUSIVE
  52. endif
  53. @@ -13,13 +14,15 @@ if ENABLE_IPV4
  54. xtables_multi_SOURCES += iptables-save.c iptables-restore.c \
  55. iptables-standalone.c iptables.c
  56. xtables_multi_CFLAGS += -DENABLE_IPV4
  57. -xtables_multi_LDADD += ../libiptc/libip4tc.la ../extensions/libext4.a
  58. +xtables_multi_LDADD += ../libiptc/libip4tc.la
  59. +xtables_multi_LDFLAGS += -liptext4
  60. endif
  61. if ENABLE_IPV6
  62. xtables_multi_SOURCES += ip6tables-save.c ip6tables-restore.c \
  63. ip6tables-standalone.c ip6tables.c
  64. xtables_multi_CFLAGS += -DENABLE_IPV6
  65. -xtables_multi_LDADD += ../libiptc/libip6tc.la ../extensions/libext6.a
  66. +xtables_multi_LDADD += ../libiptc/libip6tc.la
  67. +xtables_multi_LDFLAGS += -liptext6
  68. endif
  69. xtables_multi_SOURCES += xshared.c
  70. xtables_multi_LDADD += ../libxtables/libxtables.la -lm