<p>Alexander Traud has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/8434">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">BuildSystem: Enable Advanced Linux Sound Architecture (ALSA) in NetBSD.<br><br>ASTERISK-27720<br><br>Change-Id: I3b21f2135f6cbfac7590ccdc2df753257f426e0b<br>---<br>M channels/chan_alsa.c<br>M configure<br>M configure.ac<br>3 files changed, 116 insertions(+), 11 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/34/8434/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/channels/chan_alsa.c b/channels/chan_alsa.c<br>index ed7d5cf..a5dead1 100644<br>--- a/channels/chan_alsa.c<br>+++ b/channels/chan_alsa.c<br>@@ -39,6 +39,10 @@<br> <br> #include "asterisk.h"<br> <br>+#include <errno.h><br>+#ifndef ESTRPIPE<br>+#define ESTRPIPE EPIPE<br>+#endif<br> #include <fcntl.h><br> #include <sys/ioctl.h><br> #include <sys/time.h><br>diff --git a/configure b/configure<br>index aac2623..40d1c15 100755<br>--- a/configure<br>+++ b/configure<br>@@ -19525,9 +19525,106 @@<br> <br> ast_ext_lib_check_save_CFLAGS="${CFLAGS}"<br> CFLAGS="${CFLAGS} "<br>- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for snd_spcm_init in -lasound" >&5<br>-$as_echo_n "checking for snd_spcm_init in -lasound... " >&6; }<br>-if ${ac_cv_lib_asound_snd_spcm_init+:} false; then :<br>+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for snd_pcm_open in -lasound" >&5<br>+$as_echo_n "checking for snd_pcm_open in -lasound... " >&6; }<br>+if ${ac_cv_lib_asound_snd_pcm_open+:} false; then :<br>+ $as_echo_n "(cached) " >&6<br>+else<br>+ ac_check_lib_save_LIBS=$LIBS<br>+LIBS="-lasound ${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 snd_pcm_open ();<br>+int<br>+main ()<br>+{<br>+return snd_pcm_open ();<br>+ ;<br>+ return 0;<br>+}<br>+_ACEOF<br>+if ac_fn_c_try_link "$LINENO"; then :<br>+ ac_cv_lib_asound_snd_pcm_open=yes<br>+else<br>+ ac_cv_lib_asound_snd_pcm_open=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>+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_asound_snd_pcm_open" >&5<br>+$as_echo "$ac_cv_lib_asound_snd_pcm_open" >&6; }<br>+if test "x$ac_cv_lib_asound_snd_pcm_open" = xyes; then :<br>+ AST_ALSA_FOUND=yes<br>+else<br>+ AST_ALSA_FOUND=no<br>+fi<br>+<br>+ CFLAGS="${ast_ext_lib_check_save_CFLAGS}"<br>+<br>+<br>+ # now check for the header.<br>+ if test "${AST_ALSA_FOUND}" = "yes"; then<br>+ ALSA_LIB="${pbxlibdir} -lasound "<br>+ # if --with-ALSA=DIR has been specified, use it.<br>+ if test "x${ALSA_DIR}" != "x"; then<br>+ ALSA_INCLUDE="-I${ALSA_DIR}/include"<br>+ fi<br>+ ALSA_INCLUDE="${ALSA_INCLUDE} "<br>+<br>+ # check for the header<br>+ ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"<br>+ CPPFLAGS="${CPPFLAGS} ${ALSA_INCLUDE}"<br>+ ac_fn_c_check_header_mongrel "$LINENO" "alsa/asoundlib.h" "ac_cv_header_alsa_asoundlib_h" "$ac_includes_default"<br>+if test "x$ac_cv_header_alsa_asoundlib_h" = xyes; then :<br>+ ALSA_HEADER_FOUND=1<br>+else<br>+ ALSA_HEADER_FOUND=0<br>+fi<br>+<br>+<br>+ CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"<br>+<br>+ if test "x${ALSA_HEADER_FOUND}" = "x0" ; then<br>+ ALSA_LIB=""<br>+ ALSA_INCLUDE=""<br>+ else<br>+<br>+ PBX_ALSA=1<br>+ cat >>confdefs.h <<_ACEOF<br>+#define HAVE_ALSA 1<br>+_ACEOF<br>+<br>+ fi<br>+ fi<br>+fi<br>+<br>+<br>+if test "${PBX_ALSA}" = "0"; then<br>+<br>+if test "x${PBX_ALSA}" != "x1" -a "${USE_ALSA}" != "no"; then<br>+ pbxlibdir=""<br>+ # if --with-ALSA=DIR has been specified, use it.<br>+ if test "x${ALSA_DIR}" != "x"; then<br>+ if test -d ${ALSA_DIR}/lib; then<br>+ pbxlibdir="-L${ALSA_DIR}/lib"<br>+ else<br>+ pbxlibdir="-L${ALSA_DIR}"<br>+ fi<br>+ fi<br>+<br>+ ast_ext_lib_check_save_CFLAGS="${CFLAGS}"<br>+ CFLAGS="${CFLAGS} "<br>+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for snd_pcm_open in -lasound" >&5<br>+$as_echo_n "checking for snd_pcm_open in -lasound... " >&6; }<br>+if ${ac_cv_lib_asound_snd_pcm_open+:} false; then :<br> $as_echo_n "(cached) " >&6<br> else<br> ac_check_lib_save_LIBS=$LIBS<br>@@ -19541,27 +19638,27 @@<br> #ifdef __cplusplus<br> extern "C"<br> #endif<br>-char snd_spcm_init ();<br>+char snd_pcm_open ();<br> int<br> main ()<br> {<br>-return snd_spcm_init ();<br>+return snd_pcm_open ();<br> ;<br> return 0;<br> }<br> _ACEOF<br> if ac_fn_c_try_link "$LINENO"; then :<br>- ac_cv_lib_asound_snd_spcm_init=yes<br>+ ac_cv_lib_asound_snd_pcm_open=yes<br> else<br>- ac_cv_lib_asound_snd_spcm_init=no<br>+ ac_cv_lib_asound_snd_pcm_open=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>-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_asound_snd_spcm_init" >&5<br>-$as_echo "$ac_cv_lib_asound_snd_spcm_init" >&6; }<br>-if test "x$ac_cv_lib_asound_snd_spcm_init" = xyes; then :<br>+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_asound_snd_pcm_open" >&5<br>+$as_echo "$ac_cv_lib_asound_snd_pcm_open" >&6; }<br>+if test "x$ac_cv_lib_asound_snd_pcm_open" = xyes; then :<br> AST_ALSA_FOUND=yes<br> else<br> AST_ALSA_FOUND=no<br>@@ -19607,6 +19704,7 @@<br> fi<br> <br> <br>+fi<br> <br> <br> if test "x${PBX_BFD}" != "x1" -a "${USE_BFD}" != "no"; then<br>diff --git a/configure.ac b/configure.ac<br>index 233a52d..a518664 100644<br>--- a/configure.ac<br>+++ b/configure.ac<br>@@ -1443,7 +1443,10 @@<br> <br> # do the package library checks now<br> <br>-AST_EXT_LIB_CHECK([ALSA], [asound], [snd_spcm_init], [alsa/asoundlib.h], [-lm -ldl])<br>+AST_EXT_LIB_CHECK([ALSA], [asound], [snd_pcm_open], [alsa/asoundlib.h])<br>+if test "${PBX_ALSA}" = "0"; then<br>+ AST_EXT_LIB_CHECK([ALSA], [asound], [snd_pcm_open], [alsa/asoundlib.h], [-lm -ldl])<br>+fi<br> <br> AST_EXT_LIB_CHECK([BFD], [bfd], [bfd_openr], [bfd.h])<br> <br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/8434">change 8434</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/8434"/><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: I3b21f2135f6cbfac7590ccdc2df753257f426e0b </div>
<div style="display:none"> Gerrit-Change-Number: 8434 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Alexander Traud <pabstraud@compuserve.com> </div>