binutils: add support for v2.19.1 (from #4492, thanks to dwrobel)
[openwrt/openwrt.git] / toolchain / binutils / Makefile
1 #
2 # Copyright (C) 2006-2009 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 include $(TOPDIR)/rules.mk
8
9 PKG_NAME:=binutils
10 PKG_VERSION:=$(call qstrip,$(CONFIG_BINUTILS_VERSION))
11
12 PKG_SOURCE_URL:=@GNU/binutils/
13 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
14
15 ifeq ($(PKG_VERSION),2.17)
16 PKG_MD5SUM:=e26e2e06b6e4bf3acf1dc8688a94c0d1
17 endif
18 ifeq ($(PKG_VERSION),2.18)
19 PKG_MD5SUM:=9d22ee4dafa3a194457caf4706f9cf01
20 endif
21 ifeq ($(PKG_VERSION),2.19)
22 PKG_MD5SUM:=17a52219dee5a76c1a9d9b0bfd337d66
23 endif
24 ifeq ($(PKG_VERSION),2.19.1)
25 PKG_MD5SUM:=09a8c5821a2dfdbb20665bc0bd680791
26 endif
27
28 PATCH_DIR:=./patches/$(PKG_VERSION)
29
30 REAL_STAGING_DIR_HOST:=$(STAGING_DIR_HOST)
31 STAGING_DIR_HOST:=$(TOOLCHAIN_DIR)
32 BUILD_DIR_HOST:=$(BUILD_DIR_TOOLCHAIN)
33
34 override CONFIG_AUTOREBUILD=
35
36 include $(INCLUDE_DIR)/host-build.mk
37
38 EXTRA_TARGET=$(if $(CONFIG_EXTRA_TARGET_ARCH),--enable-targets=$(call qstrip,$(CONFIG_EXTRA_TARGET_ARCH_NAME))-linux-$(TARGET_SUFFIX))
39
40 ifneq ($(CONFIG_SSP_SUPPORT),)
41 LIB_SSP:=--enable-libssp
42 else
43 LIB_SSP:=--disable-libssp
44 endif
45
46 define Build/Prepare
47 $(call Build/Prepare/Default)
48 ln -snf $(PKG_NAME)-$(PKG_VERSION) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
49 $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(PKG_BUILD_DIR)/
50 endef
51
52 define Build/Configure
53 (cd $(PKG_BUILD_DIR); \
54 ./configure \
55 --prefix=$(TOOLCHAIN_DIR)/usr \
56 --build=$(GNU_HOST_NAME) \
57 --host=$(GNU_HOST_NAME) \
58 --target=$(REAL_GNU_TARGET_NAME) \
59 --with-sysroot=$(TOOLCHAIN_DIR) \
60 --disable-multilib \
61 --disable-werror \
62 --disable-nls \
63 $(LIB_SSP) \
64 $(EXTRA_TARGET) \
65 $(SOFT_FLOAT_CONFIG_OPTION) \
66 $(call qstrip,$(CONFIG_EXTRA_BINUTILS_CONFIG_OPTIONS)) \
67 );
68 endef
69
70 define Build/Compile
71 $(MAKE) -C $(PKG_BUILD_DIR) all
72 endef
73
74 define Build/Install
75 $(MAKE) -C $(PKG_BUILD_DIR) install
76 $(CP) $(TOOLCHAIN_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)-readelf $(REAL_STAGING_DIR_HOST)/bin/readelf
77 endef
78
79 define Build/Clean
80 rm -rf \
81 $(PKG_BUILD_DIR) \
82 $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
83 endef
84
85 $(eval $(call HostBuild))