From 20e94fdd8ec2a82d0789fc4ea354a803a14e2ec3 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 10 Jul 2012 22:16:25 -0400 Subject: Let configure set DEFAULT_SOUND_DEVICE * configure.ac (DEFAULT_SOUND_DEVICE): New definition. * src/sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]: * src/s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it. --- ChangeLog | 4 ++++ configure.ac | 10 ++++++++++ src/ChangeLog | 5 +++++ src/s/netbsd.h | 2 -- src/sound.c | 12 ++++-------- 5 files changed, 23 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4fbb293747..1a67294ea9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2012-07-11 Glenn Morris + + * configure.ac (DEFAULT_SOUND_DEVICE): New definition. + 2012-07-10 Paul Eggert Remove "#define unix" that is no longer needed (Bug#11905). diff --git a/configure.ac b/configure.ac index 028706af8e..a05f4f860a 100644 --- a/configure.ac +++ b/configure.ac @@ -3145,6 +3145,16 @@ case $opsys in ;; esac +dnl FIXME Surely we can test for this rather than hard-code it. +case $opsys in + netbsd | openbsd) sound_device="/dev/audio" ;; + *) sound_device="/dev/dsp" ;; +esac + +dnl Used in sound.c +AC_DEFINE_UNQUOTED(DEFAULT_SOUND_DEVICE, "$sound_device", + [Name of the default sound device.]) + dnl Used in vm-limit.c AH_TEMPLATE(DATA_START, [Address of the start of the data segment.]) dnl Used in lisp.h, emacs.c, mem-limits.h diff --git a/src/ChangeLog b/src/ChangeLog index 0c98c0b356..be42db2468 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2012-07-11 Glenn Morris + + * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]: + * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it. + 2012-07-10 Paul Eggert Remove "#define unix" that is no longer needed (Bug#11905). diff --git a/src/s/netbsd.h b/src/s/netbsd.h index 23e7254192..80b4442af5 100644 --- a/src/s/netbsd.h +++ b/src/s/netbsd.h @@ -21,8 +21,6 @@ along with GNU Emacs. If not, see . */ /* Get most of the stuff from bsd-common. */ #include "bsd-common.h" -#define DEFAULT_SOUND_DEVICE "/dev/audio" - /* Greg A. Woods says we must include signal.h before syssignal.h is included, to work around interface conflicts that are handled with CPP __RENAME() macro in signal.h. */ diff --git a/src/sound.c b/src/sound.c index adeb3c47f0..3773047827 100644 --- a/src/sound.c +++ b/src/sound.c @@ -1,5 +1,6 @@ /* sound.c -- sound support. - Copyright (C) 1998-1999, 2001-2012 Free Software Foundation, Inc. + +Copyright (C) 1998-1999, 2001-2012 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -114,11 +115,6 @@ enum sound_attr /* BEGIN: Non Windows Definitions */ #ifndef WINDOWSNT -#ifndef DEFAULT_SOUND_DEVICE -#define DEFAULT_SOUND_DEVICE "/dev/dsp" -#endif - - /* Structure forward declarations. */ struct sound; @@ -714,7 +710,7 @@ vox_open (struct sound_device *sd) { const char *file; - /* Open the sound device. Default is /dev/dsp. */ + /* Open the sound device (eg /dev/dsp). */ if (sd->file) file = sd->file; else @@ -860,7 +856,7 @@ vox_init (struct sound_device *sd) const char *file; int fd; - /* Open the sound device. Default is /dev/dsp. */ + /* Open the sound device (eg /dev/dsp). */ if (sd->file) file = sd->file; else -- cgit v1.2.3