6610f0ac452f9f502a9e2903489f5f323b6fec94
[openwrt/svn-archive/archive.git] / package / devel / valgrind / Makefile
1 #
2 # Copyright (C) 2006-2013 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_VERSION:=3.8.1
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=http://valgrind.org/downloads/
16 PKG_MD5SUM:=288758010b271119a0ffc0183f1d6e38
17
18 PKG_MAINTAINER:=Felix Fietkau <nbd@openwrt.org>
19
20 PKG_FIXUP = autoreconf
21 PKG_INSTALL := 1
22
23 include $(INCLUDE_DIR)/package.mk
24 include $(INCLUDE_DIR)/kernel.mk
25
26 define Package/valgrind
27 SECTION:=devel
28 CATEGORY:=Development
29 DEPENDS:=@mips||mipsel||i386||powerpc||arm_v7 +libpthread +librt
30 TITLE:=debugging and profiling tools for Linux
31 URL:=http://www.valgrind.org
32 endef
33
34 define Package/valgrind/default
35 $(Package/valgrind)
36 DEPENDS := valgrind
37 endef
38
39 define Package/valgrind-cachegrind
40 $(Package/valgrind/default)
41 TITLE += (cache profiling)
42 endef
43
44 define Package/valgrind-callgrind
45 $(Package/valgrind/default)
46 TITLE += (callgraph profiling)
47 endef
48
49 define Package/valgrind-drd
50 $(Package/valgrind/default)
51 TITLE += (thread error detection)
52 endef
53
54 define Package/valgrind-massif
55 $(Package/valgrind/default)
56 TITLE += (heap profiling)
57 endef
58
59 define Package/valgrind-helgrind
60 $(Package/valgrind/default)
61 TITLE += (thread debugging)
62 endef
63
64 define Package/valgrind-vgdb
65 $(Package/valgrind/default)
66 TITLE += (GDB interface)
67 endef
68
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.
76 endef
77
78 CPU := $(patsubst x86,i386,$(LINUX_KARCH))
79
80 CONFIGURE_VARS += \
81 UNAME_R=$(LINUX_VERSION)
82
83 CONFIGURE_ARGS += \
84 --enable-only32bit \
85 --enable-tls \
86 --without-x \
87 --without-uiout \
88 --disable-valgrindmi \
89 --disable-tui \
90 --disable-valgrindtk \
91 --without-included-gettext
92
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
97 $(CP) \
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/
107 endef
108
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
113 $(CP) \
114 $(PKG_INSTALL_DIR)/usr/lib/valgrind/cachegrind-* \
115 $(1)/usr/lib/valgrind/
116 endef
117
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
122 $(CP) \
123 $(PKG_INSTALL_DIR)/usr/lib/valgrind/callgrind-* \
124 $(1)/usr/lib/valgrind/
125 endef
126
127 define Package/valgrind-drd/install
128 $(INSTALL_DIR) $(1)/usr/lib/valgrind
129 $(CP) \
130 $(PKG_INSTALL_DIR)/usr/lib/valgrind/drd-* \
131 $(PKG_INSTALL_DIR)/usr/lib/valgrind/vgpreload_drd*.so \
132 $(1)/usr/lib/valgrind/
133 endef
134
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
139 $(CP) \
140 $(PKG_INSTALL_DIR)/usr/lib/valgrind/massif-* \
141 $(PKG_INSTALL_DIR)/usr/lib/valgrind/vgpreload_massif*.so \
142 $(1)/usr/lib/valgrind/
143 endef
144
145 define Package/valgrind-helgrind/install
146 $(INSTALL_DIR) $(1)/usr/lib/valgrind
147 $(CP) \
148 $(PKG_INSTALL_DIR)/usr/lib/valgrind/helgrind-* \
149 $(PKG_INSTALL_DIR)/usr/lib/valgrind/vgpreload_helgrind*.so \
150 $(1)/usr/lib/valgrind/
151 endef
152
153 define Package/valgrind-vgdb/install
154 $(INSTALL_DIR) $(1)/usr/bin
155 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/vgdb $(1)/usr/bin/
156 endef
157
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))