cae26348611e06218141788db2a326041571ffc6
[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
13 PKG_VERSION:=4.14
14 PKG_RELEASE:=1
15 PKG_HASH:=5bed5110b243dce6864bedba269446c18c8c63f553cdd7fd4f808d89a764712f
16
17 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
18 PKG_SOURCE_URL:=@SF/$(PKG_NAME)
19
20 PKG_LICENSE:=BSD-3c
21 PKG_LICENSE_FILES:=COPYRIGHT
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 CONFIGURE_VARS+= \
34 LDFLAGS_FOR_BUILD="$(HOST_LDFLAGS)" \
35 CPPFLAGS_FOR_BUILD="$(HOST_CPPFLAGS)" \
36 CFLAGS_FOR_BUILD="$(HOST_CFLAGS)" \
37 CC_FOR_BUILD="$(HOST_CC)"
38
39 define Package/strace
40 SECTION:=utils
41 CATEGORY:=Utilities
42 TITLE:=System call tracer
43 DEPENDS:=+PACKAGE_strace_libunwind:libunwind
44 URL:=http://strace.sourceforge.net/
45 endef
46
47 define Package/strace/description
48 A useful diagnostic, instructional, and debugging tool. Allows you to track what
49 system calls a program makes while it is running.
50 endef
51
52 define Package/strace/config
53 config PACKAGE_strace_libunwind
54 bool "Enable stack tracing support using libunwind (experimental)"
55 default n
56 endef
57
58 CONFIGURE_ARGS += --with-libunwind=$(if $(CONFIG_PACKAGE_strace_libunwind),yes,no)
59 MAKE_FLAGS := \
60 CCOPT="$(TARGET_CFLAGS)"
61
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
67 $(eval $(call BuildPackage,strace))