SConscript 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. Import('RTT_ROOT')
  2. Import('rtconfig')
  3. from building import *
  4. import os
  5. LUA_VERSION = '5.1.4'
  6. LUA_PATH = 'lua-' + LUA_VERSION
  7. if GetDepend('RT_USING_LUA') and not os.path.exists(LUA_PATH):
  8. print '================ERROR============================'
  9. print 'Please get lua dist and put them under lua folder'
  10. print '================================================='
  11. exit(0)
  12. # core source files
  13. core_src = Split('''
  14. lapi.c
  15. lcode.c
  16. ldebug.c
  17. ldo.c
  18. ldump.c
  19. lfunc.c
  20. lgc.c
  21. llex.c
  22. lmem.c
  23. lobject.c
  24. lopcodes.c
  25. lparser.c
  26. lstate.c
  27. lstring.c
  28. ltable.c
  29. ltm.c
  30. lundump.c
  31. lvm.c
  32. lzio.c
  33. ''')
  34. # library source files
  35. lib_src = Split('''
  36. lauxlib.c
  37. lbaselib.c
  38. ldblib.c
  39. liolib.c
  40. lmathlib.c
  41. loslib.c
  42. ltablib.c
  43. lstrlib.c
  44. loadlib.c
  45. linit.c
  46. ''')
  47. src = core_src + lib_src
  48. for item in range(len(src)):
  49. src[item] = LUA_PATH + '/src/' + src[item]
  50. CPPPATH = [RTT_ROOT + '/components/external/lua/' + LUA_PATH + '/src']
  51. group = DefineGroup('lua', src, depend = ['RT_USING_LUA'], CPPPATH = CPPPATH)
  52. Return('group')