From 68ebc73ece3a9c4aad5045b7742662ece6989cf1 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Fri, 22 Mar 2019 19:31:06 +0100 Subject: extensions: Install symlinks as such Fake shared objects which are actually symlinks to others are installed using 'install' tool which follows them and therefore installs a copy of the file they point at. Fix this by introducing special handling for them in install target. Reported-by: Wenle Chen Fixes: 269655d54e22f ("build: remove symlink-only extensions from static object list") Signed-off-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso --- extensions/GNUmakefile.in | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'extensions/GNUmakefile.in') diff --git a/extensions/GNUmakefile.in b/extensions/GNUmakefile.in index c0d73cd2..0842a553 100644 --- a/extensions/GNUmakefile.in +++ b/extensions/GNUmakefile.in @@ -55,11 +55,12 @@ pfb_objs := $(patsubst %,libebt_%.o,${pfb_build_mod}) pfa_objs := $(patsubst %,libarpt_%.o,${pfa_build_mod}) pf4_objs := $(patsubst %,libipt_%.o,${pf4_build_mod}) pf6_objs := $(patsubst %,libip6t_%.o,${pf6_build_mod}) -pfx_solibs := $(patsubst %,libxt_%.so,${pfx_build_mod} ${pfx_symlinks}) +pfx_solibs := $(patsubst %,libxt_%.so,${pfx_build_mod}) pfb_solibs := $(patsubst %,libebt_%.so,${pfb_build_mod}) pfa_solibs := $(patsubst %,libarpt_%.so,${pfa_build_mod}) pf4_solibs := $(patsubst %,libipt_%.so,${pf4_build_mod}) pf6_solibs := $(patsubst %,libip6t_%.so,${pf6_build_mod}) +pfx_symlink_files := $(patsubst %,libxt_%.so,${pfx_symlinks}) # @@ -72,8 +73,9 @@ targets_install := @ENABLE_STATIC_TRUE@ libext_arpt_objs := ${pfa_objs} @ENABLE_STATIC_TRUE@ libext4_objs := ${pf4_objs} @ENABLE_STATIC_TRUE@ libext6_objs := ${pf6_objs} -@ENABLE_STATIC_FALSE@ targets += ${pfx_solibs} ${pfb_solibs} ${pf4_solibs} ${pf6_solibs} ${pfa_solibs} +@ENABLE_STATIC_FALSE@ targets += ${pfx_solibs} ${pfb_solibs} ${pf4_solibs} ${pf6_solibs} ${pfa_solibs} ${pfx_symlink_files} @ENABLE_STATIC_FALSE@ targets_install += ${pfx_solibs} ${pfb_solibs} ${pf4_solibs} ${pf6_solibs} ${pfa_solibs} +@ENABLE_STATIC_FALSE@ symlinks_install := ${pfx_symlink_files} .SECONDARY: @@ -81,9 +83,14 @@ targets_install := all: ${targets} -install: ${targets_install} +install: ${targets_install} ${symlinks_install} @mkdir -p "${DESTDIR}${xtlibdir}"; - if test -n "${targets_install}"; then install -pm0755 $^ "${DESTDIR}${xtlibdir}/"; fi; + if test -n "${targets_install}"; then \ + install -pm0755 ${targets_install} "${DESTDIR}${xtlibdir}/"; \ + fi; + if test -n "${symlinks_install}"; then \ + cp -P ${symlinks_install} "${DESTDIR}${xtlibdir}/"; \ + fi; clean: rm -f *.o *.oo *.so *.a {matches,targets}.man initext.c initext4.c initext6.c initextb.c initexta.c; -- cgit v1.2.3