diff options
author | Kristian Høgsberg <[email protected]> | 2012-03-16 12:55:40 -0400 |
---|---|---|
committer | Kristian Høgsberg <[email protected]> | 2012-03-19 11:13:06 -0400 |
commit | ca760181b4420696c7e86aa2951d7203522ad1e8 (patch) | |
tree | 88e11d719bbd0963594645ab4d16c9c051b8eace /src/mapi/shared-glapi | |
parent | 91ddfa72b4384d04e4d84e60b4cdf3efee7ef49b (diff) |
shared-glapi: Convert to automake
This fixes a build problem where EGL links to libgbm.la, which encodes
a relative path to it's libglapi.so dependency. The relative path
breaks when the linker tries to resolve it from src/egl/main instead
of src/gbm. Typically we silently fall back to the system
libglapi.so, which is wrong and breaks when there isn't one.
Morale of the story: don't mix mklib and libtool.
Diffstat (limited to 'src/mapi/shared-glapi')
-rw-r--r-- | src/mapi/shared-glapi/Makefile | 65 | ||||
-rw-r--r-- | src/mapi/shared-glapi/Makefile.am | 25 |
2 files changed, 25 insertions, 65 deletions
diff --git a/src/mapi/shared-glapi/Makefile b/src/mapi/shared-glapi/Makefile deleted file mode 100644 index 3de864d891c..00000000000 --- a/src/mapi/shared-glapi/Makefile +++ /dev/null @@ -1,65 +0,0 @@ -# src/mapi/shared-glapi/Makefile -# -# Used by OpenGL ES or when --enable-shared-glapi is specified -# - -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 - -include $(GLAPI)/gen/glapi_gen.mk -glapi_mapi_tmp.h: $(GLAPI)/gen/gl_and_es_API.xml $(glapi_gen_mapi_deps) - $(call glapi_gen_mapi,$<,shared-glapi) - -.PHONY: clean -clean: - -rm -f $(TOP)/$(LIB_DIR)/$(GLAPI_LIB_NAME) - -rm -f $(glapi_OBJECTS) - -rm -f depend depend.bak - -rm -f glapi_mapi_tmp.h - -install: - $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR) - $(MINSTALL) $(TOP)/$(LIB_DIR)/$(GLAPI_LIB_GLOB) \ - $(DESTDIR)$(INSTALL_LIB_DIR) - -# workaround a bug in makedepend -makedepend_CPPFLAGS := \ - $(filter-out -DMAPI_ABI_HEADER=%, $(glapi_CPPFLAGS)) -$(glapi_OBJECTS): glapi_mapi_tmp.h - -depend: $(glapi_SOURCES) - @echo "running $(MKDEP)" - @touch depend - @$(MKDEP) $(MKDEP_OPTIONS) -f- $(DEFINES) $(makedepend_CPPFLAGS) \ - $(glapi_SOURCES) 2>/dev/null | sed -e 's,^$(MAPI)/,,' \ - > depend - --include depend diff --git a/src/mapi/shared-glapi/Makefile.am b/src/mapi/shared-glapi/Makefile.am new file mode 100644 index 00000000000..f8e0271d71b --- /dev/null +++ b/src/mapi/shared-glapi/Makefile.am @@ -0,0 +1,25 @@ +# Used by OpenGL ES or when --enable-shared-glapi is specified + +TOP = $(top_srcdir) +GLAPI = $(top_srcdir)/src/mapi/glapi +include $(top_srcdir)/src/mapi/mapi/sources.mak + +lib_LTLIBRARIES = libglapi.la +libglapi_la_SOURCES = $(MAPI_GLAPI_FILES) + +include $(GLAPI)/gen/glapi_gen.mk +glapi_mapi_tmp.h : $(GLAPI)/gen/gl_and_es_API.xml $(glapi_gen_mapi_deps) + $(call glapi_gen_mapi,$<,shared-glapi) + +BUILT_SOURCES = glapi_mapi_tmp.h + +AM_CPPFLAGS = \ + $(DEFINES) \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/src/mapi \ + -DMAPI_MODE_GLAPI \ + -DMAPI_ABI_HEADER=\"shared-glapi/glapi_mapi_tmp.h\" + +all-local: libglapi.la + $(MKDIR_P) $(top_builddir)/$(LIB_DIR) + ln -f .libs/libglapi.so.0.0.0 $(top_builddir)/$(LIB_DIR)/libglapi.so |