aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2017-08-30 19:03:49 +0700
committerVadim Yanitskiy <axilirator@gmail.com>2017-09-03 19:17:24 +0700
commit5fb1965cacb7a3aaf269dbb8e0238721a7d44c05 (patch)
treee968d5ccb7c0c907402a3c7a25a0073f5d86a98d
parentd5cfaa6a52d09551661f2cc8ef7ffc24f809960a (diff)
Introduce a shared 'libosmogapk' library
The previous GAPK implementation was represented as a single executable. So, all audio transcoding operations were available only by calling the 'gapk' binary. This approach didn't allow external applications to benefit from using GAPK API directly. Since there are some projects (such as GR-GSM and OsmocomBB), which are potential users of GAPK code base, it would be better to have all transcoding functions within a shared library. So, this change separates the common code into a shared library, named 'libosmogapk', and links the 'gapk' binary against one. Currently there are no shared headers, pkg-config manifest and the export map, but they will be done latter.
-rw-r--r--src/Makefile.am100
1 files changed, 85 insertions, 15 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index e0b622c..93bdfa1 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,20 +1,90 @@
-AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir)
-AM_CFLAGS=-Wall $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOCORE_CFLAGS) \
- ${OPENCORE_AMRNB_CFLAGS} $(LIBALSA_CFLAGS)
-AM_LDFLAGS=$(LIBOSMOCODEC_LIBS) $(LIBOSMOCORE_LIBS) \
- ${OPENCORE_AMRNB_LIBS} ${LIBGSM_LIBS} $(LIBALSA_LIBS)
-
-COM_SOURCES = procqueue.c pq_file.c pq_format.c pq_codec.c pq_rtp.c pq_alsa.c \
- formats.c fmt_amr.c fmt_gsm.c fmt_hr_ref.c fmt_racal.c \
- fmt_amr_opencore.c \
- fmt_rtp_amr.c fmt_rtp_efr.c fmt_rtp_hr_etsi.c fmt_rtp_hr_ietf.c \
- fmt_rawpcm.c fmt_ti.c benchmark.c \
- codecs.c codec_pcm.c codec_hr.c codec_fr.c codec_efr.c codec_amr.c
+# This is _NOT_ the library release version, it's an API version.
+# Please read Chapter 6 "Library interface versions" of the libtool
+# documentation before making any modification
+LIBVERSION = 0:0:0
-bin_PROGRAMS = gapk
+AM_CPPFLAGS = \
+ $(all_includes) \
+ -I$(top_builddir) \
+ -I$(top_srcdir)/include \
+ $(NULL)
+
+AM_CFLAGS = \
+ -Wall \
+ $(LIBOSMOCORE_CFLAGS) \
+ $(LIBOSMOCODEC_CFLAGS) \
+ ${OPENCORE_AMRNB_CFLAGS} \
+ $(LIBALSA_CFLAGS) \
+ $(NULL)
+
+lib_LTLIBRARIES = libosmogapk.la
-gapk_SOURCES = main.c $(COM_SOURCES)
+libosmogapk_la_LDFLAGS = \
+ $(LIBOSMOCORE_LIBS) \
+ $(LIBOSMOCODEC_LIBS) \
+ ${OPENCORE_AMRNB_LIBS} \
+ ${LIBGSM_LIBS} \
+ $(LIBALSA_LIBS) \
+ -version-info $(LIBVERSION) \
+ -no-undefined \
+ $(NULL)
if ENABLE_GSMHR
-gapk_LDADD = $(top_builddir)/libgsmhr/libgsmhr.la
+libosmogapk_la_LIBADD = $(top_builddir)/libgsmhr/libgsmhr.la
endif
+
+# Processing queue implementation
+libosmogapk_la_SOURCES = \
+ procqueue.c \
+ pq_format.c \
+ pq_codec.c \
+ pq_file.c \
+ pq_alsa.c \
+ pq_rtp.c \
+ $(NULL)
+
+# Formats implementation
+libosmogapk_la_SOURCES += \
+ formats.c \
+ fmt_ti.c \
+ fmt_amr.c \
+ fmt_gsm.c \
+ fmt_hr_ref.c \
+ fmt_racal.c \
+ fmt_rawpcm.c \
+ fmt_rtp_amr.c \
+ fmt_rtp_efr.c \
+ fmt_rtp_hr_etsi.c \
+ fmt_rtp_hr_ietf.c \
+ fmt_amr_opencore.c \
+ $(NULL)
+
+# Codecs implementation
+libosmogapk_la_SOURCES += \
+ codecs.c \
+ codec_pcm.c \
+ codec_hr.c \
+ codec_fr.c \
+ codec_efr.c \
+ codec_amr.c \
+ $(NULL)
+
+# Codec benchmarking
+libosmogapk_la_SOURCES += \
+ benchmark.c \
+ $(NULL)
+
+# libosmogapk representative application
+bin_PROGRAMS = gapk
+
+gapk_SOURCES = \
+ main.c \
+ $(NULL)
+
+gapk_LDFLAGS = \
+ $(LIBOSMOCORE_LIBS) \
+ $(NULL)
+
+gapk_LDADD = \
+ $(top_builddir)/src/libosmogapk.la \
+ $(NULL)