[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>
This commit is contained in:
Sylvain Munaut 2010-11-12 17:10:44 +01:00
parent 4604976a5f
commit 0d2a82c312
7 changed files with 141 additions and 1 deletions

View File

@ -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

View File

@ -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)

View File

@ -1 +1,5 @@
SUBDIRS = gapk
if ENABLE_GSMHR
SUBDIRS += gsmhr
endif

View File

@ -0,0 +1 @@
noinst_HEADERS = gsmhr.h

40
include/gsmhr/gsmhr.h Normal file
View File

@ -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__ */

7
libgsmhr/Makefile.am Normal file
View File

@ -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

55
libgsmhr/libgsmhr.c Normal file
View File

@ -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;
}