[Mesa-dev] [PATCH] build: remove script compatibility symlinks

Jonathan Gray jsg at jsg.id.au
Thu Jun 20 22:54:29 PDT 2013


On Thu, Jun 20, 2013 at 08:32:03PM -0700, Kenneth Graunke wrote:
> On 06/20/2013 06:45 PM, Jonathan Gray wrote:
> >On Thu, Jun 20, 2013 at 04:00:04PM -0600, Brian Paul wrote:
> >>On 06/20/2013 03:32 PM, Dave Airlie wrote:
> >>>On Fri, Jun 21, 2013 at 2:28 AM, Jonathan Gray <jsg at jsg.id.au> wrote:
> >>>>The symlinks for compatibility with old scripts assumes
> >>>>sysv shared library versioning and breaks other systems.
> >>>>
> >>>>For example OpenBSD uses sunos 4 style .so.major.minor
> >>>>versioning so the targets with ln will fail.
> >>>>
> >>>>Fixes bug 63269.
> >>>>
> >>>
> >>>totally nak.
> >>
> >>Yeah, I don't want to loose this feature either.
> >>
> >>
> >>>My fix you mean avoids?
> >>>
> >>>A lot of developers use this feature, I do wonder if maybe we can move
> >>>it behind a configure switch though as I think it also causes some
> >>>rpaths to be emitted that I think distro packages would like to avoid.
> >>
> >>We could certainly be smarter about whether to make the links or how
> >>they're made.  I'd rather pursue that.
> >
> >Perhaps it is enough to glob the ln calls so the .patch part
> >is never explicitly referenced.  The additional symlinks to
> >the library won't always make sense on non linux systems but
> >at least mesa would actually build again then.
> 
> We could almost do:
> 
> for lib in .libs/foo.so*; do ln -f $lib
> $(top_builddir)/$(LIB_DIR)/`basename $lib`; done
> 
> This would create hardlinks for every library that actually got
> built. Unfortunately, I think it means that the symlinks will point
> to the original .libs/foo.so.1.0.0 file, which means that you can't
> just copy 'lib' around anymore.  Hm.
> 
> Alternatively, what about simply having 'make' run 'make
> DESTDIR=$(top_builddir)/$(LIB_DIR) install' or the like?  I guess
> that would put libraries in mesa/lib/<prefix>/<libdir> and DRI
> drivers in mesa/lib/<prefix>/<libdir>/dri, which is a little
> annoying.  And does rpath nonsense...

The following is enough to avoid the specific problem on OpenBSD.
There doesn't appear to be any easy way to get the name of
the shared library from automake/libtool.

diff --git src/egl/main/Makefile.am src/egl/main/Makefile.am
index ca5257a..ebe15f6 100644
--- src/egl/main/Makefile.am
+++ src/egl/main/Makefile.am
@@ -120,7 +120,7 @@ endif
 # 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 -f .libs/libEGL.so.1.0* $(top_builddir)/$(LIB_DIR)/libEGL.so.1
 	ln -sf libEGL.so.1 $(top_builddir)/$(LIB_DIR)/libEGL.so
 
 pkgconfigdir = $(libdir)/pkgconfig
diff --git src/gbm/Makefile.am src/gbm/Makefile.am
index e22c55c..cc4ba61 100644
--- src/gbm/Makefile.am
+++ src/gbm/Makefile.am
@@ -43,4 +43,4 @@ 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* $(top_builddir)/$(LIB_DIR)/libgbm.so
diff --git src/glx/Makefile.am src/glx/Makefile.am
index f01709b..faecfd6 100644
--- src/glx/Makefile.am
+++ src/glx/Makefile.am
@@ -112,5 +112,5 @@ lib at GL_LIB@_la_LDFLAGS = $(GL_LDFLAGS)
 # a while by putting a link to the driver into /lib of the build tree.
 all-local: lib at GL_LIB@.la
 	$(MKDIR_P) $(top_builddir)/$(LIB_DIR);
-	ln -f .libs/lib at GL_LIB@.so.1.2.0 $(top_builddir)/$(LIB_DIR)/lib at GL_LIB@.so.1
+	ln -f .libs/lib at GL_LIB@.so.1.2* $(top_builddir)/$(LIB_DIR)/lib at GL_LIB@.so.1
 	ln -sf lib at GL_LIB@.so.1 $(top_builddir)/$(LIB_DIR)/lib at GL_LIB@.so
diff --git src/mapi/es1api/Makefile.am src/mapi/es1api/Makefile.am
index eb98f16..f7bcce2 100644
--- src/mapi/es1api/Makefile.am
+++ src/mapi/es1api/Makefile.am
@@ -61,6 +61,4 @@ CLEANFILES = $(BUILT_SOURCES)
 # 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
+	ln -f .libs/libGLESv1_CM.so* $(top_builddir)/$(LIB_DIR)/
diff --git src/mapi/es2api/Makefile.am src/mapi/es2api/Makefile.am
index c6b0ca4..9e0419a 100644
--- src/mapi/es2api/Makefile.am
+++ src/mapi/es2api/Makefile.am
@@ -65,6 +65,4 @@ CLEANFILES = $(BUILT_SOURCES)
 # 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
+	ln -f .libs/libGLESv2.so* $(top_builddir)/$(LIB_DIR)/
diff --git src/mapi/shared-glapi/Makefile.am src/mapi/shared-glapi/Makefile.am
index 2021a73..88c0959 100644
--- src/mapi/shared-glapi/Makefile.am
+++ src/mapi/shared-glapi/Makefile.am
@@ -27,6 +27,7 @@ AM_CPPFLAGS =							\
 
 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
+	$(eval SONAME=$(shell ls .libs/libglapi.so.0.0* | cut -d / -f 2))
+	ln -f .libs/$(SONAME) $(top_builddir)/$(LIB_DIR)/$(SONAME)
+	ln -sf $(SONAME) $(top_builddir)/$(LIB_DIR)/libglapi.so.0
 	ln -sf libglapi.so.0 $(top_builddir)/$(LIB_DIR)/libglapi.so
diff --git src/mapi/vgapi/Makefile.am src/mapi/vgapi/Makefile.am
index 0af7115..a6dc2e0 100644
--- src/mapi/vgapi/Makefile.am
+++ src/mapi/vgapi/Makefile.am
@@ -56,6 +56,4 @@ CLEANFILES = $(BUILT_SOURCES)
 # 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
+	ln -f .libs/libOpenVG.so* $(top_builddir)/$(LIB_DIR)/
diff --git src/mesa/libdricore/Makefile.am src/mesa/libdricore/Makefile.am
index 56ceeb7..cad78cd 100644
--- src/mesa/libdricore/Makefile.am
+++ src/mesa/libdricore/Makefile.am
@@ -71,7 +71,7 @@ lib_LTLIBRARIES = libdricore at VERSION@.la
 # a while by putting a link to the driver into /lib of the build tree.
 all-local: libdricore at VERSION@.la
 	$(MKDIR_P) $(top_builddir)/$(LIB_DIR);
-	ln -f .libs/libdricore at VERSION@.so.1.0.0 $(top_builddir)/$(LIB_DIR)/libdricore at VERSION@.so.1;
+	ln -f .libs/libdricore at VERSION@.so.1.0* $(top_builddir)/$(LIB_DIR)/libdricore at VERSION@.so.1;
 	ln -sf libdricore at VERSION@.so.1 $(top_builddir)/$(LIB_DIR)/libdricore at VERSION@.so
 endif
 


More information about the mesa-dev mailing list