b342a8c0d01b7152b5a8337dff3a614b0648989a
[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.26
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:=7c4d2ffeef4f7d1cdc71062ca78d1130eb52f947c2fca82f59f6a1183bfa1e1c
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_INSTALL:=1
27
28 PKG_CONFIG_DEPENDS := \
29 CONFIG_STRACE_LIBDW \
30 CONFIG_STRACE_LIBUNWIND
31
32 include $(INCLUDE_DIR)/package.mk
33
34 HOST_CFLAGS += -I$(LINUX_DIR)/user_headers/include
35
36 ifeq ($(ARCH),aarch64)
37 CONFIGURE_ARGS += --enable-mpers=check
38 endif
39
40 CONFIGURE_VARS+= \
41 LDFLAGS_FOR_BUILD="$(HOST_LDFLAGS)" \
42 CPPFLAGS_FOR_BUILD="$(HOST_CPPFLAGS)" \
43 CFLAGS_FOR_BUILD="$(HOST_CFLAGS)" \
44 CC_FOR_BUILD="$(HOST_CC)"
45
46 define Package/strace
47 SECTION:=utils
48 CATEGORY:=Utilities
49 TITLE:=System call tracer
50 DEPENDS:=+STRACE_LIBDW:libdw +STRACE_LIBUNWIND:libunwind
51 URL:=http://strace.sourceforge.net/
52 endef
53
54 define Package/strace/description
55 A useful diagnostic, instructional, and debugging tool. Allows you to track what
56 system calls a program makes while it is running.
57 endef
58
59 define Package/strace/config
60 choice
61 prompt "stack tracing support"
62 default STRACE_NONE
63
64 config STRACE_NONE
65 bool "None"
66
67 config STRACE_LIBDW
68 bool "libdw"
69
70 config STRACE_LIBUNWIND
71 bool "libunwind (experimental)"
72 endchoice
73 endef
74
75 CONFIGURE_ARGS += \
76 --with-libdw=$(if $(CONFIG_STRACE_LIBDW),yes,no) \
77 --with-libunwind=$(if $(CONFIG_STRACE_LIBUNWIND),yes,no)
78
79 MAKE_FLAGS := \
80 CCOPT="$(TARGET_CFLAGS)"
81
82 define Package/strace/install
83 $(INSTALL_DIR) $(1)/usr/bin
84 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/strace $(1)/usr/bin/
85 endef
86
87 $(eval $(call BuildPackage,strace))