Mesa (master): Always build shared glapi

Matt Turner mattst88 at kemper.freedesktop.org
Fri Jan 20 11:57:30 PST 2012


Module: Mesa
Branch: master
Commit: adefee50d954151f76150af80207081ae3c247d9
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=adefee50d954151f76150af80207081ae3c247d9

Author: Matt Turner <mattst88 at gmail.com>
Date:   Wed Jan 11 18:32:14 2012 -0500

Always build shared glapi

libglapi.so, libGL.so, libGLESv2.so, libGLESv1_CM.so must all
come from the same version of Mesa or bad things may happen.

Acked-by: Kenneth Graunke <kenneth at whitecape.org>
Signed-off-by: Matt Turner <mattst88 at gmail.com>

---

 configs/autoconf.in                     |    1 -
 configure.ac                            |   24 +-----------------------
 src/egl/drivers/dri2/Android.mk         |    1 -
 src/egl/drivers/dri2/Makefile           |    4 ----
 src/egl/drivers/dri2/egl_dri2.c         |    8 --------
 src/gallium/targets/egl-static/Makefile |    7 -------
 src/gallium/targets/libgl-xlib/Makefile |    2 --
 src/glx/Makefile                        |    3 ---
 src/glx/SConscript                      |    3 ---
 src/glx/glxcmds.c                       |    2 --
 src/glx/indirect.c                      |    4 ----
 src/glx/indirect.h                      |    3 ---
 src/mapi/glapi/Makefile                 |   13 -------------
 src/mapi/glapi/gen/glX_proto_send.py    |    6 ------
 src/mesa/drivers/x11/Makefile           |    2 --
 15 files changed, 1 insertions(+), 82 deletions(-)

diff --git a/configs/autoconf.in b/configs/autoconf.in
index 9ea7588..3e5da79 100644
--- a/configs/autoconf.in
+++ b/configs/autoconf.in
@@ -15,7 +15,6 @@ ASM_FLAGS = @ASM_FLAGS@
 PIC_FLAGS = @PIC_FLAGS@
 DEFINES = @DEFINES@
 API_DEFINES = @API_DEFINES@
-SHARED_GLAPI = @SHARED_GLAPI@
 CFLAGS_NOVISIBILITY = @CPPFLAGS@ @CFLAGS@ \
 	$(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES)
 CXXFLAGS_NOVISIBILITY = @CPPFLAGS@ @CXXFLAGS@ \
diff --git a/configure.ac b/configure.ac
index e13c4cf..f8e69b7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -711,18 +711,6 @@ if test "x$enable_gles2" = xyes; then
 fi
 AC_SUBST([API_DEFINES])
 
-AC_ARG_ENABLE([shared-glapi],
-    [AS_HELP_STRING([--enable-shared-glapi],
-        [EXPERIMENTAL.  Enable shared glapi for OpenGL @<:@default=no@:>@])],
-    [enable_shared_glapi="$enableval"],
-    [enable_shared_glapi=no])
-
-SHARED_GLAPI="0"
-if test "x$enable_shared_glapi" = xyes; then
-    SHARED_GLAPI="1"
-fi
-AC_SUBST([SHARED_GLAPI])
-
 dnl
 dnl Driver configuration. Options are xlib, dri and osmesa right now.
 dnl More later: fbdev, ...
@@ -806,7 +794,7 @@ dnl Driver specific build directories
 dnl
 
 dnl this variable will be prepended to SRC_DIRS and is not exported
-CORE_DIRS=""
+CORE_DIRS="mapi/shared-glapi"
 
 SRC_DIRS=""
 GLU_DIRS="sgi"
@@ -816,13 +804,6 @@ GALLIUM_WINSYS_DIRS="sw"
 GALLIUM_DRIVERS_DIRS="galahad trace rbug noop identity"
 GALLIUM_STATE_TRACKERS_DIRS=""
 
-# build shared-glapi if enabled for OpenGL or if OpenGL ES is enabled
-case "x$enable_shared_glapi$enable_gles1$enable_gles2" in
-x*yes*)
-    CORE_DIRS="$CORE_DIRS mapi/shared-glapi"
-    ;;
-esac
-
 # build glapi if OpenGL is enabled
 if test "x$enable_opengl" = xyes; then
     CORE_DIRS="$CORE_DIRS mapi/glapi"
@@ -1377,9 +1358,6 @@ if test "x$enable_gbm" = xyes; then
 
     if test "x$enable_dri" = xyes; then
         GBM_BACKEND_DIRS="$GBM_BACKEND_DIRS dri"
-        if test "$SHARED_GLAPI" -eq 0; then
-            AC_MSG_ERROR([gbm_dri requires --enable-shared-glapi])
-        fi
     fi
 fi
 AC_SUBST([GBM_LIB_DEPS])
diff --git a/src/egl/drivers/dri2/Android.mk b/src/egl/drivers/dri2/Android.mk
index 5c506f8..b120c95 100644
--- a/src/egl/drivers/dri2/Android.mk
+++ b/src/egl/drivers/dri2/Android.mk
@@ -34,7 +34,6 @@ LOCAL_SRC_FILES := \
 LOCAL_CFLAGS := \
 	-D_EGL_MAIN=_eglBuiltInDriverDRI2 \
 	-DDEFAULT_DRIVER_DIR=\"/system/lib/dri\" \
-	-DHAVE_SHARED_GLAPI \
 	-DHAVE_ANDROID_PLATFORM
 
 LOCAL_C_INCLUDES := \
diff --git a/src/egl/drivers/dri2/Makefile b/src/egl/drivers/dri2/Makefile
index d2b1f4f..5780510 100644
--- a/src/egl/drivers/dri2/Makefile
+++ b/src/egl/drivers/dri2/Makefile
@@ -21,10 +21,6 @@ EGL_LIBS = $(LIBUDEV_LIBS) $(DLOPEN_LIBS) $(LIBDRM_LIB)
 EGL_CFLAGS = -D_EGL_MAIN=_eglBuiltInDriverDRI2
 EGL_BUILTIN = true
 
-ifeq ($(SHARED_GLAPI),1)
-EGL_CFLAGS += -DHAVE_SHARED_GLAPI
-endif
-
 ifneq ($(findstring x11, $(EGL_PLATFORMS)),)
 EGL_SOURCES += platform_x11.c
 EGL_INCLUDES += -DHAVE_X11_PLATFORM $(XCB_DRI2_CFLAGS)
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index 80b2e38..a320f35 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -1362,19 +1362,11 @@ static EGLBoolean
 dri2_load(_EGLDriver *drv)
 {
    struct dri2_egl_driver *dri2_drv = dri2_egl_driver(drv);
-#ifdef HAVE_SHARED_GLAPI
 #ifdef HAVE_ANDROID_PLATFORM
    const char *libname = "libglapi.so";
 #else
    const char *libname = "libglapi.so.0";
 #endif
-#else
-   /*
-    * Both libGL.so and libglapi.so are glapi providers.  There is no way to
-    * tell which one to load.
-    */
-   const char *libname = NULL;
-#endif
    void *handle;
 
    /* RTLD_GLOBAL to make sure glapi symbols are visible to DRI drivers */
diff --git a/src/gallium/targets/egl-static/Makefile b/src/gallium/targets/egl-static/Makefile
index 79a098a..9e87774 100644
--- a/src/gallium/targets/egl-static/Makefile
+++ b/src/gallium/targets/egl-static/Makefile
@@ -8,7 +8,6 @@
 #   EGL_PLATFORMS       - platforms to support
 #   EGL_CLIENT_APIS     - state trackers to support
 #   GALLIUM_WINSYS_DIRS - pipe drivers to support
-#   SHARED_GLAPI        - st/mesa can be statically linked or not
 #
 
 TOP = ../../../..
@@ -70,14 +69,8 @@ endif
 # st/mesa
 ifneq ($(filter $(GL_LIB), $(EGL_CLIENT_APIS)),)
 egl_CPPFLAGS += -I$(TOP)/src/mesa $(API_DEFINES)
-# make st/mesa built-in when there is a single glapi provider
-ifeq ($(SHARED_GLAPI),1)
 egl_LIBS += $(TOP)/src/mesa/libmesagallium.a
 egl_SYS += -lm -lpthread $(DLOPEN_LIBS) -l$(GLAPI_LIB)
-else
-egl_CPPFLAGS += -D_EGL_EXTERNAL_GL=1
-OUTPUTS += st_GL
-endif # SHARED_GLAPI
 endif
 
 # st/vega
diff --git a/src/gallium/targets/libgl-xlib/Makefile b/src/gallium/targets/libgl-xlib/Makefile
index 867b2da..479e085 100644
--- a/src/gallium/targets/libgl-xlib/Makefile
+++ b/src/gallium/targets/libgl-xlib/Makefile
@@ -58,9 +58,7 @@ GL_LIB_DEPS += $(LLVM_LIBS)
 LDFLAGS += $(LLVM_LDFLAGS)
 endif
 
-ifeq ($(SHARED_GLAPI),1)
 GL_LIB_DEPS := -L$(TOP)/$(LIB_DIR) -l$(GLAPI_LIB) $(GL_LIB_DEPS)
-endif
 
 
 .SUFFIXES : .cpp
diff --git a/src/glx/Makefile b/src/glx/Makefile
index f702f95..b86bd73 100644
--- a/src/glx/Makefile
+++ b/src/glx/Makefile
@@ -49,10 +49,7 @@ 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 17a5690..d08ae9e 100644
--- a/src/glx/SConscript
+++ b/src/glx/SConscript
@@ -31,9 +31,6 @@ 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 37c0933..35f98a3 100644
--- a/src/glx/glxcmds.c
+++ b/src/glx/glxcmds.c
@@ -2647,9 +2647,7 @@ _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 a6b0c0d..b8e14ad 100644
--- a/src/glx/indirect.c
+++ b/src/glx/indirect.c
@@ -10672,8 +10672,6 @@ __indirect_glFramebufferTextureLayerEXT(GLenum target, GLenum attachment,
 }
 
 
-#ifdef GLX_SHARED_GLAPI
-
 static const struct proc_pair {
     const char *name;
     _glapi_proc proc;
@@ -10729,8 +10727,6 @@ __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 b1fee9f..f76201b 100644
--- a/src/glx/indirect.h
+++ b/src/glx/indirect.h
@@ -711,10 +711,7 @@ 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
diff --git a/src/mapi/glapi/Makefile b/src/mapi/glapi/Makefile
index bb4ed65..37b178e 100644
--- a/src/mapi/glapi/Makefile
+++ b/src/mapi/glapi/Makefile
@@ -15,7 +15,6 @@ glapi_CPPFLAGS := \
 	-I$(TOP)/src/mapi \
 	-I$(TOP)/src/mesa
 
-ifeq ($(SHARED_GLAPI),1)
 glapi_CPPFLAGS += \
 	-DMAPI_MODE_BRIDGE \
 	-DMAPI_ABI_HEADER=\"glapi/glapi_mapi_tmp.h\"
@@ -24,14 +23,6 @@ glapi_SOURCES := $(addprefix $(MAPI)/, $(MAPI_BRIDGE_SOURCES))
 glapi_GLAPI_OBJECTS :=
 glapi_ASM_OBJECTS :=
 glapi_MAPI_OBJECTS := $(MAPI_BRIDGE_SOURCES:.c=.o)
-else
-glapi_CPPFLAGS += -DMAPI_MODE_UTIL
-glapi_SOURCES := $(GLAPI_SOURCES) $(addprefix $(MAPI)/, $(MAPI_UTIL_SOURCES))
-
-glapi_GLAPI_OBJECTS := $(GLAPI_SOURCES:.c=.o)
-glapi_ASM_OBJECTS := $(GLAPI_ASM_SOURCES:.S=.o)
-glapi_MAPI_OBJECTS := $(MAPI_UTIL_SOURCES:.c=.o)
-endif # SHARED_GLAPI
 
 glapi_OBJECTS := \
 	$(glapi_GLAPI_OBJECTS) \
@@ -59,14 +50,10 @@ clean:
 	-rm -f lib$(TARGET).a
 	-rm -f depend depend.bak
 
-ifeq ($(SHARED_GLAPI),1)
 # workaround a bug in makedepend
 makedepend_CPPFLAGS := \
 	$(filter-out -DMAPI_ABI_HEADER=%, $(glapi_CPPFLAGS))
 $(glapi_OBJECTS): glapi_mapi_tmp.h
-else
-makedepend_CPPFLAGS := $(glapi_CPPFLAGS)
-endif
 
 depend: $(glapi_SOURCES)
 	@ echo "running $(MKDEP)"
diff --git a/src/mapi/glapi/gen/glX_proto_send.py b/src/mapi/glapi/gen/glX_proto_send.py
index bec0222..29bf080 100644
--- a/src/mapi/glapi/gen/glX_proto_send.py
+++ b/src/mapi/glapi/gen/glX_proto_send.py
@@ -361,8 +361,6 @@ const GLuint __glXDefaultPixelStore[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 1 };
 					procs[n] = func.static_glx_name(n)
 
 		print """
-#ifdef GLX_SHARED_GLAPI
-
 static const struct proc_pair
 {
    const char *name;
@@ -396,8 +394,6 @@ __indirect_get_proc_address(const char *name)
 
    return (pair) ? pair->proc : NULL;
 }
-
-#endif /* GLX_SHARED_GLAPI */
 """
 		return
 
@@ -1051,9 +1047,7 @@ extern _X_HIDDEN NOINLINE FASTCALL GLubyte * __glXSetupVendorRequest(
 					break
 
 		print ''
-		print '#ifdef GLX_SHARED_GLAPI'
 		print 'extern _X_HIDDEN void (*__indirect_get_proc_address(const char *name))(void);'
-		print '#endif'
 
 
 def show_usage():
diff --git a/src/mesa/drivers/x11/Makefile b/src/mesa/drivers/x11/Makefile
index 412fbfe..acb6f08 100644
--- a/src/mesa/drivers/x11/Makefile
+++ b/src/mesa/drivers/x11/Makefile
@@ -44,9 +44,7 @@ INCLUDE_DIRS = \
 
 CORE_MESA = $(TOP)/src/mesa/libmesa.a $(TOP)/src/mapi/glapi/libglapi.a
 
-ifeq ($(SHARED_GLAPI),1)
 GL_LIB_DEPS := -L$(TOP)/$(LIB_DIR) -l$(GLAPI_LIB) $(GL_LIB_DEPS)
-endif
 
 
 .c.o:



More information about the mesa-commit mailing list