Index: Makefile =================================================================== RCS file: /usr/cvsroot/asterisk/Makefile,v retrieving revision 1.107 diff -u -r1.107 Makefile --- Makefile 7 Aug 2004 03:01:52 -0000 1.107 +++ Makefile 18 Aug 2004 11:01:29 -0000 @@ -128,6 +128,11 @@ CFLAGS+=$(shell if [ -d /usr/local/include/spandsp ]; then echo "-I/usr/local/include/spandsp"; fi) endif # FreeBSD +ifeq (${OSARCH},NetBSD) +CFLAGS+=-pthread +INCLUDE+=-I/usr/local/include +endif + ifeq (${OSARCH},OpenBSD) CFLAGS+=-pthread endif @@ -175,6 +180,9 @@ ifeq (${OSARCH},FreeBSD) LIBS+=-lcrypto endif +ifeq (${OSARCH},NetBSD) +LIBS+=-lpthread -lcrypto -lm -L/usr/local/lib -lncurses +endif ifeq (${OSARCH},OpenBSD) LIBS=-lcrypto -lpthread -lm -lncurses endif @@ -501,7 +509,6 @@ [ -f mpg123-0.59r.tar.gz ] || wget http://www.mpg123.de/mpg123/mpg123-0.59r.tar.gz [ -d mpg123-0.59r ] || tar xfz mpg123-0.59r.tar.gz make -C mpg123-0.59r linux - config: if [ -d /etc/rc.d/init.d ]; then \ Index: aesopt.h =================================================================== RCS file: /usr/cvsroot/asterisk/aesopt.h,v retrieving revision 1.6 diff -u -r1.6 aesopt.h --- aesopt.h 24 May 2004 20:09:05 -0000 1.6 +++ aesopt.h 18 Aug 2004 11:01:29 -0000 @@ -151,7 +151,7 @@ #if defined( __OpenBSD__ ) # include # include -#elif defined( __FreeBSD__ ) +#elif defined( __FreeBSD__ ) || defined( __NetBSD__ ) # include # include #elif defined( BSD ) && ( BSD >= 199103 ) || defined(__APPLE__) Index: asterisk.c =================================================================== RCS file: /usr/cvsroot/asterisk/asterisk.c,v retrieving revision 1.115 diff -u -r1.115 asterisk.c --- asterisk.c 8 Aug 2004 17:15:01 -0000 1.115 +++ asterisk.c 18 Aug 2004 11:01:29 -0000 @@ -54,7 +54,7 @@ #include #include -#if defined(__FreeBSD__) +#if defined(__FreeBSD__) || defined( __NetBSD__ ) #include #endif Index: md5.c =================================================================== RCS file: /usr/cvsroot/asterisk/md5.c,v retrieving revision 1.7 diff -u -r1.7 md5.c --- md5.c 24 May 2004 20:09:05 -0000 1.7 +++ md5.c 18 Aug 2004 11:01:29 -0000 @@ -3,7 +3,7 @@ #if defined( __OpenBSD__ ) # include # include -#elif defined( __FreeBSD__ ) +#elif defined( __FreeBSD__ ) || defined( __NetBSD__ ) # include # include #elif defined( BSD ) && ( BSD >= 199103 ) || defined(__APPLE__) Index: utils.c =================================================================== RCS file: /usr/cvsroot/asterisk/utils.c,v retrieving revision 1.16 diff -u -r1.16 utils.c --- utils.c 8 Aug 2004 17:15:01 -0000 1.16 +++ utils.c 18 Aug 2004 11:01:29 -0000 @@ -24,7 +24,7 @@ static char base64[64]; static char b2a[256]; -#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__APPLE__) +#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined( __NetBSD__ ) || defined(__APPLE__) /* duh? ERANGE value copied from web... */ #define ERANGE 34 Index: apps/app_sms.c =================================================================== RCS file: /usr/cvsroot/asterisk/apps/app_sms.c,v retrieving revision 1.8 diff -u -r1.8 app_sms.c --- apps/app_sms.c 14 Jul 2004 07:34:34 -0000 1.8 +++ apps/app_sms.c 18 Aug 2004 11:01:30 -0000 @@ -203,7 +203,7 @@ packdate (unsigned char *o, time_t w) { struct tm *t = localtime (&w); -#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__APPLE__) +#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined( __NetBSD__ ) || defined(__APPLE__) int z = - t->tm_gmtoff / 3600 / 15; #else int z = timezone / 3600 / 15; Index: channels/Makefile =================================================================== RCS file: /usr/cvsroot/asterisk/channels/Makefile,v retrieving revision 1.58 diff -u -r1.58 Makefile --- channels/Makefile 30 Jul 2004 18:57:37 -0000 1.58 +++ channels/Makefile 18 Aug 2004 11:01:30 -0000 @@ -46,15 +46,18 @@ 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 @@ -136,6 +139,10 @@ chan_oss.o: chan_oss.c busy.h ringtone.h 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 Index: channels/chan_oss.c =================================================================== RCS file: /usr/cvsroot/asterisk/channels/chan_oss.c,v retrieving revision 1.32 diff -u -r1.32 chan_oss.c --- channels/chan_oss.c 17 Aug 2004 23:53:15 -0000 1.32 +++ channels/chan_oss.c 18 Aug 2004 11:01:30 -0000 @@ -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 @@ 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 @@ 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); Index: channels/h323/Makefile =================================================================== RCS file: /usr/cvsroot/asterisk/channels/h323/Makefile,v retrieving revision 1.16 diff -u -r1.16 Makefile --- channels/h323/Makefile 22 Jun 2004 17:42:13 -0000 1.16 +++ channels/h323/Makefile 18 Aug 2004 11:01:30 -0000 @@ -21,7 +21,9 @@ # OSARCH=$(shell uname -s) ifneq (${OSARCH},FreeBSD) +ifneq (${OSARCH},NetBSD) CFLAGS += -march=$(shell uname -m) +endif endif CFLAGS += -DPBYTE_ORDER=PLITTLE_ENDIAN Index: codecs/lpc10/lpc10.h =================================================================== RCS file: /usr/cvsroot/asterisk/codecs/lpc10/lpc10.h,v retrieving revision 1.17 diff -u -r1.17 lpc10.h --- codecs/lpc10/lpc10.h 26 Oct 2003 18:50:49 -0000 1.17 +++ codecs/lpc10/lpc10.h 18 Aug 2004 11:01:30 -0000 @@ -41,7 +41,7 @@ */ -#if defined(unix) || defined(__unix__) +#if defined(unix) || defined(__unix__) || defined(__NetBSD__) typedef short INT16; typedef int INT32; #endif Index: db1-ast/include/db.h =================================================================== RCS file: /usr/cvsroot/asterisk/db1-ast/include/db.h,v retrieving revision 1.4 diff -u -r1.4 db.h --- db1-ast/include/db.h 26 Oct 2003 18:50:49 -0000 1.4 +++ db1-ast/include/db.h 18 Aug 2004 11:01:30 -0000 @@ -51,7 +51,7 @@ #ifndef __BIT_TYPES_DEFINED__ #define __BIT_TYPES_DEFINED__ -#if (!defined(__FreeBSD__) && !defined(__APPLE__)) +#if (!defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__APPLE__)) typedef __signed char int8_t; typedef unsigned char u_int8_t; typedef short int16_t;