diff options
author | Kristian Høgsberg <[email protected]> | 2014-01-29 11:40:25 -0800 |
---|---|---|
committer | Kristian Høgsberg <[email protected]> | 2014-01-29 12:58:13 -0800 |
commit | cbecd958a7e36736a4447ebe65e5017e5c0ea4a0 (patch) | |
tree | f826f9f122063736ae1f1524a74f6796f451ae38 | |
parent | 7965908976cdd1476db0ee7258d182292f975800 (diff) |
build: Share the all-local rule for linking libraries into the build dir
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 <[email protected]>
Reviewed-by: Matt Turner <[email protected]>
-rw-r--r-- | install-lib-links.mk | 14 | ||||
-rw-r--r-- | src/egl/main/Makefile.am | 7 | ||||
-rw-r--r-- | src/gbm/Makefile.am | 5 | ||||
-rw-r--r-- | src/glx/Makefile.am | 7 | ||||
-rw-r--r-- | src/mapi/es1api/Makefile.am | 8 | ||||
-rw-r--r-- | src/mapi/es2api/Makefile.am | 8 | ||||
-rw-r--r-- | src/mapi/shared-glapi/Makefile.am | 6 | ||||
-rw-r--r-- | src/mapi/vgapi/Makefile.am | 8 |
8 files changed, 21 insertions, 42 deletions
diff --git a/install-lib-links.mk b/install-lib-links.mk new file mode 100644 index 00000000000..73d9e14e6f3 --- /dev/null +++ b/install-lib-links.mk @@ -0,0 +1,14 @@ +# 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 $@ diff --git a/src/egl/main/Makefile.am b/src/egl/main/Makefile.am index e12aeae59b9..4c20d1215ee 100644 --- a/src/egl/main/Makefile.am +++ b/src/egl/main/Makefile.am @@ -115,12 +115,7 @@ libEGL_la_LIBADD += ../drivers/dri2/libegl_dri2.la 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 diff --git a/src/gbm/Makefile.am b/src/gbm/Makefile.am index de5126c0243..eacb96a38e6 100644 --- a/src/gbm/Makefile.am +++ b/src/gbm/Makefile.am @@ -47,7 +47,4 @@ libgbm_la_LIBADD += \ 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 diff --git a/src/glx/Makefile.am b/src/glx/Makefile.am index 54a0cc027da..c8dfb8651b6 100644 --- a/src/glx/Makefile.am +++ b/src/glx/Makefile.am @@ -118,9 +118,4 @@ lib@GL_LIB@_la_SOURCES = 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@[email protected] - $(MKDIR_P) $(top_builddir)/$(LIB_DIR); - ln -f .libs/lib@[email protected] $(top_builddir)/$(LIB_DIR)/lib@[email protected] - ln -sf lib@[email protected] $(top_builddir)/$(LIB_DIR)/lib@[email protected] +include $(top_srcdir)/install-lib-links.mk diff --git a/src/mapi/es1api/Makefile.am b/src/mapi/es1api/Makefile.am index eb98f165aa9..b61f9cb1f66 100644 --- a/src/mapi/es1api/Makefile.am +++ b/src/mapi/es1api/Makefile.am @@ -57,10 +57,4 @@ glapi_mapi_tmp.h: ../glapi/gen/gl_and_es_API.xml $(glapi_gen_mapi_deps) 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 diff --git a/src/mapi/es2api/Makefile.am b/src/mapi/es2api/Makefile.am index c6b0ca4ac3c..a9444937505 100644 --- a/src/mapi/es2api/Makefile.am +++ b/src/mapi/es2api/Makefile.am @@ -61,10 +61,4 @@ glapi_mapi_tmp.h: ../glapi/gen/gl_and_es_API.xml $(glapi_gen_mapi_deps) 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 diff --git a/src/mapi/shared-glapi/Makefile.am b/src/mapi/shared-glapi/Makefile.am index e18c30a2271..b4703be010d 100644 --- a/src/mapi/shared-glapi/Makefile.am +++ b/src/mapi/shared-glapi/Makefile.am @@ -27,8 +27,4 @@ AM_CPPFLAGS = \ -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 diff --git a/src/mapi/vgapi/Makefile.am b/src/mapi/vgapi/Makefile.am index 0af7115eb70..8952df01af3 100644 --- a/src/mapi/vgapi/Makefile.am +++ b/src/mapi/vgapi/Makefile.am @@ -52,10 +52,4 @@ vgapi_tmp.h: $(srcdir)/vgapi.csv $(top_srcdir)/src/mapi/mapi_abi.py 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 |