glibc-external: find errno.h via normal sysroot search methods

Signed-off-by: Christopher Larson <kergoth@gmail.com>
This commit is contained in:
Christopher Larson
2015-05-07 11:48:52 -07:00
parent 62d08032c9
commit eab86b4ae0

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'