toolchain/binutils: Remove 2.30
[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 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.29.1)
19 PKG_HASH:=e7010a46969f9d3e53b650a518663f98a5dde3c3ae21b7d71e5e6803bc36b577
20 endif
21
22 ifeq ($(PKG_VERSION),2.31.1)
23 PKG_HASH:=5d20086ecf5752cc7d9134246e9588fa201740d540f7eb84d795b1f7a93bca86
24 endif
25
26 ifneq ($(CONFIG_BINUTILS_VERSION_2_29_ARC),)
27 PKG_REV:=arc-2017.09-release
28 PKG_SOURCE_URL:=https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/archive/$(PKG_REV)/
29 PKG_SOURCE:=$(PKG_NAME)-$(PKG_REV).tar.gz
30 PKG_HASH:=2ea086fd5521e942926dd6ff6922ce31c29ee7ffc754fca3d06385e0f27600f8
31 BINUTILS_DIR:=$(PKG_NAME)-gdb-$(PKG_REV)
32 HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(BINUTILS_DIR)
33 endif
34
35 HOST_BUILD_PARALLEL:=1
36
37 PATCH_DIR:=./patches/$(PKG_VERSION)
38
39 include $(INCLUDE_DIR)/toolchain-build.mk
40
41 BINUTILS_CONFIGURE:= \
42 ./configure \
43 --prefix=$(TOOLCHAIN_DIR) \
44 --build=$(GNU_HOST_NAME) \
45 --host=$(GNU_HOST_NAME) \
46 --target=$(REAL_GNU_TARGET_NAME) \
47 --with-sysroot=$(TOOLCHAIN_DIR) \
48 --enable-deterministic-archives \
49 --enable-plugins \
50 --disable-multilib \
51 --disable-werror \
52 --disable-nls \
53 --disable-sim \
54 --disable-gdb \
55 $(GRAPHITE_CONFIGURE) \
56 $(SOFT_FLOAT_CONFIG_OPTION) \
57 $(call qstrip,$(CONFIG_EXTRA_BINUTILS_CONFIG_OPTIONS))
58
59 ifneq ($(CONFIG_SSP_SUPPORT),)
60 BINUTILS_CONFIGURE+= \
61 --enable-libssp
62 else
63 BINUTILS_CONFIGURE+= \
64 --disable-libssp
65 endif
66
67 ifneq ($(CONFIG_EXTRA_TARGET_ARCH),)
68 BINUTILS_CONFIGURE+= \
69 --enable-targets=$(call qstrip,$(CONFIG_EXTRA_TARGET_ARCH_NAME))-linux-$(TARGET_SUFFIX)
70 endif
71
72 define Host/Prepare
73 $(call Host/Prepare/Default)
74 ln -snf $(notdir $(HOST_BUILD_DIR)) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
75 $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(HOST_BUILD_DIR)/
76 $(SED) 's, " Linaro.*,,' $(HOST_BUILD_DIR)/bfd/version.h
77 endef
78
79 define Host/Configure
80 (cd $(HOST_BUILD_DIR); \
81 $(BINUTILS_CONFIGURE) \
82 );
83 endef
84
85 define Host/Compile
86 +$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) all
87 endef
88
89 define Host/Install
90 mkdir -p $(TOOLCHAIN_DIR)/initial
91 $(MAKE) -C $(HOST_BUILD_DIR) \
92 prefix=$(TOOLCHAIN_DIR)/initial \
93 install
94 $(MAKE) -C $(HOST_BUILD_DIR) \
95 prefix=$(TOOLCHAIN_DIR) \
96 install
97 $(call FixupLibdir,$(TOOLCHAIN_DIR)/initial)
98 $(RM) $(TOOLCHAIN_DIR)/initial/lib/libiberty.a
99 $(CP) $(TOOLCHAIN_DIR)/bin/$(REAL_GNU_TARGET_NAME)-readelf $(HOST_BUILD_PREFIX)/bin/readelf
100 # ARC gcc requires extlib.
101 # If extlib is not available in "initial" folder
102 # initial gcc will fail to build libc.
103 if [ -d $(TOOLCHAIN_DIR)/extlib ]; then \
104 $(CP) -r $(TOOLCHAIN_DIR)/extlib $(TOOLCHAIN_DIR)/initial/; \
105 fi
106 endef
107
108 define Host/Clean
109 rm -rf \
110 $(HOST_BUILD_DIR) \
111 $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
112 endef
113
114 $(eval $(call HostBuild))