]> code.ossystems Code Review - openembedded-core.git/commitdiff
base: Simplify BASEDEPENDS construction
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 11 May 2016 15:29:05 +0000 (16:29 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 12 May 2017 08:00:59 +0000 (09:00 +0100)
This code dates from distant times before we had class overrides.
The comments are also rather stale. Rewrite this code using class
overrides which makes it safer, more modern and more easily
understandable.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/base.bbclass
meta/classes/gettext.bbclass

index d95afb7b9b5e796ed02b201f52a7520ee6b10053..78926656d77b71f3c6741957bec800bdfbbb7f3e 100644 (file)
@@ -61,22 +61,15 @@ oe_runmake() {
 
 
 def base_dep_prepend(d):
-    #
-    # Ideally this will check a flag so we will operate properly in
-    # the case where host == build == target, for now we don't work in
-    # that case though.
-    #
+    if d.getVar('INHIBIT_DEFAULT_DEPS', False):
+        return ""
+    return "${BASE_DEFAULT_DEPS}"
 
-    deps = ""
-    # INHIBIT_DEFAULT_DEPS doesn't apply to the patch command.  Whether or  not
-    # we need that built is the responsibility of the patch function / class, not
-    # the application.
-    if not d.getVar('INHIBIT_DEFAULT_DEPS', False):
-        if (d.getVar('HOST_SYS') != d.getVar('BUILD_SYS')):
-            deps += " virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}compilerlibs virtual/libc "
-    return deps
+BASE_DEFAULT_DEPS = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}compilerlibs virtual/libc"
 
-BASEDEPENDS = "${@base_dep_prepend(d)}"
+BASEDEPENDS = ""
+BASEDEPENDS_class-target = "${@base_dep_prepend(d)}"
+BASEDEPENDS_class-nativesdk = "${@base_dep_prepend(d)}"
 
 DEPENDS_prepend="${BASEDEPENDS} "
 
index 0be14246bfd53ea0ce6bce8c46348cbdee7598f6..d60a0c12ce1d465c0342c5b3240dd3dafe6f010e 100644 (file)
@@ -15,5 +15,5 @@ def gettext_oeconf(d):
 
 DEPENDS_GETTEXT ??= "virtual/gettext gettext-native"
 
-BASEDEPENDS =+ "${@gettext_dependencies(d)}"
+BASEDEPENDS_append = " ${@gettext_dependencies(d)}"
 EXTRA_OECONF_append = " ${@gettext_oeconf(d)}"