binutils: fix libbfd missing DSO dependency if NLS enabled
[openwrt/openwrt.git] / package / devel / binutils / Makefile
index 84e023a08856f9318e0ecb066bceed6cb9731238..790fb1e91a8d33cf022c33b2842c8475f7671d72 100644 (file)
@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=binutils
-PKG_VERSION:=2.25
-PKG_RELEASE:=1
+PKG_VERSION:=2.35.1
+PKG_RELEASE:=2
 
 PKG_SOURCE_URL:=@GNU/binutils
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_VERSION:=$(PKG_VERSION)
-PKG_MD5SUM:=d9f3303f802a5b6b0bb73a335ab89d66
+PKG_HASH:=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
 
 PKG_FIXUP:=autoreconf
 PKG_LIBTOOL_PATHS:=. gas bfd opcodes gprof binutils ld libiberty gold intl
@@ -23,6 +23,7 @@ PKG_INSTALL:=1
 
 PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
 PKG_LICENSE:=GPL-3.0+
+PKG_CPE_ID:=cpe:/a:gnu:binutils
 PKG_BUILD_PARALLEL:=1
 PKG_USE_MIPS16:=0
 
@@ -33,13 +34,20 @@ define Package/libbfd
   SECTION:=libs
   CATEGORY:=Libraries
   TITLE:=libbfd
-  DEPENDS:=+zlib $(ICONV_DEPENDS) $(INTL_DEPENDS)
+  DEPENDS:=+zlib $(INTL_DEPENDS)
+endef
+
+define Package/libctf
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=libctf
+  DEPENDS:=+libbfd
 endef
 
 define Package/libopcodes
   SECTION:=libs
   CATEGORY:=Libraries
-  TITLE:=libbfd
+  TITLE:=libopcodes
   DEPENDS:=+libbfd
 endef
 
@@ -48,13 +56,14 @@ define Package/binutils
   CATEGORY:=Development
   TITLE:=binutils
   DEPENDS:=+objdump +ar
+  ALTERNATIVES:=200:/usr/bin/strings:/usr/bin/binutils-strings
 endef
 
 define Package/objdump
   SECTION:=devel
   CATEGORY:=Development
   TITLE:=objdump
-  DEPENDS:=+libopcodes
+  DEPENDS:=+libopcodes +libctf
 endef
 
 define Package/ar
@@ -70,12 +79,15 @@ endef
 
 TARGET_CFLAGS += $(FPIC) -Wno-unused-value
 
+TARGET_LDFLAGS += $(if $(INTL_FULL),-lintl)
+
 CONFIGURE_ARGS += \
        --host=$(REAL_GNU_TARGET_NAME) \
        --target=$(REAL_GNU_TARGET_NAME) \
        --enable-shared \
        --enable-install-libiberty \
-       --enable-install-libbfd
+       --enable-install-libbfd \
+       --enable-install-libctf
 
 define Build/Install
        $(call Build/Install/Default)
@@ -92,7 +104,12 @@ endef
 
 define Package/libbfd/install
        $(INSTALL_DIR) $(1)/usr/lib
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libbfd*.so $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libbfd*.so* $(1)/usr/lib/
+endef
+
+define Package/libctf/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libctf*.so* $(1)/usr/lib/
 endef
 
 define Package/libopcodes/install
@@ -113,12 +130,13 @@ endef
 define Package/binutils/install
        $(INSTALL_DIR) $(1)/usr $(1)/bin
        $(CP) $(PKG_INSTALL_DIR)/usr/bin/ $(1)/usr/
-       mv $(1)/usr/bin/strings $(1)/bin/strings
+       mv $(1)/usr/bin/strings $(1)/usr/bin/binutils-strings
        rm -f $(1)/usr/bin/objdump
        rm -f $(1)/usr/bin/ar
 endef
 
 $(eval $(call BuildPackage,libbfd))
+$(eval $(call BuildPackage,libctf))
 $(eval $(call BuildPackage,libopcodes))
 $(eval $(call BuildPackage,binutils))
 $(eval $(call BuildPackage,objdump))