[Tools] rename GCC_VERSION to GCC_VERSION_STR
This commit is contained in:
parent
cd8dd40cd2
commit
835504ed95
14
tools/gcc.py
14
tools/gcc.py
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import platform
|
import platform
|
||||||
|
|
||||||
def GetGCCRoot(rtconfig):
|
def GetGCCRoot(rtconfig):
|
||||||
exec_path = rtconfig.EXEC_PATH
|
exec_path = rtconfig.EXEC_PATH
|
||||||
|
@ -63,7 +63,7 @@ def CheckHeader(rtconfig, filename):
|
||||||
fn = os.path.join(root, prefix, 'include', filename)
|
fn = os.path.join(root, prefix, 'include', filename)
|
||||||
if os.path.isfile(fn):
|
if os.path.isfile(fn):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def GetNewLibVersion(rtconfig):
|
def GetNewLibVersion(rtconfig):
|
||||||
|
@ -98,18 +98,18 @@ def GCCResult(rtconfig, str):
|
||||||
|
|
||||||
gcc_cmd = os.path.join(rtconfig.EXEC_PATH, rtconfig.CC)
|
gcc_cmd = os.path.join(rtconfig.EXEC_PATH, rtconfig.CC)
|
||||||
|
|
||||||
# use temp file to get more information
|
# use temp file to get more information
|
||||||
f = open('__tmp.c', 'w')
|
f = open('__tmp.c', 'w')
|
||||||
if f:
|
if f:
|
||||||
f.write(str)
|
f.write(str)
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
# '-fdirectives-only',
|
# '-fdirectives-only',
|
||||||
if(platform.system() == 'Windows'):
|
if(platform.system() == 'Windows'):
|
||||||
child = subprocess.Popen([gcc_cmd, '-E', '-P', '__tmp.c'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
|
child = subprocess.Popen([gcc_cmd, '-E', '-P', '__tmp.c'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
|
||||||
else:
|
else:
|
||||||
child = subprocess.Popen(gcc_cmd + ' -E -P __tmp.c', stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
|
child = subprocess.Popen(gcc_cmd + ' -E -P __tmp.c', stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
|
||||||
|
|
||||||
stdout, stderr = child.communicate()
|
stdout, stderr = child.communicate()
|
||||||
|
|
||||||
# print(stdout)
|
# print(stdout)
|
||||||
|
@ -148,7 +148,7 @@ def GCCResult(rtconfig, str):
|
||||||
|
|
||||||
if re.findall('pthread_create', line):
|
if re.findall('pthread_create', line):
|
||||||
posix_thread = 1
|
posix_thread = 1
|
||||||
|
|
||||||
if have_fdset:
|
if have_fdset:
|
||||||
result += '#define HAVE_FDSET 1\n'
|
result += '#define HAVE_FDSET 1\n'
|
||||||
|
|
||||||
|
@ -162,7 +162,7 @@ def GCCResult(rtconfig, str):
|
||||||
result += '#define HAVE_SIGVAL 1\n'
|
result += '#define HAVE_SIGVAL 1\n'
|
||||||
|
|
||||||
if version:
|
if version:
|
||||||
result += '#define GCC_VERSION "%s"\n' % version
|
result += '#define GCC_VERSION_STR "%s"\n' % version
|
||||||
|
|
||||||
result += '#define STDC "%s"\n' % stdc
|
result += '#define STDC "%s"\n' % stdc
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue