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
22 '_GLAPI_NO_EXPORTS', # prevent _glapi_* from being declared __declspec(dllimport)
25 env.Append(CPPPATH = [
29 Dir('.'), # src/mapi/glapi build path
30 Dir('..'), # src/mapi build path
45 for s in mapi_sources:
46 o = env.SharedObject(s[:-2], '../' + s)
47 glapi_sources.append(o)
52 if env['platform'] not in ('cygwin', 'darwin', 'windows'):
53 GLAPI = '#src/mapi/glapi/'
54 sources = [GLAPI + 'gen/gl_and_es_API.xml'] + env.Glob(GLAPI + 'gen/*.xml')
56 if env['machine'] == 'x86':
57 env.Append(CPPDEFINES = [
64 target = 'glapi_x86.S',
65 script = GLAPI + 'gen/gl_x86_asm.py',
67 command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET'
69 elif env['machine'] == 'x86_64':
70 env.Append(CPPDEFINES = [
77 target = 'glapi_x86-64.S',
78 script = GLAPI + 'gen/gl_x86-64_asm.py',
80 command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET'
82 elif env['machine'] == 'sparc':
83 env.Append(CPPDEFINES = [
90 target = 'glapi_sparc.S',
91 script = GLAPI + 'gen/gl_SPARC_asm.py',
93 command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET'
98 glapi = env.ConvenienceLibrary(
100 source = glapi_sources,