summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@raeburn.org>2000-07-05 19:33:00 +0000
committerKen Raeburn <raeburn@raeburn.org>2000-07-05 19:33:00 +0000
commit80fcd514bbc519721a2c11e479c6fd1f0f6efb96 (patch)
tree11be53ea9730804c895ec42b6487dec66a8d0b1a
parentb192d653daad26b27e58f9a1a37593a9ce5a6bca (diff)
downloademacs-80fcd514bbc519721a2c11e479c6fd1f0f6efb96.tar.gz
Sound support for NetBSD through "Linux emulation" support:
* config.in (HAVE_SOUNDCARD_H): Undef. (HAVE_SOUND): Define if HAVE_SOUNDCARD_H. * Makefile.in (LIBSOUND): New variable. (LIBES): Include it. * sound.c [HAVE_SOUNDCARD_H]: Include <sys/ioctl.h> and <soundcard.h>. (DEFAULT_SOUND_DEVICE): Define to "/dev/dsp" if not defined elsewhere. (vox_open): Use DEFAULT_SOUND_DEVICE. * s/netbsd.h (DEFAULT_SOUND_DEVICE): Define to /dev/audio.
-rw-r--r--src/ChangeLog14
-rw-r--r--src/Makefile.in5
-rw-r--r--src/config.in4
-rw-r--r--src/s/netbsd.h2
-rw-r--r--src/sound.c10
5 files changed, 33 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 2272fac3bf9..5eb68cd9390 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,17 @@
+2000-07-05 Ken Raeburn <raeburn@gnu.org>
+
+ Sound support for NetBSD through "Linux emulation" support:
+ * config.in (HAVE_SOUNDCARD_H): Undef.
+ (HAVE_SOUND): Define if HAVE_SOUNDCARD_H.
+ * Makefile.in (LIBSOUND): New variable.
+ (LIBES): Include it.
+ * sound.c [HAVE_SOUNDCARD_H]: Include <sys/ioctl.h> and
+ <soundcard.h>.
+ (DEFAULT_SOUND_DEVICE): Define to "/dev/dsp" if not defined
+ elsewhere.
+ (vox_open): Use DEFAULT_SOUND_DEVICE.
+ * s/netbsd.h (DEFAULT_SOUND_DEVICE): Define to /dev/audio.
+
2000-07-05 Gerd Moellmann <gerd@gnu.org>
* print.c (print_error_message): If Vsignaling_function is set,
diff --git a/src/Makefile.in b/src/Makefile.in
index fce7a652a59..58113d3441e 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -417,6 +417,8 @@ LIBX= $(LIBXMENU) LD_SWITCH_X_SITE -lX10 LIBX10_MACHINE LIBX10_SYSTEM
#endif /* not HAVE_X11 */
#endif /* not HAVE_X_WINDOWS */
+LIBSOUND= @LIBSOUND@
+
#ifndef ORDINARY_LINK
/* Fix linking if compiled with GCC. */
#ifdef __GNUC__
@@ -794,7 +796,8 @@ SOME_MACHINE_LISP = ${dotdot}/lisp/menu-bar.elc ${dotdot}/lisp/mouse.elc \
Note that SunOS needs -lm to come before -lc; otherwise, you get
duplicated symbols. If the standard libraries were compiled
with GCC, we might need gnulib again after them. */
-LIBES = $(LOADLIBES) $(LIBS) $(LIBX) LIBS_SYSTEM LIBS_MACHINE LIBS_TERMCAP \
+LIBES = $(LOADLIBES) $(LIBS) $(LIBX) $(LIBSOUND) \
+ LIBS_SYSTEM LIBS_MACHINE LIBS_TERMCAP \
LIBS_DEBUG $(GETLOADAVG_LIBS) $(GNULIB_VAR) LIB_MATH LIB_STANDARD \
$(GNULIB_VAR)
diff --git a/src/config.in b/src/config.in
index 6530987ca1c..10a7080416e 100644
--- a/src/config.in
+++ b/src/config.in
@@ -136,6 +136,7 @@ Boston, MA 02111-1307, USA. */
/* Header for Voxware or PCM sound card driver. */
#undef HAVE_MACHINE_SOUNDCARD_H
#undef HAVE_SYS_SOUNDCARD_H
+#undef HAVE_SOUNDCARD_H
/* Define HAVE_SOUND if we have sound support. */
#ifdef HAVE_MACHINE_SOUNDCARD_H
@@ -144,6 +145,9 @@ Boston, MA 02111-1307, USA. */
#ifdef HAVE_SYS_SOUNDCARD_H
#define HAVE_SOUND 1
#endif
+#ifdef HAVE_SOUNDCARD_H
+#define HAVE_SOUND 1
+#endif
/* Some things figured out by the configure script, grouped as they are in
configure.in. */
diff --git a/src/s/netbsd.h b/src/s/netbsd.h
index 4209fc947ef..79d738991fc 100644
--- a/src/s/netbsd.h
+++ b/src/s/netbsd.h
@@ -87,3 +87,5 @@
#define LINKER $(CC) -nostartfiles
#define NARROWPROTO 1
+
+#define DEFAULT_SOUND_DEVICE "/dev/audio"
diff --git a/src/sound.c b/src/sound.c
index 965285a9c5f..a3a44ccefca 100644
--- a/src/sound.c
+++ b/src/sound.c
@@ -41,6 +41,14 @@ Boston, MA 02111-1307, USA. */
#ifdef HAVE_SYS_SOUNDCARD_H
#include <sys/soundcard.h>
#endif
+#ifdef HAVE_SOUNDCARD_H
+#include <sys/ioctl.h>
+#include <soundcard.h>
+#endif
+
+#ifndef DEFAULT_SOUND_DEVICE
+#define DEFAULT_SOUND_DEVICE "/dev/dsp"
+#endif
#define max(X, Y) ((X) > (Y) ? (X) : (Y))
#define min(X, Y) ((X) < (Y) ? (X) : (Y))
@@ -736,7 +744,7 @@ vox_open (sd)
if (sd->file)
file = sd->file;
else
- file = "/dev/dsp";
+ file = DEFAULT_SOUND_DEVICE;
sd->fd = emacs_open (file, O_WRONLY, 0);
if (sd->fd < 0)