SConscript 811 B

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