summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorJoe Marcus Clarke <marcus@FreeBSD.org>2008-08-20 16:53:56 -0400
committerLennart Poettering <lennart@poettering.net>2008-08-21 04:23:38 +0200
commitd7d6d26e1f858841f333264a07edc512066269af (patch)
tree85659c6e24d69ad7fcc1ace2ffdfcf5f935f6e11 /configure.ac
parentf1ca2213fa649a9e3635ec7638b6c5bced594787 (diff)
OSS driver take 3
This adds the necessary error checking, and fixes the s/alsa/oss/ problem in configure.ac. Signed-off-by: Lennart Poettering <lennart@poettering.net>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac85
1 files changed, 84 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 2a48177..f41cfe9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -202,6 +202,35 @@ fi
AC_SUBST(ALSA_CFLAGS)
AC_SUBST(ALSA_LIBS)
+### OSS support (optional) ###
+AC_ARG_ENABLE([oss],
+ AC_HELP_STRING([--disable-oss], [Disable optional OSS support]),
+ [
+ case "${enableval}" in
+ yes) oss=yes ;;
+ no) oss=no ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for --disable-oss) ;;
+ esac
+ ],
+ [oss=auto])
+
+if test "x${oss}" != xno ; then
+ AC_CHECK_HEADERS(soundcard.h sys/soundcard.h machine/soundcard.h)
+ if test "${ac_cv_header_sys_soundcard_h}" = "yes" || \
+ test "${ac_cv_header_soundcard_h}" = "yes" || \
+ test "${ac_cv_header_machine_soundcard_h}" = "yes"; then
+ HAVE_OSS=1
+ AC_DEFINE([HAVE_OSS], 1, [Have OSS?])
+ else
+ HAVE_OSS=0
+ if test "x$oss" = xyes ; then
+ AC_MSG_ERROR([*** OSS not found ***])
+ fi
+ fi
+else
+ HAVE_OSS=0
+fi
+
### PulseAudio (optional) ####
AC_ARG_ENABLE([pulse],
@@ -339,6 +368,7 @@ HAVE_DSO=0
BUILTIN_DSO=0
BUILTIN_PULSE=0
BUILTIN_ALSA=0
+BUILTIN_OSS=0
BUILTIN_NULL=0
case "x$with_builtin" in
@@ -349,6 +379,7 @@ case "x$with_builtin" in
BUILTIN_PULSE=1
HAVE_ALSA=0
+ HAVE_OSS=0
HAVE_NULL=0
;;
@@ -358,10 +389,22 @@ case "x$with_builtin" in
fi
BUILTIN_ALSA=1
+ HAVE_OSS=0
HAVE_PULSE=0
HAVE_NULL=0
;;
+ xoss)
+ if test "x$HAV_OSS" != x1 ; then
+ AC_MSG_ERROR([*** OSS selected for builtin driver, but not enabled. ***])
+ fi
+
+ BUILTIN_OSS=1
+ HAVE_ALSA=0
+ HAVE_PULSE=0
+ HAVE_NULL=0
+ ;;
+
xnull)
if test "x$HAVE_NULL" != x1 ; then
AC_MSG_ERROR([*** Null output selected for builtin driver, but not enabled. ***])
@@ -370,6 +413,7 @@ case "x$with_builtin" in
BUILTIN_NULL=1
HAVE_PULSE=0
HAVE_ALSA=0
+ HAVE_OSS=0
;;
xdso)
@@ -382,24 +426,28 @@ case "x$with_builtin" in
AC_MSG_ERROR([*** Unknown driver $with_builtin selected for builtin ***])
esac
-if test "x$HAVE_PULSE" != x1 -a "x$HAVE_ALSA" != x1 -a "x$HAVE_NULL" != x1 ; then
+if test "x$HAVE_PULSE" != x1 -a "x$HAVE_ALSA" != x1 -a "x$HAVE_OSS" != x1 -a "x$HAVE_NULL" != x1 ; then
AC_MSG_ERROR([*** No backend enabled. ***])
fi
AC_SUBST(HAVE_DSO)
AC_SUBST(HAVE_PULSE)
AC_SUBST(HAVE_ALSA)
+AC_SUBST(HAVE_OSS)
AC_SUBST(HAVE_NULL)
AC_SUBST(BUILTIN_DSO)
AC_SUBST(BUILTIN_PULSE)
AC_SUBST(BUILTIN_ALSA)
+AC_SUBST(BUILTIN_OSS)
AC_SUBST(BUILTIN_NULL)
AM_CONDITIONAL([HAVE_PULSE], [test "x$HAVE_PULSE" = x1])
AM_CONDITIONAL([HAVE_ALSA], [test "x$HAVE_ALSA" = x1])
+AM_CONDITIONAL([HAVE_OSS], [test "x$HAVE_OSS" = x1])
AM_CONDITIONAL([HAVE_NULL], [test "x$HAVE_NULL" = x1])
AM_CONDITIONAL([BUILTIN_DSO], [test "x$BUILTIN_DSO" = x1])
AM_CONDITIONAL([BUILTIN_PULSE], [test "x$BUILTIN_PULSE" = x1])
AM_CONDITIONAL([BUILTIN_ALSA], [test "x$BUILTIN_ALSA" = x1])
+AM_CONDITIONAL([BUILTIN_OSS], [test "x$BUILTIN_OSS" = x1])
AM_CONDITIONAL([BUILTIN_NULL], [test "x$BUILTIN_NULL" = x1])
GTK_DOC_CHECK(1.9)
@@ -443,6 +491,15 @@ if test "x$BUILTIN_ALSA" = "x1" ; then
ENABLE_BUILTIN_ALSA=yes
fi
+ENABLE_OSS=no
+if test "x$HAVE_OSS" = "x1" ; then
+ ENABLE_OSS=yes
+fi
+ENABLE_BUILTIN_OSS=no
+if test "x$BUILTIN_OSS" = "x1" ; then
+ ENABLE_BUILTIN_OSS=yes
+fi
+
ENABLE_NULL=no
if test "x$HAVE_NULL" = "x1" ; then
ENABLE_NULL=yes
@@ -472,8 +529,34 @@ echo "
Builtin PulseAudio: ${ENABLE_BUILTIN_PULSE}
Enable ALSA: ${ENABLE_ALSA}
Builtin ALSA: ${ENABLE_BUILTIN_ALSA}
+ Enable OSS: ${ENABLE_OSS}
+ Builtin OSS: ${ENABLE_BUILTIN_OSS}
Enable Null Output: ${ENABLE_NULL}
Builtin Null Output: ${ENABLE_BUILTIN_NULL}
Enable GTK+: ${ENABLE_GTK}
GTK Modules Directory: ${GTK_MODULES_DIR}
"
+
+
+if test "x$HAVE_OSS" = "x1" -a "x$HAVE_ALSA" = "x1" ; then
+
+ echo "
+WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING!
+
+You enabled the OSS driver although the ALSA driver is
+available. Please note that if ALSA is available the OSS driver is a
+very bad choice, since it currently doesn't support resampling or
+converting sample types to the necessities of the hardware if the
+hardware does not directly support the format/rate of the sound file
+to play.
+
+Packagers of Linux distributions! Please think twice if you package
+the OSS driver! It is probably best to not to pacakge it at all -- at
+least until the OSS driver learned sample type conversion and the most
+basic resampling. Otherwise you might end up getting bug reports from
+users misunderstanding the OSS vs. ALSA situation.
+
+WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING!
+"
+
+fi