autotools.mk: fix gettext fixup
[openwrt/staging/wigyori.git] / include / autotools.mk
index ec67c844f7e1efe27166bd9642e0d714778eb18d..eb52b55924e95b2975f44beeb575eae611f975d4 100644 (file)
@@ -62,6 +62,12 @@ define patch_libtool
        );
 endef
 
+define set_libtool_abiver
+       sed -i \
+               -e 's,^soname_spec=.*,soname_spec="\\$$$${libname}\\$$$${shared_ext}.$(PKG_ABI_VERSION)",' \
+               -e 's,^library_names_spec=.*,library_names_spec="\\$$$${libname}\\$$$${shared_ext}.$(PKG_ABI_VERSION) \\$$$${libname}\\$$$${shared_ext}",' \
+               $(PKG_BUILD_DIR)/libtool
+endef
 
 PKG_LIBTOOL_PATHS?=$(CONFIGURE_PATH)
 PKG_AUTOMAKE_PATHS?=$(CONFIGURE_PATH)
@@ -84,7 +90,7 @@ endef
 
 define gettext_version_target
        (cd $(PKG_BUILD_DIR) && \
-               GETTEXT_VERSION=$(shell $(STAGING_DIR_HOSTPKG)/bin/gettext -V | $(STAGING_DIR_HOST)/bin/sed -ne '1s/.*\([0-9]\.[0-9]\{2\}\.[0-9]\).*/\1/p' ) && \
+               GETTEXT_VERSION=$(shell $(STAGING_DIR_HOSTPKG)/bin/gettext -V | $(STAGING_DIR_HOST)/bin/sed -rne '1s/.*\b([0-9]\.[0-9]+(\.[0-9]+)?)\b.*/\1/p' ) && \
                $(STAGING_DIR_HOST)/bin/sed \
                        -i $(PKG_BUILD_DIR)/configure.ac \
                        -e "s/AM_GNU_GETTEXT_VERSION(.*)/AM_GNU_GETTEXT_VERSION(\[$$$$GETTEXT_VERSION\])/g" && \
@@ -110,6 +116,10 @@ ifneq ($(filter libtool,$(PKG_FIXUP)),)
  endif
 endif
 
+ifneq ($(filter libtool-abiver,$(PKG_FIXUP)),)
+  Hooks/Configure/Post += set_libtool_abiver
+endif
+
 ifneq ($(filter libtool-ucxx,$(PKG_FIXUP)),)
   PKG_BUILD_DEPENDS += libtool gettext libiconv
  ifeq ($(filter no-autoreconf,$(PKG_FIXUP)),)