def mapi_objects(env, printer, mode):
"""Return mapi objects built for the given printer and mode."""
mapi_sources = {
- 'glapi': ['entry.c', 'mapi_glapi.c', 'stub.c', 'table.c',
- 'u_current.c', 'u_execmem.c', 'u_thread.c'],
+ 'glapi': [
+ 'entry.c',
+ 'mapi_glapi.c',
+ 'stub.c',
+ 'table.c',
+ 'u_current.c',
+ 'u_execmem.c',
+ ],
'bridge': ['entry.c'],
}
mapi_defines = {
header_name = '%s-tmp.h' % (printer)
# generate ABI header
- header = env.CodeGenerate(
- target = header_name,
- script = '../mapi/mapi_abi.py',
- source = '../glapi/gen/gl_and_es_API.xml',
- command = python_cmd + ' $SCRIPT ' + \
- '--printer %s --mode lib $SOURCE > $TARGET' % (printer),
- )
+ GLAPI = '../glapi/'
+ if printer != 'glapi':
+ if printer == 'es1api':
+ abi_tag = 'glesv1'
+ else:
+ abi_tag = 'glesv2'
+
+ header = env.CodeGenerate(
+ target = header_name,
+ script = '../new/gen_gldispatch_mapi.py',
+ source = GLAPI + 'registry/gl.xml'
+ command = python_cmd + ' $SCRIPT ' + \
+ '%s $SOURCE > $TARGET' % (abi_tag),
+ )
+ else:
+ header = env.CodeGenerate(
+ target = header_name,
+ script = '../mapi_abi.py',
+ source = [GLAPI + 'gen/gl_and_es_API.xml'] + env.Glob(GLAPI + 'gen/*.xml'),
+ command = python_cmd + ' $SCRIPT ' + \
+ '--printer %s $SOURCE > $TARGET' % (printer),
+ )
cpppath = [
header[0].dir,
'#/include',
+ '#/src',
'#/src/mapi',
]
-
+
cppdefines = mapi_defines[mode] + [
'MAPI_ABI_HEADER=\\"%s\\"' % (header_name),
]
for s in mapi_sources[mode]:
o = env.SharedObject(
target = '%s-%s' % (printer, s[:-2]),
- source = '../mapi/' + s,
+ source = '../' + s,
CPPPATH = cpppath,
CPPDEFINES = cppdefines,
)
else:
shared_glapi = env.FindIxes(shared_glapi, 'SHLIBPREFIX', 'SHLIBSUFFIX')
-# build glapi bridge as a convenience libarary for libgl-xlib/libgl-gdi
-bridge_glapi_objects = mapi_objects(env, 'glapi', 'bridge')
-bridge_glapi = env.ConvenienceLibrary(
- target = 'glapi_bridge',
- source = bridge_glapi_objects,
-)
-
-Export(['shared_glapi', 'bridge_glapi'])
+Export(['shared_glapi'])