summaryrefslogtreecommitdiffstats
path: root/src/glx/apple/Makefile
diff options
context:
space:
mode:
authorJeremy Huddleston <[email protected]>2011-06-07 18:51:17 -0700
committerJeremy Huddleston <[email protected]>2011-06-07 23:06:35 -0700
commit7d215e7c4d0ca8a18d91d4f30f79b97835a6d6c4 (patch)
tree8d817992ed293025b7ad1b7f85f09acd98db9f6c /src/glx/apple/Makefile
parent88cec591706ff63870c9c2a04394034b6f761f9c (diff)
apple: Use glapi rather than reinventing the wheel
With this change, Apple's libGL is now using glapi rather than implementing its own dispatch. In this implementation, two dispatch tables are created: __ogl_framework_api always points into OpenGL.framework. __applegl_api is the vtable that is used. It points into OpenGL.framework or to local implementations that override / interpose this in OpenGL.framework The initialization for __ogl_framework_api was copied from XQuartz with some modifications and probably still needs further edits to better deal with aliases. This is a good step towards supporting both indirect and direct rendering on darwin. Signed-off-by: Jeremy Huddleston <[email protected]>
Diffstat (limited to 'src/glx/apple/Makefile')
-rw-r--r--src/glx/apple/Makefile28
1 files changed, 11 insertions, 17 deletions
diff --git a/src/glx/apple/Makefile b/src/glx/apple/Makefile
index 1196701ad99..c27f7d1e875 100644
--- a/src/glx/apple/Makefile
+++ b/src/glx/apple/Makefile
@@ -30,8 +30,7 @@ SOURCES = \
apple_glx_pixmap.c \
apple_glx_surface.c \
apple_visual.c \
- apple_xgl_api.c \
- apple_xgl_api_additional.c \
+ apple_glapi.c \
apple_xgl_api_read.c \
apple_xgl_api_stereo.c \
apple_xgl_api_viewport.c \
@@ -54,18 +53,18 @@ SOURCES = \
include $(TOP)/src/mesa/sources.mak
-LDFLAGS += -lXplugin -framework ApplicationServices -framework CoreFoundation
+# override GLAPI_LIB
+GLAPI_LIB = $(TOP)/src/mapi/glapi/libglapi.a
-MESA_GLAPI_ASM_SOURCES = $(addprefix $(TOP)/src/mesa/, $(GLAPI_ASM_SOURCES))
-MESA_GLAPI_SOURCES = $(addprefix $(TOP)/src/mesa/, $(GLAPI_SOURCES))
-MESA_GLAPI_OBJECTS = $(addprefix $(TOP)/src/mesa/, $(GLAPI_OBJECTS))
+LDFLAGS += -lXplugin -framework ApplicationServices -framework CoreFoundation
-OBJECTS = $(SOURCES:.c=.o) # $(MESA_GLAPI_OBJECTS)
+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) \
@@ -74,13 +73,6 @@ INCLUDES = -I. -Iinclude -I..\
##### RULES #####
-$(OBJECTS) : apple_xgl_api.h
-
-apple_xgl_api.c : apple_xgl_api.h
-
-apple_xgl_api.h : gen_api_header.tcl gen_api_library.tcl gen_code.tcl gen_defs.tcl gen_exports.tcl gen_funcs.tcl gen_types.tcl
- $(TCLSH) gen_code.tcl
-
.c.o:
$(CC) -c $(INCLUDES) $(CFLAGS) $(EXTRA_DEFINES) $< -o $@
@@ -92,11 +84,14 @@ apple_xgl_api.h : gen_api_header.tcl gen_api_library.tcl gen_code.tcl gen_def
default: depend $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME)
# Make libGL
-$(TOP)/$(LIB_DIR)/$(GL_LIB_NAME): $(OBJECTS) Makefile
+$(TOP)/$(LIB_DIR)/$(GL_LIB_NAME): $(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)
+ $(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
@@ -121,7 +116,6 @@ install: install_libraries
clean:
-rm -f *.o *.a *~
-rm -f *.c~ *.h~
- -rm -f apple_xgl_api.h apple_xgl_api.c
-rm -f *.dylib
-rm -f include/GL/gl.h
-rm -f $(TOP)/$(LIB_DIR)/$(GL_LIB_GLOB)