2
0

Makefile 4.7 KB

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