dmalloc.mk 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. ################################################################################
  2. #
  3. # dmalloc
  4. #
  5. ################################################################################
  6. DMALLOC_VERSION = 5.6.5
  7. DMALLOC_SOURCE = dmalloc-$(DMALLOC_VERSION).tgz
  8. DMALLOC_SITE = http://dmalloc.com/releases
  9. DMALLOC_LICENSE = ISC
  10. DMALLOC_LICENSE_FILES = LICENSE.txt
  11. DMALLOC_INSTALL_STAGING = YES
  12. DMALLOC_CFLAGS = $(TARGET_CFLAGS)
  13. # dmalloc uses $(LD) to link, and thus misses the object files or libs that
  14. # are needed to provide the __stack_chk_fail_local and co. symbols. Changing
  15. # to use $(CC) is really more complex that we'd like. Since dmalloc is
  16. # involved in debugging memory allocation, it is not expected to be a
  17. # production library, so we do not care that much that it has SSP.
  18. DMALLOC_CFLAGS += -fno-stack-protector
  19. ifeq ($(BR2_STATIC_LIBS),y)
  20. DMALLOC_CONF_OPTS += --disable-shlib
  21. else
  22. DMALLOC_CONF_OPTS += --enable-shlib
  23. DMALLOC_CFLAGS += -fPIC
  24. endif
  25. ifeq ($(BR2_INSTALL_LIBSTDCPP),y)
  26. DMALLOC_CONF_OPTS += --enable-cxx
  27. else
  28. DMALLOC_CONF_OPTS += --disable-cxx
  29. endif
  30. ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
  31. DMALLOC_CONF_OPTS += --enable-threads
  32. else
  33. DMALLOC_CONF_OPTS += --disable-threads
  34. endif
  35. # dmalloc has some assembly function that are not present in thumb1 mode:
  36. # Error: lo register required -- `str lr,[sp,#4]'
  37. # so, we deactivate thumb mode
  38. ifeq ($(BR2_ARM_INSTRUCTIONS_THUMB),y)
  39. DMALLOC_CFLAGS += -marm
  40. endif
  41. ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_63261),y)
  42. DMALLOC_CFLAGS += -O0
  43. endif
  44. DMALLOC_CONF_ENV = \
  45. CFLAGS="$(DMALLOC_CFLAGS)" \
  46. ac_cv_page_size=12 \
  47. ac_cv_strdup_macro=yes \
  48. ac_cv_strndup_macro=yes
  49. # both DESTDIR and PREFIX are ignored..
  50. define DMALLOC_INSTALL_STAGING_CMDS
  51. $(TARGET_MAKE_ENV) $(MAKE) includedir="$(STAGING_DIR)/usr/include" \
  52. bindir="$(STAGING_DIR)/usr/bin" \
  53. libdir="$(STAGING_DIR)/usr/lib" \
  54. shlibdir="$(STAGING_DIR)/usr/lib" \
  55. infodir="$(STAGING_DIR)/usr/share/info/" \
  56. -C $(@D) install
  57. endef
  58. ifeq ($(BR2_STATIC_LIBS),)
  59. define DMALLOC_INSTALL_SHARED_LIB
  60. cp -dpf $(STAGING_DIR)/usr/lib/libdmalloc*.so $(TARGET_DIR)/usr/lib
  61. endef
  62. endif
  63. define DMALLOC_INSTALL_TARGET_CMDS
  64. $(DMALLOC_INSTALL_SHARED_LIB)
  65. cp -dpf $(STAGING_DIR)/usr/bin/dmalloc $(TARGET_DIR)/usr/bin/dmalloc
  66. endef
  67. $(eval $(autotools-package))