2
1

binutils.mk 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. --with-sysroot=$(STAGING_DIR) \
  36. $(BINUTILS_EXTRA_CONFIG_OPTIONS)
  37. HOST_BINUTILS_DEPENDENCIES =
  38. # We just want libbfd and libiberty, not the full-blown binutils in staging
  39. define BINUTILS_INSTALL_STAGING_CMDS
  40. $(MAKE) -C $(@D)/bfd DESTDIR=$(STAGING_DIR) install
  41. $(MAKE) -C $(@D)/libiberty DESTDIR=$(STAGING_DIR) install
  42. endef
  43. # If we don't want full binutils on target
  44. ifneq ($(BR2_PACKAGE_BINUTILS_TARGET),y)
  45. define BINUTILS_INSTALL_TARGET_CMDS
  46. $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/bfd DESTDIR=$(TARGET_DIR) install
  47. $(MAKE) -C $(@D)/libiberty DESTDIR=$(STAGING_DIR) install
  48. endef
  49. endif
  50. $(eval $(call AUTOTARGETS))
  51. $(eval $(call AUTOTARGETS,host))