detect.py 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. import os
  2. import sys
  3. def is_active():
  4. return True
  5. def get_name():
  6. return "Haiku"
  7. def can_build():
  8. if (os.name != "posix"):
  9. return False
  10. if (sys.platform == "darwin"):
  11. return False
  12. return True
  13. def get_opts():
  14. return []
  15. def get_flags():
  16. return [
  17. ('builtin_zlib', 'no')
  18. ]
  19. def configure(env):
  20. is64=sys.maxsize > 2**32
  21. if (env["bits"]=="default"):
  22. if (is64):
  23. env["bits"]="64"
  24. else:
  25. env["bits"]="32"
  26. env.Append(CPPPATH = ['#platform/haiku'])
  27. # TODO: add clang and try gcc2 too
  28. env["CC"] = "gcc-x86"
  29. env["CXX"] = "g++-x86"
  30. if (env["target"]=="release"):
  31. if (env["debug_release"]=="yes"):
  32. env.Append(CCFLAGS=['-g2','-fomit-frame-pointer'])
  33. else:
  34. env.Append(CCFLAGS=['-O2','-ffast-math','-fomit-frame-pointer'])
  35. elif (env["target"]=="release_debug"):
  36. env.Append(CCFLAGS=['-O2','-ffast-math','-DDEBUG_ENABLED'])
  37. elif (env["target"]=="debug"):
  38. env.Append(CCFLAGS=['-g2', '-Wall','-DDEBUG_ENABLED','-DDEBUG_MEMORY_ENABLED'])
  39. #env.Append(CCFLAGS=['-DFREETYPE_ENABLED'])
  40. env.Append(CPPFLAGS = ['-DOPENGL_ENABLED'])
  41. env.Append(CPPFLAGS = ['-DUNIX_ENABLED', '-DGLES2_ENABLED', '-DGLES_OVER_GL'])
  42. env.Append(LIBS = ['be', 'GL', 'GLEW', 'z', 'network', 'bnetapi'])
  43. import methods
  44. env.Append(BUILDERS = {'GLSL120' : env.Builder(action = methods.build_legacygl_headers, suffix = 'glsl.h',src_suffix = '.glsl')})
  45. env.Append(BUILDERS = {'GLSL' : env.Builder(action = methods.build_glsl_headers, suffix = 'glsl.h',src_suffix = '.glsl')})
  46. env.Append(BUILDERS = {'GLSL120GLES' : env.Builder(action = methods.build_gles2_headers, suffix = 'glsl.h',src_suffix = '.glsl')})