4
0
mirror of https://github.com/RT-Thread/rt-thread.git synced 2025-02-20 20:17:29 +08:00

GetGCCRoot() for usual toolchain dir structures

So don't depend on any special assumptions. See comments in the codes.
This commit is contained in:
hollylee 2019-09-11 09:03:59 +08:00 committed by GitHub
parent 2ed84b61b0
commit 723ca994e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -37,6 +37,24 @@ def GetGCCRoot(rtconfig):
else:
root_path = os.path.join(exec_path, '..', prefix)
# Usually the cross compiling gcc toolchain has directory as:
#
# bin
# lib
# share
# arm-none-eabi
# bin
# include
# lib
# share
prefix = rtconfig.PREFIX
if prefix.endswith('-'):
prefix = prefix[:-1]
fn = os.path.join(root, prefix, 'include', filename)
if os.path.isfile(fn):
return True
return root_path
def CheckHeader(rtconfig, filename):