SConscript 867 B

1234567891011121314151617181920212223242526272829
  1. from building import *
  2. Import('rtconfig')
  3. src = Glob('*.c')
  4. cwd = GetCurrentDir()
  5. group = []
  6. CPPPATH = [cwd]
  7. CPPDEFINES = []
  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. LIBS = []
  18. elif not GetDepend('RT_USING_NEWLIB'):
  19. # RT_USING_NEWLIB is defined already
  20. CPPDEFINES = ['RT_USING_NEWLIB']
  21. group = DefineGroup('newlib', src, depend = ['RT_USING_LIBC'],
  22. CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES, LIBS = LIBS)
  23. Return('group')