From patchwork Fri Jul 6 20:29:58 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [2/3] perf: add arch-specific perf-scripting feature Date: Fri, 06 Jul 2012 20:29:58 -0000 From: Tom Zanussi X-Patchwork-Id: 31343 Message-Id: To: openembedded-core@lists.openembedded.org, richard.purdie@linuxfoundation.org From: Tom Zanussi Add a new architecture-specific feature named 'perf-scripting'. Adding this into the perf_features_by_arch table in perf.inc for a given arch will enable perf scripting on a target built for that arch, which will turn on all the language bindings currently aavailable in perf (Perl and Python), if perf is included in an image. If 'perf-scripting' isn't named as a feature (the default), all perf language bindings will be disabled and unavailable. Signed-off-by: Tom Zanussi --- meta/recipes-kernel/perf/perf_3.4.bb | 12 +++++++++--- 1 files changed, 9 insertions(+), 3 deletions(-) diff --git a/meta/recipes-kernel/perf/perf_3.4.bb b/meta/recipes-kernel/perf/perf_3.4.bb index d494243..a79e9e6 100644 --- a/meta/recipes-kernel/perf/perf_3.4.bb +++ b/meta/recipes-kernel/perf/perf_3.4.bb @@ -9,7 +9,7 @@ as well." LICENSE = "GPLv2" LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7" -PR = "r1" +PR = "r2" require perf.inc @@ -21,7 +21,8 @@ DEPENDS = "virtual/kernel \ ${MLPREFIX}binutils \ " -RDEPENDS_${PN} += "elfutils perl perl-modules python" +SCRIPTING_RDEPENDS = "${@perf_arch_supports_feature('perf-scripting', 'perl perl-modules python', '',d)}" +RDEPENDS_${PN} += "elfutils ${SCRIPTING_RDEPENDS}" PROVIDES = "virtual/perf" @@ -45,6 +46,8 @@ export PERL_ARCHLIB = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/${@get_perl_version S = "${STAGING_KERNEL_DIR}" B = "${WORKDIR}/${BPN}-${PV}" +SCRIPTING_DEFINES = "${@perf_arch_supports_feature('perf-scripting', '', 'NO_LIBPERL=1 NO_LIBPYTHON=1',d)}" + EXTRA_OEMAKE = \ '-C ${S}/tools/perf \ O=${B} \ @@ -53,7 +56,7 @@ EXTRA_OEMAKE = \ CC="${CC}" \ AR="${AR}" \ prefix=/usr \ - NO_GTK2=1 NO_NEWT=1 NO_DWARF=1 \ + NO_GTK2=1 NO_NEWT=1 NO_DWARF=1 ${SCRIPTING_DEFINES} \ ' do_compile() { @@ -62,6 +65,9 @@ do_compile() { do_install() { oe_runmake DESTDIR=${D} install + if [ "${@perf_arch_supports_feature('perf-scripting', 1, 0, d)}" = "1" ]; then + oe_runmake DESTDIR=${D} install-python_ext + fi } PACKAGE_ARCH = "${MACHINE_ARCH}"