2010-04-26 05:56:44 +01:00
|
|
|
#######################################################################
|
2010-05-31 03:52:23 +01:00
|
|
|
# SConscript for glapi
|
2010-04-26 05:56:44 +01:00
|
|
|
|
|
|
|
|
|
|
|
Import('*')
|
|
|
|
|
|
|
|
if env['platform'] != 'winddk':
|
|
|
|
|
2010-11-01 13:30:22 +00:00
|
|
|
env = env.Clone()
|
|
|
|
|
|
|
|
env.Append(CPPDEFINES = [
|
2010-12-10 19:27:54 +00:00
|
|
|
'MAPI_MODE_UTIL',
|
2010-11-01 13:30:22 +00:00
|
|
|
])
|
2010-04-23 09:06:26 +01:00
|
|
|
|
2010-11-01 13:30:22 +00:00
|
|
|
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
|
|
|
|
])
|
2011-01-14 09:50:29 +00:00
|
|
|
if env['gles']:
|
|
|
|
env.Append(CPPDEFINES = ['_GLAPI_DLL_EXPORTS'])
|
|
|
|
else:
|
|
|
|
# prevent _glapi_* from being declared __declspec(dllimport)
|
|
|
|
env.Append(CPPDEFINES = ['_GLAPI_NO_EXPORTS'])
|
2010-05-31 03:52:23 +01:00
|
|
|
|
2010-11-01 13:30:22 +00:00
|
|
|
env.Append(CPPPATH = [
|
|
|
|
'#/src/mapi',
|
|
|
|
'#/src/mesa',
|
|
|
|
])
|
|
|
|
|
|
|
|
glapi_sources = [
|
|
|
|
'glapi_dispatch.c',
|
|
|
|
'glapi_entrypoint.c',
|
|
|
|
'glapi_getproc.c',
|
|
|
|
'glapi_nop.c',
|
|
|
|
'glthread.c',
|
2010-12-10 09:14:04 +00:00
|
|
|
'glapi.c',
|
2010-11-01 13:30:22 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
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)
|
2010-04-23 09:06:26 +01:00
|
|
|
|
2010-11-01 13:30:22 +00:00
|
|
|
#
|
|
|
|
# Assembly sources
|
|
|
|
#
|
|
|
|
if env['gcc'] and env['platform'] != 'windows':
|
|
|
|
if env['machine'] == 'x86':
|
|
|
|
env.Append(CPPDEFINES = [
|
2011-06-17 19:23:06 +01:00
|
|
|
'USE_X86_ASM',
|
2010-11-01 13:30:22 +00:00
|
|
|
])
|
|
|
|
glapi_sources += [
|
|
|
|
'glapi_x86.S',
|
|
|
|
]
|
|
|
|
elif env['machine'] == 'x86_64':
|
|
|
|
env.Append(CPPDEFINES = [
|
2011-06-17 19:23:06 +01:00
|
|
|
'USE_X86_64_ASM',
|
2010-11-01 13:30:22 +00:00
|
|
|
])
|
|
|
|
glapi_sources += [
|
|
|
|
'glapi_x86-64.S'
|
|
|
|
]
|
2011-06-17 19:23:06 +01:00
|
|
|
elif env['machine'] == 'sparc':
|
2010-11-01 13:30:22 +00:00
|
|
|
env.Append(CPPDEFINES = [
|
2011-06-17 19:23:06 +01:00
|
|
|
'USE_SPARC_ASM',
|
2010-11-01 13:30:22 +00:00
|
|
|
])
|
|
|
|
glapi_sources += [
|
|
|
|
'glapi_sparc.S'
|
|
|
|
]
|
|
|
|
else:
|
|
|
|
pass
|
|
|
|
|
2011-08-25 23:50:56 +01:00
|
|
|
if env['toolchain'] == 'crossmingw':
|
|
|
|
# compile these files without -gstabs option
|
|
|
|
glapi_sources = env.compile_without_gstabs(glapi_sources, "glapi_dispatch.c")
|
|
|
|
glapi_sources = env.compile_without_gstabs(glapi_sources, "glapi_getproc.c")
|
|
|
|
|
2010-11-01 13:30:22 +00:00
|
|
|
glapi = env.ConvenienceLibrary(
|
|
|
|
target = 'glapi',
|
|
|
|
source = glapi_sources,
|
|
|
|
)
|
|
|
|
Export('glapi')
|