Makefile 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. #
  2. # Copyright (C) 2006-2016 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. include $(INCLUDE_DIR)/kernel.mk
  9. PKG_NAME:=strace
  10. PKG_VERSION:=5.0
  11. PKG_RELEASE:=1
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  13. PKG_SOURCE_URL:=https://strace.io/files/$(PKG_VERSION)
  14. PKG_HASH:=3b7ad77eb2b81dc6078046a9cc56eed5242b67b63748e7fc28f7c2daf4e647da
  15. PKG_LICENSE:=BSD-3c
  16. PKG_LICENSE_FILES:=COPYRIGHT
  17. PKG_CPE_ID:=cpe:/a:paul_kranenburg:strace
  18. PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
  19. PKG_FIXUP:=autoreconf
  20. PKG_INSTALL:=1
  21. PKG_CONFIG_DEPENDS := \
  22. CONFIG_STRACE_LIBDW \
  23. CONFIG_STRACE_LIBUNWIND
  24. include $(INCLUDE_DIR)/package.mk
  25. HOST_CFLAGS += -I$(LINUX_DIR)/user_headers/include
  26. ifeq ($(ARCH),aarch64)
  27. CONFIGURE_ARGS += --enable-mpers=check
  28. endif
  29. CONFIGURE_VARS+= \
  30. LDFLAGS_FOR_BUILD="$(HOST_LDFLAGS)" \
  31. CPPFLAGS_FOR_BUILD="$(HOST_CPPFLAGS)" \
  32. CFLAGS_FOR_BUILD="$(HOST_CFLAGS)" \
  33. CC_FOR_BUILD="$(HOST_CC)"
  34. define Package/strace
  35. SECTION:=utils
  36. CATEGORY:=Utilities
  37. TITLE:=System call tracer
  38. DEPENDS:=+STRACE_LIBDW:libdw +STRACE_LIBUNWIND:libunwind
  39. URL:=http://strace.sourceforge.net/
  40. endef
  41. define Package/strace/description
  42. A useful diagnostic, instructional, and debugging tool. Allows you to track what
  43. system calls a program makes while it is running.
  44. endef
  45. define Package/strace/config
  46. choice
  47. prompt "stack tracing support"
  48. default STRACE_NONE
  49. config STRACE_NONE
  50. bool "None"
  51. config STRACE_LIBDW
  52. bool "libdw"
  53. config STRACE_LIBUNWIND
  54. bool "libunwind (experimental)"
  55. endchoice
  56. endef
  57. CONFIGURE_ARGS += \
  58. --with-libdw=$(if $(CONFIG_STRACE_LIBDW),yes,no) \
  59. --with-libunwind=$(if $(CONFIG_STRACE_LIBUNWIND),yes,no)
  60. MAKE_FLAGS := \
  61. CCOPT="$(TARGET_CFLAGS)"
  62. define Package/strace/install
  63. $(INSTALL_DIR) $(1)/usr/bin
  64. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/strace $(1)/usr/bin/
  65. endef
  66. $(eval $(call BuildPackage,strace))