build: add support for fixing up library soname

This makes it possible to declare a package ABI_VERSION independent from the
upstream soname by setting PKG_ABI_VERSION in the package makefile.
The library filename is fixed up for files installed to packages and to the
staging dir. References to the original from executables within the same
package are also fixed up

Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
Felix Fietkau
2021-02-12 09:56:56 +01:00
parent 8597da20ac
commit b12288fa69
4 changed files with 86 additions and 0 deletions

View File

@@ -339,6 +339,10 @@ else
$(SCRIPT_DIR)/rstrip.sh
endif
SET_ABI_VERSION= \
PATCHELF="$(STAGING_DIR_HOST)/bin/patchelf" \
$(SCRIPT_DIR)/set-abi-version.sh
ifeq ($(CONFIG_IPV6),y)
DISABLE_IPV6:=
else
@@ -428,6 +432,8 @@ $(shell \
)
endef
abi_version_str = $(subst -,,$(subst _,,$(subst .,,$(1))))
COMMITCOUNT = $(if $(DUMP),0,$(call commitcount))
AUTORELEASE = $(if $(DUMP),0,$(call commitcount,1))