Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

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