2011-02-21 11:43:16 +00:00
|
|
|
#
|
2013-09-11 13:18:23 +00:00
|
|
|
# Copyright (C) 2006-2013 OpenWrt.org
|
2006-06-27 00:44:04 +00:00
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
2005-03-06 03:34:52 +00:00
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
|
2006-06-21 06:19:43 +00:00
|
|
|
PKG_NAME:=binutils
|
2008-07-14 23:24:58 +00:00
|
|
|
PKG_VERSION:=$(call qstrip,$(CONFIG_BINUTILS_VERSION))
|
2009-10-19 02:09:59 +00:00
|
|
|
BIN_VERSION:=$(PKG_VERSION)
|
2005-03-06 03:34:52 +00:00
|
|
|
|
2013-09-11 13:18:23 +00:00
|
|
|
ifeq ($(findstring linaro, $(CONFIG_BINUTILS_VERSION)),linaro)
|
|
|
|
PKG_SOURCE_URL:=https://releases.linaro.org/13.06/components/toolchain/binutils-linaro/
|
|
|
|
PKG_REV:=2.23.2-2013.06
|
|
|
|
PKG_SOURCE:=$(PKG_NAME)-linaro-$(PKG_REV).tar.bz2
|
|
|
|
PKG_MD5SUM:=73ad2a91f17b7e4fd41d49db5a541d2d
|
|
|
|
BINUTILS_DIR:=$(PKG_NAME)-2.23.2
|
|
|
|
HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(BINUTILS_DIR)
|
|
|
|
else
|
|
|
|
PKG_SOURCE_URL:=@GNU/binutils/
|
|
|
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
|
|
|
|
|
|
|
|
ifeq ($(PKG_VERSION),2.20.1)
|
|
|
|
PKG_MD5SUM:=9cdfb9d6ec0578c166d3beae5e15c4e5
|
|
|
|
endif
|
|
|
|
ifeq ($(PKG_VERSION),2.22)
|
|
|
|
PKG_MD5SUM:=ee0f10756c84979622b992a4a61ea3f5
|
|
|
|
endif
|
|
|
|
ifeq ($(PKG_VERSION),2.23.1)
|
|
|
|
PKG_MD5SUM:=33adb18c3048d057ac58d07a3f1adb38
|
|
|
|
endif
|
2012-11-19 19:37:28 +00:00
|
|
|
endif
|
2005-08-15 18:26:17 +00:00
|
|
|
|
2012-09-15 14:18:16 +00:00
|
|
|
HOST_BUILD_PARALLEL:=1
|
|
|
|
|
2007-06-28 07:20:42 +00:00
|
|
|
PATCH_DIR:=./patches/$(PKG_VERSION)
|
2008-11-08 21:18:33 +00:00
|
|
|
|
2009-01-26 04:54:25 +00:00
|
|
|
REAL_STAGING_DIR_HOST:=$(STAGING_DIR_HOST)
|
2009-01-08 01:49:11 +00:00
|
|
|
|
2009-02-23 23:52:27 +00:00
|
|
|
include $(INCLUDE_DIR)/toolchain-build.mk
|
2005-07-20 14:58:27 +00:00
|
|
|
|
2009-02-03 21:25:48 +00:00
|
|
|
BINUTILS_CONFIGURE:= \
|
|
|
|
./configure \
|
2010-08-19 12:49:51 +00:00
|
|
|
--prefix=$(TOOLCHAIN_DIR) \
|
2009-02-03 21:25:48 +00:00
|
|
|
--build=$(GNU_HOST_NAME) \
|
|
|
|
--host=$(GNU_HOST_NAME) \
|
|
|
|
--target=$(REAL_GNU_TARGET_NAME) \
|
|
|
|
--with-sysroot=$(TOOLCHAIN_DIR) \
|
|
|
|
--disable-multilib \
|
|
|
|
--disable-werror \
|
|
|
|
--disable-nls \
|
2010-04-20 16:18:08 +00:00
|
|
|
$(GRAPHITE_CONFIGURE) \
|
2009-02-03 21:25:48 +00:00
|
|
|
$(SOFT_FLOAT_CONFIG_OPTION) \
|
2010-04-20 16:18:08 +00:00
|
|
|
$(call qstrip,$(CONFIG_EXTRA_BINUTILS_CONFIG_OPTIONS))
|
2008-04-12 23:14:42 +00:00
|
|
|
|
2009-02-02 23:45:33 +00:00
|
|
|
ifneq ($(CONFIG_SSP_SUPPORT),)
|
2009-02-03 21:25:48 +00:00
|
|
|
BINUTILS_CONFIGURE+= \
|
|
|
|
--enable-libssp
|
2009-02-02 23:45:33 +00:00
|
|
|
else
|
2009-02-03 21:25:48 +00:00
|
|
|
BINUTILS_CONFIGURE+= \
|
|
|
|
--disable-libssp
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(CONFIG_EXTRA_TARGET_ARCH),)
|
|
|
|
BINUTILS_CONFIGURE+= \
|
|
|
|
--enable-targets=$(call qstrip,$(CONFIG_EXTRA_TARGET_ARCH_NAME))-linux-$(TARGET_SUFFIX)
|
2009-02-02 23:45:33 +00:00
|
|
|
endif
|
|
|
|
|
2009-02-22 04:37:20 +00:00
|
|
|
define Host/Prepare
|
|
|
|
$(call Host/Prepare/Default)
|
2009-01-08 01:49:11 +00:00
|
|
|
ln -snf $(PKG_NAME)-$(PKG_VERSION) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
|
2009-02-22 04:37:20 +00:00
|
|
|
$(CP) $(SCRIPT_DIR)/config.{guess,sub} $(HOST_BUILD_DIR)/
|
2009-01-08 01:49:11 +00:00
|
|
|
endef
|
|
|
|
|
2009-02-22 04:37:20 +00:00
|
|
|
define Host/Configure
|
|
|
|
(cd $(HOST_BUILD_DIR); \
|
2009-02-03 21:25:48 +00:00
|
|
|
$(BINUTILS_CONFIGURE) \
|
2006-06-21 06:19:43 +00:00
|
|
|
);
|
|
|
|
endef
|
2005-07-20 14:58:27 +00:00
|
|
|
|
2009-02-22 04:37:20 +00:00
|
|
|
define Host/Compile
|
2012-09-23 09:50:01 +00:00
|
|
|
+$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) all
|
2006-06-21 06:19:43 +00:00
|
|
|
endef
|
2005-07-20 14:58:27 +00:00
|
|
|
|
2009-02-22 04:37:20 +00:00
|
|
|
define Host/Install
|
2012-06-30 18:12:15 +00:00
|
|
|
mkdir -p $(TOOLCHAIN_DIR)/initial
|
|
|
|
$(MAKE) -C $(HOST_BUILD_DIR) \
|
|
|
|
prefix=$(TOOLCHAIN_DIR)/initial \
|
|
|
|
install
|
2012-06-30 21:43:59 +00:00
|
|
|
$(call FixupLibdir,$(TOOLCHAIN_DIR)/initial)
|
2012-06-30 18:12:15 +00:00
|
|
|
$(CP) $(TOOLCHAIN_DIR)/initial/. $(TOOLCHAIN_DIR)/
|
2010-08-19 12:49:51 +00:00
|
|
|
$(CP) $(TOOLCHAIN_DIR)/bin/$(REAL_GNU_TARGET_NAME)-readelf $(REAL_STAGING_DIR_HOST)/bin/readelf
|
2006-06-21 06:19:43 +00:00
|
|
|
endef
|
2005-07-20 14:58:27 +00:00
|
|
|
|
2009-02-22 04:37:20 +00:00
|
|
|
define Host/Clean
|
2009-01-08 01:49:11 +00:00
|
|
|
rm -rf \
|
2009-02-22 04:37:20 +00:00
|
|
|
$(HOST_BUILD_DIR) \
|
2009-01-08 01:49:11 +00:00
|
|
|
$(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
|
|
|
|
endef
|
|
|
|
|
2006-06-21 06:19:43 +00:00
|
|
|
$(eval $(call HostBuild))
|