Mercurial > emacs
changeset 30079:1572612184fc
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.
author | Ken Raeburn <raeburn@raeburn.org> |
---|---|
date | Wed, 05 Jul 2000 19:33:00 +0000 |
parents | 58ce7aad3fff |
children | f8f9badf6750 |
files | src/ChangeLog src/Makefile.in src/config.in src/s/netbsd.h src/sound.c |
diffstat | 5 files changed, 33 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog Wed Jul 05 19:18:52 2000 +0000 +++ b/src/ChangeLog Wed Jul 05 19:33:00 2000 +0000 @@ -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,
--- a/src/Makefile.in Wed Jul 05 19:18:52 2000 +0000 +++ b/src/Makefile.in Wed Jul 05 19:33:00 2000 +0000 @@ -417,6 +417,8 @@ #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 @@ 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)
--- a/src/config.in Wed Jul 05 19:18:52 2000 +0000 +++ b/src/config.in Wed Jul 05 19:33:00 2000 +0000 @@ -136,6 +136,7 @@ /* 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 @@ #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. */
--- a/src/s/netbsd.h Wed Jul 05 19:18:52 2000 +0000 +++ b/src/s/netbsd.h Wed Jul 05 19:33:00 2000 +0000 @@ -87,3 +87,5 @@ #define LINKER $(CC) -nostartfiles #define NARROWPROTO 1 + +#define DEFAULT_SOUND_DEVICE "/dev/audio"
--- a/src/sound.c Wed Jul 05 19:18:52 2000 +0000 +++ b/src/sound.c Wed Jul 05 19:33:00 2000 +0000 @@ -41,6 +41,14 @@ #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 @@ 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)