binutils.mk 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. ################################################################################
  2. #
  3. # binutils
  4. #
  5. ################################################################################
  6. # Version is set when using buildroot toolchain.
  7. # If not, we do like other packages
  8. BINUTILS_VERSION = $(call qstrip,$(BR2_BINUTILS_VERSION))
  9. ifeq ($(BINUTILS_VERSION),)
  10. ifeq ($(BR2_avr32),y)
  11. # avr32 uses a special version
  12. BINUTILS_VERSION = 2.18-avr32-1.0.1
  13. else
  14. BINUTILS_VERSION = 2.21
  15. endif
  16. endif
  17. ifeq ($(BINUTILS_VERSION),2.23)
  18. BINUTILS_SOURCE = binutils-$(BINUTILS_VERSION).tar.gz
  19. endif
  20. ifeq ($(ARCH),avr32)
  21. BINUTILS_SITE = ftp://www.at91.com/pub/buildroot
  22. endif
  23. ifeq ($(BR2_arc),y)
  24. BINUTILS_SITE = $(call github,foss-for-synopsys-dwc-arc-processors,binutils,$(BINUTILS_VERSION))
  25. BINUTILS_SOURCE = binutils-$(BINUTILS_VERSION).tar.gz
  26. BINUTILS_FROM_GIT = y
  27. endif
  28. BINUTILS_SITE ?= $(BR2_GNU_MIRROR)/binutils
  29. BINUTILS_SOURCE ?= binutils-$(BINUTILS_VERSION).tar.bz2
  30. BINUTILS_EXTRA_CONFIG_OPTIONS = $(call qstrip,$(BR2_BINUTILS_EXTRA_CONFIG_OPTIONS))
  31. BINUTILS_INSTALL_STAGING = YES
  32. BINUTILS_DEPENDENCIES = $(if $(BR2_NEEDS_GETTEXT_IF_LOCALE),gettext)
  33. HOST_BINUTILS_DEPENDENCIES =
  34. BINUTILS_LICENSE = GPLv3+, libiberty LGPLv2.1+
  35. BINUTILS_LICENSE_FILES = COPYING3 COPYING.LIB
  36. ifeq ($(BINUTILS_FROM_GIT),y)
  37. BINUTILS_DEPENDENCIES += host-texinfo host-flex host-bison
  38. HOST_BINUTILS_DEPENDENCIES += host-texinfo host-flex host-bison
  39. endif
  40. # We need to specify host & target to avoid breaking ARM EABI
  41. BINUTILS_CONF_OPT = --disable-multilib --disable-werror \
  42. --host=$(GNU_TARGET_NAME) \
  43. --target=$(GNU_TARGET_NAME) \
  44. --enable-install-libiberty \
  45. $(BINUTILS_EXTRA_CONFIG_OPTIONS)
  46. # Don't build documentation. It takes up extra space / build time,
  47. # and sometimes needs specific makeinfo versions to work
  48. BINUTILS_CONF_ENV += ac_cv_prog_MAKEINFO=missing
  49. HOST_BINUTILS_CONF_ENV += ac_cv_prog_MAKEINFO=missing
  50. # Install binutils after busybox to prefer full-blown utilities
  51. ifeq ($(BR2_PACKAGE_BUSYBOX),y)
  52. BINUTILS_DEPENDENCIES += busybox
  53. endif
  54. # "host" binutils should actually be "cross"
  55. # We just keep the convention of "host utility" for now
  56. HOST_BINUTILS_CONF_OPT = --disable-multilib --disable-werror \
  57. --target=$(GNU_TARGET_NAME) \
  58. --disable-shared --enable-static \
  59. --with-sysroot=$(STAGING_DIR) \
  60. $(BINUTILS_EXTRA_CONFIG_OPTIONS)
  61. # We just want libbfd and libiberty, not the full-blown binutils in staging
  62. define BINUTILS_INSTALL_STAGING_CMDS
  63. $(MAKE) -C $(@D)/bfd DESTDIR=$(STAGING_DIR) install
  64. $(MAKE) -C $(@D)/libiberty DESTDIR=$(STAGING_DIR) install
  65. endef
  66. # If we don't want full binutils on target
  67. ifneq ($(BR2_PACKAGE_BINUTILS_TARGET),y)
  68. define BINUTILS_INSTALL_TARGET_CMDS
  69. $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/bfd DESTDIR=$(TARGET_DIR) install
  70. $(MAKE) -C $(@D)/libiberty DESTDIR=$(STAGING_DIR) install
  71. endef
  72. endif
  73. XTENSA_CORE_NAME = $(call qstrip, $(BR2_XTENSA_CORE_NAME))
  74. ifneq ($(XTENSA_CORE_NAME),)
  75. define BINUTILS_XTENSA_PRE_PATCH
  76. tar xf $(BR2_XTENSA_OVERLAY_DIR)/xtensa_$(XTENSA_CORE_NAME).tar \
  77. -C $(@D) --strip-components=1 binutils
  78. endef
  79. BINUTILS_PRE_PATCH_HOOKS += BINUTILS_XTENSA_PRE_PATCH
  80. HOST_BINUTILS_PRE_PATCH_HOOKS += BINUTILS_XTENSA_PRE_PATCH
  81. endif
  82. $(eval $(autotools-package))
  83. $(eval $(host-autotools-package))