Add libsndio.so.${MAJ} symlink and use it as SONAME on linux

This avoids having to rebuild a lot of packages even if the
ABI did not break. cubeb used by firefox currently dlopen's
either libsndio.so.7.1 or libsndio.so, with the major link
this would also avoid having to patch this as long as the
ABI doesn't break without having to ship the libsndio.so
symlink outside of -dev/-devel packages.
This commit is contained in:
Duncan Overbruck 2020-08-31 22:36:58 +02:00 committed by Alexandre Ratchov
parent c888f2750b
commit 7a03da2848
2 changed files with 9 additions and 3 deletions

4
configure vendored
View File

@ -60,8 +60,9 @@ case `uname` in
alsa=yes
ldadd="-lrt"
user=sndiod
so_ldflags="-Wl,-soname=libsndio.so.\${MAJ}.\${MIN}"
so_link="libsndio.so"
so_link_maj="libsndio.so.\${MAJ}"
so_ldflags="-Wl,-soname=libsndio.so.\${MAJ}"
defs='-D_GNU_SOURCE -DHAVE_SOCK_CLOEXEC -DHAVE_CLOCK_GETTIME'
;;
NetBSD)
@ -268,6 +269,7 @@ do
-e "s:@ldadd@:$ldadd:" \
-e "s:@so@:$so:" \
-e "s:@so_link@:$so_link:" \
-e "s:@so_link_maj@:$so_link_maj:" \
-e "s:@so_ldflags@:$so_ldflags:" \
-e "s:@vars@:${vars}:" \
-e "s:@precision@:$precision:" \

View File

@ -49,8 +49,9 @@ MAJ = 7
MIN = 1
SO = @so@
SO_LINK = @so_link@
SO_LINK_MAJ = @so_link_maj@
all: ${SO} ${SO_LINK}
all: ${SO} ${SO_LINK} ${SO_LINK_MAJ}
install:
@ -59,7 +60,7 @@ install:
mkdir -p ${DESTDIR}${MAN3_DIR}
mkdir -p ${DESTDIR}${MAN7_DIR}
cp sndio.h ${DESTDIR}${INCLUDE_DIR}
cp -R ${SO} ${SO_LINK} ${DESTDIR}${LIB_DIR}
cp -R ${SO} ${SO_LINK} ${SO_LINK_MAJ} ${DESTDIR}${LIB_DIR}
cp sio_open.3 ${DESTDIR}${MAN3_DIR}
ln -sf sio_open.3 ${DESTDIR}${MAN3_DIR}/sio_close.3
ln -sf sio_open.3 ${DESTDIR}${MAN3_DIR}/sio_setpar.3
@ -126,6 +127,9 @@ ${SO}: ${OBJS}
${SO_LINK}:
ln -sf ${SO} ${SO_LINK}
${SO_LINK_MAJ}:
ln -sf ${SO} ${SO_LINK_MAJ}
issetugid.o: ../bsd-compat/issetugid.c
${CC} ${CFLAGS} ${SO_CFLAGS} ${INCLUDE} ${DEFS} -c -o issetugid.o ../bsd-compat/issetugid.c