Makefile 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  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.14.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:=037c11bfefd477cc6e9ebe8f193bb237fe397f7ce791b4a4ce3fa1c6a520baa5
  14. PKG_MAINTAINER:=Felix Fietkau <[email protected]>
  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 +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. --enable-lto
  90. define Package/valgrind/install
  91. $(INSTALL_DIR) $(1)/usr/bin
  92. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/valgrind* $(1)/usr/bin/
  93. $(INSTALL_DIR) $(1)/usr/lib/valgrind
  94. $(CP) \
  95. ./files/default.supp \
  96. $(PKG_INSTALL_DIR)/usr/lib/valgrind/none-* \
  97. $(PKG_INSTALL_DIR)/usr/lib/valgrind/vgpreload_core*.so \
  98. $(PKG_INSTALL_DIR)/usr/lib/valgrind/$(BITS)-core*.xml \
  99. $(PKG_INSTALL_DIR)/usr/lib/valgrind/$(BITS)-linux*.xml \
  100. $(PKG_INSTALL_DIR)/usr/lib/valgrind/memcheck-* \
  101. $(PKG_INSTALL_DIR)/usr/lib/valgrind/vgpreload_memcheck*.so \
  102. $(1)/usr/lib/valgrind/
  103. ifneq ($(ARCH),aarch64)
  104. $(CP) \
  105. $(PKG_INSTALL_DIR)/usr/lib/valgrind/$(CPU)-*.xml \
  106. $(1)/usr/lib/valgrind/
  107. endif
  108. endef
  109. define Package/valgrind-cachegrind/install
  110. $(INSTALL_DIR) $(1)/usr/bin
  111. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/cg_* $(1)/usr/bin/
  112. $(INSTALL_DIR) $(1)/usr/lib/valgrind
  113. $(CP) \
  114. $(PKG_INSTALL_DIR)/usr/lib/valgrind/cachegrind-* \
  115. $(1)/usr/lib/valgrind/
  116. endef
  117. define Package/valgrind-callgrind/install
  118. $(INSTALL_DIR) $(1)/usr/bin
  119. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/callgrind* $(1)/usr/bin/
  120. $(INSTALL_DIR) $(1)/usr/lib/valgrind
  121. $(CP) \
  122. $(PKG_INSTALL_DIR)/usr/lib/valgrind/callgrind-* \
  123. $(1)/usr/lib/valgrind/
  124. endef
  125. define Package/valgrind-drd/install
  126. $(INSTALL_DIR) $(1)/usr/lib/valgrind
  127. $(CP) \
  128. $(PKG_INSTALL_DIR)/usr/lib/valgrind/drd-* \
  129. $(PKG_INSTALL_DIR)/usr/lib/valgrind/vgpreload_drd*.so \
  130. $(1)/usr/lib/valgrind/
  131. endef
  132. define Package/valgrind-massif/install
  133. $(INSTALL_DIR) $(1)/usr/bin
  134. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ms_print $(1)/usr/bin/
  135. $(INSTALL_DIR) $(1)/usr/lib/valgrind
  136. $(CP) \
  137. $(PKG_INSTALL_DIR)/usr/lib/valgrind/massif-* \
  138. $(PKG_INSTALL_DIR)/usr/lib/valgrind/vgpreload_massif*.so \
  139. $(1)/usr/lib/valgrind/
  140. endef
  141. define Package/valgrind-helgrind/install
  142. $(INSTALL_DIR) $(1)/usr/lib/valgrind
  143. $(CP) \
  144. $(PKG_INSTALL_DIR)/usr/lib/valgrind/helgrind-* \
  145. $(PKG_INSTALL_DIR)/usr/lib/valgrind/vgpreload_helgrind*.so \
  146. $(1)/usr/lib/valgrind/
  147. endef
  148. define Package/valgrind-vgdb/install
  149. $(INSTALL_DIR) $(1)/usr/bin
  150. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/vgdb $(1)/usr/bin/
  151. endef
  152. $(eval $(call BuildPackage,valgrind))
  153. $(eval $(call BuildPackage,valgrind-cachegrind))
  154. $(eval $(call BuildPackage,valgrind-callgrind))
  155. $(eval $(call BuildPackage,valgrind-drd))
  156. $(eval $(call BuildPackage,valgrind-massif))
  157. $(eval $(call BuildPackage,valgrind-helgrind))
  158. $(eval $(call BuildPackage,valgrind-vgdb))