7 if env['platform'] == 'windows':
8 SConscript('getopt/SConscript')
10 SConscript('util/SConscript')
11 SConscript('compiler/SConscript')
14 # We are just compiling the things necessary on the host for cross
19 def write_git_sha1_h_file(filename):
20 """Mesa looks for a git_sha1.h file at compile time in order to display
21 the current git hash id in the GL_VERSION string. This function tries
22 to retrieve the git hashid and write the header file. An empty file
23 will be created if anything goes wrong."""
25 args = [ 'git', 'rev-parse', '--short=10', 'HEAD' ]
27 (commit, foo) = subprocess.Popen(args, stdout=subprocess.PIPE).communicate()
29 print "Warning: exception in write_git_sha1_h_file()"
30 # git log command didn't work
31 if not os.path.exists(filename):
32 dirname = os.path.dirname(filename)
33 if dirname and not os.path.exists(dirname):
35 # create an empty file if none already exists
36 f = open(filename, "w")
40 # note that commit[:-1] removes the trailing newline character
41 commit = '#define MESA_GIT_SHA1 "git-%s"\n' % commit[:-1]
42 tempfile = "git_sha1.h.tmp"
43 f = open(tempfile, "w")
46 if not os.path.exists(filename) or not filecmp.cmp(tempfile, filename):
47 # The filename does not exist or it's different from the new file,
48 # so replace old file with new.
49 if os.path.exists(filename):
51 os.rename(tempfile, filename)
55 # Create the git_sha1.h header file
56 write_git_sha1_h_file("git_sha1.h")
57 # and update CPPPATH so the git_sha1.h header can be found
58 env.Append(CPPPATH = ["#" + env['build_dir']])
62 if env['platform'] != 'windows':
63 SConscript('loader/SConscript')
65 # When env['gles'] is set, the targets defined in mapi/glapi/SConscript are not
66 # used. libgl-xlib and libgl-gdi adapt themselves to use the targets defined
67 # in mapi/glapi-shared/SConscript. mesa/SConscript also adapts itself to
68 # enable OpenGL ES support.
69 SConscript('mapi/glapi/gen/SConscript')
70 SConscript('mapi/glapi/SConscript')
72 # Haiku C++ libGL dispatch (renderers depend on libgl)
73 if env['platform'] in ['haiku']:
74 SConscript('hgl/SConscript')
76 SConscript('mesa/SConscript')
78 if not env['embedded']:
79 if env['platform'] not in ('cygwin', 'darwin', 'freebsd', 'haiku', 'windows'):
80 SConscript('glx/SConscript')
81 if env['platform'] == 'haiku':
82 SConscript('egl/SConscript')
85 SConscript('mapi/shared-glapi/SConscript')
87 SConscript('gallium/SConscript')