1 ################################################################################
5 ################################################################################
7 # Version is set when using buildroot toolchain.
8 # If not, we do like other packages
9 BINUTILS_VERSION = $(call qstrip,$(BR2_BINUTILS_VERSION))
10 ifeq ($(BINUTILS_VERSION),)
12 BINUTILS_VERSION = arc-2014.12
14 BINUTILS_VERSION = 2.22
16 endif # BINUTILS_VERSION
19 BINUTILS_SITE = $(call github,foss-for-synopsys-dwc-arc-processors,binutils-gdb,$(BINUTILS_VERSION))
20 BINUTILS_SOURCE = binutils-$(BINUTILS_VERSION).tar.gz
23 BINUTILS_SITE ?= $(BR2_GNU_MIRROR)/binutils
24 BINUTILS_SOURCE ?= binutils-$(BINUTILS_VERSION).tar.bz2
25 BINUTILS_EXTRA_CONFIG_OPTIONS = $(call qstrip,$(BR2_BINUTILS_EXTRA_CONFIG_OPTIONS))
26 BINUTILS_INSTALL_STAGING = YES
27 BINUTILS_DEPENDENCIES = $(if $(BR2_NEEDS_GETTEXT_IF_LOCALE),gettext)
28 HOST_BINUTILS_DEPENDENCIES =
29 BINUTILS_LICENSE = GPLv3+, libiberty LGPLv2.1+
30 BINUTILS_LICENSE_FILES = COPYING3 COPYING.LIB
32 ifeq ($(BINUTILS_FROM_GIT),y)
33 BINUTILS_DEPENDENCIES += host-texinfo host-flex host-bison
34 HOST_BINUTILS_DEPENDENCIES += host-texinfo host-flex host-bison
37 # When binutils sources are fetched from the binutils-gdb repository,
38 # they also contain the gdb sources, but gdb shouldn't be built, so we
40 BINUTILS_DISABLE_GDB_CONF_OPTS = \
44 # We need to specify host & target to avoid breaking ARM EABI
45 BINUTILS_CONF_OPTS = \
48 --host=$(GNU_TARGET_NAME) \
49 --target=$(GNU_TARGET_NAME) \
50 --enable-install-libiberty \
51 $(BINUTILS_DISABLE_GDB_CONF_OPTS) \
52 $(BINUTILS_EXTRA_CONFIG_OPTIONS)
54 # Don't build documentation. It takes up extra space / build time,
55 # and sometimes needs specific makeinfo versions to work
56 BINUTILS_CONF_ENV += ac_cv_prog_MAKEINFO=missing
57 HOST_BINUTILS_CONF_ENV += ac_cv_prog_MAKEINFO=missing
59 # Install binutils after busybox to prefer full-blown utilities
60 ifeq ($(BR2_PACKAGE_BUSYBOX),y)
61 BINUTILS_DEPENDENCIES += busybox
64 # "host" binutils should actually be "cross"
65 # We just keep the convention of "host utility" for now
66 HOST_BINUTILS_CONF_OPTS = \
69 --target=$(GNU_TARGET_NAME) \
72 --with-sysroot=$(STAGING_DIR) \
73 --enable-poison-system-directories \
74 $(BINUTILS_DISABLE_GDB_CONF_OPTS) \
75 $(BINUTILS_EXTRA_CONFIG_OPTIONS)
77 # We just want libbfd, libiberty and libopcodes,
78 # not the full-blown binutils in staging
79 define BINUTILS_INSTALL_STAGING_CMDS
80 $(MAKE) -C $(@D)/bfd DESTDIR=$(STAGING_DIR) install
81 $(MAKE) -C $(@D)/opcodes DESTDIR=$(STAGING_DIR) install
82 $(MAKE) -C $(@D)/libiberty DESTDIR=$(STAGING_DIR) install
85 # If we don't want full binutils on target
86 ifneq ($(BR2_PACKAGE_BINUTILS_TARGET),y)
87 define BINUTILS_INSTALL_TARGET_CMDS
88 $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/bfd DESTDIR=$(TARGET_DIR) install
89 $(MAKE) -C $(@D)/libiberty DESTDIR=$(STAGING_DIR) install
93 XTENSA_CORE_NAME = $(call qstrip, $(BR2_XTENSA_CORE_NAME))
94 ifneq ($(XTENSA_CORE_NAME),)
95 define BINUTILS_XTENSA_PRE_PATCH
96 tar xf $(BR2_XTENSA_OVERLAY_DIR)/xtensa_$(XTENSA_CORE_NAME).tar \
97 -C $(@D) --strip-components=1 binutils
99 BINUTILS_PRE_PATCH_HOOKS += BINUTILS_XTENSA_PRE_PATCH
100 HOST_BINUTILS_PRE_PATCH_HOOKS += BINUTILS_XTENSA_PRE_PATCH
103 ifeq ($(BR2_BINUTILS_ENABLE_LTO),y)
104 HOST_BINUTILS_CONF_OPTS += --enable-plugins --enable-lto
107 $(eval $(autotools-package))
108 $(eval $(host-autotools-package))