2010-12-31 12:39:01 +01:00
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# binutils
|
|
|
|
#
|
|
|
|
#############################################################
|
|
|
|
|
2011-06-08 15:57:26 +02:00
|
|
|
# Version is set when using buildroot toolchain.
|
|
|
|
# If not, we do like other packages
|
2010-12-31 12:39:01 +01:00
|
|
|
BINUTILS_VERSION = $(call qstrip,$(BR2_BINUTILS_VERSION))
|
2011-06-08 15:57:26 +02:00
|
|
|
ifeq ($(BINUTILS_VERSION),)
|
2012-05-19 08:46:28 +02:00
|
|
|
ifeq ($(BR2_avr32),y)
|
|
|
|
# avr32 uses a special version
|
|
|
|
BINUTILS_VERSION = 2.18-avr32-1.0.1
|
|
|
|
else
|
2011-06-08 15:57:26 +02:00
|
|
|
BINUTILS_VERSION = 2.21
|
|
|
|
endif
|
2012-05-19 08:46:28 +02:00
|
|
|
endif
|
2011-06-08 15:57:26 +02:00
|
|
|
|
2012-10-27 11:22:09 +02:00
|
|
|
ifeq ($(BINUTILS_VERSION),2.23)
|
|
|
|
BINUTILS_SOURCE = binutils-$(BINUTILS_VERSION).tar.gz
|
|
|
|
else
|
2010-12-31 12:39:01 +01:00
|
|
|
BINUTILS_SOURCE = binutils-$(BINUTILS_VERSION).tar.bz2
|
2012-10-27 11:22:09 +02:00
|
|
|
endif
|
|
|
|
|
2010-12-31 12:39:01 +01:00
|
|
|
BINUTILS_SITE = $(BR2_GNU_MIRROR)/binutils
|
|
|
|
ifeq ($(ARCH),avr32)
|
|
|
|
BINUTILS_SITE = ftp://www.at91.com/pub/buildroot
|
|
|
|
endif
|
|
|
|
BINUTILS_EXTRA_CONFIG_OPTIONS = $(call qstrip,$(BR2_BINUTILS_EXTRA_CONFIG_OPTIONS))
|
|
|
|
BINUTILS_INSTALL_STAGING = YES
|
2012-09-16 14:57:49 +02:00
|
|
|
BINUTILS_DEPENDENCIES = $(if $(BR2_NEEDS_GETTEXT_IF_LOCALE),gettext)
|
2012-11-13 02:05:38 +01:00
|
|
|
BINUTILS_LICENSE = GPLv3+, libiberty LGPLv2.1+
|
|
|
|
BINUTILS_LICENSE_FILES = COPYING3 COPYING.LIB
|
2010-12-31 12:39:01 +01:00
|
|
|
|
|
|
|
# We need to specify host & target to avoid breaking ARM EABI
|
|
|
|
BINUTILS_CONF_OPT = --disable-multilib --disable-werror \
|
2012-06-08 03:52:16 +02:00
|
|
|
--host=$(GNU_TARGET_NAME) \
|
|
|
|
--target=$(GNU_TARGET_NAME) \
|
2010-12-31 12:39:01 +01:00
|
|
|
--enable-shared \
|
|
|
|
$(BINUTILS_EXTRA_CONFIG_OPTIONS)
|
|
|
|
|
|
|
|
# Install binutils after busybox to prefer full-blown utilities
|
|
|
|
ifeq ($(BR2_PACKAGE_BUSYBOX),y)
|
|
|
|
BINUTILS_DEPENDENCIES += busybox
|
|
|
|
endif
|
|
|
|
|
|
|
|
# "host" binutils should actually be "cross"
|
|
|
|
# We just keep the convention of "host utility" for now
|
|
|
|
HOST_BINUTILS_CONF_OPT = --disable-multilib --disable-werror \
|
2012-06-08 03:52:16 +02:00
|
|
|
--target=$(GNU_TARGET_NAME) \
|
2011-10-02 23:19:10 +02:00
|
|
|
--disable-shared --enable-static \
|
2012-04-17 06:45:26 +02:00
|
|
|
--with-sysroot=$(STAGING_DIR) \
|
2010-12-31 12:39:01 +01:00
|
|
|
$(BINUTILS_EXTRA_CONFIG_OPTIONS)
|
|
|
|
|
2012-01-18 10:47:39 +01:00
|
|
|
HOST_BINUTILS_DEPENDENCIES =
|
|
|
|
|
2011-06-08 15:57:26 +02:00
|
|
|
# We just want libbfd and libiberty, not the full-blown binutils in staging
|
2010-12-31 12:39:01 +01:00
|
|
|
define BINUTILS_INSTALL_STAGING_CMDS
|
|
|
|
$(MAKE) -C $(@D)/bfd DESTDIR=$(STAGING_DIR) install
|
2011-06-08 15:57:26 +02:00
|
|
|
$(MAKE) -C $(@D)/libiberty DESTDIR=$(STAGING_DIR) install
|
2010-12-31 12:39:01 +01:00
|
|
|
endef
|
|
|
|
|
2011-06-08 15:57:26 +02:00
|
|
|
# If we don't want full binutils on target
|
|
|
|
ifneq ($(BR2_PACKAGE_BINUTILS_TARGET),y)
|
2010-12-31 12:39:01 +01:00
|
|
|
define BINUTILS_INSTALL_TARGET_CMDS
|
2011-06-08 15:57:26 +02:00
|
|
|
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/bfd DESTDIR=$(TARGET_DIR) install
|
|
|
|
$(MAKE) -C $(@D)/libiberty DESTDIR=$(STAGING_DIR) install
|
2010-12-31 12:39:01 +01:00
|
|
|
endef
|
2011-06-08 15:57:26 +02:00
|
|
|
endif
|
2010-12-31 12:39:01 +01:00
|
|
|
|
2012-11-20 09:31:36 +01:00
|
|
|
XTENSA_CORE_NAME = $(call qstrip, $(BR2_XTENSA_CORE_NAME))
|
2012-11-15 04:53:52 +01:00
|
|
|
ifneq ($(XTENSA_CORE_NAME),)
|
|
|
|
define BINUTILS_XTENSA_PRE_PATCH
|
2012-11-20 09:31:36 +01:00
|
|
|
tar xf $(BR2_XTENSA_OVERLAY_DIR)/xtensa_$(XTENSA_CORE_NAME).tar \
|
|
|
|
-C $(@D) --strip-components=1 binutils
|
2012-11-15 04:53:52 +01:00
|
|
|
endef
|
|
|
|
HOST_BINUTILS_PRE_PATCH_HOOKS += BINUTILS_XTENSA_PRE_PATCH
|
|
|
|
endif
|
|
|
|
|
2012-07-03 00:07:32 +02:00
|
|
|
$(eval $(autotools-package))
|
2012-07-03 00:06:54 +02:00
|
|
|
$(eval $(host-autotools-package))
|