qoriq: add kernel 6.1 support
[openwrt/openwrt.git] / package / devel / binutils / Makefile
index 7a24884a0e8042c9349aaf3c77ac0f0a44e96df4..3fb281c2edd3b51c702335b5ca30dcbcb94f3f11 100644 (file)
@@ -8,23 +8,24 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=binutils
-PKG_VERSION:=2.27
+PKG_VERSION:=2.42
 PKG_RELEASE:=1
 
 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:=2869c9bf3e60ee97c74ac2a6bf4e9d68
+PKG_HASH:=f6e4d41fd5fc778b06b7891457b3620da5ecea1006c6a4a41ae998109f85a800
 
-PKG_FIXUP:=autoreconf
-PKG_LIBTOOL_PATHS:=. gas bfd opcodes gprof binutils ld libiberty gold intl
+PKG_FIXUP:=patch-libtool
+PKG_LIBTOOL_PATHS:=. gas bfd opcodes gprof gprofng binutils ld libiberty gold intl libctf libsframe
 PKG_REMOVE_FILES:=libtool.m4
 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
+PKG_BUILD_FLAGS:=no-mips16
 
 include $(INCLUDE_DIR)/nls.mk
 include $(INCLUDE_DIR)/package.mk
@@ -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,19 @@ 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 \
+       --with-system-zlib \
+       --without-zstd \
+       --without-msgpack \
+       --disable-gprofng
 
 define Build/Install
        $(call Build/Install/Default)
@@ -92,7 +108,13 @@ 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/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsframe*.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 +135,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))