Don't hard-code /dev/sound or /dev/dsp, use DEVOSSAUDIO instead.

Add DragonFly support.
This commit is contained in:
joerg 2006-03-06 22:16:53 +00:00
parent 89f1cb708d
commit a0237ff647
5 changed files with 37 additions and 25 deletions

View file

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.19 2006/03/04 21:30:41 jlam Exp $
# $NetBSD: Makefile,v 1.20 2006/03/06 22:16:53 joerg Exp $
#
DISTNAME= gtoaster1.0Beta5
@ -19,6 +19,11 @@ GNU_CONFIGURE= YES
CONFIGURE_ARGS+= --with-oss --without-esd
CONFIGURE_ARGS+= --without-gnome --without-orbit
SUBST_CLASSES+= paths
SUBST_FILES.paths= audio_oss.c
SUBST_SED.paths+= -e 's,@DEVOSSAUDIO@,${DEVOSSAUDIO},g'
SUBST_STAGE.paths= post-patch
.include "../../x11/gtk/buildlink3.mk"
.include "../../mk/ossaudio.buildlink3.mk"

View file

@ -1,10 +1,10 @@
$NetBSD: distinfo,v 1.4 2005/02/24 13:40:53 agc Exp $
$NetBSD: distinfo,v 1.5 2006/03/06 22:16:53 joerg Exp $
SHA1 (gtoaster1.0Beta5.tgz) = c55bf7e8e532956a8907cd29cbfb98a721c5bb3a
RMD160 (gtoaster1.0Beta5.tgz) = f8c7386497c56b8e1bf924e099ddf68cbcbd02a0
Size (gtoaster1.0Beta5.tgz) = 781796 bytes
SHA1 (patch-aa) = fd411be3c18c91347cbc7c596c7cd153a6ea694b
SHA1 (patch-ab) = 89baa0e8a6d30bc1cbfe5cbb86ddecd905d5f653
SHA1 (patch-ac) = 21a2b627a656d5e61a3dd06f615c15e3f41a89c3
SHA1 (patch-aa) = a4442d35d60fb642a2ae65a379454fd1b63b6184
SHA1 (patch-ab) = 8d3d500572dbfac5263f7902655ff3269db4102f
SHA1 (patch-ac) = 8bbb117badd4430eb2fc0eb2ad130671ceb46f47
SHA1 (patch-ad) = b8b5349fe092cbf9d8a40da272d379e5fae7ef91
SHA1 (patch-ae) = b1a6f1f9bbaa605b9782f67dd8f6cdaf6770a438

View file

@ -1,4 +1,4 @@
$NetBSD: patch-aa,v 1.1.1.1 2002/03/25 11:24:28 drochner Exp $
$NetBSD: patch-aa,v 1.2 2006/03/06 22:16:53 joerg Exp $
--- cdromlow.c.orig Sat Mar 23 19:48:00 2002
+++ cdromlow.c Sat Mar 23 20:10:30 2002
@ -7,7 +7,7 @@ $NetBSD: patch-aa,v 1.1.1.1 2002/03/25 11:24:28 drochner Exp $
#include <signal.h>
#include <unistd.h>
-#if !defined( __FreeBSD__) && !defined(__svr4__ )
+#if !defined( __FreeBSD__) && !defined(__svr4__ ) && !defined(__NetBSD__)
+#if !defined( __FreeBSD__) && !defined(__svr4__ ) && !defined(__NetBSD__) && !defined(__DragonFly__)
# include <linux/cdrom.h>
#else
# include <sys/cdio.h>
@ -16,7 +16,7 @@ $NetBSD: patch-aa,v 1.1.1.1 2002/03/25 11:24:28 drochner Exp $
/* we provide some macro mappings here. FreeBSD structs are a bit
* different to those used by Linux so we will use macros to compensate that */
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__NetBSD__)
+#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__)
/* Needed by FreeBSD */
# define CDROM_DATA_TRACK 4
@ -71,7 +71,8 @@ $NetBSD: patch-aa,v 1.1.1.1 2002/03/25 11:24:28 drochner Exp $
@@ -148,7 +169,11 @@
entry.cdromlow_tocent_format=CDROM_LBA;
ioctl(info->filedescriptor,CDROMREADTOCENTRY,&entry);
#ifndef __FreeBSD__
-#ifndef __FreeBSD__
+#if !defined(__FreeBSD__) && !defined(__DragonFly__)
+#ifdef __NetBSD__
+ if (entry.data->control & CDROM_DATA_TRACK)
+#else
@ -133,7 +134,8 @@ $NetBSD: patch-aa,v 1.1.1.1 2002/03/25 11:24:28 drochner Exp $
@@ -325,7 +372,11 @@
if (ioctl(info->filedescriptor,CDROMREADTOCENTRY,&track)==-1)
ok=0;
#ifndef __FreeBSD__
-#ifndef __FreeBSD__
+#if !defined(__FreeBSD__) && !defined(__DragonFly__)
+#ifdef __NetBSD__
+ if (track.data->control & CDROM_DATA_TRACK)
+#else

View file

@ -1,4 +1,4 @@
$NetBSD: patch-ab,v 1.1.1.1 2002/03/25 11:24:29 drochner Exp $
$NetBSD: patch-ab,v 1.2 2006/03/06 22:16:53 joerg Exp $
--- cddb.c.orig Wed Jun 6 00:47:58 2001
+++ cddb.c Sat Mar 23 20:13:05 2002
@ -7,7 +7,7 @@ $NetBSD: patch-ab,v 1.1.1.1 2002/03/25 11:24:29 drochner Exp $
#include <sys/socket.h>
#include <sys/types.h>
-#ifndef __FreeBSD__
+#if !defined(__FreeBSD__) && !defined(__NetBSD__)
+#if !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__DragonFly__)
# include <arpa/inet.h>
#else
# include <netinet/in.h>

View file

@ -1,25 +1,30 @@
$NetBSD: patch-ac,v 1.1.1.1 2002/03/25 11:24:29 drochner Exp $
$NetBSD: patch-ac,v 1.2 2006/03/06 22:16:53 joerg Exp $
--- audio_oss.c.orig Sat Dec 9 12:12:15 2000
+++ audio_oss.c Sat Mar 23 21:32:08 2002
@@ -13,7 +13,11 @@
--- audio_oss.c.orig 2000-12-09 11:12:15.000000000 +0000
+++ audio_oss.c
@@ -12,11 +12,12 @@
#include <signal.h>
#include <fcntl.h>
#include <unistd.h>
#ifndef __FreeBSD__
+#ifdef __NetBSD__
-#ifndef __FreeBSD__
-#include <linux/soundcard.h>
+#if defined(__FreeBSD__) || defined(__DragonFly__)
+#include <sys/soundcard.h>
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
+#include <soundcard.h>
+#else
#include <linux/soundcard.h>
+#endif
#else
#include <machine/soundcard.h>
#define SNDCTL_DSP_CHANNELS SNDCTL_DSP_STEREO
@@ -42,12 +46,12 @@
-#include <machine/soundcard.h>
-#define SNDCTL_DSP_CHANNELS SNDCTL_DSP_STEREO
+#include <linux/soundcard.h>
#endif
#include "audio.h"
@@ -42,12 +43,12 @@ int audio_oss_open(gpointer data)
if (driver->descriptor==-1)
{
- driver->descriptor=open("/dev/dsp",O_WRONLY);
+ driver->descriptor=open("/dev/sound",O_WRONLY);
+ driver->descriptor=open("@DEVOSSAUDIO@",O_WRONLY);
if (driver->descriptor!=-1)
{
int format_mask=0;