Merge pull request #70 from kergoth/sourcery-mx6

glibc-external: fix issue locating errno.h
This commit is contained in:
Christopher Larson
2015-05-07 11:55:01 -07:00
2 changed files with 21 additions and 15 deletions

View File

@@ -201,6 +201,12 @@ def search_sysroots(path_entries, sysroots):
else:
yield path, None
def find_sysroot_files(paths, d):
sysroots, mirrors = get_file_search_metadata(d)
expanded = expand_paths(paths, mirrors)
search_results = search_sysroots(expanded, sysroots)
return [v for k, v in search_results]
# Change do_install's CWD to EXTERNAL_TOOLCHAIN for convenience
do_install[dirs] = "${D} ${EXTERNAL_TOOLCHAIN}"

View File

@@ -4,12 +4,12 @@ require recipes-core/glibc/glibc-common.inc
inherit external-toolchain
def get_external_libc_version(d):
sysroot = d.getVar('EXTERNAL_TOOLCHAIN_SYSROOT', True)
libpath = os.path.join(sysroot, 'lib')
if os.path.exists(libpath):
for filename in os.listdir(libpath):
if filename.startswith('libc-'):
return filename[5:-3]
sopattern = os.path.join(d.getVar('base_libdir', True), 'libc-*.so')
found_paths = find_sysroot_files([sopattern], d)
if found_paths:
so_paths = found_paths[0]
soname = os.path.basename(so_paths[0])
return soname[5:-3]
return 'UNKNOWN'
@@ -25,20 +25,20 @@ PROVIDES += "glibc \
virtual/libiconv"
def get_external_libc_license(d):
sysroot = d.getVar('EXTERNAL_TOOLCHAIN_SYSROOT', True)
incpath = os.path.join(sysroot, d.getVar('includedir', True)[1:])
errnopath = os.path.join(incpath, 'errno.h')
errnosearch = os.path.join(d.getVar('includedir', True), 'errno.h')
found = find_sysroot_files([errnosearch], d)
if found:
errno_paths = found[0]
with open(errno_paths[0], 'rU') as f:
text = f.read()
with open(errnopath, 'rU') as f:
text = f.read()
lictext = """ The GNU C Library is free software; you can redistribute it and/or
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'