From 2a108b9b06e52027aea370bc5c19705db74851d6 Mon Sep 17 00:00:00 2001 From: Mark Spencer Date: Tue, 31 Aug 2004 13:32:11 +0000 Subject: Merge NetBSD and Courtesty tone with modifications (bug #2329) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3686 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- channels/Makefile | 15 +++++++++++---- channels/chan_oss.c | 6 +++--- channels/h323/Makefile | 2 ++ 3 files changed, 16 insertions(+), 7 deletions(-) (limited to 'channels') diff --git a/channels/Makefile b/channels/Makefile index a2d49cbb7..d9b670999 100755 --- a/channels/Makefile +++ b/channels/Makefile @@ -46,15 +46,18 @@ PTLIB=-lpt_linux_x86_r H323LIB=-lh323_linux_x86_r CHANH323LIB=-ldl endif - -ifneq (${OSARCH},Darwin) -CHANNEL_LIBS+=chan_oss.so -endif ifeq (${OSARCH},FreeBSD) PTLIB=-lpt_FreeBSD_x86_r H323LIB=-lh323_FreeBSD_x86_r CHANH323LIB=-pthread SOLINK+=-L/usr/local/lib +endif +ifeq (${OSARCH},NetBSD) +PTLIB=-lpt_NetBSD_x86_r +H323LIB=-lh323_NetBSD_x86_r +SOLINK+=-L/usr/local/lib +endif +ifneq (${OSARCH},Darwin) CHANNEL_LIBS+=chan_oss.so endif @@ -139,6 +142,10 @@ ifeq (${OSARCH},OpenBSD) chan_oss.so: chan_oss.o $(CC) $(SOLINK) -o $@ chan_oss.o -lossaudio endif +ifeq (${OSARCH},NetBSD) +chan_oss.so: chan_oss.o + $(CC) $(SOLINK) -o $@ chan_oss.o -lossaudio +endif chan_iax2.so: chan_iax2.o iax2-parser.o iax2-provision.o ifeq ($(USE_MYSQL_FRIENDS),1) diff --git a/channels/chan_oss.c b/channels/chan_oss.c index abf399ad1..a74a9d847 100755 --- a/channels/chan_oss.c +++ b/channels/chan_oss.c @@ -47,7 +47,7 @@ #include "answer.h" /* Which device to use */ -#ifdef __OpenBSD__ +#if defined( __OpenBSD__ ) || defined( __NetBSD__ ) #define DEV_DSP "/dev/audio" #else #define DEV_DSP "/dev/dsp" @@ -375,7 +375,7 @@ static int soundcard_setoutput(int force) return 0; readmode = 0; if (force || time_has_passed()) { - ioctl(sounddev, SNDCTL_DSP_RESET); + ioctl(sounddev, SNDCTL_DSP_RESET, 0); /* Keep the same fd reserved by closing the sound device and copying stdin at the same time. */ /* dup2(0, sound); */ @@ -405,7 +405,7 @@ static int soundcard_setinput(int force) return 0; readmode = -1; if (force || time_has_passed()) { - ioctl(sounddev, SNDCTL_DSP_RESET); + ioctl(sounddev, SNDCTL_DSP_RESET, 0); close(sounddev); /* dup2(0, sound); */ fd = open(DEV_DSP, O_RDONLY | O_NONBLOCK); diff --git a/channels/h323/Makefile b/channels/h323/Makefile index fa9c8ea11..52004c1fd 100755 --- a/channels/h323/Makefile +++ b/channels/h323/Makefile @@ -21,8 +21,10 @@ endif # OSARCH=$(shell uname -s) ifneq (${OSARCH},FreeBSD) +ifneq (${OSARCH},NetBSD) CFLAGS += -march=$(shell uname -m) endif +endif CFLAGS += -DPBYTE_ORDER=PLITTLE_ENDIAN ifeq (${OSARCH},Linux) -- cgit v1.2.3