strace: fix configuration options
[openwrt/staging/jogo.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_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 menu "Select strace configuration options"
61 depends on PACKAGE_strace
62
63 config STRACE_LIBDW
64 bool "Enable stack tracing support using libdw"
65 default n
66 config STRACE_LIBUNWIND
67 bool "Enable stack tracing support using libunwind (experimental)"
68 default n
69
70 endmenu
71 endef
72
73 CONFIGURE_ARGS += \
74 --with-libdw=$(if $(CONFIG_STRACE_LIBDW),yes,no) \
75 --with-libunwind=$(if $(CONFIG_STRACE_LIBUNWIND),yes,no)
76
77 MAKE_FLAGS := \
78 CCOPT="$(TARGET_CFLAGS)"
79
80 define Package/strace/install
81 $(INSTALL_DIR) $(1)/usr/bin
82 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/strace $(1)/usr/bin/
83 endef
84
85 $(eval $(call BuildPackage,strace))