2 # Copyright (C) 2006-2008 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
7 include $(TOPDIR)/rules.mk
10 PKG_VERSION:=$(call qstrip,$(CONFIG_BINUTILS_VERSION))
12 PKG_SOURCE_URL:=@GNU/binutils/
13 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 ifeq ($(PKG_VERSION),2.17)
16 PKG_MD5SUM:=e26e2e06b6e4bf3acf1dc8688a94c0d1
18 ifeq ($(PKG_VERSION),2.18)
19 PKG_MD5SUM:=9d22ee4dafa3a194457caf4706f9cf01
21 ifeq ($(PKG_VERSION),2.19)
22 PKG_MD5SUM:=17a52219dee5a76c1a9d9b0bfd337d66
25 PATCH_DIR:=./patches/$(PKG_VERSION)
27 REAL_STAGING_DIR_HOST:=$(STAGING_DIR_HOST)
28 STAGING_DIR_HOST:=$(TOOLCHAIN_DIR)
29 BUILD_DIR_HOST:=$(BUILD_DIR_TOOLCHAIN)
31 override CONFIG_AUTOREBUILD=
33 include $(INCLUDE_DIR)/host-build.mk
35 EXTRA_TARGET=$(if $(CONFIG_EXTRA_TARGET_ARCH),--enable-targets=$(call qstrip,$(CONFIG_EXTRA_TARGET_ARCH_NAME))-linux-$(TARGET_SUFFIX))
37 ifneq ($(CONFIG_SSP_SUPPORT),)
38 LIB_SSP:=--enable-libssp
40 LIB_SSP:=--disable-libssp
44 $(call Build/Prepare/Default)
45 ln -snf $(PKG_NAME)-$(PKG_VERSION) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
46 $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(PKG_BUILD_DIR)/
49 define Build/Configure
50 (cd $(PKG_BUILD_DIR); \
52 --prefix=$(TOOLCHAIN_DIR)/usr \
53 --build=$(GNU_HOST_NAME) \
54 --host=$(GNU_HOST_NAME) \
55 --target=$(REAL_GNU_TARGET_NAME) \
56 --with-sysroot=$(TOOLCHAIN_DIR) \
62 $(SOFT_FLOAT_CONFIG_OPTION) \
63 $(call qstrip,$(CONFIG_EXTRA_BINUTILS_CONFIG_OPTIONS)) \
68 $(MAKE) -C $(PKG_BUILD_DIR) all
72 $(MAKE) -C $(PKG_BUILD_DIR) install
73 $(CP) $(TOOLCHAIN_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)-readelf $(REAL_STAGING_DIR_HOST)/bin/readelf
79 $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
82 $(eval $(call HostBuild))