Browse Source

glibc-external: skip license for non-external builds

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Christopher Larson 3 years ago
parent
commit
bc41a26b28
1 changed files with 14 additions and 13 deletions
  1. 14 13
      recipes-external/glibc/glibc-external.bb

+ 14 - 13
recipes-external/glibc/glibc-external.bb

@@ -22,25 +22,26 @@ PROVIDES += "glibc \
              linux-libc-headers-dev"
 
 def get_external_libc_license(d):
-    errnosearch = os.path.join(d.getVar('includedir', True), 'errno.h')
-    found = oe.external.find_sysroot_files([errnosearch], d)
-    if found:
-        errno_paths = found[0]
-        if errno_paths:
-            with open(errno_paths[0], 'rU') as f:
-                text = f.read()
-
-            lictext = """   The GNU C Library is free software; you can redistribute it and/or
+    if (d.getVar('TCMODE', True).startswith('external') and
+            d.getVar('EXTERNAL_TOOLCHAIN', True)):
+        errnosearch = os.path.join(d.getVar('includedir', True), 'errno.h')
+        found = oe.external.find_sysroot_files([errnosearch], d)
+        if found:
+            errno_paths = found[0]
+            if errno_paths:
+                with open(errno_paths[0], 'rU') as f:
+                    text = f.read()
+
+                lictext = """   The GNU C Library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version."""
-
-            if lictext in text:
-                return 'LGPL-2.1+'
+                if lictext in text:
+                    return 'LGPL-2.1+'
 
     return 'UNKNOWN'
 
-LICENSE := "${@get_external_libc_license(d)}"
+LICENSE_tcmode-external := "${@get_external_libc_license(d)}"
 
 require recipes-external/glibc/glibc-sysroot-setup.inc
 require recipes-external/glibc/glibc-package-adjusted.inc