1
0

Makefile 6.2 KB

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