toolchain: bump Codescape IMG MIPS version to 2016.05-06
[buildroot-gz.git] / package / valgrind / valgrind.mk
blob087a3813afec0d6abaec236a3606724000255023
1 ################################################################################
3 # valgrind
5 ################################################################################
7 VALGRIND_VERSION = 3.12.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 = \
13 --disable-ubsan \
14 --without-mpicc
15 VALGRIND_INSTALL_STAGING = YES
17 # patch 0004-Fixes-for-musl-libc.patch touching configure.ac
18 VALGRIND_AUTORECONF = YES
20 # When Valgrind detects a 32-bit MIPS architecture, it forcibly adds
21 # -march=mips32 to CFLAGS; when it detects a 64-bit MIPS architecture,
22 # it forcibly adds -march=mips64. This causes Valgrind to be built
23 # always for the first ISA revision level (R1), even when the user has
24 # configured Buildroot for the second ISA revision level (R2).
26 # Override the CFLAGS variable (which Valgrind appends to its CFLAGS)
27 # and pass the right -march option, so they take precedence over
28 # Valgrind's wrongfully detected value.
29 ifeq ($(BR2_mips)$(BR2_mipsel)$(BR2_mips64)$(BR2_mips64el),y)
30 VALGRIND_CONF_ENV += CFLAGS="$(TARGET_CFLAGS) -march=$(BR2_GCC_TARGET_ARCH)"
31 endif
33 # On ARM, Valgrind only supports ARMv7, and uses the arch part of the
34 # host tuple to determine whether it's being built for ARMv7 or
35 # not. Therefore, we adjust the host tuple to specify we're on
36 # ARMv7. The valgrind package is guaranteed, through Config.in, to
37 # only be selected on ARMv7-A platforms.
38 ifeq ($(BR2_ARM_CPU_ARMV7A),y)
39 VALGRIND_CONF_OPTS += \
40 --host=$(patsubst arm-%,armv7-%,$(GNU_TARGET_NAME))
41 endif
43 define VALGRIND_INSTALL_UCLIBC_SUPP
44 $(INSTALL) -D -m 0644 package/valgrind/uclibc.supp $(TARGET_DIR)/usr/lib/valgrind/uclibc.supp
45 endef
47 VALGRIND_POST_INSTALL_TARGET_HOOKS += VALGRIND_INSTALL_UCLIBC_SUPP
49 ifeq ($(BR2_PACKAGE_VALGRIND_MEMCHECK),)
50 define VALGRIND_REMOVE_MEMCHECK
51 rm -f $(TARGET_DIR)/usr/lib/valgrind/*memcheck*
52 endef
54 VALGRIND_POST_INSTALL_TARGET_HOOKS += VALGRIND_REMOVE_MEMCHECK
55 endif
57 ifeq ($(BR2_PACKAGE_VALGRIND_CACHEGRIND),)
58 define VALGRIND_REMOVE_CACHEGRIND
59 rm -f $(TARGET_DIR)/usr/lib/valgrind/*cachegrind*
60 for i in cg_annotate cg_diff cg_merge; do \
61 rm -f $(TARGET_DIR)/usr/bin/$$i ; \
62 done
63 endef
65 VALGRIND_POST_INSTALL_TARGET_HOOKS += VALGRIND_REMOVE_CACHEGRIND
66 endif
68 ifeq ($(BR2_PACKAGE_VALGRIND_CALLGRIND),)
69 define VALGRIND_REMOVE_CALLGRIND
70 rm -f $(TARGET_DIR)/usr/lib/valgrind/*callgrind*
71 for i in callgrind_annotate callgrind_control ; do \
72 rm -f $(TARGET_DIR)/usr/bin/$$i ; \
73 done
74 endef
76 VALGRIND_POST_INSTALL_TARGET_HOOKS += VALGRIND_REMOVE_CALLGRIND
77 endif
79 ifeq ($(BR2_PACKAGE_VALGRIND_HELGRIND),)
80 define VALGRIND_REMOVE_HELGRIND
81 rm -f $(TARGET_DIR)/usr/lib/valgrind/*helgrind*
82 endef
84 VALGRIND_POST_INSTALL_TARGET_HOOKS += VALGRIND_REMOVE_HELGRIND
85 endif
87 ifeq ($(BR2_PACKAGE_VALGRIND_DRD),)
88 define VALGRIND_REMOVE_DRD
89 rm -f $(TARGET_DIR)/usr/lib/valgrind/*drd*
90 endef
92 VALGRIND_POST_INSTALL_TARGET_HOOKS += VALGRIND_REMOVE_DRD
93 endif
95 ifeq ($(BR2_PACKAGE_VALGRIND_MASSIF),)
96 define VALGRIND_REMOVE_MASSIF
97 rm -f $(TARGET_DIR)/usr/lib/valgrind/*massif*
98 rm -f $(TARGET_DIR)/usr/bin/ms_script
99 endef
101 VALGRIND_POST_INSTALL_TARGET_HOOKS += VALGRIND_REMOVE_MASSIF
102 endif
104 ifeq ($(BR2_PACKAGE_VALGRIND_DHAT),)
105 define VALGRIND_REMOVE_DHAT
106 rm -f $(TARGET_DIR)/usr/lib/valgrind/*dhat*
107 endef
109 VALGRIND_POST_INSTALL_TARGET_HOOKS += VALGRIND_REMOVE_DHAT
110 endif
112 ifeq ($(BR2_PACKAGE_VALGRIND_SGCHECK),)
113 define VALGRIND_REMOVE_SGCHECK
114 rm -f $(TARGET_DIR)/usr/lib/valgrind/*sgcheck*
115 endef
117 VALGRIND_POST_INSTALL_TARGET_HOOKS += VALGRIND_REMOVE_SGCHECK
118 endif
120 ifeq ($(BR2_PACKAGE_VALGRIND_BBV),)
121 define VALGRIND_REMOVE_BBV
122 rm -f $(TARGET_DIR)/usr/lib/valgrind/*bbv*
123 endef
125 VALGRIND_POST_INSTALL_TARGET_HOOKS += VALGRIND_REMOVE_BBV
126 endif
128 ifeq ($(BR2_PACKAGE_VALGRIND_LACKEY),)
129 define VALGRIND_REMOVE_LACKEY
130 rm -f $(TARGET_DIR)/usr/lib/valgrind/*lackey*
131 endef
133 VALGRIND_POST_INSTALL_TARGET_HOOKS += VALGRIND_REMOVE_LACKEY
134 endif
136 ifeq ($(BR2_PACKAGE_VALGRIND_NULGRIND),)
137 define VALGRIND_REMOVE_NULGRIND
138 rm -f $(TARGET_DIR)/usr/lib/valgrind/*none*
139 endef
141 VALGRIND_POST_INSTALL_TARGET_HOOKS += VALGRIND_REMOVE_NULGRIND
142 endif
144 $(eval $(autotools-package))