diff options
author | Chia-I Wu <[email protected]> | 2010-12-26 18:02:59 +0800 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2011-01-20 17:15:50 +0800 |
commit | 9767d3b5ad08640737e9d8dd4feb046478ae1f4b (patch) | |
tree | 6353dc0af4284cc15350a2f43cb64c6f62872b00 /src/mapi/shared-glapi | |
parent | 97185bf2654f7e72d8bfcc216f905492655d4c77 (diff) |
glapi: Fix OpenGL ES 1.1 and 2.0 interop.
Move _glapi_* symbols from libGLESv1_CM.so and libGLESv2.so to
libglapi.so. This makes sure an app will get only one copy of glapi in
its address space.
Note that with this change, libGLES* and libglapi must be built from the
same source tree and distributed together. This requirement comes from
the fact that the dispatch offsets used by these libraries are
re-assigned whenever GLAPI XMLs are changed.
Diffstat (limited to 'src/mapi/shared-glapi')
-rw-r--r-- | src/mapi/shared-glapi/Makefile | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/src/mapi/shared-glapi/Makefile b/src/mapi/shared-glapi/Makefile new file mode 100644 index 00000000000..b89c458f501 --- /dev/null +++ b/src/mapi/shared-glapi/Makefile @@ -0,0 +1,61 @@ +# src/mapi/shared-glapi/Makefile +# +# Used by OpenGL ES +# + +TOP := ../../.. +include $(TOP)/configs/current + +GLAPI := $(TOP)/src/mapi/glapi +MAPI := $(TOP)/src/mapi/mapi + +glapi_CPPFLAGS := \ + -I$(TOP)/include \ + -I$(TOP)/src/mapi \ + -DMAPI_MODE_GLAPI \ + -DMAPI_ABI_HEADER=\"shared-glapi/glapi_mapi_tmp.h\" + +include $(MAPI)/sources.mak +glapi_SOURCES := $(addprefix $(MAPI)/, $(MAPI_GLAPI_SOURCES)) +glapi_OBJECTS := $(MAPI_GLAPI_SOURCES:.c=.o) + +.PHONY: default +default: depend $(TOP)/$(LIB_DIR)/$(GLAPI_LIB_NAME) + +$(TOP)/$(LIB_DIR)/$(GLAPI_LIB_NAME): $(glapi_OBJECTS) + $(MKLIB) -o $(GLAPI_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \ + -major 0 -minor 0 -patch 0 \ + -id $(INSTALL_LIB_DIR)/lib$(GLAPI_LIB).0.dylib \ + $(MKLIB_OPTIONS) -install $(TOP)/$(LIB_DIR) \ + $(glapi_OBJECTS) $(GLAPI_LIB_DEPS) + +$(glapi_OBJECTS): %.o: $(MAPI)/%.c + $(CC) -c $(glapi_CPPFLAGS) $(CFLAGS) $< -o $@ + +$(glapi_SOURCES): glapi_mapi_tmp.h + +.PHONY: glapi_mapi_tmp.h +glapi_mapi_tmp.h: + @$(MAKE) -C $(GLAPI)/gen-es shared-glapi + +.PHONY: clean +clean: + -rm -f $(TOP)/$(LIB_DIR)/$(GLAPI_LIB_NAME) + -rm -f $(glapi_OBJECTS) + -rm -f depend depend.bak + @# clean generated sources/headers + @$(MAKE) -C $(GLAPI)/gen-es clean-shared-glapi + +install: + $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR) + $(MINSTALL) $(TOP)/$(LIB_DIR)/$(GLAPI_LIB_GLOB) \ + $(DESTDIR)$(INSTALL_LIB_DIR) + +depend: $(glapi_SOURCES) + @echo "running $(MKDEP)" + @touch depend + @$(MKDEP) $(MKDEP_OPTIONS) -f- $(DEFINES) $(glapi_CPPFLAGS) \ + $(glapi_SOURCES) 2>/dev/null | sed -e 's,^$(MAPI)/,,' \ + > depend + +-include depend |