2016-06-15 17:42:34 +01:00
|
|
|
import filecmp
|
|
|
|
import os
|
|
|
|
import subprocess
|
2017-08-01 14:36:16 +01:00
|
|
|
from sys import executable as python_cmd
|
2008-02-18 10:52:44 +00:00
|
|
|
|
2016-06-15 17:42:34 +01:00
|
|
|
Import('*')
|
2011-02-11 17:38:54 +00:00
|
|
|
|
2010-11-01 13:30:22 +00:00
|
|
|
if env['platform'] == 'windows':
|
2011-01-12 15:32:17 +00:00
|
|
|
SConscript('getopt/SConscript')
|
2010-08-13 13:53:04 +01:00
|
|
|
|
2017-07-31 15:51:13 +01:00
|
|
|
SConscript('util/xmlpool/SConscript')
|
2014-02-25 07:39:14 +00:00
|
|
|
SConscript('util/SConscript')
|
2016-01-18 08:47:13 +00:00
|
|
|
SConscript('compiler/SConscript')
|
2011-02-11 17:38:54 +00:00
|
|
|
|
|
|
|
if env['hostonly']:
|
|
|
|
# We are just compiling the things necessary on the host for cross
|
|
|
|
# compilation
|
|
|
|
Return()
|
|
|
|
|
2016-06-15 17:42:34 +01:00
|
|
|
|
|
|
|
def write_git_sha1_h_file(filename):
|
|
|
|
"""Mesa looks for a git_sha1.h file at compile time in order to display
|
|
|
|
the current git hash id in the GL_VERSION string. This function tries
|
|
|
|
to retrieve the git hashid and write the header file. An empty file
|
|
|
|
will be created if anything goes wrong."""
|
|
|
|
|
|
|
|
tempfile = "git_sha1.h.tmp"
|
2017-06-27 12:08:41 +01:00
|
|
|
with open(tempfile, "w") as f:
|
2017-08-01 14:36:16 +01:00
|
|
|
args = [ python_cmd, Dir('#').abspath + '/bin/git_sha1_gen.py' ]
|
2017-06-27 12:08:41 +01:00
|
|
|
try:
|
2017-06-29 17:21:44 +01:00
|
|
|
subprocess.Popen(args, stdout=f).wait()
|
2017-06-27 12:08:41 +01:00
|
|
|
except:
|
2017-09-19 13:56:34 +01:00
|
|
|
print("Warning: exception in write_git_sha1_h_file()")
|
2017-06-27 12:08:41 +01:00
|
|
|
return
|
|
|
|
|
2016-06-15 17:42:34 +01:00
|
|
|
if not os.path.exists(filename) or not filecmp.cmp(tempfile, filename):
|
|
|
|
# The filename does not exist or it's different from the new file,
|
|
|
|
# so replace old file with new.
|
|
|
|
if os.path.exists(filename):
|
|
|
|
os.remove(filename)
|
|
|
|
os.rename(tempfile, filename)
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
|
# Create the git_sha1.h header file
|
|
|
|
write_git_sha1_h_file("git_sha1.h")
|
|
|
|
# and update CPPPATH so the git_sha1.h header can be found
|
|
|
|
env.Append(CPPPATH = ["#" + env['build_dir']])
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-03-24 20:26:21 +00:00
|
|
|
if env['platform'] != 'windows':
|
|
|
|
SConscript('loader/SConscript')
|
2011-02-11 17:38:54 +00:00
|
|
|
|
2011-01-14 09:50:29 +00:00
|
|
|
# When env['gles'] is set, the targets defined in mapi/glapi/SConscript are not
|
|
|
|
# used. libgl-xlib and libgl-gdi adapt themselves to use the targets defined
|
|
|
|
# in mapi/glapi-shared/SConscript. mesa/SConscript also adapts itself to
|
|
|
|
# enable OpenGL ES support.
|
2012-05-30 17:08:11 +01:00
|
|
|
SConscript('mapi/glapi/gen/SConscript')
|
2010-11-01 13:30:22 +00:00
|
|
|
SConscript('mapi/glapi/SConscript')
|
2013-12-31 21:39:49 +00:00
|
|
|
|
|
|
|
# Haiku C++ libGL dispatch (renderers depend on libgl)
|
|
|
|
if env['platform'] in ['haiku']:
|
|
|
|
SConscript('hgl/SConscript')
|
|
|
|
|
2010-11-01 13:30:22 +00:00
|
|
|
SConscript('mesa/SConscript')
|
2008-02-22 15:46:40 +00:00
|
|
|
|
2011-09-16 17:11:52 +01:00
|
|
|
if not env['embedded']:
|
2012-05-24 01:26:20 +01:00
|
|
|
if env['platform'] not in ('cygwin', 'darwin', 'freebsd', 'haiku', 'windows'):
|
2011-09-20 20:40:05 +01:00
|
|
|
SConscript('glx/SConscript')
|
2014-12-22 15:10:13 +00:00
|
|
|
if env['platform'] == 'haiku':
|
2015-07-14 02:04:30 +01:00
|
|
|
SConscript('egl/SConscript')
|
2010-06-08 17:38:01 +01:00
|
|
|
|
2011-01-14 09:50:29 +00:00
|
|
|
if env['gles']:
|
|
|
|
SConscript('mapi/shared-glapi/SConscript')
|
|
|
|
|
2010-03-09 15:07:57 +00:00
|
|
|
SConscript('gallium/SConscript')
|
2009-01-23 12:32:35 +00:00
|
|
|
|