detect.py 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. import os
  2. import sys
  3. import string
  4. def is_active():
  5. return True
  6. def get_name():
  7. return "Flash"
  8. def can_build():
  9. #import os
  10. print(os.environ)
  11. if (not os.environ.has_key("FLASCC_ROOT")):
  12. return False
  13. return True
  14. def get_opts():
  15. return []
  16. def get_flags():
  17. return [
  18. ('lua', 'no'),
  19. ('tools', 'no'),
  20. ('nedmalloc', 'no'),
  21. ('theora', 'no'),
  22. ('squirrel', 'yes'),
  23. ('gdscript', 'yes'),
  24. ('minizip', 'no'),
  25. ('vorbis', 'yes'),
  26. ('squish', 'yes'),
  27. ('speex', 'yes'),
  28. ('xml', 'yes'),
  29. ('png', 'yes'),
  30. ('jpg', 'yes'),
  31. ('webp', 'yes'),
  32. ('dds', 'yes'),
  33. ('pvr', 'yes'),
  34. ('musepack', 'yes'),
  35. ('default_gui_theme', 'yes'),
  36. ('old_scenes', 'no'),
  37. ]
  38. def configure(env):
  39. ccroot = os.environ["FLASCC_ROOT"]
  40. if (ccroot.find("/cygdrive")==0):
  41. unit = ccroot[ ccroot.find("/") + 1 ]
  42. ccroot=ccroot.replace("/cygdrive/"+unit,unit+":")
  43. env['FLASCC_ROOT'] = ccroot
  44. if env['PLATFORM'] == 'win32':
  45. import methods
  46. env.Tool('mingw')
  47. #env['SPAWN'] = methods.win32_spawn
  48. env['ENV']['PATH'] = os.environ["PATH"];
  49. env.PrependENVPath('PATH', env['FLASCC_ROOT']+'/usr/bin')
  50. #os.environ['PATH'] = env['ENV']['PATH']
  51. env.Append(CPPPATH=['#platform/flash', '#platform/flash/include'])
  52. env.Append(LIBPATH=['#platform/flash/lib'])
  53. env['CC'] = ccroot+'/sdk/usr/bin/gcc'
  54. env['CXX'] = ccroot+'/sdk/usr/bin/g++'
  55. env['AR'] = ccroot+'/sdk/usr/bin/ar'
  56. env['LINK'] = ccroot+'/sdk/usr/bin/gcc'
  57. env['OBJSUFFIX'] = ".fl.o"
  58. env['LIBSUFFIX'] = ".fl.a"
  59. env['PROGSUFFIX'] = "_flash"
  60. #env["CXX"]='gcc-4'
  61. import string
  62. #include path
  63. env['CCFLAGS'] = string.split('-fno-strict-aliasing -fno-rtti -fno-common -finline-limit=30000 -fno-exceptions -DNO_SAFE_CAST -DNO_THREADS -DNO_NETWORK -DNO_STATVFS')
  64. #env.Append(LDPATH=[ld_path])
  65. env.Append(LIBS=['m', 'Flash++', 'AS3++', 'GL'])
  66. env.Append(LINKFLAGS=['-symbol-abc=platform/flash/Console.abc'])
  67. #env["LINKFLAGS"]= string.split(" -g --sysroot="+ld_sysroot+" -Wl,--no-undefined -Wl,-z,noexecstack -lsupc++ ")
  68. #env.Append(CXXFLAGS=['-fno-access-control'])
  69. if (env["target"]=="release"):
  70. env.Append(CCFLAGS=['-O4', '-ffast-math','-fomit-frame-pointer'])
  71. env['OBJSUFFIX'] = ".fo.o"
  72. env['LIBSUFFIX'] = ".fo.a"
  73. env['PROGSUFFIX'] = "_opt_flash"
  74. elif (env["target"]=="debug"):
  75. env.Append(CCFLAGS=['-D_DEBUG', '-g0', '-Wall', '-O0', '-DDEBUG_ENABLED'])
  76. env.Append(CPPFLAGS=['-DDEBUG_MEMORY_ALLOC'])
  77. env.Append(CPPFLAGS=['-DFLASH_ENABLED', '-DGLES1_ENABLED', '-DNO_FCNTL', '-DUNIX_ENABLED'])
  78. # env.Append(CPPFLAGS=['-DANDROID_ENABLED', '-DUNIX_ENABLED','-DMPC_FIXED_POINT'])