This consolidates how we link the libraries into the build directory.
It works for lib_LTLIBRARIES but not custom shared libraries like DRI
drivers or gallium state trackers which needs special casing (cf dri
mega drivers, for example)
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
--- /dev/null
+# Provide compatibility with scripts for the old Mesa build system for
+# a while by putting a link to the driver into /lib of the build tree.
+
+all-local : .libs/install-mesa-links
+
+.libs/install-mesa-links : $(lib_LTLIBRARIES)
+ $(MKDIR_P) $(top_builddir)/$(LIB_DIR)
+ for f in $(lib_LTLIBRARIES:%.la=.libs/%.so*); do \
+ if test -h .libs/$$f; then \
+ cp -d $$f $(top_builddir)/$(LIB_DIR); \
+ else \
+ ln -f $$f $(top_builddir)/$(LIB_DIR); \
+ fi; \
+ done && touch $@
libEGL_la_LIBADD += $(DLOPEN_LIBS) $(LIBDRM_LIBS)
endif
-# Provide compatibility with scripts for the old Mesa build system for
-# a while by putting a link to the driver into /lib of the build tree.
-all-local: libEGL.la
- $(MKDIR_P) $(top_builddir)/$(LIB_DIR);
- ln -f .libs/libEGL.so.1.0.0 $(top_builddir)/$(LIB_DIR)/libEGL.so.1
- ln -sf libEGL.so.1 $(top_builddir)/$(LIB_DIR)/libEGL.so
+include $(top_srcdir)/install-lib-links.mk
pkgconfigdir = $(libdir)/pkgconfig
libgbm_dri.la $(top_builddir)/src/mapi/shared-glapi/libglapi.la $(LIBDRM_LIBS)
endif
-all-local: libgbm.la
- $(MKDIR_P) $(top_builddir)/$(LIB_DIR);
- ln -f .libs/libgbm.so.1.0.0 $(top_builddir)/$(LIB_DIR)/libgbm.so
- ln -f .libs/libgbm.so.1.0.0 $(top_builddir)/$(LIB_DIR)/libgbm.so.1
+include $(top_srcdir)/install-lib-links.mk
lib@GL_LIB@_la_LIBADD = $(GL_LIBS)
lib@GL_LIB@_la_LDFLAGS = $(GL_LDFLAGS)
-# Provide compatibility with scripts for the old Mesa build system for
-# a while by putting a link to the driver into /lib of the build tree.
-all-local: lib@GL_LIB@.la
- $(MKDIR_P) $(top_builddir)/$(LIB_DIR);
- ln -f .libs/lib@GL_LIB@.so.1.2.0 $(top_builddir)/$(LIB_DIR)/lib@GL_LIB@.so.1
- ln -sf lib@GL_LIB@.so.1 $(top_builddir)/$(LIB_DIR)/lib@GL_LIB@.so
+include $(top_srcdir)/install-lib-links.mk
BUILT_SOURCES = glapi_mapi_tmp.h
CLEANFILES = $(BUILT_SOURCES)
-# Provide compatibility with scripts for the old Mesa build system for
-# a while by putting a link to the driver into /lib of the build tree.
-all-local: libGLESv1_CM.la
- $(MKDIR_P) $(top_builddir)/$(LIB_DIR);
- ln -f .libs/libGLESv1_CM.so $(top_builddir)/$(LIB_DIR)/libGLESv1_CM.so
- ln -f .libs/libGLESv1_CM.so.1 $(top_builddir)/$(LIB_DIR)/libGLESv1_CM.so.1
- ln -f .libs/libGLESv1_CM.so.1.1.0 $(top_builddir)/$(LIB_DIR)/libGLESv1_CM.so.1.1.0
+include $(top_srcdir)/install-lib-links.mk
BUILT_SOURCES = glapi_mapi_tmp.h
CLEANFILES = $(BUILT_SOURCES)
-# Provide compatibility with scripts for the old Mesa build system for
-# a while by putting a link to the driver into /lib of the build tree.
-all-local: libGLESv2.la
- $(MKDIR_P) $(top_builddir)/$(LIB_DIR);
- ln -f .libs/libGLESv2.so $(top_builddir)/$(LIB_DIR)/libGLESv2.so
- ln -f .libs/libGLESv2.so.2 $(top_builddir)/$(LIB_DIR)/libGLESv2.so.2
- ln -f .libs/libGLESv2.so.2.0.0 $(top_builddir)/$(LIB_DIR)/libGLESv2.so.2.0.0
+include $(top_srcdir)/install-lib-links.mk
-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.0.0.0
- ln -sf libglapi.so.0.0.0 $(top_builddir)/$(LIB_DIR)/libglapi.so.0
- ln -sf libglapi.so.0 $(top_builddir)/$(LIB_DIR)/libglapi.so
+include $(top_srcdir)/install-lib-links.mk
BUILT_SOURCES = vgapi_tmp.h
CLEANFILES = $(BUILT_SOURCES)
-# Provide compatibility with scripts for the old Mesa build system for
-# a while by putting a link to the driver into /lib of the build tree.
-all-local: libOpenVG.la
- $(MKDIR_P) $(top_builddir)/$(LIB_DIR);
- ln -f .libs/libOpenVG.so $(top_builddir)/$(LIB_DIR)/libOpenVG.so
- ln -f .libs/libOpenVG.so.1 $(top_builddir)/$(LIB_DIR)/libOpenVG.so.1
- ln -f .libs/libOpenVG.so.1.0.0 $(top_builddir)/$(LIB_DIR)/libOpenVG.so.1.0.0
+include $(top_srcdir)/install-lib-links.mk