1
0

SConscript 847 B

12345678910111213141516171819202122232425262728293031323334
  1. import os
  2. from building import *
  3. from gcc import *
  4. Import('rtconfig')
  5. src = []
  6. cwd = GetCurrentDir()
  7. group = []
  8. LIBS = ['m'] # link libm
  9. CPPPATH = [cwd]
  10. if rtconfig.PLATFORM == 'gcc':
  11. if GetDepend('RT_USING_LIBC'):
  12. LIBS += ['c'] # link libc
  13. src += Glob('*.c')
  14. else:
  15. src += ['syscalls.c']
  16. #report newlib version
  17. print('Newlib version:' + GetNewLibVersion(rtconfig))
  18. # identify this is Newlib, and only enable POSIX.1-1990
  19. CPPDEFINES = ['RT_USING_NEWLIB', '_POSIX_C_SOURCE=1']
  20. group = DefineGroup('libc', src, depend = [], CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES, LIBS = LIBS)
  21. list = os.listdir(cwd)
  22. for d in list:
  23. path = os.path.join(cwd, d)
  24. if os.path.isfile(os.path.join(path, 'SConscript')):
  25. group = group + SConscript(os.path.join(d, 'SConscript'))
  26. Return('group')