iptables: bump to version 1.6.1
[buildroot-gz.git] / package / valgrind / valgrind.mk
blob652432ff377866167d1b5c414262b8e1e588bd3a
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 # Valgrind must be compiled with no stack protection, so forcefully
21 # pass -fno-stack-protector to override what Buildroot may have in
22 # TARGET_CFLAGS if BR2_SSP_* support is enabled.
23 VALGRIND_CFLAGS = \
24 $(TARGET_CFLAGS) \
25 -fno-stack-protector
27 # When Valgrind detects a 32-bit MIPS architecture, it forcibly adds
28 # -march=mips32 to CFLAGS; when it detects a 64-bit MIPS architecture,
29 # it forcibly adds -march=mips64. This causes Valgrind to be built
30 # always for the first ISA revision level (R1), even when the user has
31 # configured Buildroot for the second ISA revision level (R2).
33 # Override the CFLAGS variable (which Valgrind appends to its CFLAGS)
34 # and pass the right -march option, so they take precedence over
35 # Valgrind's wrongfully detected value.
36 ifeq ($(BR2_mips)$(BR2_mipsel)$(BR2_mips64)$(BR2_mips64el),y)
37 VALGRIND_CFLAGS += -march=$(BR2_GCC_TARGET_ARCH)
38 endif
40 VALGRIND_CONF_ENV = CFLAGS="$(VALGRIND_CFLAGS)"
42 # On ARM, Valgrind only supports ARMv7, and uses the arch part of the
43 # host tuple to determine whether it's being built for ARMv7 or
44 # not. Therefore, we adjust the host tuple to specify we're on
45 # ARMv7. The valgrind package is guaranteed, through Config.in, to
46 # only be selected on ARMv7-A platforms.
47 ifeq ($(BR2_ARM_CPU_ARMV7A),y)
48 VALGRIND_CONF_OPTS += \
49 --host=$(patsubst arm-%,armv7-%,$(GNU_TARGET_NAME))
50 endif
52 define VALGRIND_INSTALL_UCLIBC_SUPP
53 $(INSTALL) -D -m 0644 package/valgrind/uclibc.supp $(TARGET_DIR)/usr/lib/valgrind/uclibc.supp
54 endef
56 VALGRIND_POST_INSTALL_TARGET_HOOKS += VALGRIND_INSTALL_UCLIBC_SUPP
58 ifeq ($(BR2_PACKAGE_VALGRIND_MEMCHECK),)
59 define VALGRIND_REMOVE_MEMCHECK
60 rm -f $(TARGET_DIR)/usr/lib/valgrind/*memcheck*
61 endef
63 VALGRIND_POST_INSTALL_TARGET_HOOKS += VALGRIND_REMOVE_MEMCHECK
64 endif
66 ifeq ($(BR2_PACKAGE_VALGRIND_CACHEGRIND),)
67 define VALGRIND_REMOVE_CACHEGRIND
68 rm -f $(TARGET_DIR)/usr/lib/valgrind/*cachegrind*
69 for i in cg_annotate cg_diff cg_merge; do \
70 rm -f $(TARGET_DIR)/usr/bin/$$i ; \
71 done
72 endef
74 VALGRIND_POST_INSTALL_TARGET_HOOKS += VALGRIND_REMOVE_CACHEGRIND
75 endif
77 ifeq ($(BR2_PACKAGE_VALGRIND_CALLGRIND),)
78 define VALGRIND_REMOVE_CALLGRIND
79 rm -f $(TARGET_DIR)/usr/lib/valgrind/*callgrind*
80 for i in callgrind_annotate callgrind_control ; do \
81 rm -f $(TARGET_DIR)/usr/bin/$$i ; \
82 done
83 endef
85 VALGRIND_POST_INSTALL_TARGET_HOOKS += VALGRIND_REMOVE_CALLGRIND
86 endif
88 ifeq ($(BR2_PACKAGE_VALGRIND_HELGRIND),)
89 define VALGRIND_REMOVE_HELGRIND
90 rm -f $(TARGET_DIR)/usr/lib/valgrind/*helgrind*
91 endef
93 VALGRIND_POST_INSTALL_TARGET_HOOKS += VALGRIND_REMOVE_HELGRIND
94 endif
96 ifeq ($(BR2_PACKAGE_VALGRIND_DRD),)
97 define VALGRIND_REMOVE_DRD
98 rm -f $(TARGET_DIR)/usr/lib/valgrind/*drd*
99 endef
101 VALGRIND_POST_INSTALL_TARGET_HOOKS += VALGRIND_REMOVE_DRD
102 endif
104 ifeq ($(BR2_PACKAGE_VALGRIND_MASSIF),)
105 define VALGRIND_REMOVE_MASSIF
106 rm -f $(TARGET_DIR)/usr/lib/valgrind/*massif*
107 rm -f $(TARGET_DIR)/usr/bin/ms_script
108 endef
110 VALGRIND_POST_INSTALL_TARGET_HOOKS += VALGRIND_REMOVE_MASSIF
111 endif
113 ifeq ($(BR2_PACKAGE_VALGRIND_DHAT),)
114 define VALGRIND_REMOVE_DHAT
115 rm -f $(TARGET_DIR)/usr/lib/valgrind/*dhat*
116 endef
118 VALGRIND_POST_INSTALL_TARGET_HOOKS += VALGRIND_REMOVE_DHAT
119 endif
121 ifeq ($(BR2_PACKAGE_VALGRIND_SGCHECK),)
122 define VALGRIND_REMOVE_SGCHECK
123 rm -f $(TARGET_DIR)/usr/lib/valgrind/*sgcheck*
124 endef
126 VALGRIND_POST_INSTALL_TARGET_HOOKS += VALGRIND_REMOVE_SGCHECK
127 endif
129 ifeq ($(BR2_PACKAGE_VALGRIND_BBV),)
130 define VALGRIND_REMOVE_BBV
131 rm -f $(TARGET_DIR)/usr/lib/valgrind/*bbv*
132 endef
134 VALGRIND_POST_INSTALL_TARGET_HOOKS += VALGRIND_REMOVE_BBV
135 endif
137 ifeq ($(BR2_PACKAGE_VALGRIND_LACKEY),)
138 define VALGRIND_REMOVE_LACKEY
139 rm -f $(TARGET_DIR)/usr/lib/valgrind/*lackey*
140 endef
142 VALGRIND_POST_INSTALL_TARGET_HOOKS += VALGRIND_REMOVE_LACKEY
143 endif
145 ifeq ($(BR2_PACKAGE_VALGRIND_NULGRIND),)
146 define VALGRIND_REMOVE_NULGRIND
147 rm -f $(TARGET_DIR)/usr/lib/valgrind/*none*
148 endef
150 VALGRIND_POST_INSTALL_TARGET_HOOKS += VALGRIND_REMOVE_NULGRIND
151 endif
153 $(eval $(autotools-package))