From bb770af3a59e5935c108c05ee45490fc5668d4a3 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Fri, 14 Jan 2011 17:50:29 +0800 Subject: scons: Add support for GLES. GLES can be enabled by running scons with $ scons gles=yes When gles=yes is given, the build is changed in three ways. First, libmesa.a will be built with FEATURE_ES1 and FEATURE_ES2. This makes DRI drivers and libEGL support and advertise GLES support. Second, GLES libraries will be created. They are libGLESv1_CM, libGLESv2, and libglapi. Last, libGL or opengl32 will link to libglapi. This change is required as _glapi_* will be declared as __declspec(dllimport) in libmesa.a on windows. libmesa.a expects those symbols to be defined in another DLL. Due to this change to GL, GLES support is marked experimental. Note that GLES requires libxml2-python to generate some of its sources. --- src/gallium/state_trackers/wgl/SConscript | 3 +++ src/gallium/state_trackers/wgl/stw_device.c | 3 +++ 2 files changed, 6 insertions(+) (limited to 'src/gallium/state_trackers/wgl') diff --git a/src/gallium/state_trackers/wgl/SConscript b/src/gallium/state_trackers/wgl/SConscript index 1b7597de44..7cb953ba74 100644 --- a/src/gallium/state_trackers/wgl/SConscript +++ b/src/gallium/state_trackers/wgl/SConscript @@ -15,6 +15,9 @@ env.AppendUnique(CPPDEFINES = [ 'BUILD_GL32', # declare gl* as __declspec(dllexport) in Mesa headers 'WIN32_LEAN_AND_MEAN', # http://msdn2.microsoft.com/en-us/library/6dwk3a1z.aspx ]) +if not env['gles']: + # prevent _glapi_* from being declared __declspec(dllimport) + env.Append(CPPDEFINES = ['_GLAPI_NO_EXPORTS']) sources = [ 'stw_context.c', diff --git a/src/gallium/state_trackers/wgl/stw_device.c b/src/gallium/state_trackers/wgl/stw_device.c index c4822d4d8a..4ece4e4979 100644 --- a/src/gallium/state_trackers/wgl/stw_device.c +++ b/src/gallium/state_trackers/wgl/stw_device.c @@ -170,7 +170,10 @@ stw_cleanup(void) _glthread_DESTROY_MUTEX(OneTimeLock); + /* glapi is statically linked: we can call the local destroy function. */ +#ifdef _GLAPI_NO_EXPORTS _glapi_destroy_multithread(); +#endif #ifdef DEBUG debug_memory_end(stw_dev->memdbg_no); -- cgit v1.2.3