diff options
author | Sylvain Munaut <tnt@246tNt.com> | 2010-11-12 17:10:44 +0100 |
---|---|---|
committer | Sylvain Munaut <tnt@246tNt.com> | 2010-11-12 20:36:14 +0100 |
commit | 0d2a82c312056046ecafba318e60a930df395ea2 (patch) | |
tree | 429412e84a66cf226528fa8e44ba1f154bce76d2 | |
parent | 4604976a5facb2105bde3214b31ba609df65b939 (diff) |
[1/4] HR support: Add autotools skeleton for libgsmhr
Not functional yet, just the autotools magic to make a library
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
-rw-r--r-- | Makefile.am | 8 | ||||
-rw-r--r-- | configure.ac | 27 | ||||
-rw-r--r-- | include/Makefile.am | 4 | ||||
-rw-r--r-- | include/gsmhr/Makefile.am | 1 | ||||
-rw-r--r-- | include/gsmhr/gsmhr.h | 40 | ||||
-rw-r--r-- | libgsmhr/Makefile.am | 7 | ||||
-rw-r--r-- | libgsmhr/libgsmhr.c | 55 |
7 files changed, 141 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am index 9f4dc64..b5e0d59 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,4 +3,10 @@ ACLOCAL_AMFLAGS = -I m4 INCLUDES = $(all_includes) -I$(top_srcdir)/include -SUBDIRS = src include +SUBDIRS = include + +if ENABLE_GSMHR +SUBDIRS += libgsmhr +endif + +SUBDIRS += src diff --git a/configure.ac b/configure.ac index 39c2f76..eb2c332 100644 --- a/configure.ac +++ b/configure.ac @@ -12,12 +12,39 @@ AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_FILES([ Makefile src/Makefile + libgsmhr/Makefile include/Makefile include/gapk/Makefile + include/gsmhr/Makefile ]) +# Options +AC_ARG_ENABLE(gsmhr, + [AS_HELP_STRING( + [--disable-gsmhr], + [Disable support for GSM HR codec using reference code] + )], + [enable_gsmhr=0], [enable_gsmhr=1]) +AM_CONDITIONAL(ENABLE_GSMHR, test "x$enable_gsmhr" = "x1") +if test "x$enable_gsmhr" = "x1"; then + AC_DEFINE(HAVE_LIBGSMHR, 1, [Define to 1 if libgsmhr is available]) +fi + +# Check for -fvisibility support +# (The following test is taken from WebKit's webkit.m4) +saved_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -fvisibility=hidden " +AC_MSG_CHECKING([if ${CC} supports -fvisibility=hidden]) +AC_COMPILE_IFELSE([char foo;], + [ AC_MSG_RESULT([yes]) + SYMBOL_VISIBILITY="-fvisibility=hidden"], + AC_MSG_RESULT([no])) +CFLAGS="$saved_CFLAGS" +AC_SUBST(SYMBOL_VISIBILITY) + # Checks for programs. AC_PROG_CC +AC_PROG_LIBTOOL # Checks for libraries. # libosmocore (codec module) diff --git a/include/Makefile.am b/include/Makefile.am index b16ce5c..ddb25df 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -1 +1,5 @@ SUBDIRS = gapk + +if ENABLE_GSMHR +SUBDIRS += gsmhr +endif diff --git a/include/gsmhr/Makefile.am b/include/gsmhr/Makefile.am new file mode 100644 index 0000000..368a2b8 --- /dev/null +++ b/include/gsmhr/Makefile.am @@ -0,0 +1 @@ +noinst_HEADERS = gsmhr.h diff --git a/include/gsmhr/gsmhr.h b/include/gsmhr/gsmhr.h new file mode 100644 index 0000000..17d42cb --- /dev/null +++ b/include/gsmhr/gsmhr.h @@ -0,0 +1,40 @@ +/* HR (GSM 06.20) codec */ + +/* + * This file is part of gapk (GSM Audio Pocket Knife). + * + * gapk is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * gapk is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with gapk. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef __GSM_HR_H__ +#define __GSM_HR_H__ + +#include <stdint.h> + +#ifdef __cplusplus +extern "C" { +#endif + +struct gsmhr; + +struct gsmhr *gsmhr_init(void); +void gsmhr_exit(struct gsmhr *state); +int gsmhr_encode(struct gsmhr *state, int16_t *hr_params, const int16_t *pcm); +int gsmhr_decode(struct gsmhr *state, int16_t *pcm, const int16_t *hr_params); + +#ifdef __cplusplus +} +#endif + +#endif /* __GSM_HR_H__ */ diff --git a/libgsmhr/Makefile.am b/libgsmhr/Makefile.am new file mode 100644 index 0000000..f32e948 --- /dev/null +++ b/libgsmhr/Makefile.am @@ -0,0 +1,7 @@ +INCLUDES = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir) +AM_CFLAGS = -fPIC -Wall ${SYMBOL_VISIBILITY} + +LIBVERSION=0:0:0 + +lib_LTLIBRARIES = libgsmhr.la +libgsmhr_la_SOURCES = libgsmhr.c diff --git a/libgsmhr/libgsmhr.c b/libgsmhr/libgsmhr.c new file mode 100644 index 0000000..d10d855 --- /dev/null +++ b/libgsmhr/libgsmhr.c @@ -0,0 +1,55 @@ +/* HR (GSM 06.20) codec wrapper */ + +/* + * This file is part of gapk (GSM Audio Pocket Knife). + * + * gapk is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * gapk is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with gapk. If not, see <http://www.gnu.org/licenses/>. + */ + +#include <stdint.h> +#include <stdio.h> + +#include <gsmhr/gsmhr.h> + + +#define EXPORT __attribute__((visibility("default"))) + + +struct gsmhr { + int stub; +}; + +EXPORT struct gsmhr * +gsmhr_init(void) +{ + return NULL; +} + +EXPORT void +gsmhr_exit(struct gsmhr *state) +{ + return; +} + +EXPORT int +gsmhr_encode(struct gsmhr *state, int16_t *hr_params, const int16_t *pcm) +{ + return 0; +} + +EXPORT int +gsmhr_decode(struct gsmhr *state, int16_t *pcm, const int16_t *hr_params) +{ + return 0; +} |