libosmocoding: migrate transcoding routines from OsmoBTS

There are some projects, such as GR-GSM and OsmocomBB, which would
benefit from using one shared implementation of GSM 05.03 code. So,
this commit introduces a new sub-library called libosmocoding, which
(for now) provides GSM, GPRS and EDGE transcoding routines, migrated
from OsmoBTS.

The original GSM 05.03 code from OsmoBTS was relicensed under
GPLv2-or-later with permission of copyright holders (Andreas Eversberg,
Alexander Chemeris and Tom Tsou).

The following data types are currently supported:

 - xCCH
 - PDTCH (CS 1-4 and MCS 1-9)
 - TCH/FR
 - TCH/HR
 - TCH/AFS
 - RCH/AHS
 - RACH
 - SCH

Change-Id: I0c3256b87686d878e4e716d12393cad5924fdfa1
diff --git a/Makefile.am b/Makefile.am
index 185127e..1d17da5 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,11 +1,11 @@
 ACLOCAL_AMFLAGS = -I m4
 
 AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include
-SUBDIRS = include src src/vty src/codec src/gsm src/gb src/ctrl src/sim tests utils
+SUBDIRS = include src src/vty src/codec src/gsm src/coding src/gb src/ctrl src/sim tests utils
 
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = libosmocore.pc libosmocodec.pc libosmovty.pc libosmogsm.pc \
-		 libosmogb.pc libosmoctrl.pc
+		 libosmogb.pc libosmoctrl.pc libosmocoding.pc
 
 BUILT_SOURCES = $(top_srcdir)/.version
 $(top_srcdir)/.version:
@@ -22,7 +22,8 @@
 $(html_DATA): $(top_builddir)/doc/core/html/index.html \
 		  $(top_builddir)/doc/gsm/html/index.html \
 		  $(top_builddir)/doc/vty/html/index.html \
-		  $(top_builddir)/doc/codec/html/index.html
+		  $(top_builddir)/doc/codec/html/index.html \
+		  $(top_builddir)/doc/coding/html/index.html
 	cd $(top_builddir)/doc && tar cf html.tar */html
 
 $(top_builddir)/doc/core/html/index.html: $(SOURCES) Doxyfile.core
@@ -44,13 +45,18 @@
 	mkdir -p doc/codec
 	$(DOXYGEN) Doxyfile.codec
 
+$(top_builddir)/doc/coding/html/index.html: Doxyfile.coding
+	@rm -rf doc/coding
+	mkdir -p doc/coding
+	$(DOXYGEN) Doxyfile.coding
+
 install-data-hook:
 	cd $(DESTDIR)$(htmldir) && tar xf html.tar && rm -f html.tar
 
 uninstall-hook:
-	cd $(DESTDIR)$(htmldir) && rm -rf {core,gsm,vty,codec}
+	cd $(DESTDIR)$(htmldir) && rm -rf {core,gsm,vty,codec,coding}
 
-DX_CLEAN = doc/{core,gsm,vty,codec}/html/search/* doc/{core,gsm,vty,codec}/{html,latex}/* doc/html.tar doc/{core,gsm,vty,codec}/doxygen_sqlite3.db doc/*.tag
+DX_CLEAN = doc/{core,gsm,vty,codec,coding}/html/search/* doc/{core,gsm,vty,codec,coding}/{html,latex}/* doc/html.tar doc/{core,gsm,vty,codec,coding}/doxygen_sqlite3.db doc/*.tag
 endif
 
 MOSTLYCLEANFILES = $(DX_CLEAN)