2006-06-27 03:44:04 +03:00
|
|
|
#
|
2009-02-03 18:23:01 +02:00
|
|
|
# Copyright (C) 2006-2009 OpenWrt.org
|
2006-06-27 03:44:04 +03:00
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
2005-03-06 05:34:52 +02:00
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
|
2006-06-21 09:19:43 +03:00
|
|
|
PKG_NAME:=binutils
|
2008-07-15 02:24:58 +03:00
|
|
|
PKG_VERSION:=$(call qstrip,$(CONFIG_BINUTILS_VERSION))
|
2005-03-06 05:34:52 +02:00
|
|
|
|
2008-11-08 23:18:33 +02:00
|
|
|
PKG_SOURCE_URL:=@GNU/binutils/
|
|
|
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
|
|
|
|
|
|
|
|
ifeq ($(PKG_VERSION),2.17)
|
|
|
|
PKG_MD5SUM:=e26e2e06b6e4bf3acf1dc8688a94c0d1
|
|
|
|
endif
|
|
|
|
ifeq ($(PKG_VERSION),2.18)
|
|
|
|
PKG_MD5SUM:=9d22ee4dafa3a194457caf4706f9cf01
|
|
|
|
endif
|
2009-01-17 21:29:09 +02:00
|
|
|
ifeq ($(PKG_VERSION),2.19)
|
|
|
|
PKG_MD5SUM:=17a52219dee5a76c1a9d9b0bfd337d66
|
|
|
|
endif
|
2009-02-03 18:23:01 +02:00
|
|
|
ifeq ($(PKG_VERSION),2.19.1)
|
|
|
|
PKG_MD5SUM:=09a8c5821a2dfdbb20665bc0bd680791
|
|
|
|
endif
|
2005-08-15 21:26:17 +03:00
|
|
|
|
2007-06-28 10:20:42 +03:00
|
|
|
PATCH_DIR:=./patches/$(PKG_VERSION)
|
2008-11-08 23:18:33 +02:00
|
|
|
|
2009-01-26 06:54:25 +02:00
|
|
|
REAL_STAGING_DIR_HOST:=$(STAGING_DIR_HOST)
|
2007-08-07 03:04:25 +03:00
|
|
|
STAGING_DIR_HOST:=$(TOOLCHAIN_DIR)
|
|
|
|
BUILD_DIR_HOST:=$(BUILD_DIR_TOOLCHAIN)
|
2009-01-08 03:49:11 +02:00
|
|
|
|
2008-09-02 13:57:35 +03:00
|
|
|
override CONFIG_AUTOREBUILD=
|
2005-07-20 17:58:27 +03:00
|
|
|
|
2006-06-21 09:19:43 +03:00
|
|
|
include $(INCLUDE_DIR)/host-build.mk
|
2005-07-20 17:58:27 +03:00
|
|
|
|
2009-01-08 03:49:11 +02:00
|
|
|
EXTRA_TARGET=$(if $(CONFIG_EXTRA_TARGET_ARCH),--enable-targets=$(call qstrip,$(CONFIG_EXTRA_TARGET_ARCH_NAME))-linux-$(TARGET_SUFFIX))
|
2008-04-13 02:14:42 +03:00
|
|
|
|
2009-02-03 01:45:33 +02:00
|
|
|
ifneq ($(CONFIG_SSP_SUPPORT),)
|
|
|
|
LIB_SSP:=--enable-libssp
|
|
|
|
else
|
|
|
|
LIB_SSP:=--disable-libssp
|
|
|
|
endif
|
|
|
|
|
2009-01-08 03:49:11 +02:00
|
|
|
define Build/Prepare
|
|
|
|
$(call Build/Prepare/Default)
|
|
|
|
ln -snf $(PKG_NAME)-$(PKG_VERSION) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
|
2007-12-28 20:13:08 +02:00
|
|
|
$(CP) $(SCRIPT_DIR)/config.{guess,sub} $(PKG_BUILD_DIR)/
|
2009-01-08 03:49:11 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Build/Configure
|
2006-06-21 09:19:43 +03:00
|
|
|
(cd $(PKG_BUILD_DIR); \
|
|
|
|
./configure \
|
2009-01-08 03:49:11 +02:00
|
|
|
--prefix=$(TOOLCHAIN_DIR)/usr \
|
2005-07-20 17:58:27 +03:00
|
|
|
--build=$(GNU_HOST_NAME) \
|
|
|
|
--host=$(GNU_HOST_NAME) \
|
|
|
|
--target=$(REAL_GNU_TARGET_NAME) \
|
2009-01-08 03:49:11 +02:00
|
|
|
--with-sysroot=$(TOOLCHAIN_DIR) \
|
|
|
|
--disable-multilib \
|
2005-07-20 17:58:27 +03:00
|
|
|
--disable-werror \
|
2006-06-21 09:19:43 +03:00
|
|
|
--disable-nls \
|
2009-02-03 01:45:33 +02:00
|
|
|
$(LIB_SSP) \
|
2008-04-13 02:14:42 +03:00
|
|
|
$(EXTRA_TARGET) \
|
2007-12-28 20:06:47 +02:00
|
|
|
$(SOFT_FLOAT_CONFIG_OPTION) \
|
2007-10-23 09:23:20 +03:00
|
|
|
$(call qstrip,$(CONFIG_EXTRA_BINUTILS_CONFIG_OPTIONS)) \
|
2006-06-21 09:19:43 +03:00
|
|
|
);
|
|
|
|
endef
|
2005-07-20 17:58:27 +03:00
|
|
|
|
2006-06-21 09:19:43 +03:00
|
|
|
define Build/Compile
|
2007-08-07 03:04:25 +03:00
|
|
|
$(MAKE) -C $(PKG_BUILD_DIR) all
|
2006-06-21 09:19:43 +03:00
|
|
|
endef
|
2005-07-20 17:58:27 +03:00
|
|
|
|
2006-06-21 09:19:43 +03:00
|
|
|
define Build/Install
|
2007-08-07 03:04:25 +03:00
|
|
|
$(MAKE) -C $(PKG_BUILD_DIR) install
|
2009-01-26 06:54:25 +02:00
|
|
|
$(CP) $(TOOLCHAIN_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)-readelf $(REAL_STAGING_DIR_HOST)/bin/readelf
|
2006-06-21 09:19:43 +03:00
|
|
|
endef
|
2005-07-20 17:58:27 +03:00
|
|
|
|
2009-01-08 03:49:11 +02:00
|
|
|
define Build/Clean
|
|
|
|
rm -rf \
|
|
|
|
$(PKG_BUILD_DIR) \
|
|
|
|
$(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
|
|
|
|
endef
|
|
|
|
|
2006-06-21 09:19:43 +03:00
|
|
|
$(eval $(call HostBuild))
|