summaryrefslogtreecommitdiffstats
path: root/src/glx
diff options
context:
space:
mode:
Diffstat (limited to 'src/glx')
-rw-r--r--src/glx/Makefile3
-rw-r--r--src/glx/SConscript3
-rw-r--r--src/glx/glxcmds.c2
-rw-r--r--src/glx/indirect.c4
-rw-r--r--src/glx/indirect.h3
5 files changed, 15 insertions, 0 deletions
diff --git a/src/glx/Makefile b/src/glx/Makefile
index b86bd73be34..f702f952ce7 100644
--- a/src/glx/Makefile
+++ b/src/glx/Makefile
@@ -49,7 +49,10 @@ SOURCES = \
applegl_glx.c
+ifeq ($(SHARED_GLAPI),1)
GL_LIB_DEPS := -L$(TOP)/$(LIB_DIR) -l$(GLAPI_LIB) $(GL_LIB_DEPS)
+EXTRA_DEFINES += -DGLX_SHARED_GLAPI
+endif
# override GLAPI_LIB
GLAPI_LIB = $(TOP)/src/mapi/glapi/libglapi.a
diff --git a/src/glx/SConscript b/src/glx/SConscript
index d08ae9e2c50..17a5690ee86 100644
--- a/src/glx/SConscript
+++ b/src/glx/SConscript
@@ -31,6 +31,9 @@ if env['HAVE_XF86VIDMODE']:
env.Append(CPPDEFINES = ['XF86VIDMODE'])
env.PkgUseModules('XF86VIDMODE')
+if False: # XXX: SHARED_GLAPI
+ env.Append(CPPDEFINES = ['GLX_SHARED_GLAPI'])
+
sources = [
'clientattrib.c',
'clientinfo.c',
diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c
index 35f98a3aca2..37c09336749 100644
--- a/src/glx/glxcmds.c
+++ b/src/glx/glxcmds.c
@@ -2647,7 +2647,9 @@ _X_EXPORT void (*glXGetProcAddressARB(const GLubyte * procName)) (void)
f = (gl_function) get_glx_proc_address((const char *) procName);
if ((f == NULL) && (procName[0] == 'g') && (procName[1] == 'l')
&& (procName[2] != 'X')) {
+#ifdef GLX_SHARED_GLAPI
f = (gl_function) __indirect_get_proc_address((const char *) procName);
+#endif
if (!f)
f = (gl_function) _glapi_get_proc_address((const char *) procName);
if (!f) {
diff --git a/src/glx/indirect.c b/src/glx/indirect.c
index b8e14add410..a6b0c0d6dac 100644
--- a/src/glx/indirect.c
+++ b/src/glx/indirect.c
@@ -10672,6 +10672,8 @@ __indirect_glFramebufferTextureLayerEXT(GLenum target, GLenum attachment,
}
+#ifdef GLX_SHARED_GLAPI
+
static const struct proc_pair {
const char *name;
_glapi_proc proc;
@@ -10727,6 +10729,8 @@ __indirect_get_proc_address(const char *name)
return (pair) ? pair->proc : NULL;
}
+#endif /* GLX_SHARED_GLAPI */
+
#undef FASTCALL
#undef NOINLINE
diff --git a/src/glx/indirect.h b/src/glx/indirect.h
index f76201b64f1..b1fee9fc1a0 100644
--- a/src/glx/indirect.h
+++ b/src/glx/indirect.h
@@ -711,7 +711,10 @@ extern _X_HIDDEN GLboolean __indirect_glIsRenderbufferEXT(GLuint renderbuffer);
extern _X_HIDDEN void __indirect_glRenderbufferStorageEXT(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
extern _X_HIDDEN void __indirect_glBlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
extern _X_HIDDEN void __indirect_glFramebufferTextureLayerEXT(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
+
+#ifdef GLX_SHARED_GLAPI
extern _X_HIDDEN void (*__indirect_get_proc_address(const char *name))(void);
+#endif
# undef FASTCALL
# undef NOINLINE