summaryrefslogtreecommitdiffstats
path: root/src/glx
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2012-05-30 10:08:11 -0600
committerBrian Paul <[email protected]>2012-05-31 09:40:35 -0600
commitdff36e900c645401b26c9a44106459e96ee7a24d (patch)
tree7ca932a8752ad8bb7ab215d1d496aa696b8ceec8 /src/glx
parent185ed2105829d6f5eb19edb9abbf0d7977e157c3 (diff)
scons: add code to generate the various GL API files
This fixes recent build breakage when we began building the generated API files from xml as part of the normal build process. Fixes http://bugs.freedesktop.org/show_bug.cgi?id=50475
Diffstat (limited to 'src/glx')
-rw-r--r--src/glx/SConscript51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/glx/SConscript b/src/glx/SConscript
index 17a5690ee86..664cb86268d 100644
--- a/src/glx/SConscript
+++ b/src/glx/SConscript
@@ -1,8 +1,11 @@
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',
@@ -80,6 +83,54 @@ libgl = env.SharedLibrary(
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)