Introduce libosmo-ranap.so as shared RANAP lib

This shared RANAP library will be used not only by hnbgw, but also by
OsmoCSCN, OsmoSGSN.
diff --git a/src/Makefile.am b/src/Makefile.am
index 00af272..29e8c56 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,15 +1,22 @@
 SUBDIRS = hnbap rua ranap tests
 
+RANAP_LIBVERSION=0:0:0
+
 ASN1_ROOT = $(top_builddir)/asn1/
 ASN1TOSTRUCT = $(ASN1_ROOT)/utils/asn1tostruct.py
 
 AM_CFLAGS = $(OSMOCORE_CFLAGS) $(OSMOVTY_CFLAGS) $(OSMOGSM_CFLAGS) $(OSMONETIF_CFLAGS) $(ASN1C_CFLAGS) $(OSMOSIGTRAN_CFLAGS) -Ihnbap/
 COMMON_LDADD = -lsctp
 
+lib_LTLIBRARIES = libosmo-ranap.la
+libosmo_ranap_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(RANAP_LIBVERSION)
+libosmo_ranap_la_LIBADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(ASN1C_LIBS) $(COMMON_LDADD) ranap/libosmo-asn1-ranap.la
+libosmo_ranap_la_SOURCES = ranap_common.c ranap_encoder.c ranap_decoder.c ranap_msg_factory.c
+
 bin_PROGRAMS = hnbgw
 
-hnbgw_SOURCES = hnbap_encoder.c hnbap_decoder.c rua_encoder.c rua_decoder.c ranap_common.c rua_common.c hnbap_common.c iu_helpers.c asn1helpers.c hnbgw.c hnbgw_hnbap.c hnbgw_rua.c hnbgw_ranap.c ranap_decoder.c ranap_encoder.c ranap_msg_factory.c context_map.c hnbgw_cn.c sccp_helpers.c
-hnbgw_LDADD = $(OSMOCORE_LIBS) $(OSMOVTY_LIBS) $(OSMOGSM_LIBS) $(ASN1C_LIBS) $(OSMOSIGTRAN_LIBS) $(COMMON_LDADD) hnbap/libosmo-asn1-hnbap.a rua/libosmo-asn1-rua.a ranap/libosmo-asn1-ranap.a
+hnbgw_SOURCES = hnbap_encoder.c hnbap_decoder.c rua_encoder.c rua_decoder.c rua_common.c hnbap_common.c iu_helpers.c asn1helpers.c hnbgw.c hnbgw_hnbap.c hnbgw_rua.c hnbgw_ranap.c context_map.c hnbgw_cn.c sccp_helpers.c
+hnbgw_LDADD = $(OSMOCORE_LIBS) $(OSMOVTY_LIBS) $(OSMOGSM_LIBS) $(ASN1C_LIBS) $(OSMOSIGTRAN_LIBS) $(COMMON_LDADD) hnbap/libosmo-asn1-hnbap.a rua/libosmo-asn1-rua.a libosmo-ranap.la
 
 BUILT_SOURCES = hnbap_decoder.c hnbap_encoder.c rua_decoder.c rua_encoder.c ranap_decoder.c ranap_encoder.c
 
diff --git a/src/ranap/Makefile.am b/src/ranap/Makefile.am
index 6abe7ef..16bd69f 100644
--- a/src/ranap/Makefile.am
+++ b/src/ranap/Makefile.am
@@ -1162,10 +1162,10 @@
 
 AM_CFLAGS = $(ASN1C_CFLAGS) $(OSMOCORE_CFLAGS) -I.
 
-noinst_LIBRARIES=libosmo-asn1-ranap.a
-libosmo_asn1_ranap_a_SOURCES=$(ASN_MODULE_SRC)
+noinst_LTLIBRARIES=libosmo-asn1-ranap.la
+libosmo_asn1_ranap_la_SOURCES=$(ASN_MODULE_SRC)
 include_HEADERS=$(ASN_MODULE_INC)
-libosmo_asn1_ranap_a_LIBADD=$(ASN1C_LDADD)
+libosmo_asn1_ranap_la_LIBADD=$(ASN1C_LDADD)
 
 regen: regenerate-from-asn1-source
 
diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am
index 18490be..973cf3f 100644
--- a/src/tests/Makefile.am
+++ b/src/tests/Makefile.am
@@ -6,10 +6,6 @@
 
 HNBAP_FILES = $(top_builddir)/src/hnbap_common.c $(top_builddir)/src/hnbap_decoder.c $(top_builddir)/src/hnbap_encoder.c
 RUA_FILES = $(top_builddir)/src/rua_common.c $(top_builddir)/src/rua_decoder.c $(top_builddir)/src/rua_encoder.c
-RANAP_FILES = $(top_builddir)/src/ranap_common.c \
-	      $(top_builddir)/src/ranap_decoder.c \
-	      $(top_builddir)/src/ranap_encoder.c \
-	      $(top_builddir)/src/ranap_msg_factory.c
 HELPER_FILES = $(top_builddir)/src/iu_helpers.c $(top_builddir)/src/asn1helpers.c
 
 test_helpers_SOURCES = $(HELPER_FILES) test-helpers.c
@@ -18,14 +14,14 @@
 test_hnbap_SOURCES = $(HELPER_FILES) $(top_builddir)/src/hnbap_common.c $(top_builddir)/src/hnbap_decoder.c test-hnbap.c test_common.c
 test_hnbap_LDADD = $(COMMON_LIBS) $(top_builddir)/src/hnbap/libosmo-asn1-hnbap.a
 
-hnb_test_SOURCES = $(HELPER_FILES) $(HNBAP_FILES) $(RUA_FILES) $(RANAP_FILES) hnb-test.c rua_helper.c test_common.c
-hnb_test_LDADD = $(COMMON_LIBS) $(top_builddir)/src/hnbap/libosmo-asn1-hnbap.a $(top_builddir)/src/rua/libosmo-asn1-rua.a $(top_builddir)/src/ranap/libosmo-asn1-ranap.a
+hnb_test_SOURCES = $(HELPER_FILES) $(HNBAP_FILES) $(RUA_FILES) hnb-test.c rua_helper.c test_common.c
+hnb_test_LDADD = $(COMMON_LIBS) $(top_builddir)/src/hnbap/libosmo-asn1-hnbap.a $(top_builddir)/src/rua/libosmo-asn1-rua.a $(top_builddir)/src/libosmo-ranap.la
 
 test_ranap_SOURCES = $(HELPER_FILES) $(RANAP_FILES) test-ranap.c test_common.c
-test_ranap_LDADD = $(COMMON_LIBS) $(top_builddir)/src/ranap/libosmo-asn1-ranap.a
+test_ranap_LDADD = $(COMMON_LIBS) $(top_builddir)/src/libosmo-ranap.la
 
 dummy_cn_SOURCES = $(HELPER_FILES) $(RANAP_FILES) test_common.c dummy_cn_sua.c ranap_common_cn.c
-dummy_cn_LDADD = $(COMMON_LIBS) $(top_builddir)/src/ranap/libosmo-asn1-ranap.a
+dummy_cn_LDADD = $(COMMON_LIBS) $(top_builddir)/src/libosmo-ranap.la
 
 # The `:;' works around a Bash 3.2 bug when the output is not writeable.
 $(srcdir)/package.m4: $(top_srcdir)/configure.ac