aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xMakefile1
-rwxr-xr-xapps/Makefile1
-rwxr-xr-xapps/app_flash.c4
-rwxr-xr-xapps/app_intercom.c5
-rwxr-xr-xapps/app_meetme.c6
-rwxr-xr-xapps/app_rpt.c5
-rwxr-xr-xapps/app_zapbarge.c7
-rwxr-xr-xapps/app_zapras.c4
-rwxr-xr-xapps/app_zapscan.c7
-rwxr-xr-xastman/Makefile9
-rwxr-xr-xchannel.c4
-rwxr-xr-xchannels/Makefile4
-rwxr-xr-xchannels/chan_iax2.c4
-rwxr-xr-xchannels/chan_zap.c4
-rwxr-xr-xres/Makefile1
-rwxr-xr-xres/res_musiconhold.c4
16 files changed, 63 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index c2bad988a..0101ebc49 100755
--- a/Makefile
+++ b/Makefile
@@ -127,6 +127,7 @@ endif
#CFLAGS+=-DOLD_DSP_ROUTINES
CFLAGS+=$(shell if [ -f /usr/include/linux/zaptel.h ]; then echo "-DZAPTEL_OPTIMIZATIONS"; fi)
+CFLAGS+=$(shell if [ -f /usr/local/include/zaptel.h ]; then echo "-DZAPTEL_OPTIMIZATIONS"; fi)
LIBEDIT=editline/libedit.a
diff --git a/apps/Makefile b/apps/Makefile
index a51f5a036..5ff4a69cc 100755
--- a/apps/Makefile
+++ b/apps/Makefile
@@ -38,6 +38,7 @@ endif
#APPS+=app_rpt.so
APPS+=$(shell if [ -f /usr/include/linux/zaptel.h ]; then echo "app_zapras.so app_meetme.so app_flash.so app_zapbarge.so app_zapscan.so" ; fi)
+APPS+=$(shell if [ -f /usr/local/include/zaptel.h ]; then echo "app_zapras.so app_meetme.so app_flash.so app_zapbarge.so app_zapscan.so" ; fi)
CFLAGS+=-fPIC
diff --git a/apps/app_flash.c b/apps/app_flash.c
index 902b7506c..45d1e25cf 100755
--- a/apps/app_flash.c
+++ b/apps/app_flash.c
@@ -21,7 +21,11 @@
#include <asterisk/image.h>
#include <asterisk/options.h>
#include <sys/ioctl.h>
+#ifdef __linux__
#include <linux/zaptel.h>
+#else
+#include <zaptel.h>
+#endif /* __linux__ */
#include <string.h>
#include <errno.h>
#include <stdlib.h>
diff --git a/apps/app_intercom.c b/apps/app_intercom.c
index 1652aaa0b..a4d863697 100755
--- a/apps/app_intercom.c
+++ b/apps/app_intercom.c
@@ -26,14 +26,15 @@
#include <stdlib.h>
#include <pthread.h>
#include <sys/time.h>
-#ifdef __linux__
+#include <netinet/in.h>
+
+#if defined(__linux__)
#include <linux/soundcard.h>
#elif defined(__FreeBSD__)
#include <sys/soundcard.h>
#else
#include <soundcard.h>
#endif
-#include <netinet/in.h>
#ifdef __OpenBSD__
#define DEV_DSP "/dev/audio"
diff --git a/apps/app_meetme.c b/apps/app_meetme.c
index 98b423734..591ea5af8 100755
--- a/apps/app_meetme.c
+++ b/apps/app_meetme.c
@@ -31,9 +31,13 @@
#include <errno.h>
#include <stdlib.h>
#include <sys/ioctl.h>
-
#include <pthread.h>
+
+#ifdef __linux__
#include <linux/zaptel.h>
+#else
+#include <zaptel.h>
+#endif /* __linux__ */
static char *tdesc = "MeetMe conference bridge";
diff --git a/apps/app_rpt.c b/apps/app_rpt.c
index 9325d39ba..e6973725c 100755
--- a/apps/app_rpt.c
+++ b/apps/app_rpt.c
@@ -61,7 +61,12 @@ enum {REM_OFF,REM_MONITOR,REM_TX};
#include <sys/ioctl.h>
#include <math.h>
#include <tonezone.h>
+
+#ifdef __linux__
#include <linux/zaptel.h>
+#else
+#include <zaptel.h>
+#endif /* __linux__ */
static char *tdesc = "Radio Repeater / Remote Base version 0.2 05/30/2004";
static int debug = 0;
diff --git a/apps/app_zapbarge.c b/apps/app_zapbarge.c
index 1dd9dd3bc..6d455ce4a 100755
--- a/apps/app_zapbarge.c
+++ b/apps/app_zapbarge.c
@@ -32,9 +32,14 @@
#include <string.h>
#include <stdlib.h>
#include <sys/ioctl.h>
-
#include <pthread.h>
+
+#ifdef __linux__
#include <linux/zaptel.h>
+#else
+#include <zaptel.h>
+#endif /* __linux__ */
+
static char *tdesc = "Barge in on Zap channel application";
static char *app = "ZapBarge";
diff --git a/apps/app_zapras.c b/apps/app_zapras.c
index 9d88a06e3..b1cc5fbe0 100755
--- a/apps/app_zapras.c
+++ b/apps/app_zapras.c
@@ -33,7 +33,11 @@
#include <pthread.h>
/* Need some zaptel help here */
+#ifdef __linux__
#include <linux/zaptel.h>
+#else
+#include <zaptel.h>
+#endif /* __linux__ */
static char *tdesc = "Zap RAS Application";
diff --git a/apps/app_zapscan.c b/apps/app_zapscan.c
index 58a456f38..f449c7f36 100755
--- a/apps/app_zapscan.c
+++ b/apps/app_zapscan.c
@@ -33,9 +33,14 @@
#include <string.h>
#include <stdlib.h>
#include <sys/ioctl.h>
-
#include <pthread.h>
+
+#ifdef __linux__
#include <linux/zaptel.h>
+#else
+#include <zaptel.h>
+#endif /* __linux__ */
+
static char *tdesc = "Scan Zap channels application";
static char *app = "ZapScan";
diff --git a/astman/Makefile b/astman/Makefile
index 476c4915c..06bed92fa 100755
--- a/astman/Makefile
+++ b/astman/Makefile
@@ -2,7 +2,14 @@
# Don't use ast mm routines
#
CFLAGS+=-DNO_AST_MM
+
+OSARCH=$(shell uname -s)
+ifeq (${OSARCH},FreeBSD)
+CFLAGS+=-I/usr/local/include -L/usr/local/lib
+endif
+
TARGET=$(shell if [ -f /usr/include/newt.h ]; then echo "astman"; else echo "none" ; fi)
+TARGET=$(shell if [ -f /usr/local/include/newt.h ]; then echo "astman"; else echo "none" ; fi)
all: depend $(TARGET)
install:
@@ -19,7 +26,7 @@ clean:
rm -f *.o astman .depend
astman: astman.o ../md5.o
- $(CC) -o astman astman.o ../md5.o -lnewt
+ $(CC) $(CFLAGS) -o astman astman.o ../md5.o -lnewt
ifneq ($(wildcard .depend),)
include .depend
diff --git a/channel.c b/channel.c
index f31c01229..b3ba99743 100755
--- a/channel.c
+++ b/channel.c
@@ -40,7 +40,11 @@
#include <asterisk/utils.h>
#ifdef ZAPTEL_OPTIMIZATIONS
#include <sys/ioctl.h>
+#ifdef __linux__
#include <linux/zaptel.h>
+#else
+#include <zaptel.h>
+#endif /* __linux__ */
#ifndef ZT_TIMERPING
#error "You need newer zaptel! Please cvs update zaptel"
#endif
diff --git a/channels/Makefile b/channels/Makefile
index fd0b796e5..c1ce59939 100755
--- a/channels/Makefile
+++ b/channels/Makefile
@@ -55,6 +55,7 @@ CHANNEL_LIBS+=chan_oss.so
endif
CHANNEL_LIBS+=$(shell [ -f /usr/include/linux/ixjuser.h ] && echo chan_phone.so)
+CHANNEL_LIBS+=$(shell [ -f /usr/local/include/ixjuser.h ] && echo chan_phone.so)
CHANNEL_LIBS+=$(shell [ -f h323/libchanh323.a ] && echo chan_h323.so)
CFLAGS+=-Wno-missing-prototypes -Wno-missing-declarations
@@ -66,7 +67,7 @@ CFLAGS+=$(shell [ -f alsa-monitor.h ] && echo " -DALSA_MONITOR")
ZAPPRI=$(shell [ -f /usr/lib/libpri.so.1 ] && echo "-lpri")
ZAPR2=$(shell [ -f /usr/lib/libmfcr2.so.1 ] && echo "-lmfcr2")
CFLAGS+=$(shell [ -f /usr/include/linux/zaptel.h ] && echo "-DIAX_TRUNKING")
-# xxx CFLAGS+=$(shell [ -f /usr/local/include/zaptel.h ] && echo "-DIAX_TRUNKING")
+CFLAGS+=$(shell [ -f /usr/local/include/zaptel.h ] && echo "-DIAX_TRUNKING")
CHANNEL_LIBS+=$(shell [ -f /usr/include/vpbapi.h ] && echo "chan_vpb.so" )
CFLAGS+=$(shell [ -f /usr/include/vpbapi.h ] && echo " -DLINUX")
@@ -89,6 +90,7 @@ CFLAGS+=#-DVOFRDUMPER
ZAPDIR=/usr/lib
CHANNEL_LIBS+=$(shell [ -f /usr/include/linux/zaptel.h ] && echo "chan_zap.so")
+CHANNEL_LIBS+=$(shell [ -f /usr/local/include/zaptel.h ] && echo "chan_zap.so")
CHANNEL_LIBS+=$(shell [ -f /usr/include/nbs.h ] && echo "chan_nbs.so" )
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index b0c1aa2d6..fa8e3df4c 100755
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -57,7 +57,11 @@
#include <sys/stat.h>
#ifdef IAX_TRUNKING
#include <sys/ioctl.h>
+#ifdef __linux__
#include <linux/zaptel.h>
+#else
+#include <zaptel.h>
+#endif /* __linux__ */
#endif
#ifdef MYSQL_FRIENDS
#include <mysql/mysql.h>
diff --git a/channels/chan_zap.c b/channels/chan_zap.c
index 905b21eab..431cd0b92 100755
--- a/channels/chan_zap.c
+++ b/channels/chan_zap.c
@@ -46,7 +46,11 @@
#include <stdint.h>
#include <unistd.h>
#include <sys/ioctl.h>
+#ifdef __linux__
#include <linux/zaptel.h>
+#else
+#include <zaptel.h>
+#endif /* __linux__ */
#include <math.h>
#include <tonezone.h>
#include <ctype.h>
diff --git a/res/Makefile b/res/Makefile
index 242a06163..32e42a2e2 100755
--- a/res/Makefile
+++ b/res/Makefile
@@ -17,6 +17,7 @@ CRYPTO_LIBS=-lssl -lcrypto
CFLAGS+=
CFLAGS+=$(shell [ -f /usr/include/linux/zaptel.h ] && echo " -DZAPATA_MOH")
+CFLAGS+=$(shell [ -f /usr/local/include/zaptel.h ] && echo " -DZAPATA_MOH")
#
# Work around buggy RedHat 9.0
#
diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c
index 06798c274..d6bc6c760 100755
--- a/res/res_musiconhold.c
+++ b/res/res_musiconhold.c
@@ -37,7 +37,11 @@
#include <sys/stat.h>
#include <dirent.h>
#ifdef ZAPATA_MOH
+#ifdef __linux__
#include <linux/zaptel.h>
+#else
+#include <zaptel.h>
+#endif /* __linux__ */
#endif
#include <unistd.h>
#include <sys/ioctl.h>