mpc85xx: fix address config for ws-ap3825i
[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.32)
19 PKG_HASH:=0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
20 endif
21
22 ifeq ($(PKG_VERSION),2.34)
23 PKG_HASH:=f00b0e8803dc9bab1e2165bd568528135be734df3fabf8d0161828cd56028952
24 endif
25
26 ifeq ($(PKG_VERSION),2.35.1)
27 PKG_HASH:=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
28 endif
29
30 HOST_BUILD_PARALLEL:=1
31
32 PATCH_DIR:=./patches/$(PKG_VERSION)
33
34 include $(INCLUDE_DIR)/toolchain-build.mk
35
36 HOST_CONFIGURE_ARGS = \
37 --prefix=$(TOOLCHAIN_DIR) \
38 --build=$(GNU_HOST_NAME) \
39 --host=$(GNU_HOST_NAME) \
40 --target=$(REAL_GNU_TARGET_NAME) \
41 --with-sysroot=$(TOOLCHAIN_DIR) \
42 --enable-deterministic-archives \
43 --enable-plugins \
44 --disable-multilib \
45 --disable-werror \
46 --disable-nls \
47 --disable-sim \
48 --disable-gdb \
49 $(GRAPHITE_CONFIGURE) \
50 $(SOFT_FLOAT_CONFIG_OPTION) \
51 $(call qstrip,$(CONFIG_EXTRA_BINUTILS_CONFIG_OPTIONS))
52
53 ifneq ($(CONFIG_SSP_SUPPORT),)
54 HOST_CONFIGURE_ARGS+= \
55 --enable-libssp
56 else
57 HOST_CONFIGURE_ARGS+= \
58 --disable-libssp
59 endif
60
61 ifneq ($(CONFIG_EXTRA_TARGET_ARCH),)
62 HOST_CONFIGURE_ARGS+= \
63 --enable-targets=$(call qstrip,$(CONFIG_EXTRA_TARGET_ARCH_NAME))-linux-$(TARGET_SUFFIX)
64 endif
65
66 HOST_CONFIGURE_VARS += \
67 acx_cv_cc_gcc_supports_ada=false
68
69 define Host/Prepare
70 $(call Host/Prepare/Default)
71 ln -snf $(notdir $(HOST_BUILD_DIR)) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
72 $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(HOST_BUILD_DIR)/
73 $(SED) 's, " Linaro.*,,' $(HOST_BUILD_DIR)/bfd/version.h
74 endef
75
76 define Host/Compile
77 +$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) all
78 endef
79
80 define Host/Install
81 mkdir -p $(TOOLCHAIN_DIR)/initial
82 $(MAKE) -C $(HOST_BUILD_DIR) \
83 prefix=$(TOOLCHAIN_DIR)/initial \
84 install
85 $(MAKE) -C $(HOST_BUILD_DIR) \
86 prefix=$(TOOLCHAIN_DIR) \
87 install
88 $(call FixupLibdir,$(TOOLCHAIN_DIR)/initial)
89 $(RM) $(TOOLCHAIN_DIR)/initial/lib/libiberty.a
90 $(CP) $(TOOLCHAIN_DIR)/bin/$(REAL_GNU_TARGET_NAME)-readelf $(HOST_BUILD_PREFIX)/bin/readelf
91 # ARC gcc requires extlib.
92 # If extlib is not available in "initial" folder
93 # initial gcc will fail to build libc.
94 if [ -d $(TOOLCHAIN_DIR)/extlib ]; then \
95 $(CP) -r $(TOOLCHAIN_DIR)/extlib $(TOOLCHAIN_DIR)/initial/; \
96 fi
97 endef
98
99 define Host/Clean
100 rm -rf \
101 $(HOST_BUILD_DIR) \
102 $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
103 endef
104
105 $(eval $(call HostBuild))