drisw: use getImageShm() if available
[mesa.git] / src / SConscript
1 import filecmp
2 import os
3 import subprocess
4 from sys import executable as python_cmd
5
6 Import('*')
7
8 if env['platform'] == 'windows':
9 SConscript('getopt/SConscript')
10
11 SConscript('util/xmlpool/SConscript')
12 SConscript('util/SConscript')
13 SConscript('compiler/SConscript')
14
15 if env['hostonly']:
16 # We are just compiling the things necessary on the host for cross
17 # compilation
18 Return()
19
20
21 def write_git_sha1_h_file(filename):
22 """Mesa looks for a git_sha1.h file at compile time in order to display
23 the current git hash id in the GL_VERSION string. This function tries
24 to retrieve the git hashid and write the header file. An empty file
25 will be created if anything goes wrong."""
26
27 args = [ python_cmd, Dir('#').abspath + '/bin/git_sha1_gen.py', '--output', filename ]
28 try:
29 subprocess.call(args)
30 except:
31 print("Warning: exception in write_git_sha1_h_file()")
32 return
33
34
35 # Create the git_sha1.h header file
36 write_git_sha1_h_file("git_sha1.h")
37 # and update CPPPATH so the git_sha1.h header can be found
38 env.Append(CPPPATH = ["#" + env['build_dir']])
39
40
41
42 if env['platform'] != 'windows':
43 SConscript('loader/SConscript')
44
45 # When env['gles'] is set, the targets defined in mapi/glapi/SConscript are not
46 # used. libgl-xlib and libgl-gdi adapt themselves to use the targets defined
47 # in mapi/glapi-shared/SConscript. mesa/SConscript also adapts itself to
48 # enable OpenGL ES support.
49 SConscript('mapi/glapi/gen/SConscript')
50 SConscript('mapi/glapi/SConscript')
51
52 # Haiku C++ libGL dispatch (renderers depend on libgl)
53 if env['platform'] in ['haiku']:
54 SConscript('hgl/SConscript')
55
56 SConscript('mesa/SConscript')
57
58 if not env['embedded']:
59 if env['platform'] not in ('cygwin', 'darwin', 'freebsd', 'haiku', 'windows'):
60 SConscript('glx/SConscript')
61 if env['platform'] == 'haiku':
62 SConscript('egl/SConscript')
63
64 if env['gles']:
65 SConscript('mapi/shared-glapi/SConscript')
66
67 SConscript('gallium/SConscript')
68