Makefile 4.8 KB

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