toolchain/binutils: add support for version 2.41
[openwrt/staging/jow.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 PKG_SOURCE_URL:=@GNU/binutils/
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
15
16 TAR_OPTIONS += --exclude='*.rej'
17
18 ifeq ($(PKG_VERSION),2.37)
19 PKG_HASH:=820d9724f020a3e69cb337893a0b63c2db161dadcb0e06fc11dc29eb1e84a32c
20 endif
21
22 ifeq ($(PKG_VERSION),2.38)
23 PKG_HASH:=e316477a914f567eccc34d5d29785b8b0f5a10208d36bbacedcc39048ecfe024
24 endif
25
26 ifeq ($(PKG_VERSION),2.39)
27 PKG_HASH:=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
28 endif
29
30 ifeq ($(PKG_VERSION),2.40)
31 PKG_HASH:=0f8a4c272d7f17f369ded10a4aca28b8e304828e95526da482b0ccc4dfc9d8e1
32 endif
33
34 ifeq ($(PKG_VERSION),2.41)
35 PKG_HASH:=ae9a5789e23459e59606e6714723f2d3ffc31c03174191ef0d015bdf06007450
36 endif
37
38 HOST_BUILD_PARALLEL:=1
39
40 PATCH_DIR:=./patches/$(PKG_VERSION)
41
42 include $(INCLUDE_DIR)/toolchain-build.mk
43
44 ifdef CONFIG_GCC_USE_GRAPHITE
45 GRAPHITE_CONFIGURE:= --with-isl=$(STAGING_DIR_HOST)
46 else
47 GRAPHITE_CONFIGURE:= --without-isl --without-cloog
48 endif
49
50 HOST_CONFIGURE_ARGS = \
51 --prefix=$(TOOLCHAIN_DIR) \
52 --build=$(GNU_HOST_NAME) \
53 --host=$(GNU_HOST_NAME) \
54 --target=$(REAL_GNU_TARGET_NAME) \
55 --with-sysroot=$(TOOLCHAIN_DIR) \
56 --with-system-zlib \
57 --with-zstd \
58 --enable-deterministic-archives \
59 --enable-plugins \
60 --enable-lto \
61 --disable-gprofng \
62 --disable-multilib \
63 --disable-werror \
64 --disable-nls \
65 --disable-sim \
66 --disable-gdb \
67 $(GRAPHITE_CONFIGURE) \
68 $(SOFT_FLOAT_CONFIG_OPTION) \
69 $(call qstrip,$(CONFIG_EXTRA_BINUTILS_CONFIG_OPTIONS))
70
71 ifneq ($(CONFIG_SSP_SUPPORT),)
72 HOST_CONFIGURE_ARGS+= \
73 --enable-libssp
74 else
75 HOST_CONFIGURE_ARGS+= \
76 --disable-libssp
77 endif
78
79 ifneq ($(CONFIG_EXTRA_TARGET_ARCH),)
80 HOST_CONFIGURE_ARGS+= \
81 --enable-targets=$(call qstrip,$(CONFIG_EXTRA_TARGET_ARCH_NAME))-linux-$(TARGET_SUFFIX)
82 endif
83
84 HOST_CONFIGURE_VARS += \
85 acx_cv_cc_gcc_supports_ada=false
86
87 define Host/Prepare
88 $(call Host/Prepare/Default)
89 ln -snf $(notdir $(HOST_BUILD_DIR)) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
90 $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(HOST_BUILD_DIR)/
91 endef
92
93 define Host/Compile
94 +$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) all
95 endef
96
97 define Host/Install
98 $(MAKE) -C $(HOST_BUILD_DIR) \
99 install
100 $(call FixupLibdir,$(TOOLCHAIN_DIR))
101 $(CP) $(TOOLCHAIN_DIR)/bin/$(REAL_GNU_TARGET_NAME)-readelf $(HOST_BUILD_PREFIX)/bin/readelf
102 endef
103
104 define Host/Clean
105 rm -rf \
106 $(HOST_BUILD_DIR) \
107 $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
108 endef
109
110 $(eval $(call HostBuild))