dmalloc.mk 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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_DIR:=$(BUILD_DIR)/dmalloc-$(DMALLOC_VERSION)
  10. DMALLOC_CAT:=$(ZCAT)
  11. DMALLOC_BINARY:=dmalloc
  12. DMALLOC_TARGET_BINARY:=usr/bin/dmalloc
  13. $(DL_DIR)/$(DMALLOC_SOURCE):
  14. $(call DOWNLOAD,$(DMALLOC_SITE),$(DMALLOC_SOURCE))
  15. dmalloc-source: $(DL_DIR)/$(DMALLOC_SOURCE)
  16. $(DMALLOC_DIR)/.unpacked: $(DL_DIR)/$(DMALLOC_SOURCE)
  17. $(DMALLOC_CAT) $(DL_DIR)/$(DMALLOC_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
  18. toolchain/patch-kernel.sh $(DMALLOC_DIR) package/dmalloc dmalloc\*.patch
  19. $(SED) 's/^ac_cv_page_size=0$$/ac_cv_page_size=12/' $(DMALLOC_DIR)/configure
  20. $(SED) 's/(ld -/($${LD-ld} -/' $(DMALLOC_DIR)/configure
  21. $(SED) 's/'\''ld -/"$${LD-ld}"'\'' -/' $(DMALLOC_DIR)/configure
  22. -$(SED) 's/ar cr/$$(AR) cr/' $(DMALLOC_DIR)/Makefile.in
  23. touch $@
  24. ifeq ($(BR2_INSTALL_LIBSTDCPP),y)
  25. DMALLOC_CONFIG_ARGS:=--enable-cxx
  26. else
  27. DMALLOC_CONFIG_ARGS:=--disable-cxx
  28. endif
  29. ifeq ($(BR2_PTHREADS_NONE),y)
  30. DMALLOC_CONFIG_ARGS+=--disable-threads
  31. else
  32. DMALLOC_CONFIG_ARGS+=--enable-threads
  33. endif
  34. $(DMALLOC_DIR)/.configured: $(DMALLOC_DIR)/.unpacked
  35. (cd $(DMALLOC_DIR); rm -rf config.cache; \
  36. $(TARGET_CONFIGURE_OPTS) \
  37. $(TARGET_CONFIGURE_ARGS) \
  38. CFLAGS="-g" \
  39. LDFLAGS="-g" \
  40. ./configure $(QUIET) \
  41. --target=$(GNU_TARGET_NAME) \
  42. --host=$(GNU_TARGET_NAME) \
  43. --build=$(GNU_HOST_NAME) \
  44. --prefix=/usr \
  45. --exec-prefix=/usr \
  46. --bindir=/usr/bin \
  47. --sbindir=/usr/sbin \
  48. --libdir=/lib \
  49. --libexecdir=/usr/lib \
  50. --sysconfdir=/etc \
  51. --datadir=/usr/share \
  52. --localstatedir=/var \
  53. --includedir=/usr/include \
  54. --mandir=/usr/man \
  55. --infodir=/usr/info \
  56. --enable-shlib \
  57. $(DMALLOC_CONFIG_ARGS) \
  58. )
  59. touch $@
  60. $(DMALLOC_DIR)/$(DMALLOC_BINARY): $(DMALLOC_DIR)/.configured
  61. $(MAKE) -C $(DMALLOC_DIR)
  62. $(TARGET_DIR)/$(DMALLOC_TARGET_BINARY): $(DMALLOC_DIR)/$(DMALLOC_BINARY)
  63. # both DESTDIR and PREFIX are ignored..
  64. $(MAKE) includedir="$(STAGING_DIR)/usr/include" \
  65. bindir="$(STAGING_DIR)/usr/bin" \
  66. libdir="$(STAGING_DIR)/usr/lib" \
  67. shlibdir="$(STAGING_DIR)/usr/lib" \
  68. includedir="$(STAGING_DIR)/usr/share/info/" \
  69. -C $(DMALLOC_DIR) install
  70. (cd $(STAGING_DIR)/usr/lib; \
  71. mv libdmalloc*.so $(TARGET_DIR)/usr/lib)
  72. cp -dpf $(STAGING_DIR)/usr/bin/dmalloc $(TARGET_DIR)/$(DMALLOC_TARGET_BINARY)
  73. $(STRIPCMD) $(STRIP_STRIP_ALL) $(TARGET_DIR)/$(DMALLOC_TARGET_BINARY)
  74. dmalloc: $(TARGET_DIR)/$(DMALLOC_TARGET_BINARY)
  75. dmalloc-clean:
  76. -rm -f $(TARGET_DIR)/usr/lib/libdmalloc*
  77. -rm -f $(STAGING_DIR)/usr/lib/libdmalloc*
  78. rm -f $(STAGING_DIR)/usr/include/dmalloc.h
  79. rm -f $(TARGET_DIR)/$(DMALLOC_TARGET_BINARY)
  80. -$(MAKE) -C $(DMALLOC_DIR) clean
  81. dmalloc-dirclean:
  82. rm -rf $(DMALLOC_DIR)
  83. #############################################################
  84. #
  85. # Toplevel Makefile options
  86. #
  87. #############################################################
  88. ifeq ($(BR2_PACKAGE_DMALLOC),y)
  89. TARGETS+=dmalloc
  90. endif