[meta-xilinx] [PATCH] xilinx-versions: Change default main version

Manjukumar Matha manjukumar.harthikote-matha at xilinx.com
Fri Dec 18 17:21:57 PST 2015


Allow CSL_VER_MAIN to be defined in local.conf. 
Fetch libc version correctly from toolchain path

Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha at xilinx.com>
---
 conf/distro/include/xilinx-versions.inc | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/conf/distro/include/xilinx-versions.inc b/conf/distro/include/xilinx-versions.inc
index 4e44f07..6b0ca79 100644
--- a/conf/distro/include/xilinx-versions.inc
+++ b/conf/distro/include/xilinx-versions.inc
@@ -28,7 +28,8 @@ def csl_get_version(d):
 		return 'UNKNOWN'
 
 def csl_get_main_version(d):
-	version = csl_get_version(d)
+	toolchain_version = d.getVar('CSL_VER_MAIN')
+	version = (csl_get_version(d), toolchain_version)[toolchain_version != '']
 	if version != 'UNKNOWN':
 		return version.split()[-1].rstrip(')')
 	else:
@@ -42,6 +43,8 @@ def csl_get_gcc_version(d):
 		return version
 
 def xilinx_get_libc_version(d):
+	import fnmatch
+
 	syspath = d.expand('${EXTERNAL_TOOLCHAIN_SYSROOT}')
 	if not syspath:
 		return 'UNKNOWN'
@@ -51,9 +54,9 @@ def xilinx_get_libc_version(d):
 		libpath = syspath + '/sgxx-glibc/lib/'
 
 	if os.path.exists(libpath):
-		for file in os.listdir(libpath):
-			if file.find('libc-') == 0:
-				return file[5:-3]
+		for root,dirs,files in os.walk(libpath):
+			for filename in fnmatch.filter(files,'libc-*.so'):
+				return filename[5:-3]
 	return 'UNKNOWN'
 
 def xilinx_get_kernel_version(d):
-- 
2.1.4




More information about the meta-xilinx mailing list