The cirros image was rebuilt against the 3.13.0-83 kernel, drivers e1000e, igbvf...
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / perf / perf.mk
1 ################################################################################
2 #
3 # perf
4 #
5 ################################################################################
6
7 # Source taken from the Linux kernel tree
8 PERF_SOURCE =
9 PERF_VERSION = $(call qstrip,$(BR2_LINUX_KERNEL_VERSION))
10
11 PERF_DEPENDENCIES = linux host-flex host-bison
12
13 PERF_MAKE_FLAGS = \
14         $(LINUX_MAKE_FLAGS) \
15         NO_LIBAUDIT=1 \
16         NO_NEWT=1 \
17         NO_GTK2=1 \
18         NO_LIBPERL=1 \
19         NO_LIBPYTHON=1 \
20         DESTDIR=$(TARGET_DIR) \
21         prefix=/usr \
22         WERROR=0 \
23         ASCIIDOC=
24
25 # The call to backtrace() function fails for ARC, because for some
26 # reason the unwinder from libgcc returns early. Thus the usage of
27 # backtrace() should be disabled in perf explicitly: at build time
28 # backtrace() appears to be available, but it fails at runtime: the
29 # backtrace will contain only several functions from the top of stack,
30 # instead of the complete backtrace.
31 ifeq ($(BR2_arc),y)
32 PERF_MAKE_FLAGS += NO_BACKTRACE=1
33 endif
34
35 ifeq ($(BR2_PACKAGE_ELFUTILS),y)
36 PERF_DEPENDENCIES += elfutils
37 else
38 PERF_MAKE_FLAGS += NO_LIBELF=1 NO_DWARF=1
39 endif
40
41 define PERF_BUILD_CMDS
42         $(Q)if test ! -f $(LINUX_DIR)/tools/perf/Makefile ; then \
43                 echo "Your kernel version is too old and does not have the perf tool." ; \
44                 echo "At least kernel 2.6.31 must be used." ; \
45                 exit 1 ; \
46         fi
47         $(Q)if test "$(BR2_PACKAGE_ELFUTILS)" = "" ; then \
48                 if ! grep -q NO_LIBELF $(LINUX_DIR)/tools/perf/Makefile* ; then \
49                         if ! test -r $(LINUX_DIR)/tools/perf/config/Makefile ; then \
50                                 echo "The perf tool in your kernel cannot be built without libelf." ; \
51                                 echo "Either upgrade your kernel to >= 3.7, or enable the elfutils package." ; \
52                                 exit 1 ; \
53                         fi \
54                 fi \
55         fi
56         $(TARGET_MAKE_ENV) $(MAKE1) -C $(LINUX_DIR)/tools/perf \
57                 $(PERF_MAKE_FLAGS) O=$(@D)
58 endef
59
60 # After installation, we remove the Perl and Python scripts from the
61 # target.
62 define PERF_INSTALL_TARGET_CMDS
63         $(TARGET_MAKE_ENV) $(MAKE1) -C $(LINUX_DIR)/tools/perf \
64                 $(PERF_MAKE_FLAGS) O=$(@D) install
65         $(RM) -rf $(TARGET_DIR)/usr/libexec/perf-core/scripts/
66 endef
67
68 $(eval $(generic-package))