glx: convert glx_config_create_list to one big calloc
[mesa.git] / src / glx / SConscript
index d08ae9e2c504ce84510e383e865c319cb99865ea..ce25a1faa84aadcba0509e823e2ea5adc1cb153d 100644 (file)
@@ -1,10 +1,18 @@
 Import('*')
 
+if not env['x11'] or not env['xcb'] or not env['drm']:
+    Return()
+
+from sys import executable as python_cmd
+
 env = env.Clone()
 
 env.Prepend(CPPPATH = [
+       '.',           # the build/<platform>/glx/ directory
        '#include',
        '#include/GL/internal',
+       '#src/',
+       '#src/loader',
        '#src/mesa',
        '#src/mapi',
        '#src/mapi/glapi',
@@ -16,20 +24,18 @@ env.Prepend(CPPPATH = [
 
 env.Append(CPPDEFINES = [
     '_REENTRANT',
-    #('DEFAULT_DRIVER_DIR', 'DRI_DRIVER_SEARCH_DIR')
 ])
 
 env.Prepend(LIBS = [
+    libloader,
+    mesautil,
     glapi
 ])
 
 env.PkgUseModules('X11')
 env.PkgUseModules('XCB')
 env.PkgUseModules('DRM')
-
-if env['HAVE_XF86VIDMODE']:
-    env.Append(CPPDEFINES = ['XF86VIDMODE'])
-    env.PkgUseModules('XF86VIDMODE')
+env.PkgUseModules('XF86VIDMODE')
 
 sources = [
     'clientattrib.c',
@@ -54,6 +60,7 @@ sources = [
     'indirect_vertex_program.c',
     'pixel.c',
     'pixelstore.c',
+    'query_renderer.c',
     'render2.c',
     'renderpix.c',
     'single2.c',
@@ -69,6 +76,9 @@ sources = [
     'glxhash.c',
     'dri2_glx.c',
     'dri2.c',
+    'dri_common_query_renderer.c',
+    'dri_common_interop.c',
+    #'dri3_glx.c',
     'applegl_glx.c',
 ]
 
@@ -77,6 +87,50 @@ 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/'
+sources = [GLAPI + 'gen/gl_API.xml'] + env.Glob(GLAPI + 'gen/*.xml')
+
+env.CodeGenerate(
+    target = 'indirect.c',
+    script = GLAPI + 'gen/glX_proto_send.py',
+    source = sources,
+    command = python_cmd + ' $SCRIPT -f $SOURCE -m proto > $TARGET'
+    )
+
+env.CodeGenerate(
+    target = 'indirect_size.c',
+    script = GLAPI + 'gen/glX_proto_size.py',
+    source = sources,
+    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 = sources,
+    command = python_cmd + ' $SCRIPT -f $SOURCE -m init_c > $TARGET'
+)
+
+env.CodeGenerate(
+    target = 'indirect_size.h',
+    script = GLAPI + 'gen/glX_proto_size.py',
+    source = sources,
+    command = python_cmd + ' $SCRIPT -f $SOURCE -m size_h --only-set --header-tag _INDIRECT_SIZE_H > $TARGET'
+)
+
+env.CodeGenerate(
+    target = 'indirect.h',
+    script = GLAPI + 'gen/glX_proto_send.py',
+    source = sources,
+    command = python_cmd + ' $SCRIPT -m init_h -f $SOURCE > $TARGET',
+    )
+
+
 libgl = env.InstallSharedLibrary(libgl, version=(1, 2))
 
 env.Alias('glx', libgl)