more BSD portability fixes (issue #5155)
authorKevin P. Fleming <kpfleming@digium.com>
Wed, 14 Sep 2005 01:10:20 +0000 (01:10 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Wed, 14 Sep 2005 01:10:20 +0000 (01:10 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6578 65c4cc65-6c06-0410-ace0-fbb531ad65f3

Makefile
channels/Makefile
channels/chan_zap.c
utils/streamplayer.c

index daffa8f..72e198f 100755 (executable)
--- a/Makefile
+++ b/Makefile
@@ -235,7 +235,7 @@ ifeq (${OSARCH},FreeBSD)
   ASTCFLAGS+=$(shell if test ${BSDVERSION} -lt 500016 ; then echo "-D_THREAD_SAFE"; fi)
   LIBS+=$(shell if test  ${BSDVERSION} -lt 502102 ; then echo "-lc_r"; else echo "-pthread"; fi)
   ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/spandsp),)
-    ASTCFLAGS+=" -I$(CROSS_COMPILE_TARGET)/usr/local/include/spandsp"
+    ASTCFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include/spandsp
   endif
   MPG123TARG=freebsd
 endif # FreeBSD
@@ -255,7 +255,7 @@ ifeq (${OSARCH},SunOS)
   INCLUDE+=-Iinclude/solaris-compat -I$(CROSS_COMPILE_TARGET)/usr/local/ssl/include
 endif
 
-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/zaptel.h),)
+ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/pkg/include/zaptel.h),)
   ASTCFLAGS+=-DZAPTEL_OPTIMIZATIONS
 endif
 
index 2bfd230..7189416 100755 (executable)
@@ -92,7 +92,13 @@ ifneq ($(wildcard alsa-monitor.h),)
   ALSA_SRC+=alsa-monitor.h
 endif
 
-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/zaptel.h),)
+ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/pkg/include/zaptel.h),)
+  ifeq (${OSARCH},NetBSD)
+    SOLINK+=-L$(CROSS_COMPILE_TARGET)/usr/pkg/lib
+  endif
+  ifeq (${OSARCH},FreeBSD)
+    SOLINK+=-L$(CROSS_COMPILE_TARGET)/usr/local/lib
+  endif
   CFLAGS+=-DIAX_TRUNKING
   CHANNEL_LIBS+=chan_zap.so
 endif
index 44b3fe1..d403bfb 100755 (executable)
 
 #include <stdio.h>
 #include <string.h>
+#ifdef __NetBSD__
+#include <pthread.h>
+#include <signal.h>
+#else
 #include <sys/signal.h>
+#endif
 #include <errno.h>
 #include <stdlib.h>
 #if !defined(SOLARIS) && !defined(__FreeBSD__)
index 5ab7f70..1a83098 100755 (executable)
@@ -20,7 +20,7 @@
 #include <unistd.h>
 #include <sys/types.h>
 #include <sys/socket.h>
-#if defined(__FreeBSD__) || defined(__OpenBSD__)
+#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
 #include <netinet/in.h>
 #endif
 #include <sys/time.h>