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 = [
44 for s in mapi_sources:
45 o = env.SharedObject(s[:-2], '../mapi/' + s)
46 glapi_sources.append(o)
51 if env['gcc'] and env['platform'] not in ('darwin', 'windows'):
52 GLAPI = '#src/mapi/glapi/'
54 if env['machine'] == 'x86':
55 env.Append(CPPDEFINES = [
62 target = 'glapi_x86.S',
63 script = GLAPI + 'gen/gl_x86_asm.py',
64 source = GLAPI + 'gen/gl_API.xml',
65 command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET'
67 elif env['machine'] == 'x86_64':
68 env.Append(CPPDEFINES = [
75 target = 'glapi_x86-64.S',
76 script = GLAPI + 'gen/gl_x86-64_asm.py',
77 source = GLAPI + 'gen/gl_API.xml',
78 command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET'
80 elif env['machine'] == 'sparc':
81 env.Append(CPPDEFINES = [
88 target = 'glapi_sparc.S',
89 script = GLAPI + 'gen/gl_SPARC_asm.py',
90 source = GLAPI + 'gen/gl_API.xml',
91 command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET'
96 if env['toolchain'] == 'crossmingw':
97 # compile these files without -gstabs option
98 glapi_sources = env.compile_without_gstabs(glapi_sources, "glapi_dispatch.c")
99 glapi_sources = env.compile_without_gstabs(glapi_sources, "glapi_getproc.c")
101 glapi = env.ConvenienceLibrary(
103 source = glapi_sources,
108 env.Depends(glapi_sources, glapi_headers)