valgrind: update the package to latest svn, rework and modularize it. tested and...
[openwrt/svn-archive/archive.git] / utils / valgrind / Makefile
1 #
2 # Copyright (C) 2006-2011 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=valgrind
11 PKG_REV:=r12684
12 PKG_VERSION:=3.7.0+svn_$(PKG_REV)
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16 PKG_SOURCE_URL:=svn://svn.valgrind.org/valgrind/trunk
17 PKG_SOURCE_SUBDIR=$(PKG_NAME)-$(PKG_VERSION)
18 PKG_SOURCE_VERSION:=$(PKG_REV)
19 PKG_MIRROR_MD5SUM:=841cfcaf265fae0b866c6cb4c563e3c0
20
21 PKG_FIXUP = autoreconf
22 PKG_INSTALL := 1
23
24 PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
25
26 include $(INCLUDE_DIR)/package.mk
27 include $(INCLUDE_DIR)/kernel.mk
28
29 define Package/valgrind
30 SECTION:=utils
31 CATEGORY:=Utilities
32 DEPENDS:=@mips||mipsel||i386||arm||armeb||powerpc +libpthread +librt
33 TITLE:=debugging and profiling tools for Linux
34 URL:=http://www.valgrind.org
35 endef
36
37 define Package/valgrind/default
38 $(Package/valgrind)
39 DEPENDS := valgrind
40 endef
41
42 define Package/valgrind-cachegrind
43 $(Package/valgrind/default)
44 TITLE += (cache profiling)
45 endef
46
47 define Package/valgrind-callgrind
48 $(Package/valgrind/default)
49 TITLE += (callgraph profiling)
50 endef
51
52 define Package/valgrind-drd
53 $(Package/valgrind/default)
54 TITLE += (thread error detection)
55 endef
56
57 define Package/valgrind-massif
58 $(Package/valgrind/default)
59 TITLE += (heap profiling)
60 endef
61
62 define Package/valgrind-helgrind
63 $(Package/valgrind/default)
64 TITLE += (thread debugging)
65 endef
66
67 define Package/valgrind-vgdb
68 $(Package/valgrind/default)
69 TITLE += (GDB interface)
70 endef
71
72 define Package/valgrind/description
73 Valgrind is an award-winning suite of tools for debugging and
74 profiling Linux programs. With the tools that come with Valgrind,
75 you can automatically detect many memory management and threading
76 bugs, avoiding hours of frustrating bug-hunting, making your
77 programs more stable. You can also perform detailed profiling,
78 to speed up and reduce memory use of your programs.
79 endef
80
81 CONFIGURE_VARS += \
82 UNAME_R=$(LINUX_VERSION)
83
84 CONFIGURE_ARGS += \
85 --enable-only32bit \
86 --enable-tls \
87 --without-x \
88 --without-uiout \
89 --disable-valgrindmi \
90 --disable-tui \
91 --disable-valgrindtk \
92 --without-included-gettext
93
94 define Package/valgrind/install
95 $(INSTALL_DIR) $(1)/usr/bin
96 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/valgrind* $(1)/usr/bin/
97 $(INSTALL_DIR) $(1)/usr/lib/valgrind
98 $(CP) \
99 ./files/default.supp \
100 $(PKG_INSTALL_DIR)/usr/lib/valgrind/none-* \
101 $(PKG_INSTALL_DIR)/usr/lib/valgrind/vgpreload_core*.so \
102 $(PKG_INSTALL_DIR)/usr/lib/valgrind/$(LINUX_KARCH)-*.xml \
103 $(PKG_INSTALL_DIR)/usr/lib/valgrind/32bit-core*.xml \
104 $(PKG_INSTALL_DIR)/usr/lib/valgrind/32bit-linux*.xml \
105 $(PKG_INSTALL_DIR)/usr/lib/valgrind/memcheck-* \
106 $(PKG_INSTALL_DIR)/usr/lib/valgrind/vgpreload_memcheck*.so \
107 $(1)/usr/lib/valgrind/
108 endef
109
110 define Package/valgrind-cachegrind/install
111 $(INSTALL_DIR) $(1)/usr/bin
112 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/cg_* $(1)/usr/bin/
113 $(INSTALL_DIR) $(1)/usr/lib/valgrind
114 $(CP) \
115 $(PKG_INSTALL_DIR)/usr/lib/valgrind/cachegrind-* \
116 $(1)/usr/lib/valgrind/
117 endef
118
119 define Package/valgrind-callgrind/install
120 $(INSTALL_DIR) $(1)/usr/bin
121 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/callgrind* $(1)/usr/bin/
122 $(INSTALL_DIR) $(1)/usr/lib/valgrind
123 $(CP) \
124 $(PKG_INSTALL_DIR)/usr/lib/valgrind/callgrind-* \
125 $(1)/usr/lib/valgrind/
126 endef
127
128 define Package/valgrind-drd/install
129 $(INSTALL_DIR) $(1)/usr/lib/valgrind
130 $(CP) \
131 $(PKG_INSTALL_DIR)/usr/lib/valgrind/drd-* \
132 $(PKG_INSTALL_DIR)/usr/lib/valgrind/vgpreload_drd*.so \
133 $(1)/usr/lib/valgrind/
134 endef
135
136 define Package/valgrind-massif/install
137 $(INSTALL_DIR) $(1)/usr/bin
138 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ms_print $(1)/usr/bin/
139 $(INSTALL_DIR) $(1)/usr/lib/valgrind
140 $(CP) \
141 $(PKG_INSTALL_DIR)/usr/lib/valgrind/massif-* \
142 $(PKG_INSTALL_DIR)/usr/lib/valgrind/vgpreload_massif*.so \
143 $(1)/usr/lib/valgrind/
144 endef
145
146 define Package/valgrind-helgrind/install
147 $(INSTALL_DIR) $(1)/usr/lib/valgrind
148 $(CP) \
149 $(PKG_INSTALL_DIR)/usr/lib/valgrind/helgrind-* \
150 $(PKG_INSTALL_DIR)/usr/lib/valgrind/vgpreload_helgrind*.so \
151 $(1)/usr/lib/valgrind/
152 endef
153
154 define Package/valgrind-vgdb/install
155 $(INSTALL_DIR) $(1)/usr/bin
156 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/vgdb $(1)/usr/bin/
157 endef
158
159 $(eval $(call BuildPackage,valgrind))
160 $(eval $(call BuildPackage,valgrind-cachegrind))
161 $(eval $(call BuildPackage,valgrind-callgrind))
162 $(eval $(call BuildPackage,valgrind-drd))
163 $(eval $(call BuildPackage,valgrind-massif))
164 $(eval $(call BuildPackage,valgrind-helgrind))
165 $(eval $(call BuildPackage,valgrind-vgdb))