docs/manual: document the br2-external desc: field
[buildroot-gz.git] / package / valgrind / valgrind.mk
blobb97d446062fd170db74e0a9652faec04057e6e6b
1 ################################################################################
3 # valgrind
5 ################################################################################
7 VALGRIND_VERSION = 3.11.0
8 VALGRIND_SITE = http://valgrind.org/downloads
9 VALGRIND_SOURCE = valgrind-$(VALGRIND_VERSION).tar.bz2
10 VALGRIND_LICENSE = GPLv2 GFDLv1.2
11 VALGRIND_LICENSE_FILES = COPYING COPYING.DOCS
12 VALGRIND_CONF_OPTS = --disable-ubsan
13 VALGRIND_INSTALL_STAGING = YES
15 # patch 0004-Fixes-for-musl-libc.patch touching configure.ac
16 VALGRIND_AUTORECONF = YES
18 # When Valgrind detects a 32-bit MIPS architecture, it forcibly adds
19 # -march=mips32 to CFLAGS; when it detects a 64-bit MIPS architecture,
20 # it forcibly adds -march=mips64. This causes Valgrind to be built
21 # always for the first ISA revision level (R1), even when the user has
22 # configured Buildroot for the second ISA revision level (R2).
24 # Override the CFLAGS variable (which Valgrind appends to its CFLAGS)
25 # and pass the right -march option, so they take precedence over
26 # Valgrind's wrongfully detected value.
27 ifeq ($(BR2_mips)$(BR2_mipsel)$(BR2_mips64)$(BR2_mips64el),y)
28 VALGRIND_CONF_ENV += CFLAGS="$(TARGET_CFLAGS) -march=$(BR2_GCC_TARGET_ARCH)"
29 endif
31 # On ARM, Valgrind only supports ARMv7, and uses the arch part of the
32 # host tuple to determine whether it's being built for ARMv7 or
33 # not. Therefore, we adjust the host tuple to specify we're on
34 # ARMv7. The valgrind package is guaranteed, through Config.in, to
35 # only be selected on ARMv7-A platforms.
36 ifeq ($(BR2_ARM_CPU_ARMV7A),y)
37 VALGRIND_CONF_OPTS += \
38 --host=$(patsubst arm-%,armv7-%,$(GNU_TARGET_NAME))
39 endif
41 define VALGRIND_INSTALL_UCLIBC_SUPP
42 $(INSTALL) -D -m 0644 package/valgrind/uclibc.supp $(TARGET_DIR)/usr/lib/valgrind/uclibc.supp
43 endef
45 VALGRIND_POST_INSTALL_TARGET_HOOKS += VALGRIND_INSTALL_UCLIBC_SUPP
47 ifeq ($(BR2_PACKAGE_VALGRIND_MEMCHECK),)
48 define VALGRIND_REMOVE_MEMCHECK
49 rm -f $(TARGET_DIR)/usr/lib/valgrind/*memcheck*
50 endef
52 VALGRIND_POST_INSTALL_TARGET_HOOKS += VALGRIND_REMOVE_MEMCHECK
53 endif
55 ifeq ($(BR2_PACKAGE_VALGRIND_CACHEGRIND),)
56 define VALGRIND_REMOVE_CACHEGRIND
57 rm -f $(TARGET_DIR)/usr/lib/valgrind/*cachegrind*
58 for i in cg_annotate cg_diff cg_merge; do \
59 rm -f $(TARGET_DIR)/usr/bin/$$i ; \
60 done
61 endef
63 VALGRIND_POST_INSTALL_TARGET_HOOKS += VALGRIND_REMOVE_CACHEGRIND
64 endif
66 ifeq ($(BR2_PACKAGE_VALGRIND_CALLGRIND),)
67 define VALGRIND_REMOVE_CALLGRIND
68 rm -f $(TARGET_DIR)/usr/lib/valgrind/*callgrind*
69 for i in callgrind_annotate callgrind_control ; do \
70 rm -f $(TARGET_DIR)/usr/bin/$$i ; \
71 done
72 endef
74 VALGRIND_POST_INSTALL_TARGET_HOOKS += VALGRIND_REMOVE_CALLGRIND
75 endif
77 ifeq ($(BR2_PACKAGE_VALGRIND_HELGRIND),)
78 define VALGRIND_REMOVE_HELGRIND
79 rm -f $(TARGET_DIR)/usr/lib/valgrind/*helgrind*
80 endef
82 VALGRIND_POST_INSTALL_TARGET_HOOKS += VALGRIND_REMOVE_HELGRIND
83 endif
85 ifeq ($(BR2_PACKAGE_VALGRIND_DRD),)
86 define VALGRIND_REMOVE_DRD
87 rm -f $(TARGET_DIR)/usr/lib/valgrind/*drd*
88 endef
90 VALGRIND_POST_INSTALL_TARGET_HOOKS += VALGRIND_REMOVE_DRD
91 endif
93 ifeq ($(BR2_PACKAGE_VALGRIND_MASSIF),)
94 define VALGRIND_REMOVE_MASSIF
95 rm -f $(TARGET_DIR)/usr/lib/valgrind/*massif*
96 rm -f $(TARGET_DIR)/usr/bin/ms_script
97 endef
99 VALGRIND_POST_INSTALL_TARGET_HOOKS += VALGRIND_REMOVE_MASSIF
100 endif
102 ifeq ($(BR2_PACKAGE_VALGRIND_DHAT),)
103 define VALGRIND_REMOVE_DHAT
104 rm -f $(TARGET_DIR)/usr/lib/valgrind/*dhat*
105 endef
107 VALGRIND_POST_INSTALL_TARGET_HOOKS += VALGRIND_REMOVE_DHAT
108 endif
110 ifeq ($(BR2_PACKAGE_VALGRIND_SGCHECK),)
111 define VALGRIND_REMOVE_SGCHECK
112 rm -f $(TARGET_DIR)/usr/lib/valgrind/*sgcheck*
113 endef
115 VALGRIND_POST_INSTALL_TARGET_HOOKS += VALGRIND_REMOVE_SGCHECK
116 endif
118 ifeq ($(BR2_PACKAGE_VALGRIND_BBV),)
119 define VALGRIND_REMOVE_BBV
120 rm -f $(TARGET_DIR)/usr/lib/valgrind/*bbv*
121 endef
123 VALGRIND_POST_INSTALL_TARGET_HOOKS += VALGRIND_REMOVE_BBV
124 endif
126 ifeq ($(BR2_PACKAGE_VALGRIND_LACKEY),)
127 define VALGRIND_REMOVE_LACKEY
128 rm -f $(TARGET_DIR)/usr/lib/valgrind/*lackey*
129 endef
131 VALGRIND_POST_INSTALL_TARGET_HOOKS += VALGRIND_REMOVE_LACKEY
132 endif
134 ifeq ($(BR2_PACKAGE_VALGRIND_NULGRIND),)
135 define VALGRIND_REMOVE_NULGRIND
136 rm -f $(TARGET_DIR)/usr/lib/valgrind/*none*
137 endef
139 VALGRIND_POST_INSTALL_TARGET_HOOKS += VALGRIND_REMOVE_NULGRIND
140 endif
142 $(eval $(autotools-package))