FS-9670: add autodetection of opencore-amrnb lib and "--disable-amr" option to configure script

This commit is contained in:
Dragos Oancea 2016-10-26 08:53:54 -04:00
parent fbcb3f708f
commit a0284af8ea
3 changed files with 17 additions and 9 deletions

View File

@ -1926,7 +1926,17 @@ AM_CONDITIONAL(ISMAC, [test `uname -s` = Darwin])
AM_CONDITIONAL(ISFREEBSD, [test `uname -s` = FreeBSD])
AM_CONDITIONAL(IS64BITLINUX, [test `uname -m` = x86_64])
AM_CONDITIONAL(HAVE_AMR, [ test -d ${switch_srcdir}/libs/amr ])
AC_ARG_ENABLE(amr,
[AC_HELP_STRING([--disable-amr],[build without opencore-amrnb])],[enable_amr="$enable_amr"],[enable_amr="yes"])
if test x"$enable_amr" = x"yes" ; then
PKG_CHECK_MODULES([AMR], [opencore-amrnb >= 0.1.0],[
AM_CONDITIONAL([HAVE_AMR],[true])],[
AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_AMR],[false])])
else
AM_CONDITIONAL([HAVE_AMR],[false])
fi
AM_CONDITIONAL(HAVE_AMRWB, [ test -d ${switch_srcdir}/libs/amrwb ])
AM_CONDITIONAL(HAVE_G723_1, [ test -d ${switch_srcdir}/libs/libg723_1 ])
AM_CONDITIONAL(HAVE_G729, [ test -d ${switch_srcdir}/libs/libg729 ])

View File

@ -1,8 +1,5 @@
include $(top_srcdir)/build/modmake.rulesam
MODNAME=mod_amr
AMR_DIR=$(switch_srcdir)/libs/amr
AMR_BUILDDIR=$(switch_builddir)/libs/amr
AMR_A=$(AMR_BUILDDIR)/libamr.a
mod_LTLIBRARIES = mod_amr.la
if HAVE_AMR
@ -10,15 +7,15 @@ mod_amr_la_SOURCES = mod_amr.c bitshift.c amr_be.c
else
mod_amr_la_SOURCES = mod_amr.c
endif
mod_amr_la_CFLAGS = $(AM_CFLAGS)
mod_amr_la_LIBADD = $(switch_builddir)/libfreeswitch.la
mod_amr_la_LDFLAGS = -avoid-version -module -no-undefined -shared
if HAVE_AMR
# install AMR library opencore-amrnb (check README)
mod_amr_la_CFLAGS += -I/usr/include/opencore-amrnb
mod_amr_la_LIBADD += -lopencore-amrnb
mod_amr_la_CFLAGS +=
mod_amr_la_CFLAGS += $(AMR_CFLAGS)
mod_amr_la_LIBADD += $(AMR_LIBS)
else
mod_amr_la_CFLAGS += -DAMR_PASSTHROUGH
endif

View File

@ -27,6 +27,7 @@
* Brian K. West <brian@freeswitch.org>
* Dragos Oancea <dragos.oancea@athonet.com>
* Federico Favaro <federico.favaro@athonet.com>
* Marco Sinibaldi <marco.sinibaldi@athonet.com>
*
* The amr codec itself is not distributed with this module.
*
@ -40,8 +41,8 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_amr_load);
SWITCH_MODULE_DEFINITION(mod_amr, mod_amr_load, NULL, NULL);
#ifndef AMR_PASSTHROUGH
#include "interf_enc.h"
#include "interf_dec.h"
#include "opencore-amrnb/interf_enc.h"
#include "opencore-amrnb/interf_dec.h"
#include "bitshift.h"
#include "amr_be.h"