7b194205292ecc7c8bb26d814f62a16e53f6c4a1
[openwrt/staging/wigyori.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.12.0
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:=67ca4395b2527247780f36148b084f5743a68ab0c850cb43e4a5b4b012cf76a1
17
18 PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
19 PKG_LICENSE:=GPL-2.0+
20
21 PKG_FIXUP = autoreconf
22 PKG_INSTALL := 1
23 PKG_BUILD_PARALLEL := 1
24 PKG_USE_MIPS16:=0
25 PKG_SSP:=0
26
27 include $(INCLUDE_DIR)/package.mk
28 include $(INCLUDE_DIR)/kernel.mk
29
30 define Package/valgrind
31 SECTION:=devel
32 CATEGORY:=Development
33 DEPENDS:=@mips||mipsel||i386||x86_64||powerpc||arm_v7 +libpthread +librt
34 TITLE:=debugging and profiling tools for Linux
35 URL:=http://www.valgrind.org
36 endef
37
38 define Package/valgrind/default
39 $(Package/valgrind)
40 DEPENDS := valgrind
41 endef
42
43 define Package/valgrind-cachegrind
44 $(Package/valgrind/default)
45 TITLE += (cache profiling)
46 endef
47
48 define Package/valgrind-callgrind
49 $(Package/valgrind/default)
50 TITLE += (callgraph profiling)
51 endef
52
53 define Package/valgrind-drd
54 $(Package/valgrind/default)
55 TITLE += (thread error detection)
56 endef
57
58 define Package/valgrind-massif
59 $(Package/valgrind/default)
60 TITLE += (heap profiling)
61 endef
62
63 define Package/valgrind-helgrind
64 $(Package/valgrind/default)
65 TITLE += (thread debugging)
66 endef
67
68 define Package/valgrind-vgdb
69 $(Package/valgrind/default)
70 TITLE += (GDB interface)
71 endef
72
73 define Package/valgrind/description
74 Valgrind is an award-winning suite of tools for debugging and
75 profiling Linux programs. With the tools that come with Valgrind,
76 you can automatically detect many memory management and threading
77 bugs, avoiding hours of frustrating bug-hunting, making your
78 programs more stable. You can also perform detailed profiling,
79 to speed up and reduce memory use of your programs.
80 endef
81
82 CPU := $(patsubst x86_64,amd64,$(patsubst x86,i386,$(patsubst um,$(ARCH),$(LINUX_KARCH))))
83
84 CONFIGURE_VARS += \
85 UNAME_R=$(LINUX_VERSION)
86
87 ifeq ($(ARCH),x86_64)
88 CONFIGURE_ARGS += \
89 --enable-only64bit
90 BITS := 64bit
91 else
92 CONFIGURE_ARGS += \
93 --enable-only32bit
94 BITS := 32bit
95 endif
96
97 CONFIGURE_ARGS += \
98 --enable-tls \
99 --without-x \
100 --without-mpicc \
101 --without-uiout \
102 --disable-valgrindmi \
103 --disable-tui \
104 --disable-valgrindtk \
105 --without-included-gettext \
106 --with-pagesize=4 \
107
108 define Package/valgrind/install
109 $(INSTALL_DIR) $(1)/usr/bin
110 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/valgrind* $(1)/usr/bin/
111 $(INSTALL_DIR) $(1)/usr/lib/valgrind
112 $(CP) \
113 ./files/default.supp \
114 $(PKG_INSTALL_DIR)/usr/lib/valgrind/none-* \
115 $(PKG_INSTALL_DIR)/usr/lib/valgrind/vgpreload_core*.so \
116 $(PKG_INSTALL_DIR)/usr/lib/valgrind/$(CPU)-*.xml \
117 $(PKG_INSTALL_DIR)/usr/lib/valgrind/$(BITS)-core*.xml \
118 $(PKG_INSTALL_DIR)/usr/lib/valgrind/$(BITS)-linux*.xml \
119 $(PKG_INSTALL_DIR)/usr/lib/valgrind/memcheck-* \
120 $(PKG_INSTALL_DIR)/usr/lib/valgrind/vgpreload_memcheck*.so \
121 $(1)/usr/lib/valgrind/
122 endef
123
124 define Package/valgrind-cachegrind/install
125 $(INSTALL_DIR) $(1)/usr/bin
126 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/cg_* $(1)/usr/bin/
127 $(INSTALL_DIR) $(1)/usr/lib/valgrind
128 $(CP) \
129 $(PKG_INSTALL_DIR)/usr/lib/valgrind/cachegrind-* \
130 $(1)/usr/lib/valgrind/
131 endef
132
133 define Package/valgrind-callgrind/install
134 $(INSTALL_DIR) $(1)/usr/bin
135 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/callgrind* $(1)/usr/bin/
136 $(INSTALL_DIR) $(1)/usr/lib/valgrind
137 $(CP) \
138 $(PKG_INSTALL_DIR)/usr/lib/valgrind/callgrind-* \
139 $(1)/usr/lib/valgrind/
140 endef
141
142 define Package/valgrind-drd/install
143 $(INSTALL_DIR) $(1)/usr/lib/valgrind
144 $(CP) \
145 $(PKG_INSTALL_DIR)/usr/lib/valgrind/drd-* \
146 $(PKG_INSTALL_DIR)/usr/lib/valgrind/vgpreload_drd*.so \
147 $(1)/usr/lib/valgrind/
148 endef
149
150 define Package/valgrind-massif/install
151 $(INSTALL_DIR) $(1)/usr/bin
152 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ms_print $(1)/usr/bin/
153 $(INSTALL_DIR) $(1)/usr/lib/valgrind
154 $(CP) \
155 $(PKG_INSTALL_DIR)/usr/lib/valgrind/massif-* \
156 $(PKG_INSTALL_DIR)/usr/lib/valgrind/vgpreload_massif*.so \
157 $(1)/usr/lib/valgrind/
158 endef
159
160 define Package/valgrind-helgrind/install
161 $(INSTALL_DIR) $(1)/usr/lib/valgrind
162 $(CP) \
163 $(PKG_INSTALL_DIR)/usr/lib/valgrind/helgrind-* \
164 $(PKG_INSTALL_DIR)/usr/lib/valgrind/vgpreload_helgrind*.so \
165 $(1)/usr/lib/valgrind/
166 endef
167
168 define Package/valgrind-vgdb/install
169 $(INSTALL_DIR) $(1)/usr/bin
170 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/vgdb $(1)/usr/bin/
171 endef
172
173 $(eval $(call BuildPackage,valgrind))
174 $(eval $(call BuildPackage,valgrind-cachegrind))
175 $(eval $(call BuildPackage,valgrind-callgrind))
176 $(eval $(call BuildPackage,valgrind-drd))
177 $(eval $(call BuildPackage,valgrind-massif))
178 $(eval $(call BuildPackage,valgrind-helgrind))
179 $(eval $(call BuildPackage,valgrind-vgdb))