build: add support for fixing up library soname
[openwrt/staging/rmilecki.git] / rules.mk
index b1b69eabf9ea735d9f1c41446e80c6a4a6c4308a..c6bd7327c5857d2eac0771e23ad23a666764c8db 100644 (file)
--- a/rules.mk
+++ b/rules.mk
@@ -1,10 +1,7 @@
+# SPDX-License-Identifier: GPL-2.0-only
 #
 # Copyright (C) 2006-2010 OpenWrt.org
 # Copyright (C) 2016 LEDE Project
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
 
 ifneq ($(__rules_inc),1)
 __rules_inc=1
@@ -342,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
@@ -431,8 +432,10 @@ $(shell \
 )
 endef
 
-COMMITCOUNT = $(if $(DUMP),,$(call commitcount))
-AUTORELEASE = $(if $(DUMP),,$(call commitcount,1))
+abi_version_str = $(subst -,,$(subst _,,$(subst .,,$(1))))
+
+COMMITCOUNT = $(if $(DUMP),0,$(call commitcount))
+AUTORELEASE = $(if $(DUMP),0,$(call commitcount,1))
 
 all:
 FORCE: ;