external-toolchain-angstrom: fix parsing if TOOLCHAIN_PREFIX isn't defined
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
This commit is contained in:
committed by
Koen Kooi
parent
5c91a0ab24
commit
7c710830c2
@@ -138,33 +138,46 @@ DESCRIPTION_gdbserver = "gdb - GNU debugger"
|
||||
|
||||
def ang_get_main_version(d):
|
||||
import os,bb
|
||||
if os.path.exists(bb.data.getVar('TOOLCHAIN_PATH', d, 1)+'/version'):
|
||||
f = open(bb.data.getVar('TOOLCHAIN_PATH', d, 1)+'/version', 'r')
|
||||
tp = bb.data.getVar('TOOLCHAIN_PATH', d, 1)
|
||||
if tp == None:
|
||||
return ""
|
||||
if os.path.exists(tp+'/version'):
|
||||
f = open(tp +'/version', 'r')
|
||||
l = f.readlines();
|
||||
f.close();
|
||||
for s in l:
|
||||
if s.find('Version') > 0:
|
||||
ver = s.split()[2]
|
||||
return ver
|
||||
return None
|
||||
return ""
|
||||
return ""
|
||||
|
||||
def ang_get_gcc_version(d):
|
||||
import subprocess,os,bb
|
||||
if os.path.exists(bb.data.getVar('TOOLCHAIN_PATH', d, 1)+'/bin/'+bb.data.getVar('TARGET_PREFIX', d, 1)+'gcc'):
|
||||
return subprocess.Popen([bb.data.getVar('TOOLCHAIN_PATH', d, 1)+'/bin/'+bb.data.getVar('TARGET_PREFIX', d, 1)+'gcc', '-v'], stderr=subprocess.PIPE).communicate()[1].splitlines()[-1].split()[2]
|
||||
tp = bb.data.getVar('TOOLCHAIN_PATH', d, 1)
|
||||
if tp == None:
|
||||
return ""
|
||||
if os.path.exists(tp+'/bin/'+bb.data.getVar('TARGET_PREFIX', d, 1)+'gcc'):
|
||||
return subprocess.Popen([tp+'/bin/'+bb.data.getVar('TARGET_PREFIX', d, 1)+'gcc', '-v'], stderr=subprocess.PIPE).communicate()[1].splitlines()[-1].split()[2]
|
||||
|
||||
def ang_get_libc_version(d):
|
||||
import os,bb
|
||||
if os.path.exists(bb.data.getVar('TOOLCHAIN_SYSPATH', d, 1)+'/lib/'):
|
||||
for file in os.listdir(bb.data.getVar('TOOLCHAIN_SYSPATH', d, 1)+'/lib/'):
|
||||
tsp = bb.data.getVar('TOOLCHAIN_SYSPATH', d, 1)
|
||||
if tsp == None:
|
||||
return ""
|
||||
if os.path.exists(tsp+'/lib/'):
|
||||
for file in os.listdir(tsp+'/lib/'):
|
||||
if file.find('libc-') == 0:
|
||||
return file[5:-3]
|
||||
return None
|
||||
|
||||
def ang_get_kernel_version(d):
|
||||
import os,bb
|
||||
if os.path.exists(bb.data.getVar('TOOLCHAIN_SYSPATH', d, 1)+'/usr/include/linux/'):
|
||||
f = open(bb.data.getVar('TOOLCHAIN_SYSPATH', d, 1)+'/usr/include/linux/version.h', 'r')
|
||||
tsp = bb.data.getVar('TOOLCHAIN_SYSPATH', d, 1)
|
||||
if tsp == None:
|
||||
return ""
|
||||
if os.path.exists(tsp+'/usr/include/linux/'):
|
||||
f = open(tsp+'/usr/include/linux/version.h', 'r')
|
||||
l = f.readlines();
|
||||
f.close();
|
||||
for s in l:
|
||||
@@ -179,8 +192,11 @@ def ang_get_kernel_version(d):
|
||||
|
||||
def ang_get_gdb_version(d):
|
||||
import subprocess,os,bb
|
||||
if os.path.exists(bb.data.getVar('TOOLCHAIN_PATH', d, 1)+'/bin/'+bb.data.getVar('TARGET_PREFIX', d, 1)+'gdb'):
|
||||
return subprocess.Popen([bb.data.getVar('TOOLCHAIN_PATH', d, 1)+'/bin/'+bb.data.getVar('TARGET_PREFIX', d, 1)+'gdb', '-v'],stdout=subprocess.PIPE).communicate()[0].splitlines()[0].split()[-1]
|
||||
tp = bb.data.getVar('TOOLCHAIN_PATH', d, 1)
|
||||
if tp == None:
|
||||
return ""
|
||||
if os.path.exists(tp+'/bin/'+bb.data.getVar('TARGET_PREFIX', d, 1)+'gdb'):
|
||||
return subprocess.Popen([tp+'/bin/'+bb.data.getVar('TARGET_PREFIX', d, 1)+'gdb', '-v'],stdout=subprocess.PIPE).communicate()[0].splitlines()[0].split()[-1]
|
||||
|
||||
ANG_VER_MAIN := "${@ang_get_main_version(d)}"
|
||||
ANG_VER_GCC := "${@ang_get_gcc_version(d)}"
|
||||
|
||||
Reference in New Issue
Block a user