2013-06-06 01:53:30 +02:00
|
|
|
################################################################################
|
2006-12-12 23:16:41 +01:00
|
|
|
#
|
|
|
|
# dmalloc
|
|
|
|
#
|
2013-06-06 01:53:30 +02:00
|
|
|
################################################################################
|
2013-01-20 10:45:47 +01:00
|
|
|
|
2021-11-24 18:29:13 +01:00
|
|
|
DMALLOC_VERSION = 5.6.5
|
2013-01-20 10:45:47 +01:00
|
|
|
DMALLOC_SOURCE = dmalloc-$(DMALLOC_VERSION).tgz
|
|
|
|
DMALLOC_SITE = http://dmalloc.com/releases
|
2006-12-12 23:16:41 +01:00
|
|
|
|
2021-11-24 18:29:13 +01:00
|
|
|
DMALLOC_LICENSE = ISC
|
|
|
|
DMALLOC_LICENSE_FILES = LICENSE.txt
|
2012-11-13 02:05:39 +01:00
|
|
|
|
2010-06-16 13:47:04 +02:00
|
|
|
DMALLOC_INSTALL_STAGING = YES
|
2015-01-20 12:24:37 +01:00
|
|
|
DMALLOC_CFLAGS = $(TARGET_CFLAGS)
|
2007-01-20 21:54:05 +01:00
|
|
|
|
2021-05-15 17:17:30 +02:00
|
|
|
ifeq ($(BR2_STATIC_LIBS),y)
|
|
|
|
DMALLOC_CONF_OPTS += --disable-shlib
|
|
|
|
else
|
|
|
|
DMALLOC_CONF_OPTS += --enable-shlib
|
2021-04-17 12:49:19 +02:00
|
|
|
DMALLOC_CFLAGS += -fPIC
|
|
|
|
endif
|
|
|
|
|
2007-01-20 21:54:05 +01:00
|
|
|
ifeq ($(BR2_INSTALL_LIBSTDCPP),y)
|
2014-09-27 21:32:44 +02:00
|
|
|
DMALLOC_CONF_OPTS += --enable-cxx
|
2007-01-20 21:54:05 +01:00
|
|
|
else
|
2014-09-27 21:32:44 +02:00
|
|
|
DMALLOC_CONF_OPTS += --disable-cxx
|
2007-01-20 21:54:05 +01:00
|
|
|
endif
|
|
|
|
|
2010-12-13 17:27:44 +01:00
|
|
|
ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
|
2014-09-27 21:32:44 +02:00
|
|
|
DMALLOC_CONF_OPTS += --enable-threads
|
2010-12-13 17:27:44 +01:00
|
|
|
else
|
2014-09-27 21:32:44 +02:00
|
|
|
DMALLOC_CONF_OPTS += --disable-threads
|
2007-01-20 21:54:05 +01:00
|
|
|
endif
|
|
|
|
|
2015-01-20 12:24:37 +01:00
|
|
|
# dmalloc has some assembly function that are not present in thumb1 mode:
|
|
|
|
# Error: lo register required -- `str lr,[sp,#4]'
|
|
|
|
# so, we desactivate thumb mode
|
|
|
|
ifeq ($(BR2_ARM_INSTRUCTIONS_THUMB),y)
|
|
|
|
DMALLOC_CFLAGS += -marm
|
|
|
|
endif
|
|
|
|
|
2019-06-14 23:03:39 +02:00
|
|
|
ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_63261),y)
|
|
|
|
DMALLOC_CFLAGS += -O0
|
|
|
|
endif
|
|
|
|
|
2015-01-20 12:24:37 +01:00
|
|
|
DMALLOC_CONF_ENV = CFLAGS="$(DMALLOC_CFLAGS)"
|
|
|
|
|
2010-06-16 13:47:04 +02:00
|
|
|
define DMALLOC_POST_PATCH
|
|
|
|
$(SED) 's/^ac_cv_page_size=0$$/ac_cv_page_size=12/' $(@D)/configure
|
2021-12-08 18:30:51 +01:00
|
|
|
$(SED) 's/ac_cv_strdup_macro=no$$/ac_cv_strdup_macro=yes/' $(@D)/configure
|
2022-06-10 23:05:40 +02:00
|
|
|
$(SED) 's/ac_cv_strndup_macro=no$$/ac_cv_strndup_macro=yes/' $(@D)/configure
|
2010-06-16 13:47:04 +02:00
|
|
|
$(SED) 's/(ld -/($${LD-ld} -/' $(@D)/configure
|
|
|
|
$(SED) 's/'\''ld -/"$${LD-ld}"'\'' -/' $(@D)/configure
|
|
|
|
$(SED) 's/ar cr/$$(AR) cr/' $(@D)/Makefile.in
|
|
|
|
endef
|
2007-01-20 21:54:05 +01:00
|
|
|
|
2010-06-16 13:47:04 +02:00
|
|
|
DMALLOC_POST_PATCH_HOOKS += DMALLOC_POST_PATCH
|
2006-12-12 23:16:41 +01:00
|
|
|
|
2010-06-16 13:47:04 +02:00
|
|
|
# both DESTDIR and PREFIX are ignored..
|
|
|
|
define DMALLOC_INSTALL_STAGING_CMDS
|
2016-10-17 18:06:34 +02:00
|
|
|
$(TARGET_MAKE_ENV) $(MAKE) includedir="$(STAGING_DIR)/usr/include" \
|
2007-01-20 21:54:05 +01:00
|
|
|
bindir="$(STAGING_DIR)/usr/bin" \
|
|
|
|
libdir="$(STAGING_DIR)/usr/lib" \
|
|
|
|
shlibdir="$(STAGING_DIR)/usr/lib" \
|
2011-09-28 16:29:55 +02:00
|
|
|
infodir="$(STAGING_DIR)/usr/share/info/" \
|
2010-06-16 13:47:04 +02:00
|
|
|
-C $(@D) install
|
|
|
|
endef
|
2006-12-12 23:16:41 +01:00
|
|
|
|
2016-06-13 08:07:17 +02:00
|
|
|
ifeq ($(BR2_STATIC_LIBS),)
|
|
|
|
define DMALLOC_INSTALL_SHARED_LIB
|
2013-02-13 16:12:02 +01:00
|
|
|
cp -dpf $(STAGING_DIR)/usr/lib/libdmalloc*.so $(TARGET_DIR)/usr/lib
|
2016-06-13 08:07:17 +02:00
|
|
|
endef
|
|
|
|
endif
|
|
|
|
|
|
|
|
define DMALLOC_INSTALL_TARGET_CMDS
|
|
|
|
$(DMALLOC_INSTALL_SHARED_LIB)
|
2010-06-16 13:47:04 +02:00
|
|
|
cp -dpf $(STAGING_DIR)/usr/bin/dmalloc $(TARGET_DIR)/usr/bin/dmalloc
|
|
|
|
endef
|
2006-12-12 23:16:41 +01:00
|
|
|
|
2012-07-03 00:07:32 +02:00
|
|
|
$(eval $(autotools-package))
|