SConscript 864 B

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