summaryrefslogtreecommitdiff
path: root/aconfigure.ac
diff options
context:
space:
mode:
authorLiong Sauw Ming <ming@teluu.com>2016-02-04 06:11:58 +0000
committerLiong Sauw Ming <ming@teluu.com>2016-02-04 06:11:58 +0000
commit56f6e91963bbd507c300e4f2a806a8db2935566d (patch)
treee0ab33100a9c31f1c7872ddc22787011a04b64c3 /aconfigure.ac
parente6a13543eb90a73b095c4aa84038753d31ff2b39 (diff)
Fixed #1904: Support for Opus codec
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@5239 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'aconfigure.ac')
-rw-r--r--aconfigure.ac48
1 files changed, 48 insertions, 0 deletions
diff --git a/aconfigure.ac b/aconfigure.ac
index d0e88a72..2f71abbe 100644
--- a/aconfigure.ac
+++ b/aconfigure.ac
@@ -1761,6 +1761,54 @@ AC_ARG_ENABLE(silk,
fi
])
+dnl # Do not use default OPUS installation if we are cross-compiling
+if test "x$ac_cross_compile" != "x" -a "x$with_opus" = "xno"; then
+ enable_opus=no
+fi
+
+dnl # OPUS prefix
+AC_ARG_WITH(opus,
+ AC_HELP_STRING([--with-opus=DIR],
+ [Specify alternate OPUS prefix]),
+ [],
+ [with_opus=no]
+ )
+
+dnl # Include OPUS support
+AC_SUBST(ac_no_opus)
+AC_ARG_ENABLE(opus,
+ AC_HELP_STRING([--disable-opus],
+ [Exclude OPUS support from the build (default: autodetect)])
+ ,
+ [
+ if test "$enable_opus" = "no"; then
+ [ac_no_opus=1]
+ AC_DEFINE(PJMEDIA_HAS_OPUS_CODEC,0)
+ AC_MSG_RESULT([Checking if OPUS support is disabled... yes])
+ fi
+ ],
+ [
+ AC_MSG_RESULT([checking for OPUS installations..])
+ if test "x$with_opus" != "xno" -a "x$with_opus" != "x"; then
+ CFLAGS="$CFLAGS -I$with_opus/include"
+ CPPFLAGS="$CPPFLAGS -I$with_opus/include"
+ LDFLAGS="$LDFLAGS -L$with_opus/lib"
+ AC_MSG_RESULT([Using OPUS prefix... $with_opus])
+ fi
+ AC_SUBST(opus_h_present)
+ AC_SUBST(opus_present)
+ AC_CHECK_HEADER(opus/opus.h,[opus_h_present=1])
+ AC_CHECK_LIB(opus,opus_repacketizer_get_size,[opus_present=1 && LIBS="$LIBS -lopus"])
+ if test "x$opus_h_present" = "x1" -a "x$opus_present" = "x1"; then
+ AC_MSG_RESULT([OPUS library found, OPUS support enabled])
+ AC_DEFINE(PJMEDIA_HAS_OPUS_CODEC,1)
+ else
+ [ac_no_opus=1]
+ AC_MSG_RESULT([OPUS library not found, OPUS support disabled])
+ AC_DEFINE(PJMEDIA_HAS_OPUS_CODEC,0)
+ fi
+ ])
+
dnl ##########################################
dnl #