1
0

SConscript 882 B

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