# HG changeset patch # User Ken Raeburn # Date 962825580 0 # Node ID 1572612184fcbdd72a7e0afcd1266f68673a72f0 # Parent 58ce7aad3fff5f60cbf7e3a22eb2f1b53d1581d3 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 and . (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. diff -r 58ce7aad3fff -r 1572612184fc src/ChangeLog --- 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 + + 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 and + . + (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 * print.c (print_error_message): If Vsignaling_function is set, diff -r 58ce7aad3fff -r 1572612184fc src/Makefile.in --- 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) diff -r 58ce7aad3fff -r 1572612184fc src/config.in --- 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. */ diff -r 58ce7aad3fff -r 1572612184fc src/s/netbsd.h --- 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" diff -r 58ce7aad3fff -r 1572612184fc src/sound.c --- 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 #endif +#ifdef HAVE_SOUNDCARD_H +#include +#include +#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)