SConscript 875 B

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