Fix build of appleglx
authorJon TURNEY <jon.turney@dronecode.org.uk>
Mon, 12 May 2014 09:47:07 +0000 (10:47 +0100)
committerJon TURNEY <jon.turney@dronecode.org.uk>
Fri, 23 May 2014 14:24:07 +0000 (15:24 +0100)
Define GLX_USE_APPLEGL, as config/darwin used to, to turn on specific code to
use the applegl direct renderer

Convert src/glx/apple/Makefile to automake

Since the applegl libGL is now built by linking libappleglx into libGL, rather
than by linking selected files into a special libGL:

- Remove duplicate code in apple/glxreply.c and apple/apple_glx.c.  This makes
apple/glxreply.c empty, so remove it

- Some indirect rendering code is already guarded by !GLX_USE_APPLEGL, but we
need to add those guards to indirect_glx.c, indirect_init.c (via it's
generator), render2.c and vertarr.c so they don't generate anything

Fix and update various includes

glapi_gentable.c (which is only used on darwin), should be included in shared
glapi as well, to provide _glapi_create_table_from_handle()

Note that neither swrast nor indirect is supported in the APPLEGL path at the
moment, which makes things more complex than they need to be.  More untangling
is needed to allow that

v2: Correct apple/Makefile.am for srcdir != builddir

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
22 files changed:
configure.ac
src/glx/Makefile.am
src/glx/apple/Makefile [deleted file]
src/glx/apple/Makefile.am [new file with mode: 0644]
src/glx/apple/apple_glapi.c
src/glx/apple/apple_glx.c
src/glx/apple/apple_glx.h
src/glx/apple/apple_xgl_api_read.c
src/glx/apple/apple_xgl_api_stereo.c
src/glx/apple/apple_xgl_api_viewport.c
src/glx/apple/glxreply.c [deleted file]
src/glx/applegl_glx.c
src/glx/glx_pbuffer.c
src/glx/glxcmds.c
src/glx/glxcurrent.c
src/glx/glxext.c
src/glx/indirect_glx.c
src/glx/render2.c
src/glx/vertarr.c
src/mapi/glapi/Makefile.am
src/mapi/glapi/Makefile.sources
src/mapi/glapi/gen/glX_proto_send.py

index b91520246bb5d3d5b2a0a445e0fa837c8fef48cd..7397341b2907f550aaac8a8443c0365a156d59b0 100644 (file)
@@ -950,6 +950,10 @@ xyesno)
             if test x"$enable_dri3" = xyes; then
                dri_modules="$dri_modules xcb-dri3 xcb-present xcb-sync xshmfence >= $XSHMFENCE_REQUIRED"
             fi
+        fi
+        if test x"$dri_platform" = xapple ; then
+            DEFINES="$DEFINES -DGLX_USE_APPLEGL"
+        fi
     fi
 
     # add xf86vidmode if available
@@ -2235,6 +2239,7 @@ AC_CONFIG_FILES([Makefile
                src/gbm/main/gbm.pc
                src/glsl/Makefile
                src/glx/Makefile
+               src/glx/apple/Makefile
                src/glx/tests/Makefile
                src/gtest/Makefile
                src/loader/Makefile
index 4553de01a1737e99232e1e39efbe4b7de7576f05..cdd898efc878afb359de88268f994215d9af381b 100644 (file)
@@ -24,7 +24,7 @@ SHARED_GLAPI_CFLAGS = -DGLX_SHARED_GLAPI
 SHARED_GLAPI_LIB = $(top_builddir)/src/mapi/shared-glapi/libglapi.la
 endif
 
-SUBDIRS=. tests
+SUBDIRS =
 
 if HAVE_XF86VIDMODE
 EXTRA_DEFINES_XF86VIDMODE = -DXF86VIDMODE
@@ -86,6 +86,8 @@ libglx_la_SOURCES = \
          glx_query.c \
          glxhash.c
 
+libglx_la_LIBADD = $(top_builddir)/src/loader/libloader.la
+
 if HAVE_DRISW
 libglx_la_SOURCES += \
          drisw_glx.c
@@ -114,9 +116,10 @@ endif
 if HAVE_APPLEDRI
 libglx_la_SOURCES += \
          applegl_glx.c
-endif
 
-libglx_la_LIBADD = $(top_builddir)/src/loader/libloader.la
+SUBDIRS += apple
+libglx_la_LIBADD += $(builddir)/apple/libappleglx.la
+endif
 
 GL_LIBS = \
        libglx.la \
@@ -135,4 +138,6 @@ lib@GL_LIB@_la_SOURCES =
 lib@GL_LIB@_la_LIBADD = $(GL_LIBS)
 lib@GL_LIB@_la_LDFLAGS = $(GL_LDFLAGS)
 
+SUBDIRS += . tests
+
 include $(top_srcdir)/install-lib-links.mk
diff --git a/src/glx/apple/Makefile b/src/glx/apple/Makefile
deleted file mode 100644 (file)
index 91a7218..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-TOP = ../../..
-top_builddir = $(TOP)
-# This can be a filthy lie. But it doesn't currently build out-of-tree
-# anyway, so it's no worse than what we've got now.
-top_srcdir = $(TOP)
-
-include $(TOP)/configs/current
-
-#CC=gcc
-#GL_CFLAGS=-Wall -ggdb3 -Os -DHAVE_PTHREAD -D_REENTRANT $(RC_CFLAGS) $(CFLAGS)
-#GL_LDFLAGS=-L$(INSTALL_DIR)/lib -L$(X11_DIR)/lib $(LDFLAGS) -Wl,-single_module
-
-TCLSH=tclsh8.5
-MKDIR=mkdir
-INSTALL=install
-LN=ln
-RM=rm
-
-#INCLUDE=-I. -Iinclude -I.. -DGLX_ALIAS_UNSUPPORTED -I$(INSTALL_DIR)/include -I$(X11_DIR)/include
-
-#COMPILE=$(CC) $(INCLUDE) $(GL_CFLAGS) -c
-
-#The directory with the final binaries.
-BUILD_DIR=builds
-
-default: $(TOP)/$(LIB_DIR)/lib$(GL_LIB).$(LIB_EXT)
-
-SOURCES = \
-       apple_cgl.c \
-       apple_glx.c \
-       apple_glx_context.c \
-       apple_glx_drawable.c \
-       apple_glx_log.c \
-       apple_glx_pbuffer.c \
-       apple_glx_pixmap.c \
-       apple_glx_surface.c \
-       apple_visual.c \
-       apple_glapi.c \
-       apple_xgl_api_read.c \
-       apple_xgl_api_stereo.c \
-       apple_xgl_api_viewport.c \
-       appledri.c \
-       ../create_context.c \
-       ../clientattrib.c \
-       ../compsize.c \
-       ../glxconfig.c \
-       glx_empty.c \
-       ../glx_error.c \
-       ../glx_pbuffer.c \
-       ../glx_query.c \
-       ../glxcmds.c \
-       ../glxcurrent.c \
-       ../glxext.c \
-       ../glxextensions.c \
-       ../glxhash.c \
-       glxreply.c \
-       ../pixel.c \
-       ../xfont.c \
-       ../applegl_glx.c
-
-include $(TOP)/src/mesa/Makefile.sources
-
-# override GLAPI_LIB
-GLAPI_LIB = $(TOP)/src/mapi/glapi/libglapi.a
-
-LDFLAGS += -lXplugin -framework ApplicationServices -framework CoreFoundation
-
-OBJECTS = $(SOURCES:.c=.o)
-
-INCLUDES = -I. -Iinclude -I..\
-       -I$(TOP)/include \
-       -I$(TOP)/include/GL/internal \
-       -I$(TOP)/src/mesa \
-       -I$(TOP)/src/mesa/main \
-       -I$(TOP)/src/mapi \
-       -I$(TOP)/src/mapi/glapi \
-       $(LIBDRM_CFLAGS) \
-       $(DRI2PROTO_CFLAGS) \
-       $(X11_INCLUDES)
-
-##### RULES #####
-
-.c.o:
-       $(CC) -c $(INCLUDES) $(CFLAGS) $(EXTRA_DEFINES) $< -o $@
-
-.S.o:
-       $(CC) -c $(INCLUDES) $(CFLAGS) $(EXTRA_DEFINES)  $< -o $@
-
-##### TARGETS #####
-
-default: depend $(TOP)/$(LIB_DIR)/lib$(GL_LIB).$(LIB_EXT)
-
-# Make libGL
-$(TOP)/$(LIB_DIR)/lib$(GL_LIB).$(LIB_EXT):  $(OBJECTS) $(GLAPI_LIB) Makefile
-       $(MKLIB) -o $(GL_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
-               -major 1 -minor 2 $(MKLIB_OPTIONS) \
-               -install $(TOP)/$(LIB_DIR) -id $(INSTALL_LIB_DIR)/lib$(GL_LIB).1.dylib \
-               $(GL_LIB_DEPS) $(OBJECTS) $(GLAPI_LIB)
-
-$(GLAPI_LIB):
-       @$(MAKE) -C $(TOP)/src/mapi/glapi
-
-depend: $(SOURCES) $(MESA_GLAPI_SOURCES) $(MESA_GLAPI_ASM_SOURCES) Makefile
-       rm -f depend
-       touch depend
-       $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(SOURCES) \
-               $(MESA_GLAPI_SOURCES) $(MESA_GLAPI_ASM_SOURCES) 
-
-# Emacs tags
-tags:
-       etags `find . -name \*.[ch]` `find $(TOP)/include`
-
-install_headers: include/GL/gl.h
-       $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/include/GL
-       $(INSTALL) -m 644 include/GL/gl.h $(DESTDIR)$(INSTALL_DIR)/include/GL
-
-install_libraries: $(TOP)/$(LIB_DIR)/lib$(GL_LIB).$(LIB_EXT)
-       $(MAKE) -C $(TOP)/src/mesa install-libgl
-
-install: install_libraries
-
-# Remove .o and backup files
-clean:
-       -rm -f *.o *.a *~
-       -rm -f *.c~ *.h~
-       -rm -f *.dylib
-       -rm -f include/GL/gl.h
-       -rm -f *.o *~
-       -rm -f depend depend.bak
-
--include depend
diff --git a/src/glx/apple/Makefile.am b/src/glx/apple/Makefile.am
new file mode 100644 (file)
index 0000000..894ab5b
--- /dev/null
@@ -0,0 +1,33 @@
+noinst_LTLIBRARIES = libappleglx.la
+
+AM_CFLAGS = \
+       -I$(top_srcdir)/include \
+       -I$(top_srcdir)/src/glx \
+       -I$(top_srcdir)/src/mesa \
+       -I$(top_builddir)/src/mesa \
+       -I$(top_srcdir)/src/mapi \
+       -I$(top_srcdir)/src/mapi/glapi \
+       -I$(top_builddir)/src/mapi/glapi \
+       $(VISIBILITY_CFLAGS) \
+       $(SHARED_GLAPI_CFLAGS) \
+       $(DEFINES) \
+       $(X11_INCLUDES)
+
+libappleglx_la_SOURCES = \
+       apple_cgl.c \
+       apple_glapi.c \
+       apple_glx.c \
+       apple_glx_context.c \
+       apple_glx_drawable.c \
+       apple_glx_log.c \
+       apple_glx_pbuffer.c \
+       apple_glx_pixmap.c \
+       apple_glx_surface.c \
+       apple_visual.c \
+       apple_xgl_api_read.c \
+       apple_xgl_api_stereo.c \
+       apple_xgl_api_viewport.c \
+       appledri.c \
+       glx_empty.c
+
+libappleglx_la_LDFLAGS = -lXplugin -framework ApplicationServices -framework CoreFoundation
index c9327814d986f5db6cf0be8cec6b425e04901def..4d19f7f6a3ec67ee66e5506ded15f9a9d9aad4aa 100644 (file)
@@ -38,6 +38,7 @@
 
 #include <GL/gl.h>
 
+#include "main/glheader.h"
 #include "glapi.h"
 #include "glapitable.h"
 #include "main/dispatch.h"
index 4e2aa33e59f06268b8ff10ed5955458646f2f18a..3b570882572f198f0df8ef2855eed236c497f23e 100644 (file)
@@ -43,8 +43,6 @@
 static bool initialized = false;
 static int dri_event_base = 0;
 
-const GLuint __glXDefaultPixelStore[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 1 };
-
 int
 apple_get_dri_event_base(void)
 {
index 0967f1812a05ba3bf551adc774aaf0b4cc0b8038..7d94f8873dba189825d3886fbb4fd4b5e770cebb 100644 (file)
@@ -32,7 +32,6 @@
 
 #include <stdbool.h>
 #include <GL/gl.h>
-#include <GL/glxint.h>
 #include <X11/Xlib.h>
 
 #define XP_NO_X_HEADERS
index 612f5f7b01fa8955beb849072638e20ed4979532..4a9a20d3477a1b0d7710e6106fb52217bfb88e91 100644 (file)
@@ -37,6 +37,7 @@
 #include "glxclient.h"
 #include "apple_glx_context.h"
 #include "apple_xgl_api.h"
+#include "main/glheader.h"
 #include "glapitable.h"
 
 extern struct _glapi_table * __ogl_framework_api;
index c9ed684b279ab328208865bf052b0969edf39ad9..4b21aaf79ef34ee24bb6335bb29764644aa1473c 100644 (file)
@@ -40,6 +40,7 @@
 #include "glxclient.h"
 #include "apple_glx_context.h"
 #include "apple_xgl_api.h"
+#include "main/glheader.h"
 #include "glapitable.h"
 
 extern struct _glapi_table * __ogl_framework_api;
@@ -75,7 +76,7 @@ __applegl_glDrawBuffer(GLenum mode)
          break;
       }
 
-      __ogl_framework_api->DrawBuffersARB(n, buf);
+      __ogl_framework_api->DrawBuffers(n, buf);
    }
    else {
       __ogl_framework_api->DrawBuffer(mode);
@@ -116,9 +117,9 @@ __applegl_glDrawBuffers(GLsizei n, const GLenum * bufs)
          newbuf[outi++] = GL_FRONT_RIGHT;
       }
 
-      __ogl_framework_api->DrawBuffersARB(outi, newbuf);
+      __ogl_framework_api->DrawBuffers(outi, newbuf);
    }
    else {
-      __ogl_framework_api->DrawBuffersARB(n, bufs);
+      __ogl_framework_api->DrawBuffers(n, bufs);
    }
 }
index 8f914b425f244d9161fbaabdcb30051e96f3f386..281c90c6bbdc95f86e26146b7bc85654789be580 100644 (file)
@@ -30,6 +30,7 @@
 #include "glxclient.h"
 #include "apple_glx_context.h"
 #include "apple_xgl_api.h"
+#include "main/glheader.h"
 #include "glapitable.h"
 
 extern struct _glapi_table * __ogl_framework_api;
diff --git a/src/glx/apple/glxreply.c b/src/glx/apple/glxreply.c
deleted file mode 100644 (file)
index 240caa7..0000000
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * (C) Copyright Apple Inc. 2008
- * (C) Copyright IBM Corporation 2004, 2005
- * All Rights Reserved.
- * 
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sub license,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- * 
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.  IN NO EVENT SHALL
- * IBM,
- * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include <GL/gl.h>
-#include "glxclient.h"
-#include <GL/glxproto.h>
-
-CARD32
-__glXReadReply(Display * dpy, size_t size, void *dest,
-               GLboolean reply_is_always_array)
-{
-   xGLXSingleReply reply;
-
-   (void) _XReply(dpy, (xReply *) & reply, 0, False);
-   if (size != 0) {
-      if ((reply.length > 0) || reply_is_always_array) {
-         const GLint bytes = (reply_is_always_array)
-            ? (4 * reply.length) : (reply.size * size);
-         const GLint extra = 4 - (bytes & 3);
-
-         _XRead(dpy, dest, bytes);
-         if (extra < 4) {
-            _XEatData(dpy, extra);
-         }
-      }
-      else {
-         (void) memcpy(dest, &(reply.pad3), size);
-      }
-   }
-
-   return reply.retval;
-}
-
-void
-__glXReadPixelReply(Display * dpy, struct glx_context * gc, unsigned max_dim,
-                    GLint width, GLint height, GLint depth, GLenum format,
-                    GLenum type, void *dest, GLboolean dimensions_in_reply)
-{
-   xGLXSingleReply reply;
-   GLint size;
-
-   (void) _XReply(dpy, (xReply *) & reply, 0, False);
-
-   if (dimensions_in_reply) {
-      width = reply.pad3;
-      height = reply.pad4;
-      depth = reply.pad5;
-
-      if ((height == 0) || (max_dim < 2)) {
-         height = 1;
-      }
-      if ((depth == 0) || (max_dim < 3)) {
-         depth = 1;
-      }
-   }
-
-   size = reply.length * 4;
-   if (size != 0) {
-      void *buf = malloc(size);
-
-      if (buf == NULL) {
-         _XEatData(dpy, size);
-         __glXSetError(gc, GL_OUT_OF_MEMORY);
-      }
-      else {
-         const GLint extra = 4 - (size & 3);
-
-         _XRead(dpy, buf, size);
-         if (extra < 4) {
-            _XEatData(dpy, extra);
-         }
-
-         __glEmptyImage(gc, 3, width, height, depth, format, type, buf, dest);
-         free(buf);
-      }
-   }
-}
-
-#if 0
-GLubyte *
-__glXSetupSingleRequest(struct glx_context * gc, GLint sop, GLint cmdlen)
-{
-   xGLXSingleReq *req;
-   Display *const dpy = gc->currentDpy;
-
-   (void) __glXFlushRenderBuffer(gc, gc->pc);
-   LockDisplay(dpy);
-   GetReqExtra(GLXSingle, cmdlen, req);
-   req->reqType = gc->majorOpcode;
-   req->contextTag = gc->currentContextTag;
-   req->glxCode = sop;
-   return (GLubyte *) (req) + sz_xGLXSingleReq;
-}
-#endif
-
-GLubyte *
-__glXSetupVendorRequest(struct glx_context * gc, GLint code, GLint vop,
-                        GLint cmdlen)
-{
-   xGLXVendorPrivateReq *req;
-   Display *const dpy = gc->currentDpy;
-
-   (void) __glXFlushRenderBuffer(gc, gc->pc);
-   LockDisplay(dpy);
-   GetReqExtra(GLXVendorPrivate, cmdlen, req);
-   req->reqType = gc->majorOpcode;
-   req->glxCode = code;
-   req->vendorCode = vop;
-   req->contextTag = gc->currentContextTag;
-   return (GLubyte *) (req) + sz_xGLXVendorPrivateReq;
-}
index 4e2d5d021aea3b76167a189d3f74fd76c5ccf3b7..c086e5146a84f1f3d2ad77d1ba772c89e19fb11a 100644 (file)
@@ -37,9 +37,9 @@
 #include <dlfcn.h>
 
 #include "glxclient.h"
-#include "apple_glx_context.h"
-#include "apple_glx.h"
-#include "apple_cgl.h"
+#include "apple/apple_glx_context.h"
+#include "apple/apple_glx.h"
+#include "apple/apple_cgl.h"
 #include "glx_error.h"
 
 static void
index 0cd05545786c657a2cc7bda67dd144b2f395d7d9..8f4809345583a0ff5fc52f7bc10c32144215828d 100644 (file)
@@ -39,7 +39,7 @@
 
 #ifdef GLX_USE_APPLEGL
 #include <pthread.h>
-#include "apple_glx_drawable.h"
+#include "apple/apple_glx_drawable.h"
 #endif
 
 #include "glx_error.h"
index 7984715036054a47fd30c8cd4744d3acc36a3fe1..c8de79276137716765b30249b19f6f9b2735a625 100644 (file)
@@ -41,8 +41,8 @@
 
 #ifdef GLX_DIRECT_RENDERING
 #ifdef GLX_USE_APPLEGL
-#include "apple_glx_context.h"
-#include "apple_glx.h"
+#include "apple/apple_glx_context.h"
+#include "apple/apple_glx.h"
 #else
 #include <sys/time.h>
 #ifdef XF86VIDMODE
index 2e5111b8cf73738135cec72a1e7bf1ddaa6e18a1..dc2acd5e2ab9ef09c64056514f3cff6d08fc2fd4 100644 (file)
 #endif
 
 #include "glxclient.h"
-#ifdef GLX_USE_APPLEGL
-#include <stdlib.h>
-
-#include "apple_glx.h"
-#include "apple_glx_context.h"
-#endif
 
 #include "glapi.h"
 
index 29317906d52bdeaaa88feb0b617a2d8bad7a947a..24c80d4f31d51f0f33fe548595ac49203a363a26 100644 (file)
@@ -42,8 +42,8 @@
 #include <X11/extensions/Xext.h>
 #include <X11/extensions/extutil.h>
 #ifdef GLX_USE_APPLEGL
-#include "apple_glx.h"
-#include "apple_visual.h"
+#include "apple/apple_glx.h"
+#include "apple/apple_visual.h"
 #endif
 #include "glxextensions.h"
 
index 1bcecda9f48d1b2f9fb6192c80f07b99491757f6..bb121f85b40f3e27061365c617c38cab32d8811e 100644 (file)
@@ -33,6 +33,8 @@
 #include "glapi.h"
 #include "glxclient.h"
 
+#ifndef GLX_USE_APPLEGL
+
 extern struct _glapi_table *__glXNewIndirectAPI(void);
 
 /*
@@ -488,3 +490,5 @@ indirect_create_screen(int screen, struct glx_display * priv)
 
    return psc;
 }
+
+#endif
index a33c2cf19bf30386ec4a8a45950b6f79e7993501..3dfee7c4651ac69778e5a0d0df4020e77e7b189b 100644 (file)
@@ -28,6 +28,8 @@
  * Silicon Graphics, Inc.
  */
 
+#ifndef GLX_USE_APPLEGL
+
 #include "packrender.h"
 #include "indirect.h"
 #include "indirect_size.h"
@@ -379,3 +381,5 @@ __indirect_glDisable(GLenum cap)
    __GLX_PUT_LONG(4, cap);
    __GLX_END(8);
 }
+
+#endif
index 609cafac2b1f2a397397b7c2dbd33aaeca72575e..066bf59f759a74d687a3c4a8f90745772d94688c 100644 (file)
@@ -32,6 +32,7 @@
 #include "indirect.h"
 #include "indirect_vertex_array.h"
 
+#ifndef GLX_USE_APPLEGL
 
 /*****************************************************************************/
 
@@ -210,3 +211,5 @@ __indirect_glInterleavedArrays(GLenum format, GLsizei stride,
                               trueStride,
                               (const char *) pointer + offsets[3]);
 }
+
+#endif
index e425baceacf8166710fd20e9a73713e93a5586fa..cadcd69d6641fe141974e77f788ae62800ca3f64 100644 (file)
@@ -48,13 +48,13 @@ if HAVE_SHARED_GLAPI
 AM_CPPFLAGS += \
        -DMAPI_MODE_BRIDGE \
        -DMAPI_ABI_HEADER=\"glapi/glapi_mapi_tmp.h\"
-glapi_GLAPI_sources =
+glapi_GLAPI_sources = $(GLAPI_UTIL_SOURCES)
 glapi_ASM_sources =
 glapi_MAPI_sources = $(MAPI_BRIDGE_FILES)
 else
 AM_CPPFLAGS += \
        -DMAPI_MODE_UTIL
-glapi_GLAPI_sources = $(GLAPI_SOURCES)
+glapi_GLAPI_sources = $(GLAPI_SOURCES) $(GLAPI_UTIL_SOURCES)
 glapi_ASM_sources = $(GLAPI_ASM_SOURCES)
 glapi_MAPI_sources = $(MAPI_UTIL_FILES)
 endif
index 04fef6c9e4b9b4dfda9459733e27c0e65a166373..aae41a88d9bbc81ed7e7914d203b60e6ddc514d8 100644 (file)
@@ -1,9 +1,11 @@
 # src/mapi/glapi/Makefile.sources
 
+GLAPI_UTIL_SOURCES = \
+       glapi_gentable.c
+
 GLAPI_SOURCES = \
        glapi_dispatch.c \
        glapi_entrypoint.c \
-       glapi_gentable.c \
        glapi_getproc.c \
        glapi_nop.c \
        glapi.c \
index a98f63e99ab8a53d703b3a1a47e0e3b0ecd9f45c..1419a7cc1bc44444754dabf174ee652fefc19027 100644 (file)
@@ -947,6 +947,7 @@ class PrintGlxProtoInit_c(gl_XML.gl_print_base):
 #include "glapi.h"
 #include <assert.h>
 
+#ifndef GLX_USE_APPLEGL
 
 /**
  * No-op function used to initialize functions that have no GLX protocol
@@ -984,6 +985,8 @@ struct _glapi_table * __glXNewIndirectAPI( void )
         print """
     return (struct _glapi_table *) table;
 }
+
+#endif
 """
         return