1 #######################################################################
5 from sys import executable as python_cmd
11 env.Append(CPPDEFINES = [
15 if env['platform'] == 'windows':
16 env.Append(CPPDEFINES = [
17 '_GDI32_', # prevent gl* being declared __declspec(dllimport) in MS headers
18 'BUILD_GL32', # declare gl* as __declspec(dllexport) in Mesa headers
21 env.Append(CPPDEFINES = ['_GLAPI_DLL_EXPORTS'])
23 # prevent _glapi_* from being declared __declspec(dllimport)
24 env.Append(CPPDEFINES = ['_GLAPI_NO_EXPORTS'])
26 env.Append(CPPPATH = [
29 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['gcc'] or env['clang']) and \
53 env['platform'] not in ('cygwin', 'darwin', 'windows'):
54 GLAPI = '#src/mapi/glapi/'
55 sources = [GLAPI + 'gen/gl_and_es_API.xml'] + env.Glob(GLAPI + 'gen/*.xml')
57 if env['machine'] == 'x86':
58 env.Append(CPPDEFINES = [
65 target = 'glapi_x86.S',
66 script = GLAPI + 'gen/gl_x86_asm.py',
68 command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET'
70 elif env['machine'] == 'x86_64':
71 env.Append(CPPDEFINES = [
78 target = 'glapi_x86-64.S',
79 script = GLAPI + 'gen/gl_x86-64_asm.py',
81 command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET'
83 elif env['machine'] == 'sparc':
84 env.Append(CPPDEFINES = [
91 target = 'glapi_sparc.S',
92 script = GLAPI + 'gen/gl_SPARC_asm.py',
94 command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET'
99 glapi = env.ConvenienceLibrary(
101 source = glapi_sources,