diff options
| author | 朱天龙 (Armink) <[email protected]> | 2023-04-05 20:48:12 +0800 |
|---|---|---|
| committer | Man, Jianting (Meco) <[email protected]> | 2023-04-05 08:54:43 -0400 |
| commit | 00a6d1a1c5ac87f5ccbbb6986e6c1be9d67ee214 (patch) | |
| tree | f9931f465d278daa1a2b977ad0a96d46aeeabdd0 | |
| parent | 5c70c9e402fe3c57f6133575d645c503df10d941 (diff) | |
[tools] update the comment for old gen cconfig.h code.
| -rw-r--r-- | tools/building.py | 4 | ||||
| -rw-r--r-- | tools/gcc.py | 69 |
2 files changed, 37 insertions, 36 deletions
diff --git a/tools/building.py b/tools/building.py index 1bfff2c2ce..fc86f31e7e 100644 --- a/tools/building.py +++ b/tools/building.py @@ -123,7 +123,9 @@ class Win32Spawn: # generate cconfig.h file def GenCconfigFile(env, BuildOptions): - + # The cconfig.h will NOT generate in the lastest RT-Thread code. + # When you want to use it, you can uncomment out the following code. + # if rtconfig.PLATFORM in ['gcc']: # contents = '' # if not os.path.isfile('cconfig.h'): diff --git a/tools/gcc.py b/tools/gcc.py index 78f0b7afc5..d806e6f3f0 100644 --- a/tools/gcc.py +++ b/tools/gcc.py @@ -199,44 +199,43 @@ def GCCResult(rtconfig, str): return result def GenerateGCCConfig(rtconfig): - # str = '' - # cc_header = '' - # cc_header += '#ifndef CCONFIG_H__\n' - # cc_header += '#define CCONFIG_H__\n' - # cc_header += '/* Automatically generated file; DO NOT EDIT. */\n' - # cc_header += '/* compiler configure file for RT-Thread in GCC*/\n\n' + str = '' + cc_header = '' + cc_header += '#ifndef CCONFIG_H__\n' + cc_header += '#define CCONFIG_H__\n' + cc_header += '/* Automatically generated file; DO NOT EDIT. */\n' + cc_header += '/* compiler configure file for RT-Thread in GCC*/\n\n' - # if CheckHeader(rtconfig, 'newlib.h'): - # str += '#include <newlib.h>\n' - # cc_header += '#define HAVE_NEWLIB_H 1\n' - # cc_header += '#define LIBC_VERSION "newlib %s"\n\n' % GetNewLibVersion(rtconfig) + if CheckHeader(rtconfig, 'newlib.h'): + str += '#include <newlib.h>\n' + cc_header += '#define HAVE_NEWLIB_H 1\n' + cc_header += '#define LIBC_VERSION "newlib %s"\n\n' % GetNewLibVersion(rtconfig) - # if CheckHeader(rtconfig, 'sys/signal.h'): - # str += '#include <sys/signal.h>\n' - # cc_header += '#define HAVE_SYS_SIGNAL_H 1\n' - # if CheckHeader(rtconfig, 'sys/select.h'): - # str += '#include <sys/select.h>\n' - # cc_header += '#define HAVE_SYS_SELECT_H 1\n' - # if CheckHeader(rtconfig, 'pthread.h'): - # str += "#include <pthread.h>\n" - # cc_header += '#define HAVE_PTHREAD_H 1\n' + if CheckHeader(rtconfig, 'sys/signal.h'): + str += '#include <sys/signal.h>\n' + cc_header += '#define HAVE_SYS_SIGNAL_H 1\n' + if CheckHeader(rtconfig, 'sys/select.h'): + str += '#include <sys/select.h>\n' + cc_header += '#define HAVE_SYS_SELECT_H 1\n' + if CheckHeader(rtconfig, 'pthread.h'): + str += "#include <pthread.h>\n" + cc_header += '#define HAVE_PTHREAD_H 1\n' - # # if CheckHeader(rtconfig, 'sys/dirent.h'): - # # str += '#include <sys/dirent.h>\n' + # if CheckHeader(rtconfig, 'sys/dirent.h'): + # str += '#include <sys/dirent.h>\n' - # # add some common features - # str += 'const char* version = __VERSION__;\n' - # str += 'const int iso_c_visible = __ISO_C_VISIBLE;\n' - # str += '\n#ifdef HAVE_INITFINI_ARRAY\n' - # str += 'const int init_fini_array = HAVE_INITFINI_ARRAY;\n' - # str += '#endif\n' + # add some common features + str += 'const char* version = __VERSION__;\n' + str += 'const int iso_c_visible = __ISO_C_VISIBLE;\n' + str += '\n#ifdef HAVE_INITFINI_ARRAY\n' + str += 'const int init_fini_array = HAVE_INITFINI_ARRAY;\n' + str += '#endif\n' - # cc_header += '\n' - # cc_header += GCCResult(rtconfig, str) - # cc_header += '\n#endif\n' + cc_header += '\n' + cc_header += GCCResult(rtconfig, str) + cc_header += '\n#endif\n' - # cc_file = open('cconfig.h', 'w') - # if cc_file: - # cc_file.write(cc_header) - # cc_file.close() - pass + cc_file = open('cconfig.h', 'w') + if cc_file: + cc_file.write(cc_header) + cc_file.close() |
