Re: libsndio SONAME?

From: Alexandre Ratchov <alex_at_caoua.org>
Date: Wed, 10 Jan 2018 22:13:57 +0100
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
_at_@ -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
_at_@ -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'
 		;;
_at_@ -253,6 +255,7 @@ do
 	-e "s:_at_ldadd@:$ldadd:" \
 	-e "s:_at_so@:$so:" \
 	-e "s:_at_so_link@:$so_link:" \
+	-e "s:_at_so_ldflags@:$so_ldflags:" \
 	-e "s:_at_vars@:${vars}:" \
 	-e "s:_at_precision@:$precision:" \
 	-e "s:_at_user@:$user:" \
diff --git a/libsndio/Makefile.in b/libsndio/Makefile.in
index fd6c735..a7fb79b 100644
--- a/libsndio/Makefile.in
+++ b/libsndio/Makefile.in
_at_@ -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 _at_so_ldflags@
 
 # variables defined on configure script command line (if any)
 _at_vars@
Received on Wed Jan 10 2018 - 22:13:57 CET

This archive was generated by hypermail 2.3.0 : Tue Aug 09 2022 - 16:23:47 CEST