aco: Don't store LS VS outputs to LDS when TCS doesn't need them.
[mesa.git] / src / mapi / shared-glapi / SConscript
index b7c43a7347606227d5095fbb5590af115a1e88f2..81aea74873d43c05bbe4337d0d2de17df5576f0a 100644 (file)
@@ -8,8 +8,14 @@ Import('*')
 def mapi_objects(env, printer, mode):
     """Return mapi objects built for the given printer and mode."""
     mapi_sources = {
-        'glapi': ['entry.c', 'mapi_glapi.c', 'stub.c', 'table.c',
-                  'u_current.c', 'u_execmem.c', 'u_thread.c'],
+        'glapi': [
+            'entry.c',
+            'mapi_glapi.c',
+            'stub.c',
+            'table.c',
+            'u_current.c',
+            'u_execmem.c',
+        ],
         'bridge': ['entry.c'],
     }
     mapi_defines = {
@@ -20,20 +26,36 @@ def mapi_objects(env, printer, mode):
     header_name = '%s-tmp.h' % (printer)
 
     # generate ABI header
-    header = env.CodeGenerate(
-        target = header_name,
-        script = '../mapi/mapi_abi.py',
-        source = '../glapi/gen/gl_and_es_API.xml',
-        command = python_cmd + ' $SCRIPT ' + \
-                '--printer %s --mode lib $SOURCE > $TARGET' % (printer),
-    )
+    GLAPI = '../glapi/'
+    if printer != 'glapi':
+        if printer == 'es1api':
+            abi_tag = 'glesv1'
+        else:
+            abi_tag = 'glesv2'
+
+        header = env.CodeGenerate(
+            target = header_name,
+            script = '../new/gen_gldispatch_mapi.py',
+            source = GLAPI + 'registry/gl.xml'
+            command = python_cmd + ' $SCRIPT ' + \
+                    '%s $SOURCE > $TARGET' % (abi_tag),
+        )
+    else:
+        header = env.CodeGenerate(
+            target = header_name,
+            script = '../mapi_abi.py',
+            source = [GLAPI + 'gen/gl_and_es_API.xml'] + env.Glob(GLAPI + 'gen/*.xml'),
+            command = python_cmd + ' $SCRIPT ' + \
+                    '--printer %s $SOURCE > $TARGET' % (printer),
+        )
 
     cpppath = [
         header[0].dir,
         '#/include',
+        '#/src',
         '#/src/mapi',
     ]
-    
+
     cppdefines = mapi_defines[mode] + [
         'MAPI_ABI_HEADER=\\"%s\\"' % (header_name),
     ]
@@ -53,7 +75,7 @@ def mapi_objects(env, printer, mode):
     for s in mapi_sources[mode]:
         o = env.SharedObject(
             target = '%s-%s' % (printer, s[:-2]),
-            source = '../mapi/' + s,
+            source = '../' + s,
             CPPPATH = cpppath,
             CPPDEFINES = cppdefines,
         )
@@ -63,54 +85,46 @@ def mapi_objects(env, printer, mode):
 
     return objects
 
-if env['platform'] != 'winddk':
-    env = env.Clone()
-
-    env['SHLIBPREFIX'] = 'lib'
-    env['LIBPREFIX'] = 'lib'
-
-    shared_glapi_objects = mapi_objects(env, 'shared-glapi', 'glapi')
-    shared_glapi = env.SharedLibrary(
-        target = 'glapi',
-        source = shared_glapi_objects,
-    )
-
-    # manually add LIBPREFIX on windows
-    if env['platform'] == 'windows':
-        libs = ['libglapi']
-    else:
-        libs = ['glapi']
-
-    es1api_objects = mapi_objects(env, 'es1api', 'bridge')
-    es1api = env.SharedLibrary(
-        target = 'GLESv1_CM',
-        source = es1api_objects,
-        LIBPATH = ['.'],
-        LIBS = libs,
-    )
-
-    es2api_objects = mapi_objects(env, 'es2api', 'bridge')
-    es2api = env.SharedLibrary(
-        target = 'GLESv2',
-        source = es2api_objects,
-        LIBPATH = ['.'],
-        LIBS = libs,
-    )
-
-    env.InstallSharedLibrary(shared_glapi, version=(0, 0, 0))
-    env.InstallSharedLibrary(es1api, version=(1, 0, 0))
-    env.InstallSharedLibrary(es2api, version=(2, 0, 0))
-
-    if env['platform'] == 'windows':
-        shared_glapi = env.FindIxes(shared_glapi, 'LIBPREFIX', 'LIBSUFFIX')
-    else:
-        shared_glapi = env.FindIxes(shared_glapi, 'SHLIBPREFIX', 'SHLIBSUFFIX')
-
-    # build glapi bridge as a convenience libarary for libgl-xlib/libgl-gdi
-    bridge_glapi_objects = mapi_objects(env, 'glapi', 'bridge')
-    bridge_glapi = env.ConvenienceLibrary(
-        target = 'glapi_bridge',
-        source = bridge_glapi_objects,
-    )
-
-    Export(['shared_glapi', 'bridge_glapi'])
+env = env.Clone()
+
+env['SHLIBPREFIX'] = 'lib'
+env['LIBPREFIX'] = 'lib'
+
+shared_glapi_objects = mapi_objects(env, 'shared-glapi', 'glapi')
+shared_glapi = env.SharedLibrary(
+    target = 'glapi',
+    source = shared_glapi_objects,
+)
+
+# manually add LIBPREFIX on windows
+if env['platform'] == 'windows':
+    libs = ['libglapi']
+else:
+    libs = ['glapi']
+
+es1api_objects = mapi_objects(env, 'es1api', 'bridge')
+es1api = env.SharedLibrary(
+    target = 'GLESv1_CM',
+    source = es1api_objects,
+    LIBPATH = ['.'],
+    LIBS = libs,
+)
+
+es2api_objects = mapi_objects(env, 'es2api', 'bridge')
+es2api = env.SharedLibrary(
+    target = 'GLESv2',
+    source = es2api_objects,
+    LIBPATH = ['.'],
+    LIBS = libs,
+)
+
+env.InstallSharedLibrary(shared_glapi, version=(0, 0, 0))
+env.InstallSharedLibrary(es1api, version=(1, 0, 0))
+env.InstallSharedLibrary(es2api, version=(2, 0, 0))
+
+if env['platform'] == 'windows':
+    shared_glapi = env.FindIxes(shared_glapi, 'LIBPREFIX', 'LIBSUFFIX')
+else:
+    shared_glapi = env.FindIxes(shared_glapi, 'SHLIBPREFIX', 'SHLIBSUFFIX')
+
+Export(['shared_glapi'])