summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernard Xiong <[email protected]>2020-02-08 11:51:26 +0800
committerGitHub <[email protected]>2020-02-08 11:51:26 +0800
commit4cffe19dfe04f30fff2bf623e840c44f45ed418c (patch)
tree3f08fe235b7a5a4976ee612cd8b9775b69d37f44
parent57ff16edb926948c647e3ec7b6f9eccf186cf98f (diff)
parent835504ed956bd6528cbd473ae2fe4b0f650c7188 (diff)
Merge pull request #3364 from BernardXiong/gcc_version
[Tools] rename GCC_VERSION to GCC_VERSION_STR
-rw-r--r--tools/gcc.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/tools/gcc.py b/tools/gcc.py
index 2e29c8f34b..8c9685d52b 100644
--- a/tools/gcc.py
+++ b/tools/gcc.py
@@ -23,7 +23,7 @@
import os
import re
-import platform
+import platform
def GetGCCRoot(rtconfig):
exec_path = rtconfig.EXEC_PATH
@@ -63,7 +63,7 @@ def CheckHeader(rtconfig, filename):
fn = os.path.join(root, prefix, 'include', filename)
if os.path.isfile(fn):
return True
-
+
return False
def GetNewLibVersion(rtconfig):
@@ -98,18 +98,18 @@ def GCCResult(rtconfig, str):
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')
if f:
f.write(str)
f.close()
- # '-fdirectives-only',
+ # '-fdirectives-only',
if(platform.system() == 'Windows'):
child = subprocess.Popen([gcc_cmd, '-E', '-P', '__tmp.c'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
else:
child = subprocess.Popen(gcc_cmd + ' -E -P __tmp.c', stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
-
+
stdout, stderr = child.communicate()
# print(stdout)
@@ -148,7 +148,7 @@ def GCCResult(rtconfig, str):
if re.findall('pthread_create', line):
posix_thread = 1
-
+
if have_fdset:
result += '#define HAVE_FDSET 1\n'
@@ -162,7 +162,7 @@ def GCCResult(rtconfig, str):
result += '#define HAVE_SIGVAL 1\n'
if version:
- result += '#define GCC_VERSION "%s"\n' % version
+ result += '#define GCC_VERSION_STR "%s"\n' % version
result += '#define STDC "%s"\n' % stdc