Files
third_party_mesa3d/src/mapi/glapi/SConscript
Chia-I Wu bb770af3a5 scons: Add support for GLES.
GLES can be enabled by running scons with

  $ scons gles=yes

When gles=yes is given, the build is changed in three ways.  First,
libmesa.a will be built with FEATURE_ES1 and FEATURE_ES2.  This makes
DRI drivers and libEGL support and advertise GLES support.  Second, GLES
libraries will be created.  They are libGLESv1_CM, libGLESv2, and
libglapi.  Last, libGL or opengl32 will link to libglapi.  This change
is required as _glapi_* will be declared as __declspec(dllimport) in
libmesa.a on windows.  libmesa.a expects those symbols to be defined in
another DLL.  Due to this change to GL, GLES support is marked
experimental.

Note that GLES requires libxml2-python to generate some of its sources.
2011-01-22 11:59:05 +08:00

89 lines
2.2 KiB
Python

#######################################################################
# SConscript for glapi
Import('*')
if env['platform'] != 'winddk':
env = env.Clone()
env.Append(CPPDEFINES = [
'MAPI_MODE_UTIL',
])
if env['platform'] == 'windows':
env.Append(CPPDEFINES = [
'_GDI32_', # prevent gl* being declared __declspec(dllimport) in MS headers
'BUILD_GL32', # declare gl* as __declspec(dllexport) in Mesa headers
])
if env['gles']:
env.Append(CPPDEFINES = ['_GLAPI_DLL_EXPORTS'])
else:
# prevent _glapi_* from being declared __declspec(dllimport)
env.Append(CPPDEFINES = ['_GLAPI_NO_EXPORTS'])
env.Append(CPPPATH = [
'#/src/mapi',
'#/src/mesa',
])
glapi_sources = [
'glapi_dispatch.c',
'glapi_entrypoint.c',
'glapi_getproc.c',
'glapi_nop.c',
'glthread.c',
'glapi.c',
]
mapi_sources = [
'u_current.c',
'u_execmem.c',
'u_thread.c',
]
for s in mapi_sources:
o = env.SharedObject(s[:-2], '../mapi/' + s)
glapi_sources.append(o)
#
# Assembly sources
#
if env['gcc'] and env['platform'] != 'windows':
if env['machine'] == 'x86':
env.Append(CPPDEFINES = [
'USE_X86_ASM',
'USE_MMX_ASM',
'USE_3DNOW_ASM',
'USE_SSE_ASM',
])
glapi_sources += [
'glapi_x86.S',
]
elif env['machine'] == 'x86_64':
env.Append(CPPDEFINES = [
'USE_X86_64_ASM',
])
glapi_sources += [
'glapi_x86-64.S'
]
elif env['machine'] == 'ppc':
env.Append(CPPDEFINES = [
'USE_PPC_ASM',
'USE_VMX_ASM',
])
glapi_sources += [
]
elif env['machine'] == 'sparc':
glapi_sources += [
'glapi_sparc.S'
]
else:
pass
glapi = env.ConvenienceLibrary(
target = 'glapi',
source = glapi_sources,
)
Export('glapi')