SConscript 890 B

123456789101112131415161718192021222324252627282930
  1. from building import *
  2. Import('rtconfig')
  3. src = []
  4. cwd = GetCurrentDir()
  5. group = []
  6. CPPPATH = [cwd]
  7. if rtconfig.PLATFORM == 'gcc':
  8. if GetDepend('RT_USING_LIBC'):
  9. CPPDEFINES = ['RT_USING_NEWLIB']
  10. # link with libc and libm:
  11. # libm is a frequently used lib. Newlib is compiled with -ffunction-sections in
  12. # recent GCC tool chains. The linker would just link in the functions that have
  13. # been referenced. So setting this won't result in bigger text size.
  14. LIBS = ['c', 'm']
  15. src += Glob('*.c')
  16. SrcRemove(src, ['minilib.c'])
  17. if GetDepend('RT_USING_MODULE') == False:
  18. SrcRemove(src, ['libc_syms.c'])
  19. else:
  20. src += ['minilib.c']
  21. CPPDEFINES = []
  22. LIBS = []
  23. group = DefineGroup('libc', src, depend = [], CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES, LIBS = LIBS)
  24. Return('group')