upgrade the Linaro binutils to 2.24-2013.12
[openwrt/openwrt.git] / toolchain / binutils / Makefile
1 #
2 # Copyright (C) 2006-2013 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 BIN_VERSION:=$(PKG_VERSION)
12
13 ifeq ($(findstring linaro, $(CONFIG_BINUTILS_VERSION)),linaro)
14 PKG_SOURCE_URL:=https://releases.linaro.org/13.12/components/toolchain/binutils-linaro/
15 PKG_REV:=2.24-2013.12
16 PKG_SOURCE:=$(PKG_NAME)-linaro-$(PKG_REV).tar.xz
17 PKG_MD5SUM:=4f0fe947895a260b8386de63b09feb18
18 BINUTILS_DIR:=$(PKG_NAME)-linaro-$(PKG_REV)
19 HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(BINUTILS_DIR)
20 else
21 PKG_SOURCE_URL:=@GNU/binutils/
22 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
23
24 ifeq ($(PKG_VERSION),2.20.1)
25 PKG_MD5SUM:=9cdfb9d6ec0578c166d3beae5e15c4e5
26 endif
27 ifeq ($(PKG_VERSION),2.22)
28 PKG_MD5SUM:=ee0f10756c84979622b992a4a61ea3f5
29 endif
30 ifeq ($(PKG_VERSION),2.23.1)
31 PKG_MD5SUM:=33adb18c3048d057ac58d07a3f1adb38
32 endif
33 endif
34
35 HOST_BUILD_PARALLEL:=1
36
37 PATCH_DIR:=./patches/$(PKG_VERSION)
38
39 REAL_STAGING_DIR_HOST:=$(STAGING_DIR_HOST)
40
41 include $(INCLUDE_DIR)/toolchain-build.mk
42
43 BINUTILS_CONFIGURE:= \
44 ./configure \
45 --prefix=$(TOOLCHAIN_DIR) \
46 --build=$(GNU_HOST_NAME) \
47 --host=$(GNU_HOST_NAME) \
48 --target=$(REAL_GNU_TARGET_NAME) \
49 --with-sysroot=$(TOOLCHAIN_DIR) \
50 --disable-multilib \
51 --disable-werror \
52 --disable-nls \
53 $(GRAPHITE_CONFIGURE) \
54 $(SOFT_FLOAT_CONFIG_OPTION) \
55 $(call qstrip,$(CONFIG_EXTRA_BINUTILS_CONFIG_OPTIONS))
56
57 ifneq ($(CONFIG_SSP_SUPPORT),)
58 BINUTILS_CONFIGURE+= \
59 --enable-libssp
60 else
61 BINUTILS_CONFIGURE+= \
62 --disable-libssp
63 endif
64
65 ifneq ($(CONFIG_EXTRA_TARGET_ARCH),)
66 BINUTILS_CONFIGURE+= \
67 --enable-targets=$(call qstrip,$(CONFIG_EXTRA_TARGET_ARCH_NAME))-linux-$(TARGET_SUFFIX)
68 endif
69
70 define Host/Prepare
71 $(call Host/Prepare/Default)
72 ln -snf $(PKG_NAME)-$(PKG_VERSION) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
73 $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(HOST_BUILD_DIR)/
74 endef
75
76 define Host/Configure
77 (cd $(HOST_BUILD_DIR); \
78 $(BINUTILS_CONFIGURE) \
79 );
80 endef
81
82 define Host/Compile
83 +$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) all
84 endef
85
86 define Host/Install
87 mkdir -p $(TOOLCHAIN_DIR)/initial
88 $(MAKE) -C $(HOST_BUILD_DIR) \
89 prefix=$(TOOLCHAIN_DIR)/initial \
90 install
91 $(call FixupLibdir,$(TOOLCHAIN_DIR)/initial)
92 $(CP) $(TOOLCHAIN_DIR)/initial/. $(TOOLCHAIN_DIR)/
93 $(CP) $(TOOLCHAIN_DIR)/bin/$(REAL_GNU_TARGET_NAME)-readelf $(REAL_STAGING_DIR_HOST)/bin/readelf
94 endef
95
96 define Host/Clean
97 rm -rf \
98 $(HOST_BUILD_DIR) \
99 $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
100 endef
101
102 $(eval $(call HostBuild))