From 290678b66576e9adaaa338f0e110ce17535bd262 Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Sun, 20 Aug 2023 13:12:37 -0400 Subject: [PATCH] [tools][gcc] remove legacy functions - GenerateGCCConfig - GenCconfigFile --- tools/building.py | 31 ------------------------------- tools/gcc.py | 46 ---------------------------------------------- 2 files changed, 77 deletions(-) diff --git a/tools/building.py b/tools/building.py index 13a7b48270..d274a45b12 100644 --- a/tools/building.py +++ b/tools/building.py @@ -121,34 +121,6 @@ class Win32Spawn: return proc.wait() -# 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'): - # import gcc - # gcc.GenerateGCCConfig(rtconfig) - - # # try again - # if os.path.isfile('cconfig.h'): - # f = open('cconfig.h', 'r') - # if f: - # contents = f.read() - # f.close() - - # prep = PatchedPreProcessor() - # prep.process_contents(contents) - # options = prep.cpp_namespace - - # BuildOptions.update(options) - - # # add HAVE_CCONFIG_H definition - # env.AppendUnique(CPPDEFINES = ['HAVE_CCONFIG_H']) - pass - def PrepareBuilding(env, root_directory, has_libcpu=False, remove_components = []): global BuildOptions @@ -312,9 +284,6 @@ def PrepareBuilding(env, root_directory, has_libcpu=False, remove_components = [ # found or something like that). rtconfig.POST_ACTION = '' - # generate cconfig.h file - GenCconfigFile(env, BuildOptions) - # auto append '_REENT_SMALL' when using newlib 'nano.specs' option if rtconfig.PLATFORM in ['gcc'] and str(env['LINKFLAGS']).find('nano.specs') != -1: env.AppendUnique(CPPDEFINES = ['_REENT_SMALL']) diff --git a/tools/gcc.py b/tools/gcc.py index c82a1e9271..390fd2868e 100644 --- a/tools/gcc.py +++ b/tools/gcc.py @@ -177,49 +177,3 @@ def GCCResult(rtconfig, str): os.remove('__tmp.c') return result - -def GenerateGCCConfig(rtconfig): - # 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. - - # 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 \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 \n' - # cc_header += '#define HAVE_SYS_SIGNAL_H 1\n' - # if CheckHeader(rtconfig, 'sys/select.h'): - # str += '#include \n' - # cc_header += '#define HAVE_SYS_SELECT_H 1\n' - # if CheckHeader(rtconfig, 'pthread.h'): - # str += "#include \n" - # cc_header += '#define HAVE_PTHREAD_H 1\n' - - # # if CheckHeader(rtconfig, 'sys/dirent.h'): - # # str += '#include \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_file = open('cconfig.h', 'w') - # if cc_file: - # cc_file.write(cc_header) - # cc_file.close() - pass