Re: libsndio SONAME?

From: Alexandre Ratchov <alex_at_caoua.org>
Date: Wed Jan 10 2018 - 22:13:57 CET
On Wed, Jan 10, 2018 at 02:04:52PM -0500, Peter Piwowarski wrote:
> I'm working on (finally...) updating the sndio Debian package to the
> latest version, and have come across something curious. As of portable
> release 1.3.0, part of the SO_LDFLAGS definition in
> libsndio/Makefile.in is seemingly commented out:
> 
> SO_LDFLAGS = -shared #-Wl,-soname=libsndio.so.${MAJ}.${MIN}
> 
> (as opposed to:)
> 
> SO_LDFLAGS = -shared -Wl,-soname=libsndio.so.${MAJ}.${MIN}
> 
> Can anyone explain why this is? I believe I'll need to revert this
> change in a local patch to comply with Debian policy in the new package
> (they're very strict about libraries having their SONAMEs just so).

Embarassing; this was commented out by mistake when porting libsndio
to MacOS and, as BSDs don't rely on soname, it remained unnoticed.

Does the fix below look OK for you? It "reverts" the SONAME setting
attempting to not change non-Linux builds.

diff --git a/configure b/configure
index 9c1d08a..d1e4353 100755
--- a/configure
+++ b/configure
@@ -40,6 +40,7 @@ umidi=no				# do we want support for umidi ?
 precision=16				# aucat/sndiod arithmetic precision
 user=_sndio				# non-privileged user for sndio daemon
 libbsd=no				# use libbsd?
+so_ldflags=				# extra linker flags for shared libs
 unset vars				# variables passed as arguments
 unset bindir				# path where to install binaries
 unset datadir				# path where to install doc
@@ -57,6 +58,7 @@ case `uname` in
 		alsa=yes
 		ldadd="-lrt"
 		user=sndiod
+		so_ldflags="-Wl,-soname=libsndio.\${MAJ}.\${MIN}"
 		so_link="libsndio.so"
 		defs='-D_GNU_SOURCE -DHAVE_SOCK_CLOEXEC -DHAVE_CLOCK_GETTIME'
 		;;
@@ -253,6 +255,7 @@ do
 	-e "s:@ldadd@:$ldadd:" \
 	-e "s:@so@:$so:" \
 	-e "s:@so_link@:$so_link:" \
+	-e "s:@so_ldflags@:$so_ldflags:" \
 	-e "s:@vars@:${vars}:" \
 	-e "s:@precision@:$precision:" \
 	-e "s:@user@:$user:" \
diff --git a/libsndio/Makefile.in b/libsndio/Makefile.in
index fd6c735..a7fb79b 100644
--- a/libsndio/Makefile.in
+++ b/libsndio/Makefile.in
@@ -14,7 +14,7 @@ LDADD = @ldadd@
 SO_CFLAGS = -fPIC
 
 # extra compiler flags to produce a shared library with the given name
-SO_LDFLAGS = -shared #-Wl,-soname=libsndio.so.${MAJ}.${MIN}
+SO_LDFLAGS = -shared @so_ldflags@
 
 # variables defined on configure script command line (if any)
 @vars@
Received on Wed, 10 Jan 2018 22:13:57 +0100

This archive was generated by hypermail 2.1.8 : Thu Jan 11 2018 - 01:31:43 CET