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