[tools] support LLVMEmbeddedToolchainForArm-17.0.1
This commit is contained in:
parent
d01dd05a0c
commit
21facce472
|
@ -34,9 +34,9 @@ def GetLLVM_ARMRoot(rtconfig):
|
||||||
|
|
||||||
def CheckHeader(rtconfig, filename):
|
def CheckHeader(rtconfig, filename):
|
||||||
root = GetLLVM_ARMRoot(rtconfig)
|
root = GetLLVM_ARMRoot(rtconfig)
|
||||||
config = re.findall(r"--config (.*)\.cfg", rtconfig.CFLAGS)
|
if os.path.isdir(root):
|
||||||
if config:
|
for config in os.listdir(root):
|
||||||
fn = os.path.join(root, config[0], 'include', filename)
|
fn = os.path.join(root, config, 'include', filename)
|
||||||
if os.path.isfile(fn):
|
if os.path.isfile(fn):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
@ -46,8 +46,8 @@ def GetPicoLibcVersion(rtconfig):
|
||||||
version = None
|
version = None
|
||||||
root = GetLLVM_ARMRoot(rtconfig)
|
root = GetLLVM_ARMRoot(rtconfig)
|
||||||
if CheckHeader(rtconfig, 'picolibc.h'): # get version from picolibc.h file
|
if CheckHeader(rtconfig, 'picolibc.h'): # get version from picolibc.h file
|
||||||
config = re.findall(r"--config (.*)\.cfg", rtconfig.CFLAGS)
|
for config in os.listdir(root):
|
||||||
fn = os.path.join(root, config[0], 'include', 'picolibc.h')
|
fn = os.path.join(root, config, 'include', 'picolibc.h')
|
||||||
f = open(fn, 'r')
|
f = open(fn, 'r')
|
||||||
if f:
|
if f:
|
||||||
for line in f:
|
for line in f:
|
||||||
|
@ -55,3 +55,4 @@ def GetPicoLibcVersion(rtconfig):
|
||||||
version = re.search(r'\"([^"]+)\"', line).groups()[0]
|
version = re.search(r'\"([^"]+)\"', line).groups()[0]
|
||||||
f.close()
|
f.close()
|
||||||
return version
|
return version
|
||||||
|
return version
|
||||||
|
|
Loading…
Reference in New Issue