Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Khem Raj <raj.khem@gmail.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH] classes: Apply libc-${LIBC} overrides to target recipes only
Date: Tue, 29 Nov 2011 14:46:58 -0800	[thread overview]
Message-ID: <1322606818-2817-1-git-send-email-raj.khem@gmail.com> (raw)

Currently these overrides are enabled for native and nativesdk
recipes as well when inheriting native and nativesdk classes. This patch
filters these from OVERRIDES variables for native and nativesdk
recipes.

oe_filter_out and oe_filter functions currently only operated on
space separated strings. Since OVERRIDES are separated using ':'
these functions are enhanced to take and additional parameter
called 'sep' which defaults to None if not specified which means we keep
the existing behaviour.

Drop the last parameter 'd' from filter functions since it was not being
used.

adjust uclibc and gcc-runtime recipes to follow new signatures of
oe_fiter functions.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta/classes/native.bbclass                        |    5 +++--
 meta/classes/nativesdk.bbclass                     |    5 +++--
 meta/classes/utils.bbclass                         |    8 ++++----
 meta/lib/oe/utils.py                               |   14 ++++++++++----
 meta/recipes-core/uclibc/uclibc.inc                |    6 +++---
 .../recipes-devtools/gcc/gcc-configure-runtime.inc |    2 +-
 6 files changed, 24 insertions(+), 16 deletions(-)

diff --git a/meta/classes/native.bbclass b/meta/classes/native.bbclass
index 8f7cc1f..270b4f3 100644
--- a/meta/classes/native.bbclass
+++ b/meta/classes/native.bbclass
@@ -138,8 +138,9 @@ python native_virtclass_handler () {
         if not prov.endswith("-native"):
             provides = provides.replace(prov, prov + "-native")
     e.data.setVar("PROVIDES", provides)
-
-    e.data.setVar("OVERRIDES", e.data.getVar("OVERRIDES", False) + ":virtclass-native")
+    overrides = e.data.getVar("OVERRIDES", False);
+    overrides = oe_filter_out('libc-uclibc|libc-glibc', overrides, ':')
+    e.data.setVar("OVERRIDES",overrides + ":virtclass-native")
 }
 
 addhandler native_virtclass_handler
diff --git a/meta/classes/nativesdk.bbclass b/meta/classes/nativesdk.bbclass
index e6204c0..0f897a9 100644
--- a/meta/classes/nativesdk.bbclass
+++ b/meta/classes/nativesdk.bbclass
@@ -65,8 +65,9 @@ python nativesdk_virtclass_handler () {
     pn = e.data.getVar("PN", True)
     if not pn.endswith("-nativesdk"):
         return
-
-    e.data.setVar("OVERRIDES", e.data.getVar("OVERRIDES", False) + ":virtclass-nativesdk")
+    overrides = e.data.getVar("OVERRIDES", False)
+    oe_filter_out('libc-uclibc|libc-glibc', overrides, ':')
+    e.data.setVar("OVERRIDES",overrides + ":virtclass-nativesdk")
 }
 
 python () {
diff --git a/meta/classes/utils.bbclass b/meta/classes/utils.bbclass
index 103fa9a..6311017 100644
--- a/meta/classes/utils.bbclass
+++ b/meta/classes/utils.bbclass
@@ -32,11 +32,11 @@ def base_both_contain(variable1, variable2, checkvalue, d):
 def base_prune_suffix(var, suffixes, d):
     return oe.utils.prune_suffix(var, suffixes, d)
 
-def oe_filter(f, str, d):
-    return oe.utils.str_filter(f, str, d)
+def oe_filter(f, str, sep = None):
+    return oe.utils.str_filter(f, str, sep)
 
-def oe_filter_out(f, str, d):
-    return oe.utils.str_filter_out(f, str, d)
+def oe_filter_out(f, str, sep = None):
+    return oe.utils.str_filter_out(f, str, sep)
 
 def machine_paths(d):
     """List any existing machine specific filespath directories"""
diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py
index 95daace..3e321fc 100644
--- a/meta/lib/oe/utils.py
+++ b/meta/lib/oe/utils.py
@@ -66,13 +66,19 @@ def prune_suffix(var, suffixes, d):
 
     return var
 
-def str_filter(f, str, d):
+def str_filter(f, str, sep = None):
     from re import match
-    return " ".join(filter(lambda x: match(f, x, 0), str.split()))
+    if sep is None or sep is '':
+	return " ".join(filter(lambda x: match(f, x, 0), str.split()))
+    else:
+	return sep.join(filter(lambda x: match(f, x, 0), str.split(sep)))
 
-def str_filter_out(f, str, d):
+def str_filter_out(f, str, sep = None):
     from re import match
-    return " ".join(filter(lambda x: not match(f, x, 0), str.split()))
+    if sep is None or sep is '':
+	return " ".join(filter(lambda x: not match(f, x, 0), str.split()))
+    else:
+	return sep.join(filter(lambda x: not match(f, x, 0), str.split(sep)))
 
 def param_bool(cfg, field, dflt = None):
     """Lookup <field> in <cfg> map and convert it to a boolean; take
diff --git a/meta/recipes-core/uclibc/uclibc.inc b/meta/recipes-core/uclibc/uclibc.inc
index 92157bd..5845519 100644
--- a/meta/recipes-core/uclibc/uclibc.inc
+++ b/meta/recipes-core/uclibc/uclibc.inc
@@ -112,9 +112,9 @@ export V="2"
 # -O<n> -fno-omit-frame-pointer ends up with GCC ICE on thumb as reported
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44860
 #
-CFLAGS_arm := "${@oe_filter_out('-fno-omit-frame-pointer', '${CFLAGS}', d)}"
-UCLIBC_EXTRA_CFLAGS  := "${@oe_filter_out('(-I\S+|-i\S+)', '${CFLAGS}', d)}"
-UCLIBC_EXTRA_LDFLAGS := "${@oe_filter_out('(-L\S+|-l\S+)', '${LDFLAGS}', d)}"
+CFLAGS_arm := "${@oe_filter_out('-fno-omit-frame-pointer', '${CFLAGS}')}"
+UCLIBC_EXTRA_CFLAGS  := "${@oe_filter_out('(-I\S+|-i\S+)', '${CFLAGS}')}"
+UCLIBC_EXTRA_LDFLAGS := "${@oe_filter_out('(-L\S+|-l\S+)', '${LDFLAGS}')}"
 do_compile_prepend () {
   unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
 }
diff --git a/meta/recipes-devtools/gcc/gcc-configure-runtime.inc b/meta/recipes-devtools/gcc/gcc-configure-runtime.inc
index 34bfaeb..5b19ec9 100644
--- a/meta/recipes-devtools/gcc/gcc-configure-runtime.inc
+++ b/meta/recipes-devtools/gcc/gcc-configure-runtime.inc
@@ -1,6 +1,6 @@
 require gcc-configure-common.inc
 
-CXXFLAGS := "${@oe_filter_out('-fvisibility-inlines-hidden', '${CXXFLAGS}', d)}"
+CXXFLAGS := "${@oe_filter_out('-fvisibility-inlines-hidden', '${CXXFLAGS}')}"
 
 EXTRA_OECONF_PATHS = " \
     --with-local-prefix=${STAGING_DIR_TARGET}${prefix} \
-- 
1.7.5.4




             reply	other threads:[~2011-11-29 22:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-29 22:46 Khem Raj [this message]
2011-11-30 23:26 ` [PATCH] classes: Apply libc-${LIBC} overrides to target recipes only Richard Purdie
2011-11-30 23:33   ` Khem Raj

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1322606818-2817-1-git-send-email-raj.khem@gmail.com \
    --to=raj.khem@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox