SConscript 744 B

12345678910111213141516171819202122
  1. Import('rtconfig')
  2. from building import *
  3. if GetDepend('RT_USING_NEWLIB') and rtconfig.CROSS_TOOL != 'gcc':
  4. print '================ERROR============================'
  5. print 'Please use GNU GCC compiler if using newlib'
  6. print '================================================='
  7. exit(0)
  8. cwd = GetCurrentDir()
  9. src = Glob('*.c')
  10. CPPPATH = [cwd]
  11. # link with libm in default.
  12. # libm is a frequently used lib. Newlib is compiled with -ffunction-sections in
  13. # recent GCC tool chains. The linker would just link in the functions that have
  14. # been referenced. So setting this won't result in bigger text size.
  15. Env.Append(LIBS = ['m'])
  16. group = DefineGroup('newlib', src, depend = ['RT_USING_NEWLIB'], CPPPATH = CPPPATH)
  17. Return('group')