1# 
2# Copyright (C) 2006 OpenWrt.org
3#
4# This is free software, licensed under the GNU General Public License v2.
5# See /LICENSE for more information.
6#
7include $(TOPDIR)/rules.mk
8
9PKG_NAME:=binutils
10PKG_VERSION:=$(strip $(subst ",, $(CONFIG_BINUTILS_VERSION)))
11#"))
12
13PKG_SOURCE_URL:=http://ftp.gnu.org/gnu/binutils/ \
14	ftp://gatekeeper.dec.com/pub/GNU/ \
15        ftp://ftp.uu.net/archive/systems/gnu/ \
16        ftp://ftp.eu.uu.net/pub/gnu/ \
17        ftp://ftp.funet.fi/pub/gnu/prep/ \
18        ftp://ftp.leo.org/pub/comp/os/unix/gnu/ 
19
20PKG_SOURCE:=binutils-$(PKG_VERSION).tar.bz2
21PATCH_DIR:=./patches/$(PKG_VERSION)
22STAGING_DIR_HOST:=$(TOOLCHAIN_DIR)
23BUILD_DIR_HOST:=$(BUILD_DIR_TOOLCHAIN)
24
25include $(INCLUDE_DIR)/host-build.mk
26
27EXTRA_TARGET=$(if $(CONFIG_EXTRA_TARGET_ARCH),--enable-targets=$(call qstrip,$(CONFIG_EXTRA_TARGET_ARCH_NAME))-linux-uclibc)
28
29define Build/Configure
30	$(CP) $(SCRIPT_DIR)/config.{guess,sub} $(PKG_BUILD_DIR)/
31	(cd $(PKG_BUILD_DIR); \
32		./configure \
33		--prefix=$(STAGING_DIR_HOST) \
34		--build=$(GNU_HOST_NAME) \
35		--host=$(GNU_HOST_NAME) \
36		--target=$(REAL_GNU_TARGET_NAME) \
37		--with-sysroot=$(TOOLCHAIN_DIR) \
38		--disable-multilib \
39		--disable-werror \
40		--disable-nls \
41		$(EXTRA_TARGET) \
42		$(SOFT_FLOAT_CONFIG_OPTION) \
43		$(call qstrip,$(CONFIG_EXTRA_BINUTILS_CONFIG_OPTIONS)) \
44	);
45endef
46
47define Build/Compile
48	$(MAKE) -C $(PKG_BUILD_DIR) all
49endef
50
51define Build/Install
52	$(MAKE) -C $(PKG_BUILD_DIR) install
53endef
54
55$(eval $(call HostBuild))
56