[Asterisk-code-review] BuildSystem: Enable Advanced Linux Sound Architecture (ALSA)... (asterisk[master])

Jenkins2 asteriskteam at digium.com
Tue Mar 20 06:45:36 CDT 2018


Jenkins2 has submitted this change and it was merged. ( https://gerrit.asterisk.org/8433 )

Change subject: BuildSystem: Enable Advanced Linux Sound Architecture (ALSA) in NetBSD.
......................................................................

BuildSystem: Enable Advanced Linux Sound Architecture (ALSA) in NetBSD.

In the script ./configure, AST_EXT_LIB_CHECK checks for external libraries. Some
libraries do not specify all their dependencies and require additional shared
libraries. In AST_EXT_LIB_CHECK, this is the fifth parameter. However, if a
library is specified there, it must exist on the platform, because ./configure
tries to compile/link/execute a small app using those statements. For example,
the library libdl.so is Linux specific and does not exist on BSD-like platforms.

Furthermore, no supported platform/version was found, which still (ever?)
requires those additional libraries. Therefore, they were simply removed.

Finally, this change adds the error code ESTRPIPE to the channel driver
chan_alsa for those platforms which lack it, again for example NetBSD.

ASTERISK-27720

Change-Id: I3b21f2135f6cbfac7590ccdc2df753257f426e0b
---
M channels/chan_alsa.c
M configure
M configure.ac
3 files changed, 17 insertions(+), 13 deletions(-)

Approvals:
  George Joseph: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved
  Jenkins2: Approved for Submit



diff --git a/channels/chan_alsa.c b/channels/chan_alsa.c
index ed7d5cf..a5dead1 100644
--- a/channels/chan_alsa.c
+++ b/channels/chan_alsa.c
@@ -39,6 +39,10 @@
 
 #include "asterisk.h"
 
+#include <errno.h>
+#ifndef ESTRPIPE
+#define ESTRPIPE EPIPE
+#endif
 #include <fcntl.h>
 #include <sys/ioctl.h>
 #include <sys/time.h>
diff --git a/configure b/configure
index afe61aa..5ccfd4f 100755
--- a/configure
+++ b/configure
@@ -19602,13 +19602,13 @@
 
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for snd_spcm_init in -lasound" >&5
-$as_echo_n "checking for snd_spcm_init in -lasound... " >&6; }
-if ${ac_cv_lib_asound_snd_spcm_init+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for snd_pcm_open in -lasound" >&5
+$as_echo_n "checking for snd_pcm_open in -lasound... " >&6; }
+if ${ac_cv_lib_asound_snd_pcm_open+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lasound ${pbxlibdir} -lm -ldl $LIBS"
+LIBS="-lasound ${pbxlibdir}  $LIBS"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -19618,27 +19618,27 @@
 #ifdef __cplusplus
 extern "C"
 #endif
-char snd_spcm_init ();
+char snd_pcm_open ();
 int
 main ()
 {
-return snd_spcm_init ();
+return snd_pcm_open ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_asound_snd_spcm_init=yes
+  ac_cv_lib_asound_snd_pcm_open=yes
 else
-  ac_cv_lib_asound_snd_spcm_init=no
+  ac_cv_lib_asound_snd_pcm_open=no
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_asound_snd_spcm_init" >&5
-$as_echo "$ac_cv_lib_asound_snd_spcm_init" >&6; }
-if test "x$ac_cv_lib_asound_snd_spcm_init" = xyes; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_asound_snd_pcm_open" >&5
+$as_echo "$ac_cv_lib_asound_snd_pcm_open" >&6; }
+if test "x$ac_cv_lib_asound_snd_pcm_open" = xyes; then :
   AST_ALSA_FOUND=yes
 else
   AST_ALSA_FOUND=no
@@ -19649,7 +19649,7 @@
 
    # now check for the header.
    if test "${AST_ALSA_FOUND}" = "yes"; then
-      ALSA_LIB="${pbxlibdir} -lasound -lm -ldl"
+      ALSA_LIB="${pbxlibdir} -lasound "
       # if --with-ALSA=DIR has been specified, use it.
       if test "x${ALSA_DIR}" != "x"; then
          ALSA_INCLUDE="-I${ALSA_DIR}/include"
diff --git a/configure.ac b/configure.ac
index 4b9b830..85881d7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1466,7 +1466,7 @@
 
 # do the package library checks now
 
-AST_EXT_LIB_CHECK([ALSA], [asound], [snd_spcm_init], [alsa/asoundlib.h], [-lm -ldl])
+AST_EXT_LIB_CHECK([ALSA], [asound], [snd_pcm_open], [alsa/asoundlib.h])
 
 AST_EXT_LIB_CHECK([BFD], [bfd], [bfd_openr], [bfd.h])
 # Fedora/RedHat/CentOS require extra libraries

-- 
To view, visit https://gerrit.asterisk.org/8433
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I3b21f2135f6cbfac7590ccdc2df753257f426e0b
Gerrit-Change-Number: 8433
Gerrit-PatchSet: 5
Gerrit-Owner: Alexander Traud <pabstraud at compuserve.com>
Gerrit-Reviewer: Alexander Traud <pabstraud at compuserve.com>
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180320/079a5a1b/attachment.html>


More information about the asterisk-code-review mailing list