2 # Copyright (C) 2006-2011 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR)/rules.mk
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=http://valgrind.org/downloads/
16 PKG_MD5SUM:=0539e2fa4aadb2cd4ca4bba65b1fe8b5
18 include $(INCLUDE_DIR)/package.mk
20 define Package/valgrind
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
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.
42 --disable-valgrindmi \
44 --disable-valgrindtk \
45 --without-included-gettext
47 DEFAULT_SUPP += "uclibc.supp"
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" \
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/
73 $(eval $(call BuildPackage,valgrind))