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