2 # Copyright (C) 2006-2012 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://valgrind.org/downloads/
16 PKG_MD5SUM:=ec04dfd1256307432b2a7b520398c526
18 PKG_MAINTAINER:=Felix Fietkau <nbd@openwrt.org>
20 PKG_FIXUP = autoreconf
23 include $(INCLUDE_DIR)/package.mk
24 include $(INCLUDE_DIR)/kernel.mk
26 define Package/valgrind
29 DEPENDS:=@mips||mipsel||i386||powerpc||TARGET_omap4 +libpthread +librt
30 TITLE:=debugging and profiling tools for Linux
31 URL:=http://www.valgrind.org
34 define Package/valgrind/default
39 define Package/valgrind-cachegrind
40 $(Package/valgrind/default)
41 TITLE += (cache profiling)
44 define Package/valgrind-callgrind
45 $(Package/valgrind/default)
46 TITLE += (callgraph profiling)
49 define Package/valgrind-drd
50 $(Package/valgrind/default)
51 TITLE += (thread error detection)
54 define Package/valgrind-massif
55 $(Package/valgrind/default)
56 TITLE += (heap profiling)
59 define Package/valgrind-helgrind
60 $(Package/valgrind/default)
61 TITLE += (thread debugging)
64 define Package/valgrind-vgdb
65 $(Package/valgrind/default)
66 TITLE += (GDB interface)
69 define Package/valgrind/description
70 Valgrind is an award-winning suite of tools for debugging and
71 profiling Linux programs. With the tools that come with Valgrind,
72 you can automatically detect many memory management and threading
73 bugs, avoiding hours of frustrating bug-hunting, making your
74 programs more stable. You can also perform detailed profiling,
75 to speed up and reduce memory use of your programs.
78 CPU := $(patsubst x86,i386,$(LINUX_KARCH))
81 UNAME_R=$(LINUX_VERSION)
88 --disable-valgrindmi \
90 --disable-valgrindtk \
91 --without-included-gettext
93 define Package/valgrind/install
94 $(INSTALL_DIR) $(1)/usr/bin
95 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/valgrind* $(1)/usr/bin/
96 $(INSTALL_DIR) $(1)/usr/lib/valgrind
98 ./files/default.supp \
99 $(PKG_INSTALL_DIR)/usr/lib/valgrind/none-* \
100 $(PKG_INSTALL_DIR)/usr/lib/valgrind/vgpreload_core*.so \
101 $(PKG_INSTALL_DIR)/usr/lib/valgrind/$(CPU)-*.xml \
102 $(PKG_INSTALL_DIR)/usr/lib/valgrind/32bit-core*.xml \
103 $(PKG_INSTALL_DIR)/usr/lib/valgrind/32bit-linux*.xml \
104 $(PKG_INSTALL_DIR)/usr/lib/valgrind/memcheck-* \
105 $(PKG_INSTALL_DIR)/usr/lib/valgrind/vgpreload_memcheck*.so \
106 $(1)/usr/lib/valgrind/
109 define Package/valgrind-cachegrind/install
110 $(INSTALL_DIR) $(1)/usr/bin
111 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/cg_* $(1)/usr/bin/
112 $(INSTALL_DIR) $(1)/usr/lib/valgrind
114 $(PKG_INSTALL_DIR)/usr/lib/valgrind/cachegrind-* \
115 $(1)/usr/lib/valgrind/
118 define Package/valgrind-callgrind/install
119 $(INSTALL_DIR) $(1)/usr/bin
120 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/callgrind* $(1)/usr/bin/
121 $(INSTALL_DIR) $(1)/usr/lib/valgrind
123 $(PKG_INSTALL_DIR)/usr/lib/valgrind/callgrind-* \
124 $(1)/usr/lib/valgrind/
127 define Package/valgrind-drd/install
128 $(INSTALL_DIR) $(1)/usr/lib/valgrind
130 $(PKG_INSTALL_DIR)/usr/lib/valgrind/drd-* \
131 $(PKG_INSTALL_DIR)/usr/lib/valgrind/vgpreload_drd*.so \
132 $(1)/usr/lib/valgrind/
135 define Package/valgrind-massif/install
136 $(INSTALL_DIR) $(1)/usr/bin
137 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ms_print $(1)/usr/bin/
138 $(INSTALL_DIR) $(1)/usr/lib/valgrind
140 $(PKG_INSTALL_DIR)/usr/lib/valgrind/massif-* \
141 $(PKG_INSTALL_DIR)/usr/lib/valgrind/vgpreload_massif*.so \
142 $(1)/usr/lib/valgrind/
145 define Package/valgrind-helgrind/install
146 $(INSTALL_DIR) $(1)/usr/lib/valgrind
148 $(PKG_INSTALL_DIR)/usr/lib/valgrind/helgrind-* \
149 $(PKG_INSTALL_DIR)/usr/lib/valgrind/vgpreload_helgrind*.so \
150 $(1)/usr/lib/valgrind/
153 define Package/valgrind-vgdb/install
154 $(INSTALL_DIR) $(1)/usr/bin
155 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/vgdb $(1)/usr/bin/
158 $(eval $(call BuildPackage,valgrind))
159 $(eval $(call BuildPackage,valgrind-cachegrind))
160 $(eval $(call BuildPackage,valgrind-callgrind))
161 $(eval $(call BuildPackage,valgrind-drd))
162 $(eval $(call BuildPackage,valgrind-massif))
163 $(eval $(call BuildPackage,valgrind-helgrind))
164 $(eval $(call BuildPackage,valgrind-vgdb))