From 0cc88a66c338b91d79084383ba374d82da87e837 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Mon, 30 Oct 2023 21:38:41 +0000 Subject: Fix multicall symlink installation Signed-off-by: Laurent Bercot --- Makefile | 27 ++++++++++++++++++++------- package/targets.mak | 2 +- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index b82361b..f158e82 100644 --- a/Makefile +++ b/Makefile @@ -19,6 +19,7 @@ SHARED_LIBS := INTERNAL_LIBS := EXTRA_TARGETS := LIB_DEFS := +BIN_SYMLINKS := define library_definition LIB$(firstword $(subst =, ,$(1))) := lib$(lastword $(subst =, ,$(1))).$(if $(DO_ALLSTATIC),a,so).xyzzy @@ -30,6 +31,19 @@ STATIC_LIBS += lib$(lastword $(subst =, ,$(1))).a.xyzzy endif endef +define binary_installation_rule +$(DESTDIR)$(1)/$(2): $(2) package/modes + exec $(INSTALL) -D -m 600 $$< $$@ + grep -- ^$$(@F) < package/modes | { read name mode owner && \ + if [ x$$$$owner != x ] ; then chown -- $$$$owner $$@ ; fi && \ + chmod $$$$mode $$@ ; } +endef + +define symlink_installation_rule +$(DESTDIR)$(1)/$(2): $(DESTDIR)$(1)/$(SYMLINK_TARGET_$(2)) + exec $(INSTALL) -l $$(