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