Subject: 24.3.50; configure does not allow for sound support without ALSA

From: Ulrich Mueller <[email-masked]>
Date: Sat, 10 Aug 2013 12:13:57 +0200

Tags: patch

In GNU Emacs 24.3.50.1 (x86_64-pc-linux-gnu, Motif Version 2.3.4)
 of 2013-08-02 on juno
Bzr revision: [email-masked]
Windowing system distributor `The X.Org Foundation', version
 11.0.11402901
System Description:	NAME=Gentoo

After the 2013-07-27 change to configure.ac, --with-sound will accept
option values (yes, no, ossaudio, alsa). However, it is not possible
to enable sound support but prevent autodetection of ALSA.
For example, when configuring --with-sound=yes on a GNU/Linux system,
ALSA will be enabled when it is found.

The patch below adds a new value --with-sound=voxware that will enable
sound but not ALSA, i.e. src/sound.c will then use the /dev/dsp device
of OSS.

(I'd have preferred the name "oss" over "voxware", but there already
is "ossaudio" and I think having "oss" along with it would be too
confusing. Also src/sound.c refers to the driver as Voxware and
functions are called vox_init() etc. But feel free to change it to
"oss" if you think that confusion is not an issue.)

--- emacs-orig/ChangeLog
+++ emacs/ChangeLog
@@ -1,3 +1,9 @@
+2013-08-10  Ulrich Müller  <[email-masked]>
+
+	* configure.ac: Allow for --with-sound=voxware that will enable
+	sound but otherwise disable ALSA. This will use the OSS device,
+	typically /dev/dsp, for sound output.
+
 2013-08-10  Eli Zaretskii  <[email-masked]>
 
 	* configure.ac: Define and substitute UPDATE_MANIFEST.
--- emacs-orig/configure.ac
+++ emacs/configure.ac
@@ -142,12 +142,12 @@
     AC_DEFINE_UNQUOTED(MAILHOST, ["$withval"], [String giving fallback POP mail host.]))
 
 AC_ARG_WITH([sound],[AS_HELP_STRING([--with-sound=VALUE],
-  [compile with sound support (VALUE one of: yes, ossaudio, alsa, no;
+  [compile with sound support (VALUE one of: yes, ossaudio, alsa, voxware, no;
 default yes).  Only for GNU/Linux, FreeBSD, NetBSD, MinGW.])],
   [ case "${withval}" in
-      yes|no|ossaudio|alsa) val=$withval ;;
+      yes|no|ossaudio|alsa|voxware) val=$withval ;;
       *) AC_MSG_ERROR([`--with-sound=$withval' is invalid;
-this option's value should be `yes', `no', `ossaudio', or `alsa'.])
+this option's value should be `yes', `no', `ossaudio', `alsa', or `voxware'.])
       ;;
     esac
     with_sound=$val
@@ -1274,6 +1274,9 @@
     #include <windows.h>
     #endif
     ])
+  test "${with_sound}" = "voxware" && test "${have_sound_header}" != "yes" && \
+    AC_MSG_ERROR([OSS/Voxware sound support requested but not found.])
+
   if test "${with_sound}" = "ossaudio" || test "${with_sound}" = "yes"; then
     # Emulation library used on NetBSD.
     AC_CHECK_LIB(ossaudio, _oss_ioctl, LIBSOUND=-lossaudio, LIBSOUND=)