7e5d3f8c5a9d0eead899cbfc31faffd474b6c990
[openwrt/svn-archive/archive.git] / utils / valgrind / Makefile
1 #
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id: $
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=valgrind
12 PKG_VERSION:=3.3.1
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16 PKG_SOURCE_URL:=http://valgrind.org/downloads/
17 PKG_MD5SUM:=0539e2fa4aadb2cd4ca4bba65b1fe8b5
18
19 include $(INCLUDE_DIR)/package.mk
20
21 define Package/valgrind
22 SECTION:=utils
23 CATEGORY:=Utilities
24 DEPENDS:=@TARGET_x86||@TARGET_rdc||@TARGET_ps3||@TARGET_magicbox||@TARGET_amcc||@TARGET_uml
25 TITLE:=debugging and profiling Linux programs
26 URL:=http://www.valgrind.org
27 endef
28
29 define Package/valgrind/description
30 Valgrind is an award-winning suite of tools for debugging and
31 profiling Linux programs. With the tools that come with Valgrind,
32 you can automatically detect many memory management and threading
33 bugs, avoiding hours of frustrating bug-hunting, making your
34 programs more stable. You can also perform detailed profiling,
35 to speed up and reduce memory use of your programs.
36 endef
37
38 CONFIGURE_ARGS += \
39 --disable-tls \
40 --enable-only32bit \
41 --without-x \
42 --without-uiout \
43 --disable-valgrindmi \
44 --disable-tui \
45 --disable-valgrindtk \
46 --without-included-gettext
47
48 DEFAULT_SUPP += "uclibc.supp"
49
50 define Build/Compile
51 $(TARGET_CC) $(TARGET_CFLAGS) -c -o $(PKG_BUILD_DIR)/abort.o ./src/abort.c
52 $(TARGET_CROSS)ar rcu $(PKG_BUILD_DIR)/abort.a $(PKG_BUILD_DIR)/abort.o
53 $(MAKE) -C $(PKG_BUILD_DIR) \
54 $(TARGET_CONFIGURE_OPTS) \
55 DESTDIR="$(PKG_INSTALL_DIR)" \
56 CFLAGS="$(TARGET_CFLAGS)" \
57 AM_CFLAGS_X86_LINUX="$(TARGET_CFLAGS) -I$(PKG_BUILD_DIR)/coregrind" \
58 AM_CFLAGS_AMD64_LINUX="$(TARGET_CFLAGS) -I$(PKG_BUILD_DIR)/coregrind" \
59 AM_CFLAGS_PPC32_LINUX="$(TARGET_CFLAGS) -I$(PKG_BUILD_DIR)/coregrind" \
60 AM_CFLAGS_PPC64_LINUX="$(TARGET_CFLAGS) -I$(PKG_BUILD_DIR)/coregrind" \
61 TOOL_LDADD_COMMON="-lgcc $(PKG_BUILD_DIR)/abort.a" \
62 all install
63 endef
64
65 define Package/valgrind/install
66 $(INSTALL_DIR) $(1)/usr/bin
67 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
68 $(INSTALL_BIN) ./files/valgrind.sh $(1)/usr/bin/
69 $(INSTALL_DIR) $(1)/usr/lib/valgrind
70 $(CP) ./files/uclibc.supp $(1)/usr/lib/valgrind/
71 $(CP) $(PKG_INSTALL_DIR)/usr/lib/valgrind/*-linux $(1)/usr/lib/valgrind/
72 endef
73
74 $(eval $(call BuildPackage,valgrind))