Patchwork [meta-oe,v2,1/1] ktap: add configs for elfutils and ffi

login
register
mail settings
Submitter Anders Darander
Date Jan. 10, 2014, 6:47 a.m.
Message ID <e9faf20404cfc8c31b6192b2889f3deda8571d42.1389336448.git.anders@chargestorm.se>
Download mbox | patch
Permalink /patch/64497/
State Accepted, archived
Headers show

Comments

Anders Darander - Jan. 10, 2014, 6:47 a.m.
libelf (elfutils) is required for resolving symbols in DSO and for sdt (taken
from ktap docs). The earlier v0.4 recipe built ktap against libelf if it was
found, thus enable it per default.

FFI needs to be enabled for both userspace and kernel module. Currently, it is
only supported for x86_64 (enforced when building ktap-module).

Signed-off-by: Anders Darander <anders@chargestorm.se>
---
 meta-oe/recipes-kernel/ktap/ktap-module_0.4.bb |  5 ++++-
 meta-oe/recipes-kernel/ktap/ktap.inc           |  2 ++
 meta-oe/recipes-kernel/ktap/ktap_0.4.bb        | 11 ++++++++++-
 3 files changed, 16 insertions(+), 2 deletions(-)

Patch

diff --git a/meta-oe/recipes-kernel/ktap/ktap-module_0.4.bb b/meta-oe/recipes-kernel/ktap/ktap-module_0.4.bb
index 12167ea..ce6885c 100644
--- a/meta-oe/recipes-kernel/ktap/ktap-module_0.4.bb
+++ b/meta-oe/recipes-kernel/ktap/ktap-module_0.4.bb
@@ -6,8 +6,11 @@  DESCRIPTION = "KTAP is a scripting dynamic tracing tool for Linux"
 
 inherit module
 
+# Available package configs: ffi (only supported on x86_64)
+PACKAGECONFIG ?= ""
+
 # Only build the module
-MAKE_TARGETS = "mod"
+MAKE_TARGETS = "${@base_contains('PACKAGECONFIG', 'ffi', 'FFI=1', '', d)} mod"
 
 # Kernel module packages MUST begin with 'kernel-module-', otherwise
 # multilib image generation can fail.
diff --git a/meta-oe/recipes-kernel/ktap/ktap.inc b/meta-oe/recipes-kernel/ktap/ktap.inc
index 7e60453..93a4e2c 100644
--- a/meta-oe/recipes-kernel/ktap/ktap.inc
+++ b/meta-oe/recipes-kernel/ktap/ktap.inc
@@ -9,3 +9,5 @@  SRC_URI = "git://github.com/ktap/ktap.git"
 
 S = "${WORKDIR}/git"
 
+# Package config is abused as a general compile time configuration tool.
+PACKAGECONFIG[ffi] = ""
diff --git a/meta-oe/recipes-kernel/ktap/ktap_0.4.bb b/meta-oe/recipes-kernel/ktap/ktap_0.4.bb
index f5dd62f..20f94d5 100644
--- a/meta-oe/recipes-kernel/ktap/ktap_0.4.bb
+++ b/meta-oe/recipes-kernel/ktap/ktap_0.4.bb
@@ -5,8 +5,17 @@  require ktap.inc
 SUMMARY = "KTAP is a scripting dynamic tracing tool for Linux"
 DEPENDS = "ktap-module"
 
+#Available package configs:
+# libelf - needed to resolve symbols in DSO and for sdt
+# ffi    - only supports x86_64 for now!. Needs to be enabled for ktap-module too.
+PACKAGECONFIG ?= "libelf"
+
+PACKAGECONFIG[libelf] = ",,elfutils"
+
 # Only build the userspace app
-EXTRA_OEMAKE = "ktap"
+EXTRA_OEMAKE = "${@base_contains('PACKAGECONFIG', 'libelf', '', 'NO_LIBELF=1', d)} \
+             ${@base_contains('PACKAGECONFIG', 'ffi', 'FFI=1', '', d)} \
+             ktap"
 
 do_install() {
     install -d ${D}${bindir}