1import filecmp 2import os 3import subprocess 4from sys import executable as python_cmd 5 6Import('*') 7 8if env['platform'] == 'windows': 9 SConscript('getopt/SConscript') 10 11SConscript('util/xmlpool/SConscript') 12SConscript('util/SConscript') 13SConscript('compiler/SConscript') 14 15if env['hostonly']: 16 # We are just compiling the things necessary on the host for cross 17 # compilation 18 Return() 19 20 21def 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 36write_git_sha1_h_file("git_sha1.h") 37# and update CPPPATH so the git_sha1.h header can be found 38env.Append(CPPPATH = ["#" + env['build_dir']]) 39 40 41 42if env['platform'] != 'windows': 43 SConscript('loader/SConscript') 44 45SConscript('mapi/glapi/gen/SConscript') 46SConscript('mapi/glapi/SConscript') 47 48# Haiku C++ libGL dispatch (renderers depend on libgl) 49if env['platform'] in ['haiku']: 50 SConscript('hgl/SConscript') 51 52SConscript('mesa/SConscript') 53 54if not env['embedded']: 55 if env['platform'] not in ('cygwin', 'darwin', 'freebsd', 'haiku', 'windows'): 56 SConscript('glx/SConscript') 57 if env['platform'] == 'haiku': 58 SConscript('egl/SConscript') 59 60SConscript('gallium/SConscript') 61 62