Merge branch 'master' of ssh://git.freedesktop.org/git/mesa/mesa into pipe-video
[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_GLAPI_CURRENT',
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 'WIN32_THREADS', # use Win32 thread API
20 ])
21
22 env.Append(CPPPATH = [
23 '#/src/mapi',
24 '#/src/mesa',
25 ])
26
27 glapi_sources = [
28 'glapi_dispatch.c',
29 'glapi_entrypoint.c',
30 'glapi_getproc.c',
31 'glapi_nop.c',
32 'glthread.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 gcc and env['machine'] == 'x86':
48 env.Append(CPPDEFINES = [
49 'USE_X86_ASM',
50 'USE_MMX_ASM',
51 'USE_3DNOW_ASM',
52 'USE_SSE_ASM',
53 ])
54 glapi_sources += [
55 'glapi_x86.S',
56 ]
57 elif gcc and env['machine'] == 'x86_64':
58 env.Append(CPPDEFINES = [
59 'USE_X86_64_ASM',
60 ])
61 glapi_sources += [
62 'glapi_x86-64.S'
63 ]
64 elif gcc and env['machine'] == 'ppc':
65 env.Append(CPPDEFINES = [
66 'USE_PPC_ASM',
67 'USE_VMX_ASM',
68 ])
69 glapi_sources += [
70 ]
71 elif gcc and env['machine'] == 'sparc':
72 glapi_sources += [
73 'glapi_sparc.S'
74 ]
75 else:
76 pass
77
78 glapi = env.ConvenienceLibrary(
79 target = 'glapi',
80 source = glapi_sources,
81 )
82 Export('glapi')