Clone of mesa.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

SConscript 3.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. Import('*')
  2. if not env['x11'] or not env['xcb'] or not env['drm']:
  3. Return()
  4. from sys import executable as python_cmd
  5. env = env.Clone()
  6. env.Prepend(CPPPATH = [
  7. '.', # the build/<platform>/glx/ directory
  8. '#include',
  9. '#include/GL/internal',
  10. '#src/mesa',
  11. '#src/mapi',
  12. '#src/mapi/glapi',
  13. #$(LIBDRM_CFLAGS)
  14. #$(DRI2PROTO_CFLAGS)
  15. #$(GLPROTO_CFLAGS)
  16. #$(X11_INCLUDES)
  17. ])
  18. env.Append(CPPDEFINES = [
  19. '_REENTRANT',
  20. #('DEFAULT_DRIVER_DIR', 'DRI_DRIVER_SEARCH_DIR')
  21. ])
  22. env.Prepend(LIBS = [
  23. glapi
  24. ])
  25. env.PkgUseModules('X11')
  26. env.PkgUseModules('XCB')
  27. env.PkgUseModules('DRM')
  28. if env['HAVE_XF86VIDMODE']:
  29. env.Append(CPPDEFINES = ['XF86VIDMODE'])
  30. env.PkgUseModules('XF86VIDMODE')
  31. if False: # XXX: SHARED_GLAPI
  32. env.Append(CPPDEFINES = ['GLX_SHARED_GLAPI'])
  33. sources = [
  34. 'clientattrib.c',
  35. 'clientinfo.c',
  36. 'create_context.c',
  37. 'compsize.c',
  38. 'eval.c',
  39. 'glx_error.c',
  40. 'glxconfig.c',
  41. 'glxcmds.c',
  42. 'glxcurrent.c',
  43. 'glxext.c',
  44. 'glxextensions.c',
  45. 'indirect_glx.c',
  46. 'indirect.c',
  47. 'indirect_init.c',
  48. 'indirect_size.c',
  49. 'indirect_window_pos.c',
  50. 'indirect_texture_compression.c',
  51. 'indirect_transpose_matrix.c',
  52. 'indirect_vertex_array.c',
  53. 'indirect_vertex_program.c',
  54. 'pixel.c',
  55. 'pixelstore.c',
  56. 'render2.c',
  57. 'renderpix.c',
  58. 'single2.c',
  59. 'singlepix.c',
  60. 'vertarr.c',
  61. 'xfont.c',
  62. 'glx_pbuffer.c',
  63. 'glx_query.c',
  64. 'drisw_glx.c',
  65. 'dri_common.c',
  66. 'dri_glx.c',
  67. 'XF86dri.c',
  68. 'glxhash.c',
  69. 'dri2_glx.c',
  70. 'dri2.c',
  71. 'applegl_glx.c',
  72. ]
  73. libgl = env.SharedLibrary(
  74. target ='GL',
  75. source = sources,
  76. )
  77. # Generate GLX-specific .c and .h files here. Other GL API-related
  78. # files are used, but they're generated in mapi/glapi/gen/ since they're
  79. # used by other targets as well.
  80. GLAPI = '#src/mapi/glapi/'
  81. env.CodeGenerate(
  82. target = 'indirect.c',
  83. script = GLAPI + 'gen/glX_proto_send.py',
  84. source = GLAPI + 'gen/gl_and_es_API.xml',
  85. command = python_cmd + ' $SCRIPT -f $SOURCE -m proto > $TARGET'
  86. )
  87. env.CodeGenerate(
  88. target = 'indirect_size.c',
  89. script = GLAPI + 'gen/glX_proto_size.py',
  90. source = GLAPI + 'gen/gl_API.xml',
  91. command = python_cmd + ' $SCRIPT -f $SOURCE -m size_c --only-set > $TARGET'
  92. )
  93. env.CodeGenerate(
  94. target = 'indirect_init.c',
  95. script = GLAPI + 'gen/glX_proto_send.py',
  96. source = GLAPI + 'gen/gl_API.xml',
  97. command = python_cmd + ' $SCRIPT -f $SOURCE -m init_c > $TARGET'
  98. )
  99. env.CodeGenerate(
  100. target = 'indirect_size.h',
  101. script = GLAPI + 'gen/glX_proto_size.py',
  102. source = GLAPI + 'gen/gl_API.xml',
  103. command = python_cmd + ' $SCRIPT -f $SOURCE -m size_h --only-set -h _INDIRECT_SIZE_H > $TARGET'
  104. )
  105. env.CodeGenerate(
  106. target = 'indirect.h',
  107. script = GLAPI + 'gen/glX_proto_send.py',
  108. source = GLAPI + 'gen/gl_API.xml',
  109. command = python_cmd + ' $SCRIPT -m init_h -f $SOURCE > $TARGET',
  110. )
  111. libgl = env.InstallSharedLibrary(libgl, version=(1, 2))
  112. env.Alias('glx', libgl)
  113. env.Alias('libgl', libgl)