]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
autoconf for openzap
authorMichael Jerris <mike@jerris.com>
Sun, 17 Feb 2008 21:52:17 +0000 (21:52 +0000)
committerMichael Jerris <mike@jerris.com>
Sun, 17 Feb 2008 21:52:17 +0000 (21:52 +0000)
git-svn-id: http://svn.openzap.org/svn/openzap/trunk@397 a93c3328-9c30-0410-af19-c9cd2b2d52af

libs/openzap/Makefile
libs/openzap/Makefile.in [new file with mode: 0644]
libs/openzap/configure.ac [new file with mode: 0644]
libs/openzap/general.makefile
libs/openzap/src/include/wanpipe_tdm_api_iface.h
libs/openzap/src/include/zap_zt.h
libs/openzap/src/zap_wanpipe.c

index 848e5fe2e9717bc2f980b31322b67f0bfddf2b56..592ce77a2eedf96949346feae1ca95ba7983bf8a 100644 (file)
 # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
+SRC=src
+SOURCES=\
+$(SRC)/hashtable.c \
+$(SRC)/hashtable_itr.c \
+$(SRC)/zap_io.c \
+$(SRC)/zap_isdn.c \
+$(SRC)/zap_analog.c \
+$(SRC)/zap_config.c \
+$(SRC)/zap_callerid.c \
+$(SRC)/fsk.c \
+$(SRC)/uart.c \
+$(SRC)/g711.c \
+$(SRC)/libteletone_detect.c \
+$(SRC)/libteletone_generate.c \
+$(SRC)/zap_buffer.c \
+$(SRC)/zap_threadmutex.c \
+$(SRC)/isdn/EuroISDNStateNT.c \
+$(SRC)/isdn/EuroISDNStateTE.c \
+$(SRC)/isdn/mfifo.c \
+$(SRC)/isdn/Q921.c \
+$(SRC)/isdn/Q931api.c \
+$(SRC)/isdn/Q931.c \
+$(SRC)/isdn/Q931ie.c \
+$(SRC)/isdn/Q931mes.c \
+$(SRC)/isdn/Q931StateNT.c \
+$(SRC)/isdn/Q931StateTE.c \
+$(SRC)/isdn/nationalmes.c \
+$(SRC)/isdn/nationalStateNT.c \
+$(SRC)/isdn/nationalStateTE.c \
+$(SRC)/isdn/DMSmes.c \
+$(SRC)/isdn/DMSStateNT.c \
+$(SRC)/isdn/DMSStateTE.c \
+$(SRC)/isdn/5ESSmes.c \
+$(SRC)/isdn/5ESSStateNT.c \
+$(SRC)/isdn/5ESSStateTE.c \
+$(SRC)/isdn/Q932mes.c \
+$(SRC)/zap_zt.c \
+$(SRC)/zap_wanpipe.c
+
+OBJS=\
+$(SRC)/hashtable.o \
+$(SRC)/hashtable_itr.o \
+$(SRC)/zap_io.o \
+$(SRC)/zap_isdn.o \
+$(SRC)/zap_analog.o \
+$(SRC)/zap_config.o \
+$(SRC)/zap_callerid.o \
+$(SRC)/fsk.o \
+$(SRC)/uart.o \
+$(SRC)/g711.o \
+$(SRC)/libteletone_detect.o \
+$(SRC)/libteletone_generate.o \
+$(SRC)/zap_buffer.o \
+$(SRC)/zap_threadmutex.o \
+$(SRC)/isdn/EuroISDNStateNT.o \
+$(SRC)/isdn/EuroISDNStateTE.o \
+$(SRC)/isdn/mfifo.o \
+$(SRC)/isdn/Q921.o \
+$(SRC)/isdn/Q931api.o \
+$(SRC)/isdn/Q931.o \
+$(SRC)/isdn/Q931ie.o \
+$(SRC)/isdn/Q931mes.o \
+$(SRC)/isdn/Q931StateNT.o \
+$(SRC)/isdn/Q931StateTE.o \
+$(SRC)/isdn/nationalmes.o \
+$(SRC)/isdn/nationalStateNT.o \
+$(SRC)/isdn/nationalStateTE.o \
+$(SRC)/isdn/DMSmes.o \
+$(SRC)/isdn/DMSStateNT.o \
+$(SRC)/isdn/DMSStateTE.o \
+$(SRC)/isdn/5ESSmes.o \
+$(SRC)/isdn/5ESSStateNT.o \
+$(SRC)/isdn/5ESSStateTE.o \
+$(SRC)/isdn/Q932mes.o \
+$(SRC)/zap_zt.o \
+$(SRC)/zap_wanpipe.o
+
+#SRCS=$(shell echo $(OBJS) | sed "s/\.o/\.c/g")
+
+HEADERS= $(SRC)/include/fsk.h \
+$(SRC)/include/g711.h \
+$(SRC)/include/hashtable.h \
+$(SRC)/include/hashtable_itr.h \
+$(SRC)/include/hashtable_private.h \
+$(SRC)/include/libteletone_detect.h \
+$(SRC)/include/libteletone_generate.h \
+$(SRC)/include/libteletone.h \
+$(SRC)/include/openzap.h \
+$(SRC)/include/sangoma_tdm_api.h \
+$(SRC)/include/uart.h \
+$(SRC)/include/wanpipe_tdm_api_iface.h \
+$(SRC)/include/zap_analog.h \
+$(SRC)/include/zap_buffer.h \
+$(SRC)/include/zap_config.h \
+$(SRC)/include/zap_isdn.h \
+$(SRC)/include/zap_skel.h \
+$(SRC)/include/zap_threadmutex.h \
+$(SRC)/include/zap_types.h \
+$(SRC)/include/zap_wanpipe.h \
+$(SRC)/include/zap_zt.h \
+$(SRC)/isdn/include/mfifo.h \
+$(SRC)/isdn/include/national.h \
+$(SRC)/isdn/include/DMS.h \
+$(SRC)/isdn/include/5ESS.h \
+$(SRC)/isdn/include/Q921.h \
+$(SRC)/isdn/include/Q931.h \
+$(SRC)/isdn/include/Q931ie.h \
+$(SRC)/isdn/include/Q932.h 
+
+
+PWD=$(shell pwd)
+INCS=-I$(PWD)/$(SRC)/include -I$(PWD)/$(SRC)/isdn/include
+CFLAGS= $(INCS) $(ZAP_CFLAGS)
+MYLIB=libopenzap.a
+LIBPRIA=libpri.a
+LIBPRI=./libpri
+TMP=-I$(LIBPRI) -I$(SRC)/include -I./src -w
+
+PIKA_DIR=$(shell ls -d /usr/include/pika 2>/dev/null)
+PIKA_LIB=$(shell ls /usr/lib/libpikahmpapi.so 2>/dev/null)
+
+ifneq ($(PIKA_DIR),)
+ifneq ($(PIKA_LIB),)
+OBJS += $(SRC)/zap_pika.o
+CFLAGS += -DZAP_PIKA_SUPPORT -I$(PIKA_DIR)
+ADD_OBJS = $(PIKA_LIB)
+endif
+endif
+
+include general.makefile
+
+all: $(MYLIB)
+
+$(MYLIB): $(OBJS) $(HEADERS) $(SOURCES)
+       ar rcs $(MYLIB) $(OBJS) $(ADD_OBJS)
+       ranlib $(MYLIB)
+
+testapp: $(SRC)/testapp.c $(MYLIB)
+       $(CC) $(INCS) -L. $(SRC)/testapp.c -o testapp -lopenzap -lm -lpthread
+
+testcid: $(SRC)/testcid.c $(MYLIB)
+       $(CC) $(INCS) -L. -g -ggdb $(SRC)/testcid.c -o testcid -lopenzap -lm -lpthread
+
+testtones: $(SRC)/testtones.c $(MYLIB)
+       $(CC) $(INCS) -L. $(SRC)/testtones.c -o testtones -lopenzap -lm
+
+detect_tones: $(SRC)/detect_tones.c $(MYLIB)
+       $(CC) $(INCS) -L. $(SRC)/detect_tones.c -o detect_tones -lopenzap -lm
+
+detect_dtmf: $(SRC)/detect_dtmf.c $(MYLIB)
+       $(CC) $(INCS) -L. $(SRC)/detect_dtmf.c -o detect_dtmf -lopenzap -lm
+
+testisdn: $(SRC)/testisdn.c $(MYLIB)
+       $(CC) $(INCS) $(ZAP_CFLAGS) -L. $(SRC)/testisdn.c -o testisdn -lopenzap -lm -lpthread
+
+testanalog: $(SRC)/testanalog.c $(MYLIB)
+       $(CC) $(INCS) -L. $(SRC)/testanalog.c -o testanalog -lopenzap -lm -lpthread 
+
+$(SRC)/priserver.o: $(SRC)/priserver.c
+       $(CC) $(INCS) $(TMP) -c $(SRC)/priserver.c -o $(SRC)/priserver.o 
+
+$(SRC)/sangoma_pri.o: $(SRC)/sangoma_pri.c
+       $(CC) $(INCS) $(TMP) -c $(SRC)/sangoma_pri.c -o $(SRC)/sangoma_pri.o
+
+$(LIBPRI)/$(LIBPRIA):
+       cd libpri && make
+
+priserver: $(MYLIB) $(SRC)/priserver.o $(SRC)/sangoma_pri.o $(LIBPRI)/$(LIBPRIA)
+       $(CC) $(SRC)/sangoma_pri.o $(SRC)/priserver.o -L. -o priserver -lopenzap -lm -lpthread $(LIBPRI)/$(LIBPRIA)
+
+$(SRC)/zap_io.o: $(SRC)/zap_io.c
+       $(CC) $(MOD_CFLAGS) $(CC_CFLAGS) $(CFLAGS) -c $< -o $@
+
+%.o: %.c $(HEADERS)
+       $(CC) $(CC_CFLAGS) $(CFLAGS) -c $< -o $@
+
+dox:
+       cd docs && doxygen $(PWD)/docs/Doxygen.conf
+
+mod_openzap/mod_openzap.so: $(MYLIB) mod_openzap/mod_openzap.c
+       cd mod_openzap && make
+
+mod_openzap: mod_openzap/mod_openzap.so
+
+mod_openzap-install: mod_openzap
+       cd mod_openzap && make install
+
+mod_openzap-clean:
+       @if [ -f mod_openzap/mod_openzap.so ] ; then cd mod_openzap && make clean ; fi
+
+clean: mod_openzap-clean
+       rm -f $(SRC)/*.o $(SRC)/isdn/*.o $(MYLIB) *~ \#* testapp testcid testtones detect_tones detect_dtmf priserver testisdn testanalog
+       @if [ -f $(LIBPRI)/$(LIBPRIA) ] ; then cd $(LIBPRI) && make clean ; fi
+
+
+# Copyright (c) 2007, Anthony Minessale II
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 
+# * Neither the name of the original author; nor the names of any contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+# 
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER
+# OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
 SRC=src
 SOURCES=\
 $(SRC)/hashtable.c \
diff --git a/libs/openzap/Makefile.in b/libs/openzap/Makefile.in
new file mode 100644 (file)
index 0000000..3a057d2
--- /dev/null
@@ -0,0 +1,222 @@
+# Copyright (c) 2007, Anthony Minessale II
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 
+# * Neither the name of the original author; nor the names of any contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+# 
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER
+# OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+CFLAGS=@COMP_VENDOR_CFLAGS@
+SRC=src
+SOURCES=\
+$(SRC)/hashtable.c \
+$(SRC)/hashtable_itr.c \
+$(SRC)/zap_io.c \
+$(SRC)/zap_isdn.c \
+$(SRC)/zap_analog.c \
+$(SRC)/zap_config.c \
+$(SRC)/zap_callerid.c \
+$(SRC)/fsk.c \
+$(SRC)/uart.c \
+$(SRC)/g711.c \
+$(SRC)/libteletone_detect.c \
+$(SRC)/libteletone_generate.c \
+$(SRC)/zap_buffer.c \
+$(SRC)/zap_threadmutex.c \
+$(SRC)/isdn/EuroISDNStateNT.c \
+$(SRC)/isdn/EuroISDNStateTE.c \
+$(SRC)/isdn/mfifo.c \
+$(SRC)/isdn/Q921.c \
+$(SRC)/isdn/Q931api.c \
+$(SRC)/isdn/Q931.c \
+$(SRC)/isdn/Q931ie.c \
+$(SRC)/isdn/Q931mes.c \
+$(SRC)/isdn/Q931StateNT.c \
+$(SRC)/isdn/Q931StateTE.c \
+$(SRC)/isdn/nationalmes.c \
+$(SRC)/isdn/nationalStateNT.c \
+$(SRC)/isdn/nationalStateTE.c \
+$(SRC)/isdn/DMSmes.c \
+$(SRC)/isdn/DMSStateNT.c \
+$(SRC)/isdn/DMSStateTE.c \
+$(SRC)/isdn/5ESSmes.c \
+$(SRC)/isdn/5ESSStateNT.c \
+$(SRC)/isdn/5ESSStateTE.c \
+$(SRC)/isdn/Q932mes.c \
+$(SRC)/zap_zt.c \
+$(SRC)/zap_wanpipe.c
+
+OBJS=\
+$(SRC)/hashtable.o \
+$(SRC)/hashtable_itr.o \
+$(SRC)/zap_io.o \
+$(SRC)/zap_isdn.o \
+$(SRC)/zap_analog.o \
+$(SRC)/zap_config.o \
+$(SRC)/zap_callerid.o \
+$(SRC)/fsk.o \
+$(SRC)/uart.o \
+$(SRC)/g711.o \
+$(SRC)/libteletone_detect.o \
+$(SRC)/libteletone_generate.o \
+$(SRC)/zap_buffer.o \
+$(SRC)/zap_threadmutex.o \
+$(SRC)/isdn/EuroISDNStateNT.o \
+$(SRC)/isdn/EuroISDNStateTE.o \
+$(SRC)/isdn/mfifo.o \
+$(SRC)/isdn/Q921.o \
+$(SRC)/isdn/Q931api.o \
+$(SRC)/isdn/Q931.o \
+$(SRC)/isdn/Q931ie.o \
+$(SRC)/isdn/Q931mes.o \
+$(SRC)/isdn/Q931StateNT.o \
+$(SRC)/isdn/Q931StateTE.o \
+$(SRC)/isdn/nationalmes.o \
+$(SRC)/isdn/nationalStateNT.o \
+$(SRC)/isdn/nationalStateTE.o \
+$(SRC)/isdn/DMSmes.o \
+$(SRC)/isdn/DMSStateNT.o \
+$(SRC)/isdn/DMSStateTE.o \
+$(SRC)/isdn/5ESSmes.o \
+$(SRC)/isdn/5ESSStateNT.o \
+$(SRC)/isdn/5ESSStateTE.o \
+$(SRC)/isdn/Q932mes.o \
+$(SRC)/zap_zt.o \
+$(SRC)/zap_wanpipe.o
+
+#SRCS=$(shell echo $(OBJS) | sed "s/\.o/\.c/g")
+
+HEADERS= $(SRC)/include/fsk.h \
+$(SRC)/include/g711.h \
+$(SRC)/include/hashtable.h \
+$(SRC)/include/hashtable_itr.h \
+$(SRC)/include/hashtable_private.h \
+$(SRC)/include/libteletone_detect.h \
+$(SRC)/include/libteletone_generate.h \
+$(SRC)/include/libteletone.h \
+$(SRC)/include/openzap.h \
+$(SRC)/include/sangoma_tdm_api.h \
+$(SRC)/include/uart.h \
+$(SRC)/include/wanpipe_tdm_api_iface.h \
+$(SRC)/include/zap_analog.h \
+$(SRC)/include/zap_buffer.h \
+$(SRC)/include/zap_config.h \
+$(SRC)/include/zap_isdn.h \
+$(SRC)/include/zap_skel.h \
+$(SRC)/include/zap_threadmutex.h \
+$(SRC)/include/zap_types.h \
+$(SRC)/include/zap_wanpipe.h \
+$(SRC)/include/zap_zt.h \
+$(SRC)/isdn/include/mfifo.h \
+$(SRC)/isdn/include/national.h \
+$(SRC)/isdn/include/DMS.h \
+$(SRC)/isdn/include/5ESS.h \
+$(SRC)/isdn/include/Q921.h \
+$(SRC)/isdn/include/Q931.h \
+$(SRC)/isdn/include/Q931ie.h \
+$(SRC)/isdn/include/Q932.h 
+
+PWD=$(shell pwd)
+INCS=-I$(PWD)/$(SRC)/include -I$(PWD)/$(SRC)/isdn/include
+CFLAGS+= $(INCS) $(ZAP_CFLAGS)
+MYLIB=libopenzap.a
+LIBPRIA=libpri.a
+LIBPRI=./libpri
+TMP=-I$(LIBPRI) -I$(SRC)/include -I./src -w
+
+PIKA_DIR=$(shell ls -d /usr/include/pika 2>/dev/null)
+PIKA_LIB=$(shell ls /usr/lib/libpikahmpapi.so 2>/dev/null)
+
+ifneq ($(PIKA_DIR),)
+ifneq ($(PIKA_LIB),)
+OBJS += $(SRC)/zap_pika.o
+CFLAGS += -DZAP_PIKA_SUPPORT -I$(PIKA_DIR)
+ADD_OBJS = $(PIKA_LIB)
+endif
+endif
+
+all: $(MYLIB)
+
+$(MYLIB): $(OBJS) $(HEADERS) $(SOURCES)
+       ar rcs $(MYLIB) $(OBJS) $(ADD_OBJS)
+       ranlib $(MYLIB)
+
+testapp: $(SRC)/testapp.c $(MYLIB)
+       $(CC) $(INCS) -L. $(SRC)/testapp.c -o testapp -lopenzap -lm -lpthread
+
+testcid: $(SRC)/testcid.c $(MYLIB)
+       $(CC) $(INCS) -L. -g -ggdb $(SRC)/testcid.c -o testcid -lopenzap -lm -lpthread
+
+testtones: $(SRC)/testtones.c $(MYLIB)
+       $(CC) $(INCS) -L. $(SRC)/testtones.c -o testtones -lopenzap -lm
+
+detect_tones: $(SRC)/detect_tones.c $(MYLIB)
+       $(CC) $(INCS) -L. $(SRC)/detect_tones.c -o detect_tones -lopenzap -lm
+
+detect_dtmf: $(SRC)/detect_dtmf.c $(MYLIB)
+       $(CC) $(INCS) -L. $(SRC)/detect_dtmf.c -o detect_dtmf -lopenzap -lm
+
+testisdn: $(SRC)/testisdn.c $(MYLIB)
+       $(CC) $(INCS) $(ZAP_CFLAGS) -L. $(SRC)/testisdn.c -o testisdn -lopenzap -lm -lpthread
+
+testanalog: $(SRC)/testanalog.c $(MYLIB)
+       $(CC) $(INCS) -L. $(SRC)/testanalog.c -o testanalog -lopenzap -lm -lpthread 
+
+$(SRC)/priserver.o: $(SRC)/priserver.c
+       $(CC) $(INCS) $(TMP) -c $(SRC)/priserver.c -o $(SRC)/priserver.o 
+
+$(SRC)/sangoma_pri.o: $(SRC)/sangoma_pri.c
+       $(CC) $(INCS) $(TMP) -c $(SRC)/sangoma_pri.c -o $(SRC)/sangoma_pri.o
+
+$(LIBPRI)/$(LIBPRIA):
+       cd libpri && make
+
+priserver: $(MYLIB) $(SRC)/priserver.o $(SRC)/sangoma_pri.o $(LIBPRI)/$(LIBPRIA)
+       $(CC) $(SRC)/sangoma_pri.o $(SRC)/priserver.o -L. -o priserver -lopenzap -lm -lpthread $(LIBPRI)/$(LIBPRIA)
+
+$(SRC)/zap_io.o: $(SRC)/zap_io.c
+       $(CC) $(MOD_CFLAGS) $(CC_CFLAGS) $(CFLAGS) -c $< -o $@
+
+%.o: %.c $(HEADERS)
+       $(CC) $(CC_CFLAGS) $(CFLAGS) -c $< -o $@
+
+dox:
+       cd docs && doxygen $(PWD)/docs/Doxygen.conf
+
+mod_openzap/mod_openzap.so: $(MYLIB) mod_openzap/mod_openzap.c
+       cd mod_openzap && make
+
+mod_openzap: mod_openzap/mod_openzap.so
+
+mod_openzap-install: mod_openzap
+       cd mod_openzap && make install
+
+mod_openzap-clean:
+       @if [ -f mod_openzap/mod_openzap.so ] ; then cd mod_openzap && make clean ; fi
+
+clean: mod_openzap-clean
+       rm -f $(SRC)/*.o $(SRC)/isdn/*.o $(MYLIB) *~ \#* testapp testcid testtones detect_tones detect_dtmf priserver testisdn testanalog
+       @if [ -f $(LIBPRI)/$(LIBPRIA) ] ; then cd $(LIBPRI) && make clean ; fi
diff --git a/libs/openzap/configure.ac b/libs/openzap/configure.ac
new file mode 100644 (file)
index 0000000..fc33954
--- /dev/null
@@ -0,0 +1,51 @@
+#                                               -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+
+AC_PREREQ(2.61)
+AC_INIT([openzap],[pre-alpha],[bugs@freeswitch.prg])
+AC_CONFIG_SRCDIR([src/libteletone_detect.c])
+
+# Checks for programs.
+AC_PROG_CC
+AC_PROG_MAKE_SET
+AC_PROG_RANLIB
+
+# Check for com;iler type
+AC_DEFUN([AX_COMPILER_VENDOR],
+[
+AC_CACHE_CHECK([for _AC_LANG compiler vendor], ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor,
+ [ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor=unknown
+  # note: don't check for GCC first, since some other compilers define __GNUC__
+  for ventest in intel:__ICC,__ECC,__INTEL_COMPILER ibm:__xlc__,__xlC__,__IBMC__,__IBMCPP__ gnu:__GNUC__ sun:__SUNPRO_C,__SUNPRO_CC hp:__HP_cc,__HP_aCC dec:__DECC,__DECCXX,__DECC_VER,__DECCXX_VER borland:__BORLANDC__,__TURBOC__ comeau:__COMO__ cray:_CRAYC kai:__KCC lcc:__LCC__ metrowerks:__MWERKS__ sgi:__sgi,sgi microsoft:_MSC_VER watcom:__WATCOMC__ portland:__PGI; do
+       vencpp="defined("`echo $ventest | cut -d: -f2 | sed 's/,/) || defined(/g'`")"
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[
+#if !($vencpp)
+      thisisanerror;
+#endif
+])], [ax_cv_]_AC_LANG_ABBREV[_compiler_vendor=`echo $ventest | cut -d: -f1`; break])
+  done
+ ])
+])
+AC_ARG_ENABLE(enable_64,  [  --enable-64 Enable 64bit compilation])
+
+AX_COMPILER_VENDOR
+
+case "${ax_cv_c_compiler_vendor}" in
+gnu)
+    COMP_VENDOR_CFLAGS="-std=gnu99 -ffast-math -Wall -Wunused-variable -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes"
+    ;;
+sun)
+    COMP_VENDOR_CFLAGS="-xc99=all -mt -xCC -D__FUNCTION__=__func__ -xvpara"
+    if test "$enable_64" = "yes" ; then
+        COMP_VENDOR_CFLAGS="-m64 $COMP_VENDOR_CFLAGS"
+    fi
+    ;;
+*)
+    COMP_VENDOR_CFLAGS="-std=c99 -Wall -Wunused-variable -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes"
+    ;;
+esac
+
+COMP_VENDOR_CFLAGS="$COMP_VENDOR_CFLAGS"
+AC_SUBST(COMP_VENDOR_CFLAGS)
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
index 9a060c86c721a98974e5f8d6d15624221a4c4b73..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,3 +0,0 @@
-CC=gcc 
-CC_CFLAGS += -Wall -Werror -Wextra -Wno-unused-parameter #-std=c99 -pedantic -Wno-unused-parameter
-
index f7406841f58ad28f968625a19343629455382441..409469c58f9d80b16deb70cf817a861536bbb086 100644 (file)
@@ -156,39 +156,38 @@ enum wanpipe_tdm_api_events {
 #define        WP_TDMAPI_EVENT_TONE_RING       0x03
 #define        WP_TDMAPI_EVENT_TONE_CONGESTION 0x04
 
-
 typedef struct {
 
-       u_int8_t        type;
-       u_int8_t        mode;
-       u_int32_t       time_stamp;
-       u_int16_t       channel;
-       u_int32_t       chan_map;
+       uint8_t type;
+       uint8_t mode;
+       uint32_t        time_stamp;
+       uint16_t        channel;
+       uint32_t        chan_map;
        union {
                struct {
-                       u_int8_t        alarm;
+                       uint8_t alarm;
                } te1_alarm;
                struct {
-                       u_int8_t        rbs_bits;
+                       uint8_t rbs_bits;
                } te1_rbs;
                struct {
-                       u_int8_t        state;
-                       u_int8_t        sig;
+                       uint8_t state;
+                       uint8_t sig;
                } rm_hook;
                struct {
-                       u_int8_t        state;
+                       uint8_t state;
                } rm_ring;
                struct {
-                       u_int8_t        type;
+                       uint8_t type;
                } rm_tone;
                struct {
-                       u_int8_t        digit;  /* DTMF: digit  */
-                       u_int8_t        port;   /* DTMF: SOUT/ROUT */
-                       u_int8_t        type;   /* DTMF: PRESET/STOP */
+                       uint8_t digit;  /* DTMF: digit  */
+                       uint8_t port;   /* DTMF: SOUT/ROUT */
+                       uint8_t type;   /* DTMF: PRESET/STOP */
                } dtmf;
                struct {
-                       u_int16_t       polarity;
-                       u_int16_t       ohttimer;
+                       uint16_t        polarity;
+                       uint16_t        ohttimer;
                } rm_common;
        } wp_tdm_api_event_u;
 #define wp_tdm_api_event_type          type
index 46aab35eb6d3e7d68183e4e87bc49a6f9e90100d..0e16d2939897089430050dc358fb08152d818bf6 100644 (file)
 #include <sys/ioctl.h>
 #include <poll.h>
 
+#ifdef __sun
+#include <unistd.h>
+#include <sys/ioccom.h>
+#include <stropts.h>
+#endif
+
 /* Hardware interface structures and defines */
 /* Based on documentation of the structures required for the hardware interface */
 /* from http://wiki.freeswitch.org/wiki/Zapata_zaptel_interface */
index 4537e547ff64d93f6d464e00b8e3c1273bc188bf..6dd4d5db08ce601b2dfa3897593be63379f28a50 100644 (file)
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#ifdef __sun
+#include <unistd.h>
+#include <stropts.h>
+#endif
 #include "openzap.h"
 #include "zap_wanpipe.h"
 #include <poll.h>