2 # Copyright (C) 2006-2013 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR)/rules.mk
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=http://sourceware.org/pub/valgrind/
16 PKG_HASH:=417c7a9da8f60dd05698b3a7bc6002e4ef996f14c13f0ff96679a16873e78ab1
18 PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
20 PKG_CPE_ID:=cpe:/a:valgrind:valgrind
22 PKG_FIXUP = autoreconf
24 PKG_BUILD_PARALLEL := 1
30 include $(INCLUDE_DIR)/package.mk
31 include $(INCLUDE_DIR)/kernel.mk
33 define Package/valgrind
36 DEPENDS:=@mips||mipsel||i386||x86_64||powerpc||arm_v7||aarch64 +libpthread +librt
37 TITLE:=debugging and profiling tools for Linux
38 URL:=http://www.valgrind.org
41 define Package/valgrind/default
46 define Package/valgrind-cachegrind
47 $(Package/valgrind/default)
48 TITLE += (cache profiling)
51 define Package/valgrind-callgrind
52 $(Package/valgrind/default)
53 TITLE += (callgraph profiling)
56 define Package/valgrind-drd
57 $(Package/valgrind/default)
58 TITLE += (thread error detection)
61 define Package/valgrind-massif
62 $(Package/valgrind/default)
63 TITLE += (heap profiling)
66 define Package/valgrind-helgrind
67 $(Package/valgrind/default)
68 TITLE += (thread debugging)
71 define Package/valgrind-vgdb
72 $(Package/valgrind/default)
73 TITLE += (GDB interface)
76 define Package/valgrind/description
77 Valgrind is an award-winning suite of tools for debugging and
78 profiling Linux programs. With the tools that come with Valgrind,
79 you can automatically detect many memory management and threading
80 bugs, avoiding hours of frustrating bug-hunting, making your
81 programs more stable. You can also perform detailed profiling,
82 to speed up and reduce memory use of your programs.
85 CPU := $(patsubst x86_64,amd64,$(patsubst x86,i386,$(patsubst um,$(ARCH),$(LINUX_KARCH))))
88 UNAME_R=$(LINUX_VERSION)
90 ifeq ($(CONFIG_ARCH_64BIT),y)
106 --disable-valgrindmi \
108 --disable-valgrindtk \
109 --without-included-gettext \
112 define Package/valgrind/install
113 $(INSTALL_DIR) $(1)/usr/bin
114 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/valgrind* $(1)/usr/bin/
115 $(INSTALL_DIR) $(1)/usr/lib/valgrind
117 ./files/default.supp \
118 $(PKG_INSTALL_DIR)/usr/lib/valgrind/none-* \
119 $(PKG_INSTALL_DIR)/usr/lib/valgrind/vgpreload_core*.so \
120 $(PKG_INSTALL_DIR)/usr/lib/valgrind/$(BITS)-core*.xml \
121 $(PKG_INSTALL_DIR)/usr/lib/valgrind/$(BITS)-linux*.xml \
122 $(PKG_INSTALL_DIR)/usr/lib/valgrind/memcheck-* \
123 $(PKG_INSTALL_DIR)/usr/lib/valgrind/vgpreload_memcheck*.so \
124 $(1)/usr/lib/valgrind/
126 ifneq ($(ARCH),aarch64)
128 $(PKG_INSTALL_DIR)/usr/lib/valgrind/$(CPU)-*.xml \
129 $(1)/usr/lib/valgrind/
131 $(patsubst STRIP=%,STRIP="$(TARGET_CROSS)strip",$(RSTRIP)) $(PKG_INSTALL_DIR)/usr/bin
132 $(patsubst STRIP=%,STRIP="$(TARGET_CROSS)strip -g",$(RSTRIP)) \
133 $(PKG_INSTALL_DIR)/usr/lib/valgrind/none-* \
134 $(PKG_INSTALL_DIR)/usr/lib/valgrind/memcheck-*
137 define Package/valgrind-cachegrind/install
138 $(INSTALL_DIR) $(1)/usr/bin
139 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/cg_* $(1)/usr/bin/
140 $(INSTALL_DIR) $(1)/usr/lib/valgrind
142 $(PKG_INSTALL_DIR)/usr/lib/valgrind/cachegrind-* \
143 $(1)/usr/lib/valgrind/
144 $(patsubst STRIP=%,STRIP="$(TARGET_CROSS)strip",$(RSTRIP)) $(PKG_INSTALL_DIR)/usr/bin
145 $(patsubst STRIP=%,STRIP="$(TARGET_CROSS)strip -g",$(RSTRIP)) $(PKG_INSTALL_DIR)/usr/lib/valgrind/cachegrind-*
148 define Package/valgrind-callgrind/install
149 $(INSTALL_DIR) $(1)/usr/bin
150 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/callgrind* $(1)/usr/bin/
151 $(INSTALL_DIR) $(1)/usr/lib/valgrind
153 $(PKG_INSTALL_DIR)/usr/lib/valgrind/callgrind-* \
154 $(1)/usr/lib/valgrind/
155 $(patsubst STRIP=%,STRIP="$(TARGET_CROSS)strip",$(RSTRIP)) $(PKG_INSTALL_DIR)/usr/bin
156 $(patsubst STRIP=%,STRIP="$(TARGET_CROSS)strip -g",$(RSTRIP)) $(PKG_INSTALL_DIR)/usr/lib/valgrind/callgrind-*
159 define Package/valgrind-drd/install
160 $(INSTALL_DIR) $(1)/usr/lib/valgrind
162 $(PKG_INSTALL_DIR)/usr/lib/valgrind/drd-* \
163 $(PKG_INSTALL_DIR)/usr/lib/valgrind/vgpreload_drd*.so \
164 $(1)/usr/lib/valgrind/
165 $(patsubst STRIP=%,STRIP="$(TARGET_CROSS)strip",$(RSTRIP)) $(PKG_INSTALL_DIR)/usr/bin
166 $(patsubst STRIP=%,STRIP="$(TARGET_CROSS)strip -g",$(RSTRIP)) $(PKG_INSTALL_DIR)/usr/lib/valgrind/drd-*
169 define Package/valgrind-massif/install
170 $(INSTALL_DIR) $(1)/usr/bin
171 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ms_print $(1)/usr/bin/
172 $(INSTALL_DIR) $(1)/usr/lib/valgrind
174 $(PKG_INSTALL_DIR)/usr/lib/valgrind/massif-* \
175 $(PKG_INSTALL_DIR)/usr/lib/valgrind/vgpreload_massif*.so \
176 $(1)/usr/lib/valgrind/
177 $(patsubst STRIP=%,STRIP="$(TARGET_CROSS)strip",$(RSTRIP)) $(PKG_INSTALL_DIR)/usr/bin
178 $(patsubst STRIP=%,STRIP="$(TARGET_CROSS)strip -g",$(RSTRIP)) $(PKG_INSTALL_DIR)/usr/lib/valgrind/massif-*
181 define Package/valgrind-helgrind/install
182 $(INSTALL_DIR) $(1)/usr/lib/valgrind
184 $(PKG_INSTALL_DIR)/usr/lib/valgrind/helgrind-* \
185 $(PKG_INSTALL_DIR)/usr/lib/valgrind/vgpreload_helgrind*.so \
186 $(1)/usr/lib/valgrind/
187 $(patsubst STRIP=%,STRIP="$(TARGET_CROSS)strip",$(RSTRIP)) $(PKG_INSTALL_DIR)/usr/bin
188 $(patsubst STRIP=%,STRIP="$(TARGET_CROSS)strip -g",$(RSTRIP)) $(PKG_INSTALL_DIR)/usr/lib/valgrind/helgrind-*
191 define Package/valgrind-vgdb/install
192 $(INSTALL_DIR) $(1)/usr/bin
193 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/vgdb $(1)/usr/bin/
194 $(patsubst STRIP=%,STRIP="$(TARGET_CROSS)strip",$(RSTRIP)) $(PKG_INSTALL_DIR)/usr/bin
197 $(eval $(call BuildPackage,valgrind))
198 $(eval $(call BuildPackage,valgrind-cachegrind))
199 $(eval $(call BuildPackage,valgrind-callgrind))
200 $(eval $(call BuildPackage,valgrind-drd))
201 $(eval $(call BuildPackage,valgrind-massif))
202 $(eval $(call BuildPackage,valgrind-helgrind))
203 $(eval $(call BuildPackage,valgrind-vgdb))