summaryrefslogtreecommitdiffstats
path: root/package/valgrind/valgrind.mk
diff options
context:
space:
mode:
Diffstat (limited to 'package/valgrind/valgrind.mk')
-rw-r--r--package/valgrind/valgrind.mk99
1 files changed, 20 insertions, 79 deletions
diff --git a/package/valgrind/valgrind.mk b/package/valgrind/valgrind.mk
index 5bf0a9d28..551aecf4d 100644
--- a/package/valgrind/valgrind.mk
+++ b/package/valgrind/valgrind.mk
@@ -4,85 +4,26 @@
#
#############################################################
-VALGRIND_VERSION=3.2.3
-VALGRIND_SITE:=http://valgrind.org/downloads/
-VALGRIND_DIR:=$(BUILD_DIR)/valgrind-$(VALGRIND_VERSION)
-VALGRIND_SOURCE:=valgrind-$(VALGRIND_VERSION).tar.bz2
-VALGRIND_CAT:=$(BZCAT)
-
-$(DL_DIR)/$(VALGRIND_SOURCE):
- $(call DOWNLOAD,$(VALGRIND_SITE),$(VALGRIND_SOURCE))
-
-$(VALGRIND_DIR)/.unpacked: $(DL_DIR)/$(VALGRIND_SOURCE)
- $(VALGRIND_CAT) $(DL_DIR)/$(VALGRIND_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
- touch $(VALGRIND_DIR)/.unpacked
-
-$(VALGRIND_DIR)/.patched: $(VALGRIND_DIR)/.unpacked
- toolchain/patch-kernel.sh $(VALGRIND_DIR) package/valgrind/ valgrind\*.patch
- touch $(VALGRIND_DIR)/.patched
-
-$(VALGRIND_DIR)/.configured: $(VALGRIND_DIR)/.patched
- (cd $(VALGRIND_DIR); rm -rf config.cache; \
- $(TARGET_CONFIGURE_OPTS) \
- $(TARGET_CONFIGURE_ARGS) \
- CC="$(TARGET_CC) $(TARGET_CFLAGS) -I$(LINUX_HEADERS_DIR)/include" \
- ./configure $(QUIET) \
- --target=$(GNU_TARGET_NAME) \
- --host=$(GNU_TARGET_NAME) \
- --build=$(GNU_HOST_NAME) \
- --prefix=/usr \
- $(DISABLE_NLS) \
- --without-uiout --disable-valgrindmi \
- --disable-tui --disable-valgrindtk \
- --without-x --without-included-gettext \
- --disable-tls \
- )
- touch $(VALGRIND_DIR)/.configured
-
-$(VALGRIND_DIR)/coregrind/valgrind: $(VALGRIND_DIR)/.configured
- $(MAKE) -C $(VALGRIND_DIR)
- touch -c $@
-
-$(TARGET_DIR)/usr/bin/valgrind: $(VALGRIND_DIR)/coregrind/valgrind
- $(MAKE) \
- prefix=$(TARGET_DIR)/usr \
- exec_prefix=$(TARGET_DIR)/usr \
- bindir=$(TARGET_DIR)/usr/bin \
- sbindir=$(TARGET_DIR)/usr/sbin \
- libexecdir=$(TARGET_DIR)/usr/lib \
- datadir=$(TARGET_DIR)/usr/share \
- sysconfdir=$(TARGET_DIR)/etc \
- sharedstatedir=$(TARGET_DIR)/usr/com \
- localstatedir=$(TARGET_DIR)/var \
- libdir=$(TARGET_DIR)/usr/lib \
- infodir=$(TARGET_DIR)/usr/info \
- mandir=$(TARGET_DIR)/usr/man \
- includedir=$(TARGET_DIR)/usr/include \
- -C $(VALGRIND_DIR) install
- mv $(TARGET_DIR)/usr/bin/valgrind $(TARGET_DIR)/usr/bin/valgrind.bin
- cp package/valgrind/uclibc.supp $(TARGET_DIR)/usr/lib/valgrind/
- cp package/valgrind/valgrind.sh $(TARGET_DIR)/usr/bin/valgrind
- chmod a+x $(TARGET_DIR)/usr/bin/valgrind
- rm -rf $(TARGET_DIR)/usr/share/doc/valgrind
- touch -c $@
-
-valgrind: $(TARGET_DIR)/usr/bin/valgrind
-
-valgrind-source: $(DL_DIR)/$(VALGRIND_SOURCE)
+VALGRIND_VERSION = 3.6.1
+VALGRIND_SITE = http://valgrind.org/downloads/
+VALGRIND_SOURCE = valgrind-$(VALGRIND_VERSION).tar.bz2
+
+VALGRIND_CONF_OPT = --disable-tls
+
+# On ARM, Valgrind only supports ARMv7, and uses the arch part of the
+# host tuple to determine whether it's being built for ARMv7 or
+# not. Therefore, we adjust the host tuple to specify we're on
+# ARMv7. The valgrind package is guaranteed, through Config.in, to
+# only be selected on Cortex A8 and Cortex A9 platforms.
+ifeq ($(BR2_cortex_a8)$(BR2_cortex_a9),y)
+VALGRIND_CONF_OPT += \
+ --host=$(patsubst arm-%,armv7-unknown-%,$(GNU_TARGET_NAME))
+endif
-valgrind-clean:
- -$(MAKE) -C $(VALGRIND_DIR) clean
- -rm -f $(TARGET_DIR)/usr/bin/valgrind*
- rm -rf $(TARGET_DIR)/usr/lib/valgrind
+define VALGRIND_INSTALL_UCLIBC_SUPP
+ install -D -m 0644 package/valgrind/uclibc.supp $(TARGET_DIR)/usr/lib/valgrind/uclibc.supp
+endef
-valgrind-dirclean:
- rm -rf $(VALGRIND_DIR)
+VALGRIND_POST_INSTALL_TARGET_HOOKS += VALGRIND_INSTALL_UCLIBC_SUPP
-#############################################################
-#
-# Toplevel Makefile options
-#
-#############################################################
-ifeq ($(BR2_PACKAGE_VALGRIND),y)
-TARGETS+=valgrind
-endif
+$(eval $(call AUTOTARGETS,package,valgrind))