summaryrefslogtreecommitdiffstats
path: root/src/mapi
diff options
context:
space:
mode:
Diffstat (limited to 'src/mapi')
-rw-r--r--src/mapi/glapi/SConscript142
-rw-r--r--src/mapi/shared-glapi/SConscript101
-rw-r--r--src/mapi/vgapi/SConscript110
3 files changed, 174 insertions, 179 deletions
diff --git a/src/mapi/glapi/SConscript b/src/mapi/glapi/SConscript
index fdd65790013..dad7d597299 100644
--- a/src/mapi/glapi/SConscript
+++ b/src/mapi/glapi/SConscript
@@ -4,83 +4,81 @@
Import('*')
-if env['platform'] != 'winddk':
+env = env.Clone()
- env = env.Clone()
-
+env.Append(CPPDEFINES = [
+ 'MAPI_MODE_UTIL',
+])
+
+if env['platform'] == 'windows':
env.Append(CPPDEFINES = [
- 'MAPI_MODE_UTIL',
+ '_GDI32_', # prevent gl* being declared __declspec(dllimport) in MS headers
+ 'BUILD_GL32', # declare gl* as __declspec(dllexport) in Mesa headers
])
+ if env['gles']:
+ env.Append(CPPDEFINES = ['_GLAPI_DLL_EXPORTS'])
+ else:
+ # prevent _glapi_* from being declared __declspec(dllimport)
+ env.Append(CPPDEFINES = ['_GLAPI_NO_EXPORTS'])
+
+env.Append(CPPPATH = [
+ '#/src/mapi',
+ '#/src/mesa',
+])
+
+glapi_sources = [
+ 'glapi_dispatch.c',
+ 'glapi_entrypoint.c',
+ 'glapi_getproc.c',
+ 'glapi_nop.c',
+ 'glthread.c',
+ 'glapi.c',
+]
- if env['platform'] == 'windows':
+mapi_sources = [
+ 'u_current.c',
+ 'u_execmem.c',
+ 'u_thread.c',
+]
+for s in mapi_sources:
+ o = env.SharedObject(s[:-2], '../mapi/' + s)
+ glapi_sources.append(o)
+
+#
+# Assembly sources
+#
+if env['gcc'] and env['platform'] != 'windows':
+ if env['machine'] == 'x86':
env.Append(CPPDEFINES = [
- '_GDI32_', # prevent gl* being declared __declspec(dllimport) in MS headers
- 'BUILD_GL32', # declare gl* as __declspec(dllexport) in Mesa headers
+ 'USE_X86_ASM',
])
- if env['gles']:
- env.Append(CPPDEFINES = ['_GLAPI_DLL_EXPORTS'])
- else:
- # prevent _glapi_* from being declared __declspec(dllimport)
- env.Append(CPPDEFINES = ['_GLAPI_NO_EXPORTS'])
-
- env.Append(CPPPATH = [
- '#/src/mapi',
- '#/src/mesa',
- ])
-
- glapi_sources = [
- 'glapi_dispatch.c',
- 'glapi_entrypoint.c',
- 'glapi_getproc.c',
- 'glapi_nop.c',
- 'glthread.c',
- 'glapi.c',
- ]
-
- mapi_sources = [
- 'u_current.c',
- 'u_execmem.c',
- 'u_thread.c',
- ]
- for s in mapi_sources:
- o = env.SharedObject(s[:-2], '../mapi/' + s)
- glapi_sources.append(o)
+ glapi_sources += [
+ 'glapi_x86.S',
+ ]
+ elif env['machine'] == 'x86_64':
+ env.Append(CPPDEFINES = [
+ 'USE_X86_64_ASM',
+ ])
+ glapi_sources += [
+ 'glapi_x86-64.S'
+ ]
+ elif env['machine'] == 'sparc':
+ env.Append(CPPDEFINES = [
+ 'USE_SPARC_ASM',
+ ])
+ glapi_sources += [
+ 'glapi_sparc.S'
+ ]
+ else:
+ pass
- #
- # Assembly sources
- #
- if env['gcc'] and env['platform'] != 'windows':
- if env['machine'] == 'x86':
- env.Append(CPPDEFINES = [
- 'USE_X86_ASM',
- ])
- glapi_sources += [
- 'glapi_x86.S',
- ]
- elif env['machine'] == 'x86_64':
- env.Append(CPPDEFINES = [
- 'USE_X86_64_ASM',
- ])
- glapi_sources += [
- 'glapi_x86-64.S'
- ]
- elif env['machine'] == 'sparc':
- env.Append(CPPDEFINES = [
- 'USE_SPARC_ASM',
- ])
- glapi_sources += [
- 'glapi_sparc.S'
- ]
- else:
- pass
-
- if env['toolchain'] == 'crossmingw':
- # compile these files without -gstabs option
- glapi_sources = env.compile_without_gstabs(glapi_sources, "glapi_dispatch.c")
- glapi_sources = env.compile_without_gstabs(glapi_sources, "glapi_getproc.c")
+if env['toolchain'] == 'crossmingw':
+ # compile these files without -gstabs option
+ glapi_sources = env.compile_without_gstabs(glapi_sources, "glapi_dispatch.c")
+ glapi_sources = env.compile_without_gstabs(glapi_sources, "glapi_getproc.c")
- glapi = env.ConvenienceLibrary(
- target = 'glapi',
- source = glapi_sources,
- )
- Export('glapi')
+glapi = env.ConvenienceLibrary(
+ target = 'glapi',
+ source = glapi_sources,
+)
+Export('glapi')
diff --git a/src/mapi/shared-glapi/SConscript b/src/mapi/shared-glapi/SConscript
index b7c43a73476..f17a4dd892a 100644
--- a/src/mapi/shared-glapi/SConscript
+++ b/src/mapi/shared-glapi/SConscript
@@ -63,54 +63,53 @@ 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')
+
+# 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'])
diff --git a/src/mapi/vgapi/SConscript b/src/mapi/vgapi/SConscript
index ee6d9fb827c..5b4549e0594 100644
--- a/src/mapi/vgapi/SConscript
+++ b/src/mapi/vgapi/SConscript
@@ -5,59 +5,57 @@ from sys import executable as python_cmd
Import('*')
-if env['platform'] != 'winddk':
-
- env = env.Clone()
-
- vgapi_header = env.CodeGenerate(
- target = '#src/mapi/vgapi/vgapi_tmp.h',
- script = '../mapi/mapi_abi.py',
- source = 'vgapi.csv',
- command = python_cmd + ' $SCRIPT --printer vgapi --mode lib $SOURCE > $TARGET'
- )
-
- env.Append(CPPDEFINES = [
- 'MAPI_ABI_HEADER=\\"vgapi/vgapi_tmp.h\\"',
- 'MAPI_DLL_EXPORTS',
- 'KHRONOS_DLL_EXPORTS',
- ])
-
- env.Append(CPPPATH = [
- '#/include',
- '#/src/mapi',
- ])
-
- mapi_sources = [
- 'entry.c',
- 'mapi.c',
- 'stub.c',
- 'table.c',
- 'u_current.c',
- 'u_execmem.c',
- 'u_thread.c',
- ]
-
- vgapi_objects = []
- for s in mapi_sources:
- o = env.SharedObject(s[:-2], '../mapi/' + s)
- vgapi_objects.append(o)
-
- env.Depends(vgapi_objects, vgapi_header)
-
- # libOpenVG.dll
- env['LIBPREFIX'] = 'lib'
- env['SHLIBPREFIX'] = 'lib'
-
- openvg = env.SharedLibrary(
- target = 'OpenVG',
- source = vgapi_objects,
- )
-
- env.InstallSharedLibrary(openvg, version=(1, 0, 0))
-
- if env['platform'] == 'windows':
- openvg = env.FindIxes(openvg, 'LIBPREFIX', 'LIBSUFFIX')
- else:
- openvg = env.FindIxes(openvg, 'SHLIBPREFIX', 'SHLIBSUFFIX')
-
- Export(['openvg'])
+env = env.Clone()
+
+vgapi_header = env.CodeGenerate(
+ target = '#src/mapi/vgapi/vgapi_tmp.h',
+ script = '../mapi/mapi_abi.py',
+ source = 'vgapi.csv',
+ command = python_cmd + ' $SCRIPT --printer vgapi --mode lib $SOURCE > $TARGET'
+)
+
+env.Append(CPPDEFINES = [
+ 'MAPI_ABI_HEADER=\\"vgapi/vgapi_tmp.h\\"',
+ 'MAPI_DLL_EXPORTS',
+ 'KHRONOS_DLL_EXPORTS',
+])
+
+env.Append(CPPPATH = [
+ '#/include',
+ '#/src/mapi',
+])
+
+mapi_sources = [
+ 'entry.c',
+ 'mapi.c',
+ 'stub.c',
+ 'table.c',
+ 'u_current.c',
+ 'u_execmem.c',
+ 'u_thread.c',
+]
+
+vgapi_objects = []
+for s in mapi_sources:
+ o = env.SharedObject(s[:-2], '../mapi/' + s)
+ vgapi_objects.append(o)
+
+env.Depends(vgapi_objects, vgapi_header)
+
+# libOpenVG.dll
+env['LIBPREFIX'] = 'lib'
+env['SHLIBPREFIX'] = 'lib'
+
+openvg = env.SharedLibrary(
+ target = 'OpenVG',
+ source = vgapi_objects,
+)
+
+env.InstallSharedLibrary(openvg, version=(1, 0, 0))
+
+if env['platform'] == 'windows':
+ openvg = env.FindIxes(openvg, 'LIBPREFIX', 'LIBSUFFIX')
+else:
+ openvg = env.FindIxes(openvg, 'SHLIBPREFIX', 'SHLIBSUFFIX')
+
+Export(['openvg'])