binutils.mk 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #############################################################
  2. #
  3. # binutils
  4. #
  5. #############################################################
  6. BINUTILS_VERSION = $(call qstrip,$(BR2_BINUTILS_VERSION))
  7. BINUTILS_SOURCE = binutils-$(BINUTILS_VERSION).tar.bz2
  8. BINUTILS_SITE = $(BR2_GNU_MIRROR)/binutils
  9. ifeq ($(ARCH),avr32)
  10. BINUTILS_SITE = ftp://www.at91.com/pub/buildroot
  11. endif
  12. BINUTILS_EXTRA_CONFIG_OPTIONS = $(call qstrip,$(BR2_BINUTILS_EXTRA_CONFIG_OPTIONS))
  13. BINUTILS_INSTALL_STAGING = YES
  14. BINUTILS_DEPENDENCIES = $(if $(BR2_NEEDS_GETTEXT_IF_LOCALE),gettext libintl)
  15. # We need to specify host & target to avoid breaking ARM EABI
  16. BINUTILS_CONF_OPT = --disable-multilib --disable-werror \
  17. --host=$(REAL_GNU_TARGET_NAME) \
  18. --target=$(REAL_GNU_TARGET_NAME) \
  19. --enable-shared \
  20. $(BINUTILS_EXTRA_CONFIG_OPTIONS)
  21. # Install binutils after busybox to prefer full-blown utilities
  22. ifeq ($(BR2_PACKAGE_BUSYBOX),y)
  23. BINUTILS_DEPENDENCIES += busybox
  24. endif
  25. # "host" binutils should actually be "cross"
  26. # We just keep the convention of "host utility" for now
  27. HOST_BINUTILS_CONF_OPT = --disable-multilib --disable-werror \
  28. --target=$(REAL_GNU_TARGET_NAME) \
  29. $(BR2_CONFIGURE_STAGING_SYSROOT) \
  30. $(BINUTILS_EXTRA_CONFIG_OPTIONS)
  31. # We just want libbfd, not the full-blown binutils in staging
  32. define BINUTILS_INSTALL_STAGING_CMDS
  33. $(MAKE) -C $(@D)/bfd DESTDIR=$(STAGING_DIR) install
  34. endef
  35. # only libbfd in the target...
  36. BINUTILS_INSTALL_FROM = $(@D)/bfd
  37. # unless we want full...
  38. ifeq ($(BR2_PACKAGE_BINUTILS_TARGET),y)
  39. BINUTILS_INSTALL_FROM = $(@D)
  40. endif
  41. define BINUTILS_INSTALL_TARGET_CMDS
  42. $(TARGET_MAKE_ENV) $(MAKE) -C $(BINUTILS_INSTALL_FROM) \
  43. DESTDIR=$(TARGET_DIR) install
  44. endef
  45. $(eval $(call AUTOTARGETS,package,binutils))
  46. $(eval $(call AUTOTARGETS,package,binutils,host))