2008-01-31 04:14:35 +00:00
|
|
|
#######################################################################
|
2008-02-18 10:52:44 +00:00
|
|
|
# SConscript for Mesa
|
2008-01-31 04:14:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
Import('*')
|
2012-05-30 17:08:11 +01:00
|
|
|
from sys import executable as python_cmd
|
2008-01-31 04:14:35 +00:00
|
|
|
|
2010-11-01 13:30:22 +00:00
|
|
|
env = env.Clone()
|
2008-02-19 06:07:53 +00:00
|
|
|
|
2015-03-04 14:23:52 +00:00
|
|
|
env.MSVC2013Compat()
|
|
|
|
|
2010-11-01 13:30:22 +00:00
|
|
|
env.Append(CPPPATH = [
|
2015-12-22 02:34:11 +00:00
|
|
|
'../compiler/nir', # for generated nir_opcodes.h, etc
|
2015-04-16 00:59:43 +01:00
|
|
|
'../compiler/glsl', # for generated headers
|
2014-02-25 07:39:14 +00:00
|
|
|
'#/src',
|
2016-07-18 19:23:02 +01:00
|
|
|
Dir('../mapi'), # src/mapi build path
|
2010-11-01 13:30:22 +00:00
|
|
|
'#/src/mapi',
|
2016-07-18 19:23:02 +01:00
|
|
|
Dir('.'), # src/mesa build path
|
2010-11-01 13:30:22 +00:00
|
|
|
'#/src/mesa',
|
2016-07-18 19:23:02 +01:00
|
|
|
Dir('main'), # src/mesa/main/ build path
|
2016-06-15 17:42:34 +01:00
|
|
|
'#/src/mesa/main',
|
2015-02-11 22:18:50 +00:00
|
|
|
'#/src/gallium/include',
|
|
|
|
'#/src/gallium/auxiliary',
|
2010-11-01 13:30:22 +00:00
|
|
|
])
|
2009-01-06 16:20:12 +00:00
|
|
|
|
2010-11-01 13:30:22 +00:00
|
|
|
if env['platform'] == 'windows':
|
|
|
|
env.Append(CPPDEFINES = [
|
|
|
|
'_GDI32_', # prevent gl* being declared __declspec(dllimport) in MS headers
|
|
|
|
'BUILD_GL32', # declare gl* as __declspec(dllexport) in Mesa headers
|
2018-10-18 15:04:49 +01:00
|
|
|
'_GLAPI_NO_EXPORTS', # prevent _glapi_* from being declared __declspec(dllimport)
|
2010-11-01 13:30:22 +00:00
|
|
|
])
|
2008-06-04 15:56:57 +01:00
|
|
|
|
2014-07-24 01:20:12 +01:00
|
|
|
# parse Makefile.sources
|
|
|
|
source_lists = env.ParseSourceList('Makefile.sources')
|
2010-11-01 13:30:22 +00:00
|
|
|
|
2015-03-19 13:35:18 +00:00
|
|
|
env.Append(YACCFLAGS = ['-d', '-p', '_mesa_program_'])
|
2015-03-18 14:22:41 +00:00
|
|
|
env.CFile('program/lex.yy.c', 'program/program_lexer.l')
|
|
|
|
env.CFile('program/program_parse.tab.c', 'program/program_parse.y')
|
2010-11-01 13:30:22 +00:00
|
|
|
|
|
|
|
mesa_sources = (
|
2014-07-24 01:20:12 +01:00
|
|
|
source_lists['MESA_FILES'] +
|
2015-03-18 14:22:41 +00:00
|
|
|
source_lists['PROGRAM_FILES'] +
|
2018-05-12 08:27:52 +01:00
|
|
|
source_lists['PROGRAM_NIR_FILES'] +
|
2014-07-24 01:20:12 +01:00
|
|
|
source_lists['STATETRACKER_FILES']
|
2010-11-01 13:30:22 +00:00
|
|
|
)
|
|
|
|
|
2012-05-30 17:08:11 +01:00
|
|
|
GLAPI = '#src/mapi/glapi/'
|
|
|
|
|
2012-09-10 06:46:13 +01:00
|
|
|
get_hash_header = env.CodeGenerate(
|
|
|
|
target = 'main/get_hash.h',
|
|
|
|
script = 'main/get_hash_generator.py',
|
2016-08-27 21:30:38 +01:00
|
|
|
source = [GLAPI + 'gen/gl_and_es_API.xml'] + env.Glob(GLAPI + 'gen/*.xml'),
|
2013-04-17 16:49:39 +01:00
|
|
|
command = python_cmd + ' $SCRIPT ' + ' -f $SOURCE > $TARGET'
|
2012-09-10 06:46:13 +01:00
|
|
|
)
|
|
|
|
|
2014-06-20 23:52:10 +01:00
|
|
|
format_info = env.CodeGenerate(
|
2015-03-02 15:58:17 +00:00
|
|
|
target = 'main/format_info.h',
|
2014-06-20 23:52:10 +01:00
|
|
|
script = 'main/format_info.py',
|
|
|
|
source = 'main/formats.csv',
|
|
|
|
command = python_cmd + ' $SCRIPT ' + ' $SOURCE > $TARGET'
|
|
|
|
)
|
|
|
|
|
2014-08-21 20:38:05 +01:00
|
|
|
format_pack = env.CodeGenerate(
|
|
|
|
target = 'main/format_pack.c',
|
|
|
|
script = 'main/format_pack.py',
|
|
|
|
source = 'main/formats.csv',
|
|
|
|
command = python_cmd + ' $SCRIPT ' + ' $SOURCE > $TARGET'
|
|
|
|
)
|
|
|
|
|
2017-06-28 03:56:22 +01:00
|
|
|
format_fallback = env.CodeGenerate(
|
|
|
|
target = 'main/format_fallback.c',
|
|
|
|
script = 'main/format_fallback.py',
|
|
|
|
source = 'main/formats.csv',
|
|
|
|
command = python_cmd + ' $SCRIPT ' + ' $SOURCE ' + ' $TARGET'
|
|
|
|
)
|
|
|
|
|
2010-11-01 13:30:22 +00:00
|
|
|
#
|
|
|
|
# Assembly sources
|
|
|
|
#
|
2016-04-18 11:47:07 +01:00
|
|
|
if env['platform'] not in ('cygwin', 'darwin', 'windows', 'haiku'):
|
2010-11-01 13:56:16 +00:00
|
|
|
if env['machine'] == 'x86':
|
|
|
|
env.Append(CPPDEFINES = [
|
|
|
|
'USE_X86_ASM',
|
|
|
|
'USE_MMX_ASM',
|
|
|
|
'USE_3DNOW_ASM',
|
|
|
|
'USE_SSE_ASM',
|
|
|
|
])
|
2014-07-24 01:20:12 +01:00
|
|
|
mesa_sources += source_lists['X86_FILES']
|
2010-11-01 13:56:16 +00:00
|
|
|
elif env['machine'] == 'x86_64':
|
|
|
|
env.Append(CPPDEFINES = [
|
|
|
|
'USE_X86_64_ASM',
|
|
|
|
])
|
2014-07-24 01:20:12 +01:00
|
|
|
mesa_sources += source_lists['X86_64_FILES']
|
2010-11-01 13:56:16 +00:00
|
|
|
elif env['machine'] == 'sparc':
|
2014-07-24 01:20:12 +01:00
|
|
|
mesa_sources += source_lists['SPARC_FILES']
|
2010-11-01 13:56:16 +00:00
|
|
|
else:
|
|
|
|
pass
|
2010-11-01 13:30:22 +00:00
|
|
|
|
2012-11-07 21:03:13 +00:00
|
|
|
# The marshal_generated.c file is generated from the GL/ES API.xml file
|
2020-03-05 23:08:58 +00:00
|
|
|
for i in range(8):
|
|
|
|
env.CodeGenerate(
|
|
|
|
target = 'main/marshal_generated{0}.c'.format(i),
|
|
|
|
script = GLAPI + 'gen/gl_marshal.py',
|
|
|
|
source = [GLAPI + 'gen/gl_and_es_API.xml'] + env.Glob(GLAPI + 'gen/*.xml'),
|
|
|
|
command = python_cmd + ' $SCRIPT -f $SOURCE -i {0} -n 8 > $TARGET'.format(i)
|
|
|
|
)
|
2012-11-07 21:03:13 +00:00
|
|
|
|
|
|
|
# The marshal_generated.h file is generated from the GL/ES API.xml file
|
|
|
|
env.CodeGenerate(
|
|
|
|
target = 'main/marshal_generated.h',
|
|
|
|
script = GLAPI + 'gen/gl_marshal_h.py',
|
2017-03-26 21:28:29 +01:00
|
|
|
source = [GLAPI + 'gen/gl_and_es_API.xml'] + env.Glob(GLAPI + 'gen/*.xml'),
|
2012-11-07 21:03:13 +00:00
|
|
|
command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET'
|
|
|
|
)
|
|
|
|
|
2010-11-01 13:30:22 +00:00
|
|
|
#
|
|
|
|
# Libraries
|
|
|
|
#
|
|
|
|
|
|
|
|
mesa = env.ConvenienceLibrary(
|
|
|
|
target = 'mesa',
|
|
|
|
source = mesa_sources,
|
|
|
|
)
|
|
|
|
|
|
|
|
env.Alias('mesa', mesa)
|
|
|
|
|
|
|
|
Export('mesa')
|