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