diff options
Diffstat (limited to 'aconfigure.ac')
-rw-r--r-- | aconfigure.ac | 48 |
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 # |