binutils.mk 2.0 KB

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