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