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
22 PATCH_DIR:=./patches/$(PKG_VERSION)
24 STAGING_DIR_HOST:=$(TOOLCHAIN_DIR)
25 BUILD_DIR_HOST:=$(BUILD_DIR_TOOLCHAIN)
27 override CONFIG_AUTOREBUILD=
29 include $(INCLUDE_DIR)/host-build.mk
31 EXTRA_TARGET=$(if $(CONFIG_EXTRA_TARGET_ARCH),--enable-targets=$(call qstrip,$(CONFIG_EXTRA_TARGET_ARCH_NAME))-linux-$(TARGET_SUFFIX))
34 $(call Build/Prepare/Default)
35 ln -snf $(PKG_NAME)-$(PKG_VERSION) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
36 $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(PKG_BUILD_DIR)/
39 define Build/Configure
40 (cd $(PKG_BUILD_DIR); \
42 --prefix=$(TOOLCHAIN_DIR)/usr \
43 --build=$(GNU_HOST_NAME) \
44 --host=$(GNU_HOST_NAME) \
45 --target=$(REAL_GNU_TARGET_NAME) \
46 --with-sysroot=$(TOOLCHAIN_DIR) \
51 $(SOFT_FLOAT_CONFIG_OPTION) \
52 $(call qstrip,$(CONFIG_EXTRA_BINUTILS_CONFIG_OPTIONS)) \
57 $(MAKE) -C $(PKG_BUILD_DIR) all
61 $(MAKE) -C $(PKG_BUILD_DIR) install
67 $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
70 $(eval $(call HostBuild))