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