dmalloc.mk 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. #############################################################
  2. #
  3. # dmalloc
  4. #
  5. #############################################################
  6. DMALLOC_VER:=5.4.2
  7. DMALLOC_SOURCE:=dmalloc-$(DMALLOC_VER).tgz
  8. DMALLOC_SITE:=http://dmalloc.com/releases
  9. DMALLOC_DIR:=$(BUILD_DIR)/dmalloc-$(DMALLOC_VER)
  10. DMALLOC_CAT:=$(ZCAT)
  11. DMALLOC_BINARY:=dmalloc
  12. DMALLOC_TARGET_BINARY:=usr/bin/dmalloc
  13. $(DL_DIR)/$(DMALLOC_SOURCE):
  14. $(WGET) -P $(DL_DIR) $(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. CFLAGS="-g $(TARGET_CFLAGS)" \
  38. LDFLAGS="-g $(TARGET_LDFLAGS)" \
  39. ./configure \
  40. --target=$(GNU_TARGET_NAME) \
  41. --host=$(GNU_TARGET_NAME) \
  42. --build=$(GNU_HOST_NAME) \
  43. --prefix=/usr \
  44. --exec-prefix=/usr \
  45. --bindir=/usr/bin \
  46. --sbindir=/usr/sbin \
  47. --libdir=/lib \
  48. --libexecdir=/usr/lib \
  49. --sysconfdir=/etc \
  50. --datadir=/usr/share \
  51. --localstatedir=/var \
  52. --includedir=/include \
  53. --mandir=/usr/man \
  54. --infodir=/usr/info \
  55. --enable-shlib \
  56. $(DMALLOC_CONFIG_ARGS) \
  57. );
  58. touch $@
  59. $(DMALLOC_DIR)/$(DMALLOC_BINARY): $(DMALLOC_DIR)/.configured
  60. $(MAKE) -C $(DMALLOC_DIR)
  61. $(TARGET_DIR)/$(DMALLOC_TARGET_BINARY): $(DMALLOC_DIR)/$(DMALLOC_BINARY)
  62. # both DESTDIR and PREFIX are ignored..
  63. $(MAKE) includedir="$(STAGING_DIR)/usr/include" \
  64. bindir="$(STAGING_DIR)/usr/bin" \
  65. libdir="$(STAGING_DIR)/usr/lib" \
  66. shlibdir="$(STAGING_DIR)/usr/lib" \
  67. includedir="$(STAGING_DIR)/usr/share/info/" \
  68. -C $(DMALLOC_DIR) install
  69. (cd $(STAGING_DIR)/usr/lib; \
  70. mv libdmalloc*.so $(TARGET_DIR)/usr/lib);
  71. cp -dpf $(STAGING_DIR)/usr/bin/dmalloc $(TARGET_DIR)/$(DMALLOC_TARGET_BINARY)
  72. $(STRIP) -s $(TARGET_DIR)/$(DMALLOC_TARGET_BINARY)
  73. dmalloc: uclibc $(TARGET_DIR)/$(DMALLOC_TARGET_BINARY)
  74. dmalloc-clean:
  75. rm -f $(TARGET_DIR)/usr/lib/libdmalloc*
  76. rm -f $(STAGING_DIR)/usr/lib/libdmalloc*
  77. rm -f $(STAGING_DIR)/include/dmalloc.h
  78. rm -f $(TARGET_DIR)/$(DMALLOC_TARGET_BINARY)
  79. $(MAKE) -C $(DMALLOC_DIR) clean
  80. dmalloc-dirclean:
  81. rm -rf $(DMALLOC_DIR)
  82. #############################################################
  83. #
  84. # Toplevel Makefile options
  85. #
  86. #############################################################
  87. ifeq ($(strip $(BR2_PACKAGE_DMALLOC)),y)
  88. TARGETS+=dmalloc
  89. endif