]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
BuildSystem: Enable Advanced Linux Sound Architecture (ALSA) in NetBSD.
authorAlexander Traud <pabstraud@compuserve.com>
Mon, 5 Mar 2018 16:17:23 +0000 (17:17 +0100)
committerAlexander Traud <pabstraud@compuserve.com>
Fri, 16 Mar 2018 15:09:31 +0000 (16:09 +0100)
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

channels/chan_alsa.c
configure
configure.ac

index 1edd22e325bc467bc14e11b7dfee41f08d2a2bfd..d4808bcf307ecf3e31c517c24fb17e5d2d14358b 100644 (file)
 
 ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 
+#include <errno.h>
+#ifndef ESTRPIPE
+#define ESTRPIPE EPIPE
+#endif
 #include <fcntl.h>
 #include <sys/ioctl.h>
 #include <sys/time.h>
index eeb746758489f3d3eb80839cc43ffa7d4a336181..c472e9f002c1146a1d6dff5c5b65cbd5736f5087 100755 (executable)
--- a/configure
+++ b/configure
@@ -19287,13 +19287,13 @@ if test "x${PBX_ALSA}" != "x1" -a "${USE_ALSA}" != "no"; then
 
       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.  */
 
@@ -19303,27 +19303,27 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #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
@@ -19334,7 +19334,7 @@ fi
 
    # 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"
index c920bae1091ec40ea59e52828f736c25a67da1a0..cbd2cc18e1be6d0634c7f679f99fcf60d470fc3e 100644 (file)
@@ -1422,7 +1422,7 @@ PKG_PROG_PKG_CONFIG()
 
 # 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