SHA256
1
0
forked from pool/iptables
iptables/0001-build-also-use-libtool-for-install-stage.patch

81 lines
3.7 KiB
Diff

From 145e3ea1c4c6a8e47a77587d17fcad4df4e2c06f Mon Sep 17 00:00:00 2001
From: Jan Engelhardt <jengelh@inai.de>
Date: Thu, 10 Jan 2013 15:54:08 +0100
Subject: [PATCH] build: also use libtool for install stage
The just-built library has DT_RPATH entries to be runnable from
whereever it is. If we just install that, the distro build systems
will throw warnings like
(Open Build Service) ERROR: RPATH
"/home/abuild/rpmbuild/BUILD/iptables-1.4.18/libxtables/.libs"
on /home/abuild/rpmbuild/BUILDROOT/iptables-1.4.18-0.x86_64/usr/lib64/xtables/libxt_unclean.so
is not allowed
These RPATH entries are indeed undesired for libraries in a system
location, which is why libtool produces another copy of the library on
installation. The Makefile however missed using libtool during
installation (introduced with commit v1.4.17-1-g68e77a2). This patch
now resolves this.
Signed-off-by: Jan Engelhardt <jengelh@inai.de>
---
extensions/GNUmakefile.in | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/extensions/GNUmakefile.in b/extensions/GNUmakefile.in
index 781ac6d..6467f05 100644
--- a/extensions/GNUmakefile.in
+++ b/extensions/GNUmakefile.in
@@ -49,6 +49,9 @@ pf6_build_mod := $(filter-out @blacklist_modules@,${pf6_build_mod})
pfx_objs := $(patsubst %,libxt_%.o,${pfx_build_mod})
pf4_objs := $(patsubst %,libipt_%.o,${pf4_build_mod})
pf6_objs := $(patsubst %,libip6t_%.o,${pf6_build_mod})
+pfx_lalibs := $(patsubst %,libxt_%.la,${pfx_build_mod})
+pf4_lalibs := $(patsubst %,libipt_%.la,${pf4_build_mod})
+pf6_lalibs := $(patsubst %,libip6t_%.la,${pf6_build_mod})
pfx_solibs := $(patsubst %,libxt_%.so,${pfx_build_mod})
pf4_solibs := $(patsubst %,libipt_%.so,${pf4_build_mod})
pf6_solibs := $(patsubst %,libip6t_%.so,${pf6_build_mod})
@@ -63,8 +66,9 @@ targets_instlink :=
@ENABLE_STATIC_TRUE@ libext_objs := ${pfx_objs}
@ENABLE_STATIC_TRUE@ libext4_objs := ${pf4_objs}
@ENABLE_STATIC_TRUE@ libext6_objs := ${pf6_objs}
-@ENABLE_STATIC_FALSE@ targets += ${pfx_solibs} ${pfx_symlinks} ${pf4_solibs} ${pf6_solibs}
-@ENABLE_STATIC_FALSE@ targets_install += ${pfx_solibs} ${pf4_solibs} ${pf6_solibs}
+@ENABLE_STATIC_FALSE@ targets += ${pfx_solibs} ${pf4_solibs} ${pf6_solibs}
+@ENABLE_STATIC_FALSE@ targets_la_install += ${pfx_lalibs} ${pf4_lalibs} ${pf6_lalibs}
+@ENABLE_STATIC_FALSE@ targets_so_install += ${pfx_solibs}
@ENABLE_STATIC_FALSE@ targets_instlink += ${pfx_symlinks}
.SECONDARY:
@@ -73,12 +77,14 @@ targets_instlink :=
all: ${targets}
-install: ${targets_install} ${targets_instlink}
+install: ${targets_la_install} ${targets_so_install} ${targets_instlink}
@mkdir -p "${DESTDIR}${xtlibdir}";
+ ../libtool ${AM_LIBTOOL_SILENT} --no-warn --mode=install install -pm0755 ${targets_la_install} "${DESTDIR}${xtlibdir}/"
+ rm -f "${DESTDIR}${xtlibdir}"/*.la
if test -n "${targets_install}"; then \
install -pm0755 ${targets_install} "${DESTDIR}${xtlibdir}/"; \
cp -a ${pfx_symlinks} "${DESTDIR}${xtlibdir}/"; \
- fi;
+ fi
clean:
rm -f *.la *.o *.lo *.so *.a {matches,targets}.man initext.c initext4.c initext6.c;
@@ -99,7 +105,7 @@ lib%.so: lib%.la
${AM_VERBOSE_NULL} ln -fs .libs/$@ $@
lib%.la: lib%.lo
- ${AM_VERBOSE_CCLD} ../libtool ${AM_LIBTOOL_SILENT} --tag=CC --mode=link ${CCLD} ${AM_LDFLAGS} -module ${LDFLAGS} -o $@ $< ../libxtables/libxtables.la ${$*_LIBADD} -rpath ${xtlibdir}
+ ${AM_VERBOSE_CCLD} ../libtool ${AM_LIBTOOL_SILENT} --tag=CC --mode=link ${CCLD} ${AM_LDFLAGS} -avoid-version -module ${LDFLAGS} -o $@ $< ../libxtables/libxtables.la ${$*_LIBADD} -rpath ${xtlibdir}
lib%.lo: ${srcdir}/lib%.c
${AM_VERBOSE_CC} ../libtool ${AM_LIBTOOL_SILENT} --tag=CC --mode=compile ${CC} ${AM_CPPFLAGS} ${AM_DEPFLAGS} ${AM_CFLAGS} -D_INIT=lib$*_init ${CFLAGS} -o $@ -c $<
--
1.7.10.4