diff options
| author | Man, Jianting (Meco) <[email protected]> | 2023-04-30 00:19:57 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-04-30 12:19:57 +0800 |
| commit | d5800421459bec6cea97d5fc505ffa9b0c16b8e1 (patch) | |
| tree | 13dfce5b5cb06abc89838b1bebda31e052b4332f /tools/gcc.py | |
| parent | 74719aafc8ed6ef6b9ea4ed90094b1663b6e8a26 (diff) | |
[libc] support external third pary libc software package (#7425)
Diffstat (limited to 'tools/gcc.py')
| -rw-r--r-- | tools/gcc.py | 28 |
1 files changed, 4 insertions, 24 deletions
diff --git a/tools/gcc.py b/tools/gcc.py index 905845f825..c82a1e9271 100644 --- a/tools/gcc.py +++ b/tools/gcc.py @@ -67,7 +67,7 @@ def CheckHeader(rtconfig, filename): return False def GetNewLibVersion(rtconfig): - version = 'unknown' + version = None root = GetGCCRoot(rtconfig) if CheckHeader(rtconfig, '_newlib_version.h'): # get version from _newlib_version.h file f = open(os.path.join(root, 'include', '_newlib_version.h'), 'r') @@ -85,33 +85,13 @@ def GetNewLibVersion(rtconfig): f.close() return version -# FIXME: it's not very good -def CheckMUSLLibc(rtconfig): - if 'musl' in rtconfig.PREFIX: - return True - return False - # FIXME: there is no musl version or musl macros can be found officially def GetMuslVersion(rtconfig): - version = 'unknown' - # root = GetGCCRoot(rtconfig) - # print(root) + version = None + if 'musl' in rtconfig.PREFIX: + version = 'unknown' return version -# return libc name and version -def GetGCCLibcNameVersion(rtconfig): - if rtconfig.PLATFORM != 'gcc': - return ('unknown', 'unknown') - - newlib_version = GetNewLibVersion(rtconfig) - if newlib_version != 'unknown': - return ('newlib', newlib_version) # libc: newlib, version: newlib_version - elif CheckMUSLLibc(rtconfig) == True: - GetMuslVersion(rtconfig) - return ('musl', 'unknown') #libc: musl, version: unknown - else: - return ('unknown', 'unknown') # libc: unknown, version: unknown - def GCCResult(rtconfig, str): import subprocess |
