kumquat-buildroot/package/dmalloc/dmalloc.mk
Thomas Petazzoni 9eaad202f1 toolchain: rework thread options
The selection of linuxthreads, linuxthreads old or NPTL doesn't make a
lot of sense for external toolchains. So, instead, we :

 * Introduce an hidden BR2_TOOLCHAIN_HAS_THREADS option, which must be
   selected by toolchain specific options when thread support is
   available. Package needing to test thread support should use this
   option.

 * Move the none/linuxthreads/linuxthreads old/NPTL selection to
   Buildroot internal toolchain configuration.

 * Add an option in external toolchain to tell if thread support is
   available or not in the external toolchain. We assume that glibc
   without threads is not possible, as Ulrich Drepper said in
   http://sourceware.org/ml/libc-alpha/2005-08/msg00091.html

ffmpeg, dmalloc and openvpn are fixed to use the new
BR2_TOOLCHAIN_HAS_THREADS option. For openvpn, --enable-threads=posix
is no longer used, as the configure script doesn't even understand
this option.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2010-12-13 22:26:41 +01:00

59 lines
1.6 KiB
Makefile

#############################################################
#
# dmalloc
#
#############################################################
DMALLOC_VERSION:=5.4.3
DMALLOC_SOURCE:=dmalloc-$(DMALLOC_VERSION).tgz
DMALLOC_SITE:=http://dmalloc.com/releases
DMALLOC_INSTALL_STAGING = YES
DMALLOC_CONF_OPT:= --enable-shlib
ifeq ($(BR2_INSTALL_LIBSTDCPP),y)
DMALLOC_CONF_OPT+=--enable-cxx
else
DMALLOC_CONF_OPT+=--disable-cxx
endif
ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
DMALLOC_CONF_OPT+=--enable-threads
else
DMALLOC_CONF_OPT+=--disable-threads
endif
define DMALLOC_POST_PATCH
$(SED) 's/^ac_cv_page_size=0$$/ac_cv_page_size=12/' $(@D)/configure
$(SED) 's/(ld -/($${LD-ld} -/' $(@D)/configure
$(SED) 's/'\''ld -/"$${LD-ld}"'\'' -/' $(@D)/configure
$(SED) 's/ar cr/$$(AR) cr/' $(@D)/Makefile.in
endef
DMALLOC_POST_PATCH_HOOKS += DMALLOC_POST_PATCH
# both DESTDIR and PREFIX are ignored..
define DMALLOC_INSTALL_STAGING_CMDS
$(MAKE) includedir="$(STAGING_DIR)/usr/include" \
bindir="$(STAGING_DIR)/usr/bin" \
libdir="$(STAGING_DIR)/usr/lib" \
shlibdir="$(STAGING_DIR)/usr/lib" \
includedir="$(STAGING_DIR)/usr/share/info/" \
-C $(@D) install
endef
define DMALLOC_INSTALL_TARGET_CMDS
mv $(STAGING_DIR)/usr/lib/libdmalloc*.so $(TARGET_DIR)/usr/lib
cp -dpf $(STAGING_DIR)/usr/bin/dmalloc $(TARGET_DIR)/usr/bin/dmalloc
endef
define DMALLOC_CLEAN_CMDS
-rm -f $(TARGET_DIR)/usr/lib/libdmalloc*
-rm -f $(STAGING_DIR)/usr/lib/libdmalloc*
rm -f $(STAGING_DIR)/usr/include/dmalloc.h
rm -f $(TARGET_DIR)/usr/bin/dmalloc
-$(MAKE) -C $(DMALLOC_DIR) clean
endef
$(eval $(call AUTOTARGETS,package,dmalloc))