package/valgrind: fix build on eglibc
[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.10.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:=7c311a72a20388aceced1aa5573ce970
17
18 PKG_MAINTAINER:=Felix Fietkau <nbd@openwrt.org>
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
26 include $(INCLUDE_DIR)/package.mk
27 include $(INCLUDE_DIR)/kernel.mk
28
29 define Package/valgrind
30 SECTION:=devel
31 CATEGORY:=Development
32 DEPENDS:=@mips||mipsel||i386||x86_64||powerpc||arm_v7 +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_64,amd64,$(patsubst x86,i386,$(patsubst um,$(ARCH),$(LINUX_KARCH))))
82
83 CONFIGURE_VARS += \
84 UNAME_R=$(LINUX_VERSION)
85
86 ifeq ($(ARCH),x86_64)
87 CONFIGURE_ARGS += \
88 --enable-only64bit
89 BITS := 64bit
90 else
91 CONFIGURE_ARGS += \
92 --enable-only32bit
93 BITS := 32bit
94 endif
95
96 CONFIGURE_ARGS += \
97 --enable-tls \
98 --without-x \
99 --without-mpicc \
100 --without-uiout \
101 --disable-valgrindmi \
102 --disable-tui \
103 --disable-valgrindtk \
104 --without-included-gettext \
105 --with-pagesize=4 \
106
107 define Package/valgrind/install
108 $(INSTALL_DIR) $(1)/usr/bin
109 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/valgrind* $(1)/usr/bin/
110 $(INSTALL_DIR) $(1)/usr/lib/valgrind
111 $(CP) \
112 ./files/default.supp \
113 $(PKG_INSTALL_DIR)/usr/lib/valgrind/none-* \
114 $(PKG_INSTALL_DIR)/usr/lib/valgrind/vgpreload_core*.so \
115 $(PKG_INSTALL_DIR)/usr/lib/valgrind/$(CPU)-*.xml \
116 $(PKG_INSTALL_DIR)/usr/lib/valgrind/$(BITS)-core*.xml \
117 $(PKG_INSTALL_DIR)/usr/lib/valgrind/$(BITS)-linux*.xml \
118 $(PKG_INSTALL_DIR)/usr/lib/valgrind/memcheck-* \
119 $(PKG_INSTALL_DIR)/usr/lib/valgrind/vgpreload_memcheck*.so \
120 $(1)/usr/lib/valgrind/
121 endef
122
123 define Package/valgrind-cachegrind/install
124 $(INSTALL_DIR) $(1)/usr/bin
125 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/cg_* $(1)/usr/bin/
126 $(INSTALL_DIR) $(1)/usr/lib/valgrind
127 $(CP) \
128 $(PKG_INSTALL_DIR)/usr/lib/valgrind/cachegrind-* \
129 $(1)/usr/lib/valgrind/
130 endef
131
132 define Package/valgrind-callgrind/install
133 $(INSTALL_DIR) $(1)/usr/bin
134 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/callgrind* $(1)/usr/bin/
135 $(INSTALL_DIR) $(1)/usr/lib/valgrind
136 $(CP) \
137 $(PKG_INSTALL_DIR)/usr/lib/valgrind/callgrind-* \
138 $(1)/usr/lib/valgrind/
139 endef
140
141 define Package/valgrind-drd/install
142 $(INSTALL_DIR) $(1)/usr/lib/valgrind
143 $(CP) \
144 $(PKG_INSTALL_DIR)/usr/lib/valgrind/drd-* \
145 $(PKG_INSTALL_DIR)/usr/lib/valgrind/vgpreload_drd*.so \
146 $(1)/usr/lib/valgrind/
147 endef
148
149 define Package/valgrind-massif/install
150 $(INSTALL_DIR) $(1)/usr/bin
151 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ms_print $(1)/usr/bin/
152 $(INSTALL_DIR) $(1)/usr/lib/valgrind
153 $(CP) \
154 $(PKG_INSTALL_DIR)/usr/lib/valgrind/massif-* \
155 $(PKG_INSTALL_DIR)/usr/lib/valgrind/vgpreload_massif*.so \
156 $(1)/usr/lib/valgrind/
157 endef
158
159 define Package/valgrind-helgrind/install
160 $(INSTALL_DIR) $(1)/usr/lib/valgrind
161 $(CP) \
162 $(PKG_INSTALL_DIR)/usr/lib/valgrind/helgrind-* \
163 $(PKG_INSTALL_DIR)/usr/lib/valgrind/vgpreload_helgrind*.so \
164 $(1)/usr/lib/valgrind/
165 endef
166
167 define Package/valgrind-vgdb/install
168 $(INSTALL_DIR) $(1)/usr/bin
169 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/vgdb $(1)/usr/bin/
170 endef
171
172 $(eval $(call BuildPackage,valgrind))
173 $(eval $(call BuildPackage,valgrind-cachegrind))
174 $(eval $(call BuildPackage,valgrind-callgrind))
175 $(eval $(call BuildPackage,valgrind-drd))
176 $(eval $(call BuildPackage,valgrind-massif))
177 $(eval $(call BuildPackage,valgrind-helgrind))
178 $(eval $(call BuildPackage,valgrind-vgdb))