From: Ruben Undheim <ruben.undheim@gmail.com>
Date: Sun, 5 Aug 2018 20:53:25 +0000
Subject: Upstream only delivers static libraries. This patch changes these

to shared libraries. In addition, the libraries are renamed to make it clearer
what they are (and because of a conflict in the Debian namespace for one of
them)
---
 libosmo-mtp.pc.in      |  2 +-
 libosmo-sccp.pc.in     |  2 +-
 src/Makefile.am        | 13 ++++++++-----
 tests/m2ua/Makefile.am |  2 +-
 4 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/libosmo-mtp.pc.in b/libosmo-mtp.pc.in
index 675d0d3..02f10ad 100644
--- a/libosmo-mtp.pc.in
+++ b/libosmo-mtp.pc.in
@@ -6,5 +6,5 @@ includedir=@includedir@
 Name: Osmo MTP Lib
 Description: Osmo MTP Lib
 Version: @VERSION@
-Libs: -L${libdir} -lmtp
+Libs: -L${libdir} -losmomtp
 Cflags: -I${includedir}/
diff --git a/libosmo-sccp.pc.in b/libosmo-sccp.pc.in
index eda8d49..b04664f 100644
--- a/libosmo-sccp.pc.in
+++ b/libosmo-sccp.pc.in
@@ -6,5 +6,5 @@ includedir=@includedir@
 Name: OpenBSC SCCP Lib
 Description: OpenBSC SCCP Lib
 Version: @VERSION@
-Libs: -L${libdir} -lsccp
+Libs: -L${libdir} -losmosccp -losmoxua
 Cflags: -I${includedir}/
diff --git a/src/Makefile.am b/src/Makefile.am
index 3af23d1..a10a2df 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -7,11 +7,14 @@ noinst_HEADERS = sccp_internal.h xua_asp_fsm.h xua_as_fsm.h xua_internal.h
 # Legacy static libs
 
 sccpdir = $(libdir)
-sccp_LIBRARIES = libsccp.a libmtp.a libxua.a
-
-libsccp_a_SOURCES = sccp.c
-libmtp_a_SOURCES = mtp_pcap.c
-libxua_a_SOURCES = xua_msg.c
+sccp_LTLIBRARIES = libosmosccp.la libosmomtp.la libosmoxua.la
+
+libosmosccp_la_SOURCES = sccp.c
+libosmosccp_la_LDFLAGS= -shared -fPIC
+libosmomtp_la_SOURCES = mtp_pcap.c
+libosmomtp_la_LDFLAGS= -shared -fPIC
+libosmoxua_la_SOURCES = xua_msg.c
+libosmoxua_la_LDFLAGS= -shared -fPIC
 # ensure that the file for the static lib is built with different C
 # flags, working around automake complaining that xua_msg.o is built
 # both with libtool (below) and without (here)
diff --git a/tests/m2ua/Makefile.am b/tests/m2ua/Makefile.am
index 33618ef..815fd87 100644
--- a/tests/m2ua/Makefile.am
+++ b/tests/m2ua/Makefile.am
@@ -5,4 +5,4 @@ EXTRA_DIST = m2ua_test.ok
 
 noinst_PROGRAMS = m2ua_test
 m2ua_test_SOURCES = m2ua_test.c
-m2ua_test_LDADD = $(top_builddir)/src/libxua.a $(LIBOSMOCORE_LIBS)
+m2ua_test_LDADD = $(top_builddir)/src/libosmoxua.la $(LIBOSMOCORE_LIBS)
