4057991ec8da935d1b0b7f3a5810c561a36978fa
[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
21 env.Append(CPPPATH = [
22 '#/src/mapi',
23 '#/src/mesa',
24 ])
25
26 glapi_sources = [
27 'glapi_dispatch.c',
28 'glapi_entrypoint.c',
29 'glapi_getproc.c',
30 'glapi_nop.c',
31 'glthread.c',
32 'glapi.c',
33 ]
34
35 mapi_sources = [
36 'u_current.c',
37 'u_execmem.c',
38 'u_thread.c',
39 ]
40 for s in mapi_sources:
41 o = env.SharedObject(s[:-2], '../mapi/' + s)
42 glapi_sources.append(o)
43
44 #
45 # Assembly sources
46 #
47 if env['gcc'] and env['platform'] != 'windows':
48 if env['machine'] == 'x86':
49 env.Append(CPPDEFINES = [
50 'USE_X86_ASM',
51 'USE_MMX_ASM',
52 'USE_3DNOW_ASM',
53 'USE_SSE_ASM',
54 ])
55 glapi_sources += [
56 'glapi_x86.S',
57 ]
58 elif env['machine'] == 'x86_64':
59 env.Append(CPPDEFINES = [
60 'USE_X86_64_ASM',
61 ])
62 glapi_sources += [
63 'glapi_x86-64.S'
64 ]
65 elif env['machine'] == 'ppc':
66 env.Append(CPPDEFINES = [
67 'USE_PPC_ASM',
68 'USE_VMX_ASM',
69 ])
70 glapi_sources += [
71 ]
72 elif env['machine'] == 'sparc':
73 glapi_sources += [
74 'glapi_sparc.S'
75 ]
76 else:
77 pass
78
79 glapi = env.ConvenienceLibrary(
80 target = 'glapi',
81 source = glapi_sources,
82 )
83 Export('glapi')