dmalloc.mk 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #############################################################
  2. #
  3. # dmalloc
  4. #
  5. #############################################################
  6. DMALLOC_VERSION:=5.4.3
  7. DMALLOC_SOURCE:=dmalloc-$(DMALLOC_VERSION).tgz
  8. DMALLOC_SITE:=http://dmalloc.com/releases
  9. DMALLOC_INSTALL_STAGING = YES
  10. DMALLOC_CONF_OPT:= --enable-shlib
  11. ifeq ($(BR2_INSTALL_LIBSTDCPP),y)
  12. DMALLOC_CONF_OPT+=--enable-cxx
  13. else
  14. DMALLOC_CONF_OPT+=--disable-cxx
  15. endif
  16. ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
  17. DMALLOC_CONF_OPT+=--enable-threads
  18. else
  19. DMALLOC_CONF_OPT+=--disable-threads
  20. endif
  21. define DMALLOC_POST_PATCH
  22. $(SED) 's/^ac_cv_page_size=0$$/ac_cv_page_size=12/' $(@D)/configure
  23. $(SED) 's/(ld -/($${LD-ld} -/' $(@D)/configure
  24. $(SED) 's/'\''ld -/"$${LD-ld}"'\'' -/' $(@D)/configure
  25. $(SED) 's/ar cr/$$(AR) cr/' $(@D)/Makefile.in
  26. endef
  27. DMALLOC_POST_PATCH_HOOKS += DMALLOC_POST_PATCH
  28. # both DESTDIR and PREFIX are ignored..
  29. define DMALLOC_INSTALL_STAGING_CMDS
  30. $(MAKE) includedir="$(STAGING_DIR)/usr/include" \
  31. bindir="$(STAGING_DIR)/usr/bin" \
  32. libdir="$(STAGING_DIR)/usr/lib" \
  33. shlibdir="$(STAGING_DIR)/usr/lib" \
  34. includedir="$(STAGING_DIR)/usr/share/info/" \
  35. -C $(@D) install
  36. endef
  37. define DMALLOC_INSTALL_TARGET_CMDS
  38. mv $(STAGING_DIR)/usr/lib/libdmalloc*.so $(TARGET_DIR)/usr/lib
  39. cp -dpf $(STAGING_DIR)/usr/bin/dmalloc $(TARGET_DIR)/usr/bin/dmalloc
  40. endef
  41. define DMALLOC_CLEAN_CMDS
  42. -rm -f $(TARGET_DIR)/usr/lib/libdmalloc*
  43. -rm -f $(STAGING_DIR)/usr/lib/libdmalloc*
  44. rm -f $(STAGING_DIR)/usr/include/dmalloc.h
  45. rm -f $(TARGET_DIR)/usr/bin/dmalloc
  46. -$(MAKE) -C $(DMALLOC_DIR) clean
  47. endef
  48. $(eval $(call AUTOTARGETS,package,dmalloc))