changeset 1213:e49e02828f85

OSS4 VMIX-enabled fork of the OSS3 output plugin (just bypasses the mixer settings). Warning!!! The ALSA and OSS3 users will experience build failures because it's enabled by default. Anyway, now you have another reason to switch ;)
author Cristi Magherusan <majeru@atheme-project.org>
date Sat, 07 Jul 2007 04:54:06 +0300
parents 36cc5e56246e
children 2a722c3ccd9e
files configure.ac
diffstat 1 files changed, 70 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/configure.ac	Fri Jul 06 17:37:21 2007 +0200
+++ b/configure.ac	Sat Jul 07 04:54:06 2007 +0300
@@ -843,6 +843,76 @@
 
 AC_SUBST(OSS_LIBS)
 
+
+dnl *** OSS4 output
+
+AC_ARG_ENABLE(oss4,
+    [  --disable-oss4          disable the OSS4 output plugin (default=enabled)],
+    [enable_oss4=$enableval],
+    [enable_oss4=yes]
+)
+
+have_oss4=no
+if test "$enable_oss4" = "yes"; then
+    AC_MSG_CHECKING(for OSS4 include dir)
+    OSS4_CFLAGS=""
+    if test -f "/etc/oss.conf" ; then
+        for i in `cat /etc/oss.conf`; do
+            t=`echo $i | sed -e 's/OSSLIBDIR=//'`
+            if test "$i" != "$t" ; then
+                if test -f "$t/include/sys/soundcard.h" -o -f "$i/include/soundcard.h" ; then
+                    OSS4_CFLAGS="-I$t/include"
+                fi
+            fi
+        done
+    fi
+    if test -n "$OSS4_CFLAGS" ; then
+        AC_MSG_RESULT([$OSS4_CFLAGS])
+    else
+        AC_MSG_RESULT([not found])
+    fi
+    CFLAGS_save=$CFLAGS
+    CFLAGS="$CFLAGS $OSS4_CFLAGS"
+    AC_CHECK_HEADERS(soundcard.h)
+    AC_CHECK_HEADERS(sys/soundcard.h)
+    AC_CHECK_HEADERS(machine/soundcard.h)
+    CFLAGS=$CFLAGS_save
+
+    if test "${ac_cv_header_soundcard_h}" = "yes" || test "${ac_cv_header_sys_soundcard_h}" = "yes" || test "${ac_cv_header_machine_soundcard_h}" = "yes"; then
+        have_oss4=yes
+    fi
+
+    if test "${have_oss4}" = "yes"; then
+	AC_MSG_CHECKING(whether we need -lossaudio)
+        AC_TRY_LINK([
+		#include <sys/ioctl.h>
+		#ifdef HAVE_SYS_SOUNDCARD_H
+		#include <sys/soundcard.h>
+		#else
+		#include <soundcard.h>
+		#endif
+        ], [
+		int fd, value;
+		ioctl(fd, SOUND_MIXER_READ_VOLUME, &value);
+	], AC_MSG_RESULT(no), [
+		OSS_LIBS="-lossaudio"
+		AC_MSG_RESULT(yes)
+        ])
+   fi
+fi
+
+if test "$have_oss4" = "yes"; then
+    AC_DEFINE(HAVE_OSS4, 1, [Define if the OSS4 output plugin should be built])
+else
+    have_oss4=no
+fi
+
+if test "$have_oss4" = "yes"; then
+	OUTPUT_PLUGINS="$OUTPUT_PLUGINS OSS4"
+fi
+
+AC_SUBST(OSS_LIBS)
+
 dnl *** ALSA output plugin
 
 AC_ARG_ENABLE(alsa,