Merge branch 'gallium-polygon-stipple'
[mesa.git] / src / mapi / glapi / SConscript
1 #######################################################################
2 # SConscript for glapi
3
4
5 Import('*')
6
7 if env['platform'] != 'winddk':
8
9 env = env.Clone()
10
11 env.Append(CPPDEFINES = [
12 'MAPI_MODE_UTIL',
13 ])
14
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
19 ])
20 if env['gles']:
21 env.Append(CPPDEFINES = ['_GLAPI_DLL_EXPORTS'])
22 else:
23 # prevent _glapi_* from being declared __declspec(dllimport)
24 env.Append(CPPDEFINES = ['_GLAPI_NO_EXPORTS'])
25
26 env.Append(CPPPATH = [
27 '#/src/mapi',
28 '#/src/mesa',
29 ])
30
31 glapi_sources = [
32 'glapi_dispatch.c',
33 'glapi_entrypoint.c',
34 'glapi_getproc.c',
35 'glapi_nop.c',
36 'glthread.c',
37 'glapi.c',
38 ]
39
40 mapi_sources = [
41 'u_current.c',
42 'u_execmem.c',
43 'u_thread.c',
44 ]
45 for s in mapi_sources:
46 o = env.SharedObject(s[:-2], '../mapi/' + s)
47 glapi_sources.append(o)
48
49 #
50 # Assembly sources
51 #
52 if env['gcc'] and env['platform'] != 'windows':
53 if env['machine'] == 'x86':
54 env.Append(CPPDEFINES = [
55 'USE_X86_ASM',
56 ])
57 glapi_sources += [
58 'glapi_x86.S',
59 ]
60 elif env['machine'] == 'x86_64':
61 env.Append(CPPDEFINES = [
62 'USE_X86_64_ASM',
63 ])
64 glapi_sources += [
65 'glapi_x86-64.S'
66 ]
67 elif env['machine'] == 'sparc':
68 env.Append(CPPDEFINES = [
69 'USE_SPARC_ASM',
70 ])
71 glapi_sources += [
72 'glapi_sparc.S'
73 ]
74 else:
75 pass
76
77 glapi = env.ConvenienceLibrary(
78 target = 'glapi',
79 source = glapi_sources,
80 )
81 Export('glapi')