binutils.mk 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. BINUTILS_VERSION = 2.21
  11. endif
  12. BINUTILS_SOURCE = binutils-$(BINUTILS_VERSION).tar.bz2
  13. BINUTILS_SITE = $(BR2_GNU_MIRROR)/binutils
  14. ifeq ($(ARCH),avr32)
  15. BINUTILS_SITE = ftp://www.at91.com/pub/buildroot
  16. endif
  17. BINUTILS_EXTRA_CONFIG_OPTIONS = $(call qstrip,$(BR2_BINUTILS_EXTRA_CONFIG_OPTIONS))
  18. BINUTILS_INSTALL_STAGING = YES
  19. BINUTILS_DEPENDENCIES = $(if $(BR2_NEEDS_GETTEXT_IF_LOCALE),gettext libintl)
  20. # We need to specify host & target to avoid breaking ARM EABI
  21. BINUTILS_CONF_OPT = --disable-multilib --disable-werror \
  22. --host=$(REAL_GNU_TARGET_NAME) \
  23. --target=$(REAL_GNU_TARGET_NAME) \
  24. --enable-shared \
  25. $(BINUTILS_EXTRA_CONFIG_OPTIONS)
  26. # Install binutils after busybox to prefer full-blown utilities
  27. ifeq ($(BR2_PACKAGE_BUSYBOX),y)
  28. BINUTILS_DEPENDENCIES += busybox
  29. endif
  30. # "host" binutils should actually be "cross"
  31. # We just keep the convention of "host utility" for now
  32. HOST_BINUTILS_CONF_OPT = --disable-multilib --disable-werror \
  33. --target=$(REAL_GNU_TARGET_NAME) \
  34. --disable-shared --enable-static \
  35. $(BR2_CONFIGURE_STAGING_SYSROOT) \
  36. $(BINUTILS_EXTRA_CONFIG_OPTIONS)
  37. # We just want libbfd and libiberty, not the full-blown binutils in staging
  38. define BINUTILS_INSTALL_STAGING_CMDS
  39. $(MAKE) -C $(@D)/bfd DESTDIR=$(STAGING_DIR) install
  40. $(MAKE) -C $(@D)/libiberty DESTDIR=$(STAGING_DIR) install
  41. endef
  42. # If we don't want full binutils on target
  43. ifneq ($(BR2_PACKAGE_BINUTILS_TARGET),y)
  44. define BINUTILS_INSTALL_TARGET_CMDS
  45. $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/bfd DESTDIR=$(TARGET_DIR) install
  46. $(MAKE) -C $(@D)/libiberty DESTDIR=$(STAGING_DIR) install
  47. endef
  48. endif
  49. $(eval $(call AUTOTARGETS))
  50. $(eval $(call AUTOTARGETS,host))