Makefile 4.7 KB

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