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 ])
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
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
* 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.
*
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"