# 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.
+SConscript('mapi/glapi/gen/SConscript')
SConscript('mapi/glapi/SConscript')
SConscript('mesa/SConscript')
'xlib.c',
]
+# The sources depend on the python-generated GL API files/headers.
+env.Depends(sources, glapi_headers)
+
if True:
env.Append(CPPDEFINES = ['GALLIUM_TRACE', 'GALLIUM_RBUG', 'GALLIUM_GALAHAD', 'GALLIUM_SOFTPIPE'])
env.Prepend(LIBS = [trace, rbug, galahad, softpipe])
Import('*')
+from sys import executable as python_cmd
+
env = env.Clone()
env.Prepend(CPPPATH = [
+ '.', # the build/<platform>/glx/ directory
'#include',
'#include/GL/internal',
'#src/mesa',
source = sources,
)
+
+# Generate GLX-specific .c and .h files here. Other GL API-related
+# files are used, but they're generated in mapi/glapi/gen/ since they're
+# used by other targets as well.
+
+GLAPI = '#src/mapi/glapi/'
+
+env.CodeGenerate(
+ target = 'indirect.c',
+ script = GLAPI + 'gen/glX_proto_send.py',
+ source = GLAPI + 'gen/gl_and_es_API.xml',
+ command = python_cmd + ' $SCRIPT -f $SOURCE -m proto > $TARGET'
+ )
+
+env.CodeGenerate(
+ target = 'indirect_size.c',
+ script = GLAPI + 'gen/glX_proto_size.py',
+ source = GLAPI + 'gen/gl_API.xml',
+ command = python_cmd + ' $SCRIPT -f $SOURCE -m size_c --only-set > $TARGET'
+)
+
+env.CodeGenerate(
+ target = 'indirect_init.c',
+ script = GLAPI + 'gen/glX_proto_send.py',
+ source = GLAPI + 'gen/gl_API.xml',
+ command = python_cmd + ' $SCRIPT -f $SOURCE -m init_c > $TARGET'
+)
+
+headers = []
+
+headers += env.CodeGenerate(
+ target = 'indirect_size.h',
+ script = GLAPI + 'gen/glX_proto_size.py',
+ source = GLAPI + 'gen/gl_API.xml',
+ command = python_cmd + ' $SCRIPT -f $SOURCE -m size_h --only-set -h _INDIRECT_SIZE_H > $TARGET'
+)
+
+headers += env.CodeGenerate(
+ target = 'indirect.h',
+ script = GLAPI + 'gen/glX_proto_send.py',
+ source = GLAPI + 'gen/gl_API.xml',
+ command = python_cmd + ' $SCRIPT -m init_h -f $SOURCE > $TARGET',
+ )
+
+
+env.Depends(sources, headers)
+
+
libgl = env.InstallSharedLibrary(libgl, version=(1, 2))
env.Alias('glx', libgl)
# SConscript for glapi
+from sys import executable as python_cmd
+
Import('*')
env = env.Clone()
# Assembly sources
#
if env['gcc'] and env['platform'] not in ('darwin', 'windows'):
+ GLAPI = '#src/mapi/glapi/'
+
if env['machine'] == 'x86':
env.Append(CPPDEFINES = [
'USE_X86_ASM',
glapi_sources += [
'glapi_x86.S',
]
+ env.CodeGenerate(
+ target = 'glapi_x86.S',
+ script = GLAPI + 'gen/gl_x86_asm.py',
+ source = GLAPI + 'gen/gl_API.xml',
+ command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET'
+ )
elif env['machine'] == 'x86_64':
env.Append(CPPDEFINES = [
'USE_X86_64_ASM',
glapi_sources += [
'glapi_x86-64.S'
]
+ env.CodeGenerate(
+ target = 'glapi_x86-64.S',
+ script = GLAPI + 'gen/gl_x86-64_asm.py',
+ source = GLAPI + 'gen/gl_API.xml',
+ command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET'
+ )
elif env['machine'] == 'sparc':
env.Append(CPPDEFINES = [
'USE_SPARC_ASM',
glapi_sources += [
'glapi_sparc.S'
]
+ env.CodeGenerate(
+ target = 'glapi_sparc.S',
+ script = GLAPI + 'gen/gl_SPARC_asm.py',
+ source = GLAPI + 'gen/gl_API.xml',
+ command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET'
+ )
else:
pass
source = glapi_sources,
)
Export('glapi')
+
+
+env.Depends(glapi_sources, glapi_headers)
--- /dev/null
+Import('*')
+
+from sys import executable as python_cmd
+
+
+# Generate the GL API headers that are used by various parts of the
+# Mesa and GLX tree. Other .c and .h files are generated elsewhere
+# if they're only used in one place.
+
+GLAPI = '#src/mapi/glapi/'
+
+glapi_headers = []
+
+glapi_headers += env.CodeGenerate(
+ target = '#src/mesa/main/dispatch.h',
+ script = GLAPI + 'gen/gl_table.py',
+ source = GLAPI + 'gen/gl_API.xml',
+ command = python_cmd + ' $SCRIPT -m remap_table -f $SOURCE > $TARGET',
+ )
+
+glapi_headers += env.CodeGenerate(
+ target = '#src/mapi/glapi/glapitemp.h',
+ script = GLAPI + 'gen/gl_apitemp.py',
+ source = GLAPI + 'gen/gl_API.xml',
+ command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET'
+ )
+
+glapi_headers += env.CodeGenerate(
+ target = '#src/mapi/glapi/glprocs.h',
+ script = GLAPI + 'gen/gl_procs.py',
+ source = GLAPI + 'gen/gl_API.xml',
+ command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET'
+ )
+
+glapi_headers += env.CodeGenerate(
+ target = '#src/mesa/main/remap_helper.h',
+ script = GLAPI + 'gen/remap_helper.py',
+ source = GLAPI + 'gen/gl_API.xml',
+ command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET'
+ )
+
+env.Export('glapi_headers')
import filecmp
import os
import subprocess
+from sys import executable as python_cmd
env = env.Clone()
statetracker_sources
)
+GLAPI = '#src/mapi/glapi/'
+
if env['gles']:
- from sys import executable as python_cmd
env.Append(CPPDEFINES = ['FEATURE_ES1=1', 'FEATURE_ES2=1'])
)
# generate GLES headers
- GLAPI = '#src/mapi/glapi/'
gles_headers = []
gles_headers += env.CodeGenerate(
target = 'main/api_exec_es1_dispatch.h',
env.Append(CPPPATH = [matypes[0].dir])
+# The enums.c file is generated from the GL/ES API.xml file
+env.CodeGenerate(
+ target = 'main/enums.c',
+ script = GLAPI + 'gen/gl_enums.py',
+ source = GLAPI + 'gen/gl_and_es_API.xml',
+ command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET'
+ )
+
+# We also depend on the auto-generated GL API headers
+env.Depends(mesa_sources, glapi_headers)
def write_git_sha1_h_file(filename):
)
env.Alias('osmesa', osmesa)
+
+env.Depends(sources, glapi_headers)