1 #######################################################################
5 from sys import executable as python_cmd
13 env.Append(CPPDEFINES = [
17 if env['platform'] == 'windows':
18 env.Append(CPPDEFINES = [
19 '_GDI32_', # prevent gl* being declared __declspec(dllimport) in MS headers
20 'BUILD_GL32', # declare gl* as __declspec(dllexport) in Mesa headers
21 'KHRONOS_DLL_EXPORTS', # declare gl* as __declspec(dllexport) in Khronos headers
24 env.Append(CPPDEFINES = ['_GLAPI_DLL_EXPORTS'])
26 # prevent _glapi_* from being declared __declspec(dllimport)
27 env.Append(CPPDEFINES = ['_GLAPI_NO_EXPORTS'])
29 env.Append(CPPPATH = [
33 Dir('..'), # src/mapi build path
48 for s in mapi_sources:
49 o = env.SharedObject(s[:-2], '../' + s)
50 glapi_sources.append(o)
55 if env['platform'] not in ('cygwin', 'darwin', 'windows'):
56 GLAPI = '#src/mapi/glapi/'
57 sources = [GLAPI + 'gen/gl_and_es_API.xml'] + env.Glob(GLAPI + 'gen/*.xml')
59 if env['machine'] == 'x86':
60 env.Append(CPPDEFINES = [
67 target = 'glapi_x86.S',
68 script = GLAPI + 'gen/gl_x86_asm.py',
70 command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET'
72 elif env['machine'] == 'x86_64':
73 env.Append(CPPDEFINES = [
80 target = 'glapi_x86-64.S',
81 script = GLAPI + 'gen/gl_x86-64_asm.py',
83 command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET'
85 elif env['machine'] == 'sparc':
86 env.Append(CPPDEFINES = [
93 target = 'glapi_sparc.S',
94 script = GLAPI + 'gen/gl_SPARC_asm.py',
96 command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET'
101 glapi = env.ConvenienceLibrary(
103 source = glapi_sources,