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/glapi build path
34 Dir('..'), # src/mapi build path
49 for s in mapi_sources:
50 o = env.SharedObject(s[:-2], '../' + s)
51 glapi_sources.append(o)
56 if env['platform'] not in ('cygwin', 'darwin', 'windows'):
57 GLAPI = '#src/mapi/glapi/'
58 sources = [GLAPI + 'gen/gl_and_es_API.xml'] + env.Glob(GLAPI + 'gen/*.xml')
60 if env['machine'] == 'x86':
61 env.Append(CPPDEFINES = [
68 target = 'glapi_x86.S',
69 script = GLAPI + 'gen/gl_x86_asm.py',
71 command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET'
73 elif env['machine'] == 'x86_64':
74 env.Append(CPPDEFINES = [
81 target = 'glapi_x86-64.S',
82 script = GLAPI + 'gen/gl_x86-64_asm.py',
84 command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET'
86 elif env['machine'] == 'sparc':
87 env.Append(CPPDEFINES = [
94 target = 'glapi_sparc.S',
95 script = GLAPI + 'gen/gl_SPARC_asm.py',
97 command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET'
102 glapi = env.ConvenienceLibrary(
104 source = glapi_sources,