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 2.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. #######################################################################
  2. # SConscript for glapi
  3. Import('*')
  4. if env['platform'] != 'winddk':
  5. env = env.Clone()
  6. env.Append(CPPDEFINES = [
  7. 'MAPI_GLAPI_CURRENT',
  8. ])
  9. if env['platform'] == 'windows':
  10. env.Append(CPPDEFINES = [
  11. '_GDI32_', # prevent gl* being declared __declspec(dllimport) in MS headers
  12. 'BUILD_GL32', # declare gl* as __declspec(dllexport) in Mesa headers
  13. 'WIN32_THREADS', # use Win32 thread API
  14. ])
  15. env.Append(CPPPATH = [
  16. '#/src/mapi',
  17. '#/src/mesa',
  18. ])
  19. glapi_sources = [
  20. 'glapi_dispatch.c',
  21. 'glapi_entrypoint.c',
  22. 'glapi_getproc.c',
  23. 'glapi_nop.c',
  24. 'glthread.c',
  25. ]
  26. mapi_sources = [
  27. 'u_current.c',
  28. 'u_execmem.c',
  29. 'u_thread.c',
  30. ]
  31. for s in mapi_sources:
  32. o = env.SharedObject(s[:-2], '../mapi/' + s)
  33. glapi_sources.append(o)
  34. #
  35. # Assembly sources
  36. #
  37. if env['gcc'] and env['platform'] != 'windows':
  38. if env['machine'] == 'x86':
  39. env.Append(CPPDEFINES = [
  40. 'USE_X86_ASM',
  41. 'USE_MMX_ASM',
  42. 'USE_3DNOW_ASM',
  43. 'USE_SSE_ASM',
  44. ])
  45. glapi_sources += [
  46. 'glapi_x86.S',
  47. ]
  48. elif env['machine'] == 'x86_64':
  49. env.Append(CPPDEFINES = [
  50. 'USE_X86_64_ASM',
  51. ])
  52. glapi_sources += [
  53. 'glapi_x86-64.S'
  54. ]
  55. elif env['machine'] == 'ppc':
  56. env.Append(CPPDEFINES = [
  57. 'USE_PPC_ASM',
  58. 'USE_VMX_ASM',
  59. ])
  60. glapi_sources += [
  61. ]
  62. elif env['machine'] == 'sparc':
  63. glapi_sources += [
  64. 'glapi_sparc.S'
  65. ]
  66. else:
  67. pass
  68. glapi = env.ConvenienceLibrary(
  69. target = 'glapi',
  70. source = glapi_sources,
  71. )
  72. Export('glapi')