2011-02-21 19:43:16 +08:00
|
|
|
#
|
|
|
|
# Copyright (C) 2006-2011 OpenWrt.org
|
2006-06-27 08:44:04 +08:00
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
2005-03-06 11:34:52 +08:00
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
|
2006-06-21 14:19:43 +08:00
|
|
|
PKG_NAME:=binutils
|
2008-07-15 07:24:58 +08:00
|
|
|
PKG_VERSION:=$(call qstrip,$(CONFIG_BINUTILS_VERSION))
|
2009-10-19 10:09:59 +08:00
|
|
|
BIN_VERSION:=$(PKG_VERSION)
|
2005-03-06 11:34:52 +08:00
|
|
|
|
2008-11-09 05:18:33 +08:00
|
|
|
PKG_SOURCE_URL:=@GNU/binutils/
|
|
|
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
|
|
|
|
|
2009-02-04 00:23:01 +08:00
|
|
|
ifeq ($(PKG_VERSION),2.19.1)
|
|
|
|
PKG_MD5SUM:=09a8c5821a2dfdbb20665bc0bd680791
|
|
|
|
endif
|
2010-03-11 19:50:25 +08:00
|
|
|
ifeq ($(PKG_VERSION),2.20.1)
|
|
|
|
PKG_MD5SUM:=9cdfb9d6ec0578c166d3beae5e15c4e5
|
|
|
|
endif
|
2011-02-18 17:52:19 +08:00
|
|
|
ifeq ($(PKG_VERSION),2.21)
|
|
|
|
PKG_MD5SUM:=c84c5acc9d266f1a7044b51c85a823f5
|
|
|
|
endif
|
2011-08-06 17:53:58 +08:00
|
|
|
ifeq ($(PKG_VERSION),2.21.1)
|
|
|
|
PKG_MD5SUM:=a22801a9cad45c85e9ff6afc10537d72
|
|
|
|
endif
|
2005-08-16 02:26:17 +08:00
|
|
|
|
2007-06-28 15:20:42 +08:00
|
|
|
PATCH_DIR:=./patches/$(PKG_VERSION)
|
2008-11-09 05:18:33 +08:00
|
|
|
|
2009-01-26 12:54:25 +08:00
|
|
|
REAL_STAGING_DIR_HOST:=$(STAGING_DIR_HOST)
|
2009-01-08 09:49:11 +08:00
|
|
|
|
2009-02-24 07:52:27 +08:00
|
|
|
include $(INCLUDE_DIR)/toolchain-build.mk
|
2005-07-20 22:58:27 +08:00
|
|
|
|
2009-02-04 05:25:48 +08:00
|
|
|
BINUTILS_CONFIGURE:= \
|
|
|
|
./configure \
|
2010-08-19 20:49:51 +08:00
|
|
|
--prefix=$(TOOLCHAIN_DIR) \
|
2009-02-04 05:25:48 +08: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-21 00:18:08 +08:00
|
|
|
$(GRAPHITE_CONFIGURE) \
|
2009-02-04 05:25:48 +08:00
|
|
|
$(SOFT_FLOAT_CONFIG_OPTION) \
|
2010-04-21 00:18:08 +08:00
|
|
|
$(call qstrip,$(CONFIG_EXTRA_BINUTILS_CONFIG_OPTIONS))
|
2008-04-13 07:14:42 +08:00
|
|
|
|
2009-02-03 07:45:33 +08:00
|
|
|
ifneq ($(CONFIG_SSP_SUPPORT),)
|
2009-02-04 05:25:48 +08:00
|
|
|
BINUTILS_CONFIGURE+= \
|
|
|
|
--enable-libssp
|
2009-02-03 07:45:33 +08:00
|
|
|
else
|
2009-02-04 05:25:48 +08: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-03 07:45:33 +08:00
|
|
|
endif
|
|
|
|
|
2009-02-22 12:37:20 +08:00
|
|
|
define Host/Prepare
|
|
|
|
$(call Host/Prepare/Default)
|
2009-01-08 09:49:11 +08:00
|
|
|
ln -snf $(PKG_NAME)-$(PKG_VERSION) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
|
2009-02-22 12:37:20 +08:00
|
|
|
$(CP) $(SCRIPT_DIR)/config.{guess,sub} $(HOST_BUILD_DIR)/
|
2009-01-08 09:49:11 +08:00
|
|
|
endef
|
|
|
|
|
2009-02-22 12:37:20 +08:00
|
|
|
define Host/Configure
|
|
|
|
(cd $(HOST_BUILD_DIR); \
|
2009-02-04 05:25:48 +08:00
|
|
|
$(BINUTILS_CONFIGURE) \
|
2006-06-21 14:19:43 +08:00
|
|
|
);
|
|
|
|
endef
|
2005-07-20 22:58:27 +08:00
|
|
|
|
2009-02-22 12:37:20 +08:00
|
|
|
define Host/Compile
|
2010-10-03 20:54:07 +08:00
|
|
|
$(MAKE) $(TOOLCHAIN_JOBS) -C $(HOST_BUILD_DIR) all
|
2006-06-21 14:19:43 +08:00
|
|
|
endef
|
2005-07-20 22:58:27 +08:00
|
|
|
|
2009-02-22 12:37:20 +08:00
|
|
|
define Host/Install
|
|
|
|
$(MAKE) -C $(HOST_BUILD_DIR) install
|
2010-08-19 20:49:51 +08:00
|
|
|
$(CP) $(TOOLCHAIN_DIR)/bin/$(REAL_GNU_TARGET_NAME)-readelf $(REAL_STAGING_DIR_HOST)/bin/readelf
|
2006-06-21 14:19:43 +08:00
|
|
|
endef
|
2005-07-20 22:58:27 +08:00
|
|
|
|
2009-02-22 12:37:20 +08:00
|
|
|
define Host/Clean
|
2009-01-08 09:49:11 +08:00
|
|
|
rm -rf \
|
2009-02-22 12:37:20 +08:00
|
|
|
$(HOST_BUILD_DIR) \
|
2009-01-08 09:49:11 +08:00
|
|
|
$(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
|
|
|
|
endef
|
|
|
|
|
2006-06-21 14:19:43 +08:00
|
|
|
$(eval $(call HostBuild))
|