SConscript 899 B

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