68af36c52632e498d204696efe1ac35911f05862
[packages.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 CPU := $(patsubst x86,i386,$(LINUX_KARCH))
82
83 CONFIGURE_VARS += \
84         UNAME_R=$(LINUX_VERSION)
85
86 CONFIGURE_ARGS += \
87         --enable-only32bit \
88         --enable-tls \
89         --without-x \
90         --without-uiout \
91         --disable-valgrindmi \
92         --disable-tui \
93         --disable-valgrindtk \
94         --without-included-gettext
95
96 define Package/valgrind/install 
97         $(INSTALL_DIR) $(1)/usr/bin
98         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/valgrind* $(1)/usr/bin/
99         $(INSTALL_DIR) $(1)/usr/lib/valgrind
100         $(CP) \
101                 ./files/default.supp \
102                 $(PKG_INSTALL_DIR)/usr/lib/valgrind/none-* \
103                 $(PKG_INSTALL_DIR)/usr/lib/valgrind/vgpreload_core*.so \
104                 $(PKG_INSTALL_DIR)/usr/lib/valgrind/$(CPU)-*.xml \
105                 $(PKG_INSTALL_DIR)/usr/lib/valgrind/32bit-core*.xml \
106                 $(PKG_INSTALL_DIR)/usr/lib/valgrind/32bit-linux*.xml \
107                 $(PKG_INSTALL_DIR)/usr/lib/valgrind/memcheck-* \
108                 $(PKG_INSTALL_DIR)/usr/lib/valgrind/vgpreload_memcheck*.so \
109                 $(1)/usr/lib/valgrind/
110 endef
111
112 define Package/valgrind-cachegrind/install
113         $(INSTALL_DIR) $(1)/usr/bin
114         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/cg_* $(1)/usr/bin/
115         $(INSTALL_DIR) $(1)/usr/lib/valgrind
116         $(CP) \
117                 $(PKG_INSTALL_DIR)/usr/lib/valgrind/cachegrind-* \
118                 $(1)/usr/lib/valgrind/
119 endef
120
121 define Package/valgrind-callgrind/install
122         $(INSTALL_DIR) $(1)/usr/bin
123         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/callgrind* $(1)/usr/bin/
124         $(INSTALL_DIR) $(1)/usr/lib/valgrind
125         $(CP) \
126                 $(PKG_INSTALL_DIR)/usr/lib/valgrind/callgrind-* \
127                 $(1)/usr/lib/valgrind/
128 endef
129
130 define Package/valgrind-drd/install
131         $(INSTALL_DIR) $(1)/usr/lib/valgrind
132         $(CP) \
133                 $(PKG_INSTALL_DIR)/usr/lib/valgrind/drd-* \
134                 $(PKG_INSTALL_DIR)/usr/lib/valgrind/vgpreload_drd*.so \
135                 $(1)/usr/lib/valgrind/
136 endef
137
138 define Package/valgrind-massif/install
139         $(INSTALL_DIR) $(1)/usr/bin
140         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ms_print $(1)/usr/bin/
141         $(INSTALL_DIR) $(1)/usr/lib/valgrind
142         $(CP) \
143                 $(PKG_INSTALL_DIR)/usr/lib/valgrind/massif-* \
144                 $(PKG_INSTALL_DIR)/usr/lib/valgrind/vgpreload_massif*.so \
145                 $(1)/usr/lib/valgrind/
146 endef
147
148 define Package/valgrind-helgrind/install
149         $(INSTALL_DIR) $(1)/usr/lib/valgrind
150         $(CP) \
151                 $(PKG_INSTALL_DIR)/usr/lib/valgrind/helgrind-* \
152                 $(PKG_INSTALL_DIR)/usr/lib/valgrind/vgpreload_helgrind*.so \
153                 $(1)/usr/lib/valgrind/
154 endef
155
156 define Package/valgrind-vgdb/install
157         $(INSTALL_DIR) $(1)/usr/bin
158         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/vgdb $(1)/usr/bin/
159 endef
160
161 $(eval $(call BuildPackage,valgrind))
162 $(eval $(call BuildPackage,valgrind-cachegrind))
163 $(eval $(call BuildPackage,valgrind-callgrind))
164 $(eval $(call BuildPackage,valgrind-drd))
165 $(eval $(call BuildPackage,valgrind-massif))
166 $(eval $(call BuildPackage,valgrind-helgrind))
167 $(eval $(call BuildPackage,valgrind-vgdb))