<p>Corey Farrell has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/7002">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">configure: Add autoconf check for libopusfile.<br><br>This check is being added to make it easier for end-users of third party<br>open source Opus modules.  This was removed by ASTERISK-26426 but only<br>the module needed to be removed.<br><br>Change-Id: I62b9cd0c4fa8a77596ab0e042948a643a1152677<br>---<br>M build_tools/menuselect-deps.in<br>M configure<br>M configure.ac<br>M include/asterisk/autoconfig.h.in<br>M makeopts.in<br>5 files changed, 163 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/02/7002/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/build_tools/menuselect-deps.in b/build_tools/menuselect-deps.in<br>index ec70be0..9becdb6 100644<br>--- a/build_tools/menuselect-deps.in<br>+++ b/build_tools/menuselect-deps.in<br>@@ -45,6 +45,7 @@<br> OGG=@PBX_OGG@<br> OPENH323=@PBX_OPENH323@<br> OPUS=@PBX_OPUS@<br>+OPUSFILE=@PBX_OPUSFILE@<br> OSPTK=@PBX_OSPTK@<br> OSS=@PBX_OSS@<br> PGSQL=@PBX_PGSQL@<br>diff --git a/configure b/configure<br>index 8bcf938..9a8fb40 100755<br>--- a/configure<br>+++ b/configure<br>@@ -1008,6 +1008,10 @@<br> OSPTK_DIR<br> OSPTK_INCLUDE<br> OSPTK_LIB<br>+PBX_OPUSFILE<br>+OPUSFILE_DIR<br>+OPUSFILE_INCLUDE<br>+OPUSFILE_LIB<br> PBX_OPUS<br> OPUS_DIR<br> OPUS_INCLUDE<br>@@ -1435,6 +1439,7 @@<br> with_ogg<br> with_openr2<br> with_opus<br>+with_opusfile<br> with_osptk<br> with_oss<br> with_postgres<br>@@ -2191,6 +2196,7 @@<br>   --with-ogg=PATH         use OGG files in PATH<br>   --with-openr2=PATH      use MFR2 files in PATH<br>   --with-opus=PATH        use Opus files in PATH<br>+  --with-opusfile=PATH    use Opusfile files in PATH<br>   --with-osptk=PATH       use OSP Toolkit files in PATH<br>   --with-oss=PATH         use Open Sound System files in PATH<br>   --with-postgres=PATH    use PostgreSQL files in PATH<br>@@ -11345,6 +11351,38 @@<br>   *)<br>    OPUS_DIR="${withval}"<br>       ac_mandatory_list="${ac_mandatory_list} OPUS"<br>+      ;;<br>+   esac<br>+<br>+fi<br>+<br>+<br>+<br>+<br>+<br>+<br>+<br>+<br>+    OPUSFILE_DESCRIP="Opusfile"<br>+    OPUSFILE_OPTION="opusfile"<br>+    PBX_OPUSFILE=0<br>+<br>+# Check whether --with-opusfile was given.<br>+if test "${with_opusfile+set}" = set; then :<br>+  withval=$with_opusfile;<br>+        case ${withval} in<br>+   n|no)<br>+        USE_OPUSFILE=no<br>+      # -1 is a magic value used by menuselect to know that the package<br>+    # was disabled, other than 'not found'<br>+       PBX_OPUSFILE=-1<br>+      ;;<br>+   y|ye|yes)<br>+    ac_mandatory_list="${ac_mandatory_list} OPUSFILE"<br>+  ;;<br>+   *)<br>+   OPUSFILE_DIR="${withval}"<br>+  ac_mandatory_list="${ac_mandatory_list} OPUSFILE"<br>   ;;<br>    esac<br> <br>@@ -30426,6 +30464,116 @@<br> fi<br> <br> <br>+# opusfile.h includes <opus_multistream.h> so we need to make sure that<br>+# either $OPUS_INCLUDE or /usr/include/opus is added to the search path.<br>+__opus_include=${OPUS_INCLUDE}<br>+if test -z "$__opus_include" -o x"$__opus_include" = x" " ; then<br>+   __opus_include=-I/usr/include/opus<br>+fi<br>+<br>+if test "x${PBX_OPUSFILE}" != "x1" -a "${USE_OPUSFILE}" != "no"; then<br>+   pbxlibdir=""<br>+   # if --with-OPUSFILE=DIR has been specified, use it.<br>+   if test "x${OPUSFILE_DIR}" != "x"; then<br>+      if test -d ${OPUSFILE_DIR}/lib; then<br>+         pbxlibdir="-L${OPUSFILE_DIR}/lib"<br>+      else<br>+         pbxlibdir="-L${OPUSFILE_DIR}"<br>+      fi<br>+   fi<br>+   pbxfuncname="op_open_callbacks"<br>+   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers<br>+      AST_OPUSFILE_FOUND=yes<br>+   else<br>+      ast_ext_lib_check_save_CFLAGS="${CFLAGS}"<br>+      CFLAGS="${CFLAGS} $__opus_include"<br>+      as_ac_Lib=`$as_echo "ac_cv_lib_opusfile_${pbxfuncname}" | $as_tr_sh`<br>+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lopusfile" >&5<br>+$as_echo_n "checking for ${pbxfuncname} in -lopusfile... " >&6; }<br>+if eval \${$as_ac_Lib+:} false; then :<br>+  $as_echo_n "(cached) " >&6<br>+else<br>+  ac_check_lib_save_LIBS=$LIBS<br>+LIBS="-lopusfile ${pbxlibdir}  $LIBS"<br>+cat confdefs.h - <<_ACEOF >conftest.$ac_ext<br>+/* end confdefs.h.  */<br>+<br>+/* Override any GCC internal prototype to avoid an error.<br>+   Use char because int might match the return type of a GCC<br>+   builtin and then its argument prototype would still apply.  */<br>+#ifdef __cplusplus<br>+extern "C"<br>+#endif<br>+char ${pbxfuncname} ();<br>+int<br>+main ()<br>+{<br>+return ${pbxfuncname} ();<br>+  ;<br>+  return 0;<br>+}<br>+_ACEOF<br>+if ac_fn_c_try_link "$LINENO"; then :<br>+  eval "$as_ac_Lib=yes"<br>+else<br>+  eval "$as_ac_Lib=no"<br>+fi<br>+rm -f core conftest.err conftest.$ac_objext \<br>+    conftest$ac_exeext conftest.$ac_ext<br>+LIBS=$ac_check_lib_save_LIBS<br>+fi<br>+eval ac_res=\$$as_ac_Lib<br>+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5<br>+$as_echo "$ac_res" >&6; }<br>+if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then :<br>+  AST_OPUSFILE_FOUND=yes<br>+else<br>+  AST_OPUSFILE_FOUND=no<br>+fi<br>+<br>+      CFLAGS="${ast_ext_lib_check_save_CFLAGS}"<br>+   fi<br>+<br>+   # now check for the header.<br>+   if test "${AST_OPUSFILE_FOUND}" = "yes"; then<br>+      OPUSFILE_LIB="${pbxlibdir} -lopusfile "<br>+      # if --with-OPUSFILE=DIR has been specified, use it.<br>+      if test "x${OPUSFILE_DIR}" != "x"; then<br>+         OPUSFILE_INCLUDE="-I${OPUSFILE_DIR}/include"<br>+      fi<br>+      OPUSFILE_INCLUDE="${OPUSFILE_INCLUDE} $__opus_include"<br>+      if test "xopus/opusfile.h" = "x" ; then    # no header, assume found<br>+         OPUSFILE_HEADER_FOUND="1"<br>+      else                           # check for the header<br>+         ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"<br>+         CPPFLAGS="${CPPFLAGS} ${OPUSFILE_INCLUDE}"<br>+         ac_fn_c_check_header_mongrel "$LINENO" "opus/opusfile.h" "ac_cv_header_opus_opusfile_h" "$ac_includes_default"<br>+if test "x$ac_cv_header_opus_opusfile_h" = xyes; then :<br>+  OPUSFILE_HEADER_FOUND=1<br>+else<br>+  OPUSFILE_HEADER_FOUND=0<br>+fi<br>+<br>+<br>+         CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"<br>+      fi<br>+      if test "x${OPUSFILE_HEADER_FOUND}" = "x0" ; then<br>+         OPUSFILE_LIB=""<br>+         OPUSFILE_INCLUDE=""<br>+      else<br>+         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library<br>+            OPUSFILE_LIB=""<br>+         fi<br>+         PBX_OPUSFILE=1<br>+         cat >>confdefs.h <<_ACEOF<br>+#define HAVE_OPUSFILE 1<br>+_ACEOF<br>+<br>+      fi<br>+   fi<br>+fi<br>+<br>+<br> <br> if test "${USE_PWLIB}" != "no"; then<br>   if test -n "${PWLIB_DIR}"; then<br>diff --git a/configure.ac b/configure.ac<br>index 3fe9044..23ff526 100644<br>--- a/configure.ac<br>+++ b/configure.ac<br>@@ -503,6 +503,7 @@<br> AST_EXT_LIB_SETUP([OGG], [OGG], [ogg])<br> AST_EXT_LIB_SETUP([OPENR2], [MFR2], [openr2])<br> AST_EXT_LIB_SETUP([OPUS], [Opus], [opus])<br>+AST_EXT_LIB_SETUP([OPUSFILE], [Opusfile], [opusfile])<br> AST_EXT_LIB_SETUP([OSPTK], [OSP Toolkit], [osptk])<br> AST_EXT_LIB_SETUP([OSS], [Open Sound System], [oss])<br> AST_EXT_LIB_SETUP([PGSQL], [PostgreSQL], [postgres])<br>@@ -2350,6 +2351,13 @@<br> AST_EXT_LIB_CHECK([OPENR2], [openr2], [openr2_chan_new], [openr2.h])<br> <br> AST_EXT_LIB_CHECK([OPUS], [opus], [opus_encoder_create], [opus/opus.h])<br>+# opusfile.h includes <opus_multistream.h> so we need to make sure that<br>+# either $OPUS_INCLUDE or /usr/include/opus is added to the search path.<br>+__opus_include=${OPUS_INCLUDE}<br>+if test -z "$__opus_include" -o x"$__opus_include" = x" " ; then<br>+     __opus_include=-I/usr/include/opus<br>+fi<br>+AST_EXT_LIB_CHECK([OPUSFILE], [opusfile], [op_open_callbacks], [opus/opusfile.h], [], [$__opus_include])<br> <br> if test "${USE_PWLIB}" != "no"; then<br>      if test -n "${PWLIB_DIR}"; then<br>diff --git a/include/asterisk/autoconfig.h.in b/include/asterisk/autoconfig.h.in<br>index 5865c0a..cfa260b 100644<br>--- a/include/asterisk/autoconfig.h.in<br>+++ b/include/asterisk/autoconfig.h.in<br>@@ -588,6 +588,9 @@<br> /* Define to 1 if you have the Opus library. */<br> #undef HAVE_OPUS<br> <br>+/* Define to 1 if you have the Opusfile library. */<br>+#undef HAVE_OPUSFILE<br>+<br> /* Define this to indicate the ${OSPTK_DESCRIP} library */<br> #undef HAVE_OSPTK<br> <br>diff --git a/makeopts.in b/makeopts.in<br>index 30bc2e2..e25b614 100644<br>--- a/makeopts.in<br>+++ b/makeopts.in<br>@@ -232,6 +232,9 @@<br> OPUS_INCLUDE=@OPUS_INCLUDE@<br> OPUS_LIB=@OPUS_LIB@<br> <br>+OPUSFILE_INCLUDE=@OPUSFILE_INCLUDE@<br>+OPUSFILE_LIB=@OPUSFILE_LIB@<br>+<br> OSPTK_INCLUDE=@OSPTK_INCLUDE@<br> OSPTK_LIB=@OSPTK_LIB@<br> <br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/7002">change 7002</a>. To unsubscribe, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/7002"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 15 </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I62b9cd0c4fa8a77596ab0e042948a643a1152677 </div>
<div style="display:none"> Gerrit-Change-Number: 7002 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Corey Farrell <git@cfware.com> </div>