From: <jpg...@us...> - 2007-06-14 15:29:28
|
Revision: 1038 http://svn.sourceforge.net/iaxclient/?rev=1038&view=rev Author: jpgrayson Date: 2007-06-14 08:29:29 -0700 (Thu, 14 Jun 2007) Log Message: ----------- Merge branches/team/pete/autobranch 983:1037 into trunk. This brings the autotools build system into the iaxclient trunk. The package and library versions are maintained in configure.ac. The autogen.sh script must be run to generate (amongst other things) the configure script. After that, the standard ./configure && make && make install. Portaudio is no longer in the iaxclient tree. Portmixer demands that you use a relatively recent v19 branch version of portaudio. Gsm support is now optional. The clients need work. Modified Paths: -------------- trunk/README trunk/lib/audio_encode.c trunk/lib/audio_encode.h trunk/lib/audio_portaudio.c trunk/lib/codec_alaw.c trunk/lib/codec_alaw.h trunk/lib/codec_ffmpeg.c trunk/lib/codec_ffmpeg.h trunk/lib/codec_gsm.c trunk/lib/codec_gsm.h trunk/lib/codec_ilbc.c trunk/lib/codec_ilbc.h trunk/lib/codec_speex.c trunk/lib/codec_speex.h trunk/lib/codec_theora.c trunk/lib/codec_theora.h trunk/lib/codec_ulaw.c trunk/lib/codec_ulaw.h trunk/lib/iaxclient.h trunk/lib/iaxclient_lib.c trunk/lib/iaxclient_lib.h trunk/lib/libiax2/src/iax.c trunk/lib/portmixer/px_common/portmixer.h trunk/lib/portmixer/px_mac_core/px_mac_core.c trunk/lib/unixfuncs.c trunk/lib/video.c trunk/lib/videoLib/linux/linuxgrab.c trunk/lib/videoLib/video_grab.c trunk/lib/videoLib/video_grab.h trunk/lib/videoLib/win32/wingrab.cpp trunk/lib/winfuncs.c trunk/simpleclient/iaxcomm/accounts.cc trunk/simpleclient/iaxcomm/devices.cc trunk/simpleclient/iaxcomm/directory.cc trunk/simpleclient/iaxcomm/frame.cc trunk/simpleclient/iaxcomm/main.cc trunk/simpleclient/iaxphone/iaxphone.h trunk/simpleclient/testcall/testcall.c trunk/simpleclient/vtestcall/vtestcall.c Added Paths: ----------- trunk/AUTHORS trunk/ChangeLog trunk/INSTALL trunk/Makefile.am trunk/NEWS trunk/autogen.sh trunk/clean.sh trunk/configure.ac trunk/iaxclient.pc.in trunk/lib/Makefile.am trunk/lib/ringbuffer.c trunk/lib/ringbuffer.h trunk/lib/video.h trunk/lib/videoLib/macosx/macgrab.c trunk/m4/ trunk/m4/acx_pthread.m4 trunk/m4/gsm.m4 trunk/m4/iax.m4 trunk/m4/iax2.m4 trunk/m4/ogg.m4 trunk/m4/portaudio.m4 trunk/m4/speex.m4 trunk/m4/theora.m4 trunk/m4/wxwin.m4 trunk/simpleclient/Makefile.am trunk/simpleclient/WinIAX/Makefile.am trunk/simpleclient/iaxcomm/Makefile.am trunk/simpleclient/iaxphone/Makefile.am trunk/simpleclient/testcall/Makefile.am trunk/simpleclient/tkphone/Makefile.am trunk/simpleclient/vtestcall/Makefile.am trunk/simpleclient/wx/Makefile.am Removed Paths: ------------- trunk/README.1st trunk/lib/Makefile trunk/lib/TODO trunk/lib/portaudio/ trunk/lib/videoLib/macosx/macgrab.cpp trunk/lib/videoLib/win32/BaseClasses/Debug_Unicode/ trunk/m4/acx_pthread.m4 trunk/m4/gsm.m4 trunk/m4/iax.m4 trunk/m4/iax2.m4 trunk/m4/ogg.m4 trunk/m4/portaudio.m4 trunk/m4/speex.m4 trunk/m4/theora.m4 trunk/simpleclient/iaxcomm/Makefile trunk/simpleclient/iaxphone/Makefile trunk/simpleclient/testcall/Makefile trunk/simpleclient/tkphone/Makefile trunk/simpleclient/vtestcall/Makefile trunk/simpleclient/win32/simpleiax.dsw trunk/simpleclient/win32/simpleiax.ncb trunk/simpleclient/win32/simpleiax.opt trunk/simpleclient/win32/simpleiax.plg trunk/simpleclient/wx/Makefile Copied: trunk/AUTHORS (from rev 1035, branches/team/pete/autobranch/AUTHORS) =================================================================== --- trunk/AUTHORS (rev 0) +++ trunk/AUTHORS 2007-06-14 15:29:29 UTC (rev 1038) @@ -0,0 +1,14 @@ +Steve Kann <st...@st...> +Shawn Lawrence <sha...@te...> +Faizan "Tili" Naqvi <fa...@ti...> [Win32 VC++ build/client] +Scott Lambert <la...@la...> [FreeBSD build changes] +Michael Van Donselaar <mv...@va...> [Win32/MinGW build directions, UI changes, IAXComm phone ] +Steven Sokol <ss...@so...> [ Debugging, Blind Transfer ] +Stephan Kauss <St...@ka...> [ 32-bit alignment for IAX2 ] +Stephen Uhler <su...@su...> [Solaris build, tkiaxphone] +Steve Underwood <st...@co...> [PLC implementation from spandsp] +Jean-Denis Girard <jd....@sy...> [URL Receive implementation] +Panfilov Dmitry <di...@bd...> [Basic ALSA-native audio driver] +Mihai Balea <mihai at hates dot ms> +Bill Welch <welch1820 at gmail dot com> [Project files for several MS development environments] +Peter Grayson <jpg...@gm...> Copied: trunk/ChangeLog (from rev 1035, branches/team/pete/autobranch/ChangeLog) =================================================================== --- trunk/ChangeLog (rev 0) +++ trunk/ChangeLog 2007-06-14 15:29:29 UTC (rev 1038) @@ -0,0 +1,2 @@ + + Copied: trunk/INSTALL (from rev 1035, branches/team/pete/autobranch/INSTALL) =================================================================== --- trunk/INSTALL (rev 0) +++ trunk/INSTALL 2007-06-14 15:29:29 UTC (rev 1038) @@ -0,0 +1,229 @@ +Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software +Foundation, Inc. + + This file is free documentation; the Free Software Foundation gives +unlimited permission to copy, distribute and modify it. + +Basic Installation +================== + + These are generic installation instructions. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, and a +file `config.log' containing compiler output (useful mainly for +debugging `configure'). + + It can also use an optional file (typically called `config.cache' +and enabled with `--cache-file=config.cache' or simply `-C') that saves +the results of its tests to speed up reconfiguring. (Caching is +disabled by default to prevent problems with accidental use of stale +cache files.) + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If you are using the cache, and at +some point `config.cache' contains results you don't want to keep, you +may remove or edit it. + + The file `configure.ac' (or `configure.in') is used to create +`configure' by a program called `autoconf'. You only need +`configure.ac' if you want to change it or regenerate `configure' using +a newer version of `autoconf'. + +The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. If you're + using `csh' on an old version of System V, you might need to type + `sh ./configure' instead to prevent `csh' from trying to execute + `configure' itself. + + Running `configure' takes awhile. While running, it prints some + messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package. + + 4. Type `make install' to install the programs and any data files and + documentation. + + 5. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. Run `./configure --help' +for details on some of the pertinent environment variables. + + You can give `configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here +is an example: + + ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix + + *Note Defining Variables::, for more details. + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you must use a version of `make' that +supports the `VPATH' variable, such as GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. + + If you have to use a `make' that does not support the `VPATH' +variable, you have to compile the package for one architecture at a +time in the source code directory. After you have installed the +package for one architecture, use `make distclean' before reconfiguring +for another architecture. + +Installation Names +================== + + By default, `make install' will install the package's files in +`/usr/local/bin', `/usr/local/man', etc. You can specify an +installation prefix other than `/usr/local' by giving `configure' the +option `--prefix=PATH'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +give `configure' the option `--exec-prefix=PATH', the package will use +PATH as the prefix for installing programs and libraries. +Documentation and other data files will still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=PATH' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + +Optional Features +================= + + Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + +Specifying the System Type +========================== + + There may be some features `configure' cannot figure out +automatically, but needs to determine by the type of machine the package +will run on. Usually, assuming the package is built to be run on the +_same_ architectures, `configure' can figure that out, but if it prints +a message saying it cannot guess the machine type, give it the +`--build=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name which has the form: + + CPU-COMPANY-SYSTEM + +where SYSTEM can have one of these forms: + + OS KERNEL-OS + + See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the machine type. + + If you are _building_ compiler tools for cross-compiling, you should +use the `--target=TYPE' option to select the type of system they will +produce code for. + + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the +"host" platform (i.e., that on which the generated programs will +eventually be run) with `--host=TYPE'. + +Sharing Defaults +================ + + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Defining Variables +================== + + Variables not defined in a site shell script can be set in the +environment passed to `configure'. However, some packages may run +configure again during the build, and the customized values of these +variables may be lost. In order to avoid this problem, you should set +them in the `configure' command line, using `VAR=value'. For example: + + ./configure CC=/usr/local2/bin/gcc + +will cause the specified gcc to be used as the C compiler (unless it is +overridden in the site shell script). + +`configure' Invocation +====================== + + `configure' recognizes the following options to control how it +operates. + +`--help' +`-h' + Print a summary of the options to `configure', and exit. + +`--version' +`-V' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`--cache-file=FILE' + Enable the cache: use and save the results of the tests in FILE, + traditionally `config.cache'. FILE defaults to `/dev/null' to + disable caching. + +`--config-cache' +`-C' + Alias for `--cache-file=config.cache'. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`configure' also accepts some other, not widely useful, options. Run +`configure --help' for more details. + Copied: trunk/Makefile.am (from rev 1035, branches/team/pete/autobranch/Makefile.am) =================================================================== --- trunk/Makefile.am (rev 0) +++ trunk/Makefile.am 2007-06-14 15:29:29 UTC (rev 1038) @@ -0,0 +1,8 @@ +ACLOCAL_AMFLAGS = -I m4 + +SUBDIRS = lib simpleclient + +EXTRA_DIST = contrib + +dist-hook: + find $(distdir) -name ".svn" -type d -print0 | xargs -0 rm -rf Copied: trunk/NEWS (from rev 1035, branches/team/pete/autobranch/NEWS) =================================================================== --- trunk/NEWS (rev 0) +++ trunk/NEWS 2007-06-14 15:29:29 UTC (rev 1038) @@ -0,0 +1,2 @@ + + Modified: trunk/README =================================================================== --- trunk/README 2007-06-14 15:16:42 UTC (rev 1037) +++ trunk/README 2007-06-14 15:29:29 UTC (rev 1038) @@ -7,8 +7,8 @@ directory as this README file. The library is designed to build for multiple platforms, and currently -supports Linux, MacOSX, Solaris, and Win32 platforms. It is designed to handle -the "backend" of IAX telephony operations, including call handling, +supports Linux, MacOSX, Solaris, and Win32 platforms. It is designed to +handle the "backend" of IAX telephony operations, including call handling, network protocols, audio encoding/decoding, and audio capture/playback. In it's future, it may be extended to also handle video encode, decode, capture and playback. @@ -19,34 +19,34 @@ there are three of them: simpleclient/testcall: A simple command-line oriented test program, - useful for testing and debugging. It supports - all of the same platforms as the library itself. + useful for testing and debugging. It supports + all of the same platforms as the library itself. -simpleclient/wx: A wxWindows (see wxwindows.org) based GUI - client. This client also supports all of the - same platforms as the library itself. +simpleclient/vtestcall: Like testcall, but for testing and debugging + video calls. Requires SDL. -simpleclient/WinIAX: A MSVC/Win32 client. This only works with - Win32, obviously, and was contributed by - Faizan "Tili" Naqvi <fa...@ti...> +simpleclient/wx: A wxWindows (see wxwindows.org) based GUI + client. This client also supports all of the + same platforms as the library itself. -simpleclient/tkiaxphone A command-line client, with a Tcl/Tk GUI - client that drives it. It should work on - all the platforms +simpleclient/WinIAX: A MSVC/Win32 client. This only works with + Win32, obviously, and was contributed by + Faizan "Tili" Naqvi <fa...@ti...> +simpleclient/tkiaxphone A command-line client, with a Tcl/Tk GUI + client that drives it. It should work on + all the platforms + The home page for iaxclient is "http://iaxclient.sourceforge.net/" Up-to-date versions of iaxclient are available from a sourceforge SVN repository. -CVS tarballs are also available as a link from the home page. - ======================================================================= LICENSES - The iaxclient library itself, is provided under the terms of the LGPL: This library is free software; you can redistribute it and/or @@ -83,8 +83,9 @@ free licenses in source files. libspeex: (c) various authors BSD-like license. + libtheora: (c) 2002-2005 Xiph.org Foundation + BSD-like license. - ======================================================================= CONTRIBUTORS: @@ -103,6 +104,7 @@ Panfilov Dmitry <di...@bd...> [Basic ALSA-native audio driver] Mihai Balea <mihai at hates dot ms> Bill Welch <welch1820 at gmail dot com> [Project files for several MS development environments] +Peter Grayson <jpg...@gm...> In addition to including libiax, IAXCLIENT is also based in part on code @@ -117,49 +119,16 @@ ======================================================================= BUILDING THE LIBRARY: -From the "lib" directory: - Linux: type "make" using standard gnu make/gcc - FreeBSD: type "gmake" using standard gnu make/gcc - MacOSX: type "make" using Apple Dev Tools (gnu make/gcc) - Win32: type "make" using Cygwin or Cygwin and MinGW (see below) - Solaris: type "gmake" using standard gnu make/gcc + ./configure + make + make install -For a shared library, make clean, then make shared. -You should receive a shared library (.dll, .so, .dylib, depending on your platform). +See INSTALL for generic information about the building on Unix-like +systems. -Win32 Cygwin/MinGW; General: -The Win32 build has been tested using the Cygwin Environment, and the -MinGW port of the GCC compiler suite. Previously, we only supported -compilation with the cygwin _and_ mingw environments installed. We are -moving (4/20/2005) to support having the cygwin environment alone, with -cygwin's own mingw packages, instead. Compilation of the basic sample -clients (but not iaxcomm), works fine with cygwin alone. +See README.VisualStudio for information about how to build with +Microsoft Visual Studio. -Cygwin Alone: -To install cygwin, download and run http://www.cygwin.com/setup.exe -You will need to install, in addition to the defaults, these packages: -gcc-mingw, gcc-mingw-core, (and for C++ clients, gcc-mingw-g++). -[please let the maintainers know if other non-default packages are -required]. - -There's lots of goodies available from cygwin. - -Once you have this installed, open the cygwin shell, and build. The -library makefiles use the -mno-cygwin option, to create native Win32 -binaries which do _not_ require cygwin.dll, or any special runtimes. - -Cygwin and MinGW: -Previously, we advocated installing cygwin environment (for Gnu Make and -such), alongside the MinGW distribution itself, as outlined here. This -may still be necessary for the Wx-Windows based clients like iaxcomm. - -http://www.mingw.org/mingwfaq.shtml#faq-usingwithcygwin for the -MinGW FAQ entry on using MinGW with Cygwin. You do need to make sure -that you install the Gnu "make" utility when you install cygwin. - -It should probably also work if you use the MSYS environment and the -MinGW compiler, but this configuration is not as well tested. - ======================================================================= LIBRARY ORGANIZATION/DESIGN/CODING CONVENTION NOTES Deleted: trunk/README.1st =================================================================== --- trunk/README.1st 2007-06-14 15:16:42 UTC (rev 1037) +++ trunk/README.1st 2007-06-14 15:29:29 UTC (rev 1038) @@ -1,37 +0,0 @@ -The README file is outdated. It pertains to audio only version of -iaxclient. Many things have happened since then, and at some point -I will update it. But in the meanwhile, here's what you need to know - -We now have working video. The video frame grabber is based on the -Tipic Video Library (http://sourceforge.net/projects/tipicforge/). -The iax support for video is also based on Tipic's project, but with -extensive modifications in order to make it work well. - -Video codecs: I am testing with Theora and an H.264 implementation -from Vanguard Software Solutions. If you don't have it, you will have -to disable it in the Makefile. Some people have had some luck with -ffmpeg, if you manage to get it to work, let me know and I'll add it -in. If you plan on using Theora, I suggest browsing codec_theora.c, -there are some implementation details there. - -Test apps: they're all in iaxclient/simpleclient. You will need -SDL (http://www.libsdl.org/index.php) in order to build them. -- videotest: Simple app that exercises the frame grabber. It displays - video from your camera in an SDL window and calculates - the frame rate -- vtestcall: Video/Audio call between two end points. - -Building the library: you need libtheora and libogg on your system. -A copy of each is included with this version of iaxclient, but you will -have to build them separately. Also, make sure you disable VSS H.264 -in the Makefiles, unless you actually have the library. Finally, this -build on Mac and Linux, but NOT on windows. - -I welcome any and all patches, suggestions and comments. Please feel -free to comment on the iaxclient development mailing list. This is still -very much in development, so don't expect everything to work out of the -box. - -Enjoy - -Mihai Balea <mihai at hates dot ms> Copied: trunk/autogen.sh (from rev 1035, branches/team/pete/autobranch/autogen.sh) =================================================================== --- trunk/autogen.sh (rev 0) +++ trunk/autogen.sh 2007-06-14 15:29:29 UTC (rev 1038) @@ -0,0 +1,65 @@ +#!/bin/sh -e + +error() +{ + echo "error: $@" + exit 1 +} + +invoke() +{ + echo "$@" + $@ +} + +echo -n "checking for aclocal... " +for ACLOCAL in aclocal nope; do + ($ACLOCAL --version) < /dev/null > /dev/null 2>&1 && break +done +echo $ACLOCAL +if test x$ACLOCAL = xnope; then + error "aclocal must be installed" +fi + +echo -n "checking for autoheader... " +for AUTOHEADER in autoheader nope; do + ($AUTOHEADER --version) < /dev/null > /dev/null 2>&1 && break +done +echo $AUTOHEADER +if test x$AUTOHEADER = xnope; then + error "autoheader must be installed" +fi + +echo -n "checking for autoconf... " +for AUTOCONF in autoconf nope; do + ($AUTOCONF --version) < /dev/null > /dev/null 2>&1 && break +done +echo $AUTOCONF +if test x$AUTOCONF = xnope; then + error "autoconf must be installed" +fi + +echo -n "checking for libtoolize... " +for LIBTOOLIZE in libtoolize glibtoolize nope; do + ($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1 && break +done +echo $LIBTOOLIZE +if test x$LIBTOOLIZE = xnope; then + error "libtoolize must be installed" +fi + +echo -n "checking for automake... " +for AUTOMAKE in automake nope; do + ($AUTOMAKE --version) < /dev/null > /dev/null 2>&1 && break +done +echo $AUTOMAKE +if test x$AUTOMAKE = xnope; then + error "automake must be installed" +fi + +invoke $ACLOCAL -I m4 +invoke $AUTOHEADER +invoke $AUTOCONF --force +invoke $LIBTOOLIZE --automake --copy --force +invoke $AUTOMAKE --add-missing --copy + Copied: trunk/clean.sh (from rev 1035, branches/team/pete/autobranch/clean.sh) =================================================================== --- trunk/clean.sh (rev 0) +++ trunk/clean.sh 2007-06-14 15:29:29 UTC (rev 1038) @@ -0,0 +1,23 @@ +#!/bin/sh + +rm -rf \ + aclocal.m4 \ + autom4te.cache \ + compile \ + config.guess \ + config.h.in \ + config.h.in~ \ + config.sub \ + configure \ + depcomp \ + install-sh \ + ltmain.sh \ + missing + +for d in . lib simpleclient simpleclient/iaxcomm simpleclient/iaxphone \ + simpleclient/testcall simpleclient/tkphone simpleclient/WinIAX \ + simpleclient/wx +do + rm $d/Makefile.in +done + Copied: trunk/configure.ac (from rev 1035, branches/team/pete/autobranch/configure.ac) =================================================================== --- trunk/configure.ac (rev 0) +++ trunk/configure.ac 2007-06-14 15:29:29 UTC (rev 1038) @@ -0,0 +1,377 @@ +dnl Copyright (C) 2004-2005 Mikael Magnusson <mi...@us...> + +AC_PREREQ(2.59) + +dnl Package version +m4_define(IAXC_MAJOR, [2]) +m4_define(IAXC_MINOR, [0]) +m4_define(IAXC_MICRO, [0]) +m4_define(IAXC_EXTRA, [-svn]) + +AC_INIT(iaxclient, IAXC_MAJOR.IAXC_MINOR.IAXC_MICRO[]IAXC_EXTRA, [jpg...@gm...]) + +AC_CONFIG_SRCDIR([lib/iaxclient.h]) +AC_CONFIG_HEADERS([config.h]) +AC_CONFIG_MACRO_DIR([m4]) +AM_INIT_AUTOMAKE([foreign -Wall]) +AM_MAINTAINER_MODE + +dnl Libtool library version +IAXC_LT_CURRENT=1 +IAXC_LT_REVISION=0 +IAXC_LT_AGE=0 + +AC_SUBST(IAXC_LT_CURRENT) +AC_SUBST(IAXC_LT_REVISION) +AC_SUBST(IAXC_LT_AGE) + +AC_CANONICAL_HOST + +AC_GNU_SOURCE + +AC_PROG_CC +AM_PROG_CC_C_O +AC_PROG_GCC_TRADITIONAL +AC_PROG_CXX +AC_PROG_INSTALL +AC_LIBTOOL_WIN32_DLL +AC_PROG_LIBTOOL + +AC_HEADER_STDC +AC_HEADER_STDBOOL +AC_HEADER_TIME +AC_CHECK_HEADERS([sys/time.h varargs.h sys/socket.h]) + +AC_C_CONST +AC_C_INLINE +AC_C_VOLATILE +AC_TYPE_PID_T +AC_TYPE_SIZE_T + +AC_CHECK_FUNCS([vsnprintf _vsnprintf]) + +ACX_PTHREAD + +AC_CHECK_PROG(have_pkg_config, pkg-config, yes, no) + +if test x"$have_pkg_config" = "xno"; then + AC_MSG_ERROR(pkg-config is required to install this program) +fi + +PKG_PROG_PKG_CONFIG + +AC_PATH_PROG([WISH],[wish]) + + +dnl Default CFLAGS and CXXFLAGS if unset +CFLAGS=${CFLAGS-"-O2 -g -Wall --std=gnu99"} +CXXFLAGS=${CXXFLAGS-"-O2 -g -Wall"} + +# AC_ARG_ENABLE saves the option's argument in enable_FEATURE +AC_ARG_ENABLE(local-gsm, + [AS_HELP_STRING([--enable-local-gsm], + [Use local gsm library [default=auto]])],, + [enable_local_gsm="auto"]) + +AC_ARG_ENABLE(local-iax, + [AS_HELP_STRING([--disable-local-iax], + [Don't use local iax library])],, + [enable_local_iax="yes"]) + +AC_ARG_ENABLE(speex_preprocess, + [AS_HELP_STRING([--disable-speex-preprocess], + [Turn off speex preprocessing])],, + [enable_speex_preprocess="yes"]) + +AC_ARG_WITH(echo-can, + [AS_HELP_STRING([--with-echo-can], + [use echo can (span, speex or mec2) [default=speex]])], + use_echo_can=$withval, + use_echo_can="speex") + +AC_ARG_ENABLE(clients, + [AS_HELP_STRING([--enable-clients], + [Select clients (all iaxcomm iaxphone testcall tkphone vtestcall WinIAX wx) [default=auto]])],, + enable_clients="auto") + +AC_ARG_WITH(ilbc, + [AS_HELP_STRING([--with-ilbc], + [Enable iLBC support (You need to place the iLBC reference sources in lib/iLBC) [default=auto]])],, + with_ilbc="auto") + +case "$with_ilbc" in + yes) + enable_local_ilbc=yes ;; + no) + enable_local_ilbc=no ;; + auto) + AC_MSG_CHECKING([for iLBC reference sources in lib/iLBC]) + if test -r lib/iLBC/iLBC_encode.c; then + enable_local_ilbc=yes + else + enable_local_ilbc=no + fi + AC_MSG_RESULT([$enable_local_ilbc]) ;; + + *) + AC_MSG_ERROR([bad value ${with_ilbc} for --with-ilbc]) ;; +esac + +AC_ARG_WITH(wish, + [AS_HELP_STRING([--with-wish], + [Path to Tcl command language interpreter])], + WISH="${with_wish}", + with_wish="auto") + +if test ! "x$enable_clients" = "xauto"; then + for client in ${enable_clients}; do + case "$client" in + iaxcomm | iaxphone | testcall | tkphone | vtestcall | WinIAX | wx) + clients="$clients $client" ;; + all | yes) + clients="iaxcomm iaxphone testcall tkphone vtestcall WinIAX wx" + break ;; + none | no) + clients="" + break ;; + *) + AC_MSG_ERROR(bad value ${client} for --enable-clients) ;; + esac + done +fi + +AM_OPTIONS_WXCONFIG + +case $host_os in + *mingw32*|*cygwin* ) + OSTYPE=WIN32 + AC_DEFINE(WIN32,,[mingw or cygwin]);; + + *linux* ) + OSTYPE=LINUX + AC_DEFINE(LINUX,,[linux]);; + + *darwin* ) + OSTYPE=MACOSX + AC_DEFINE(MACOSX,,[darwin]);; + + * ) + AC_MSG_WARN([OSTYPE cannot be detected, assuming Linux ($host_os)]) + OSTYPE=LINUX + AC_DEFINE(LINUX,,[linux]);; +esac + +AC_SUBST(OSTYPE) + +PKG_CHECK_MODULES(PORTAUDIO, [portaudio-2.0 >= 19],,AC_MSG_ERROR([ + portaudio is required to build this package! + please see http://www.portaudio.com/ for how to + obtain a copy. +])) + +has_gsm=no +if test x$enable_local_gsm = xyes; then + has_gsm=yes + GSM_CFLAGS='-I$(top_srcdir)/lib/gsm/inc' +else + AM_PATH_GSM(has_gsm=yes, has_gsm=no) +fi + +PKG_CHECK_MODULES(OGG, [ogg >= 1.1.3],,AC_MSG_ERROR([ + libogg is required to build this package! + please see http://www.xiph.org/ for how to + obtain a copy. +])) + +PKG_CHECK_MODULES(SPEEX, [speex >= 1.2],,AC_MSG_ERROR([ + speex is required to build this package! + please see http://www.xiph.org/ for how to + obtain a copy. +])) + +PKG_CHECK_MODULES(THEORA, [theora >= 1.0alpha7],,AC_MSG_ERROR([ + libtheora is required to build this package! + please see http://www.xiph.org/ for how to + obtain a copy. +])) + +PKG_CHECK_MODULES(SDL, [sdl >= 1.2], has_sdl=yes, has_sdl=no) +PKG_CHECK_MODULES(GTK2, [gtk >= 2.0], has_gtk2=yes, has_gtk2=no) + +has_iax2=no +if test ! x$enable_local_iax = xyes; then + AM_PATH_IAX2(0.2.3,has_iax2=yes,has_iax2=no) +fi + +if test x$has_iax2 = xno && test ! x$enable_local_iax = xno; then + has_iax2=yes + enable_local_iax2=yes + IAX2_CFLAGS='-I$(top_srcdir)/lib/libiax2/src -DLIBIAX' + IAX2_LIBS="" + IAX2_CONFIG="" +fi + +has_wx="no" +AM_PATH_WXCONFIG(2.6.0, [has_wx="2.6"], + [AM_PATH_WXCONFIG(2.4.0, [has_wx="2.4"])]) +AM_PATH_WXRC() + +dnl Begin wx xrc check +save_CPPFLAGS="$CPPFLAGS" +save_CXXFLAGS="$CXXFLAGS" +save_LIBS="$LIBS" + +CPPFLAGS="$WX_CPPFLAGS" +CXXFLAGS="$WX_CXXFLAGS_ONLY" + +AC_LANG_PUSH(C++) +if test ! x$has_wx = xno; then + AC_CHECK_HEADER(wx/xrc/xmlres.h,has_wx_xrc=yes, + [AC_MSG_WARN([Can't find wx/xrc/xml.h]) + has_wx_xrc=no]) +fi + +if test x$has_wx_xrc = xyes; then + +dnl Check for debug libraries + wx_lib_prefix= + + case $WX_CXXFLAGS in + *__WXDEBUG__*) wx_lib_prefix=d + esac + + has_wx_xrc=xno + AC_MSG_CHECKING([for wx xrc library]) + for wx_xrc_lib in " " "-lwx_gtk${wx_lib_prefix}_xrc-2.4" "-lwx_msw${wx_lib_prefix}_xrc-2.4" "-lwxxrc"; do + LIBS="$wx_xrc_lib $WX_LIBS $save_LIBS" + AC_LINK_IFELSE([ +#include <wx/xrc/xmlres.h> +int main() +{ + wxXmlResource *res; + res->Get(); + return 0; +}],[has_wx_xrc=yes + WX_XRC_LIBS="$wx_xrc_lib" + break]) + done + + AC_MSG_RESULT([$has_wx_xrc ($WX_XRC_LIBS)]) +fi +AC_SUBST(WX_XRC_LIBS) + +AC_LANG_POP(C++) + +LIBS="$save_LIBS" +CPPFLAGS="$save_CPPFLAGS" +CXXFLAGS="$save_CXXFLAGS" +dnl End wx xrc check + +if test x$enable_speex_preprocess = xyes; then + AC_DEFINE(SPEEX_PREPROCESS, 1, [Speex preprocess]) +fi + +AM_CONDITIONAL(SPAN_EC, test x$use_echo_can = xspan) +if test x$use_echo_can = xspan; then + AC_DEFINE(SPAN_EC, 1, [Span echo can]) +fi + +if test x$use_echo_can = xspeex; then + AC_DEFINE(SPEEX_EC, 1, [Speex echo can]) +fi + +if test x$use_echo_can = xmec2; then + AC_DEFINE(MEC2_EC, 1, [Mec echo can]) +fi + +if test x$enable_local_ilbc = xyes; then + AC_DEFINE(CODEC_ILBC,,[Enable ILBC support]) +fi + +if test x$has_gsm = xyes && test ! x$with_gsmlibraries != xno; then + AC_DEFINE(CODEC_GSM,,[Enable GSM support]) +fi + +AM_CONDITIONAL(USE_CODEC_GSM, test x$has_gsm = xyes && test ! x$with_gsmlibraries != xno) +AM_CONDITIONAL(USE_LOCAL_GSM, test x$enable_local_gsm = xyes) +AM_CONDITIONAL(USE_LOCAL_IAX2, test x$enable_local_iax2 = xyes) +AM_CONDITIONAL(USE_LOCAL_ILBC, test x$enable_local_ilbc = xyes) +AM_CONDITIONAL(LINUX, test x$OSTYPE = xLINUX) +AM_CONDITIONAL(WIN32, test x$OSTYPE = xWIN32) +AM_CONDITIONAL(MACOSX, test x$OSTYPE = xMACOSX) + +# Autodetect clients +if test "x$enable_clients" = "xauto"; then + clients="$clients testcall" + + if test ! x$has_wx = xno; then + clients="$clients iaxphone wx" + + if test x$has_wx_xrc = xyes; then + clients="$clients iaxcomm" + fi + fi + + if test x$has_sdl = xyes; then + clients="$clients vtestcall" + fi + + if test x$OSTYPE = xWIN32; then + clients="$clients WinIAX" + fi + + if test ! x$WISH = x; then + clients="$clients tkphone" + fi +fi + +AC_CONFIG_FILES([ +Makefile +lib/Makefile +simpleclient/Makefile +iaxclient.pc +]) + +for client in $clients +do + case "$client" in + testcall) + AC_CONFIG_FILES([simpleclient/testcall/Makefile]) + CLIENTS="$CLIENTS $client";; + + vtestcall) + if ! test x$has_sdl = xyes; then + AC_MSG_ERROR([vtestcall requires SDL]) + fi + AC_CONFIG_FILES([simpleclient/vtestcall/Makefile]) + CLIENTS="$CLIENTS $client";; + + iaxcomm) + AC_CONFIG_FILES([simpleclient/iaxcomm/Makefile]) + CLIENTS="$CLIENTS $client";; + + iaxphone) + AC_CONFIG_FILES([simpleclient/iaxphone/Makefile]) + CLIENTS="$CLIENTS $client";; + + tkphone) + AC_CONFIG_FILES([simpleclient/tkphone/Makefile]) + CLIENTS="$CLIENTS $client";; + + WinIAX) + AC_CONFIG_FILES([simpleclient/WinIAX/Makefile]) + CLIENTS="$CLIENTS $client";; + + wx) + AC_CONFIG_FILES([simpleclient/wx/Makefile]) + CLIENTS="$CLIENTS $client";; + + *) ;; + esac +done + +AC_SUBST(CLIENTS) + +AC_OUTPUT + +AC_MSG_NOTICE([Configured clients: $clients]) Copied: trunk/iaxclient.pc.in (from rev 1035, branches/team/pete/autobranch/iaxclient.pc.in) =================================================================== --- trunk/iaxclient.pc.in (rev 0) +++ trunk/iaxclient.pc.in 2007-06-14 15:29:29 UTC (rev 1038) @@ -0,0 +1,12 @@ +prefix=@prefix@ +exec_prefix=${prefix} +libdir=@libdir@ +includedir=${prefix}/include + +Name: iaxclient +Description: Inter-Asterisk eXchange Client Library +Version: @PACKAGE_VERSION@ +Libs: -L${libdir} -liaxclient @PTHREAD_LIBS@ +Cflags: -I${includedir} +Requires: portaudio-2.0 speex theora ogg + Deleted: trunk/lib/Makefile =================================================================== --- trunk/lib/Makefile 2007-06-14 15:16:42 UTC (rev 1037) +++ trunk/lib/Makefile 2007-06-14 15:29:29 UTC (rev 1038) @@ -1,383 +0,0 @@ -# -# iaxclient: a cross-platform IAX softphone library -# -# Copyrights: -# Copyright (C) 2003 HorizonLive.com, (c) 2004, Horizon Wimba, Inc. -# -# Contributors <see README for complete list> -# Steve Kann <st...@st...> -# Michael Van Donselaar <mv...@va...> -# Shawn Lawrence <sha...@te...> -# -# -# This program is free software, distributed under the terms of -# the GNU Lesser (Library) General Public License -# - -PRODUCTION_BUILD ?= 0 - -CODEC_ILBC=0 - -SPEEX_PREPROCESS=1 -SPAN_EC=0 -SPEEX_EC=1 -MEC2_EC=0 - -#Enable only ONE of the following -#Enable this if using ffmpeg -USE_FFMPEG=0 -# Enable this if using Vanguard Softare Solutions H.264 codec -USE_H264_VSS=0 - -# For Linux, you can choose between portaudio with OSS, Alsa and Jack backend, -# and native Alsa -# Choice is inclusive -USE_PA_OSS=1 -USE_PA_ALSA=1 -USE_PA_JACK=0 -AUDIO_ALSA=0 - -CPPFLAGS += -I. \ - -Igsm/inc \ - -Iportaudio/include \ - -Iportaudio/src/common \ - -Iportaudio/pablio \ - -Iportmixer/px_common - -CFLAGS += -Wall -Wmissing-noreturn - -ifeq ($(PRODUCTION_BUILD),1) -CFLAGS += -O2 -Wpointer-arith -else -CFLAGS += -g -O0 -endif - -CPPFLAGS += -DLIBVER='"SVN $(shell svnversion .)"' - -ifeq ($(SPEEX_PREPROCESS),1) -CPPFLAGS += -DSPEEX_PREPROCESS=1 -endif - -# debug flags -# CPPFLAGS += -DDEBUG_SUPPORT -DDEBUG_DEFAULT -DEXTREME_DEBUG -D_DEBUG -# CPPFLAGS += -DDEBUG_SUPPORT -DDEBUG_DEFAULT -D_DEBUG -# enable this for API level debug info for PortAudio -# CPPFLAGS += -DPA_LOG_API_CALLS - -OBJS=\ - portaudio/src/common/pa_allocation.o \ - portaudio/src/common/pa_converters.o \ - portaudio/src/common/pa_cpuload.o \ - portaudio/src/common/pa_dither.o \ - portaudio/src/common/pa_front.o \ - portaudio/src/common/pa_process.o \ - portaudio/src/common/pa_skeleton.o \ - portaudio/src/common/pa_stream.o \ - portaudio/src/common/pa_trace.o \ - spandsp/plc.o \ - audio_encode.o \ - audio_portaudio.o \ - codec_gsm.o \ - codec_ulaw.o \ - codec_alaw.o \ - codec_speex.o \ - iaxclient_lib.o \ - video.o \ - videoLib/video_grab.o \ - codec_theora.o - -OBJS_GSM=\ - gsm/src/add.o \ - gsm/src/code.o \ - gsm/src/debug.o \ - gsm/src/decode.o \ - gsm/src/gsm_create.o \ - gsm/src/gsm_decode.o \ - gsm/src/gsm_destroy.o \ - gsm/src/gsm_encode.o \ - gsm/src/gsm_explode.o \ - gsm/src/gsm_implode.o \ - gsm/src/gsm_option.o \ - gsm/src/gsm_print.o \ - gsm/src/long_term.o \ - gsm/src/lpc.o \ - gsm/src/preprocess.o \ - gsm/src/rpe.o \ - gsm/src/short_term.o \ - gsm/src/table.o - -OBJS_ILBC=\ - iLBC/anaFilter.o\ - iLBC/iCBSearch.o\ - iLBC/packing.o\ - iLBC/constants.o\ - iLBC/gainquant.o\ - iLBC/iLBC_decode.o\ - iLBC/StateConstructW.o \ - iLBC/createCB.o\ - iLBC/getCBvec.o\ - iLBC/iLBC_encode.o\ - iLBC/StateSearchW.o\ - iLBC/doCPLC.o\ - iLBC/helpfun.o\ - iLBC/syntFilter.o\ - iLBC/enhancer.o\ - iLBC/hpInput.o\ - iLBC/LPCdecode.o\ - iLBC/filter.o\ - iLBC/hpOutput.o\ - iLBC/LPCencode.o\ - iLBC/FrameClassify.o\ - iLBC/iCBConstruct.o\ - iLBC/lsf.o - -OBJS:= $(OBJS) $(OBJS_GSM) - -ifeq ($(CODEC_ILBC),1) -OBJS:= $(OBJS) $(OBJS_ILBC) codec_ilbc.o -CPPFLAGS += -DCODEC_ILBC -endif - -OBJS_WIN32=\ - winfuncs.o \ - portmixer/px_win_wmme/px_win_wmme.o \ - portaudio/src/hostapi/wmme/pa_win_wmme.o \ - portaudio/src/os/win/pa_win_hostapis.o \ - portaudio/src/os/win/pa_win_util.o \ - portaudio/pablio/ringbuffer.o - -OBJS_LIBFG = \ - videoLib/linux/linuxgrab.o \ - videoLib/linux/libfg/capture.o \ - videoLib/linux/libfg/frame.o - -OBJS_LINUX=\ - unixfuncs.o \ - portmixer/px_unix_oss/px_unix_oss.o \ - portaudio/src/os/unix/pa_unix_util.o \ - portaudio/src/os/unix/pa_unix_hostapis.o \ - portaudio/pablio/ringbuffer.o \ - $(OBJS_LIBFG) - -OBJS_SOLARIS=\ - unixfuncs.o \ - portmixer/px_solaris/px_solaris.o \ - portaudio/pa_unix_oss/pa_unix_solaris.o \ - portaudio/pa_unix_oss/pa_unix.o - -OBJS_MACOSX=\ - unixfuncs.o \ - portmixer/px_mac_core/px_mac_core.o \ - portaudio/src/hostapi/coreaudio/pa_mac_core.o \ - portaudio/src/hostapi/coreaudio/pa_mac_core_utilities.o \ - portaudio/src/hostapi/coreaudio/pa_mac_core_blocking.o \ - portaudio/src/os/unix/pa_unix_util.o \ - portaudio/src/os/mac_osx/pa_mac_hostapis.o \ - portaudio/src/hostapi/coreaudio/ringbuffer.o \ - videoLib/macosx/SSUtility.o \ - videoLib/macosx/vdigGrab.o \ - videoLib/macosx/macgrab.o - -OBJS_IAX2=\ - libiax2/src/md5.o \ - libiax2/src/iax.o \ - libiax2/src/iax2-parser.o \ - libiax2/src/jitterbuf.o - - -LIB=libiaxclient.a - -RANLIB= echo - -all: $(LIB) - -# glean the platform -# We will define this as either Linux, Win32, SOLARIS, or MacOSX -ifneq (,$(findstring Linux,$(shell uname))) -OSTYPE=LINUX -else -ifneq (,$(findstring Darwin,$(shell uname))) -OSTYPE=MACOSX -else -# CYGWIN reports CYGWIN_NT-5.0 under Win2K -ifneq (,$(findstring WIN,$(shell uname))) -OSTYPE=WIN32 -else -ifneq (,$(findstring MINGW,$(shell uname))) -OSTYPE=WIN32 -else -ifneq (,$(findstring SunOS,$(shell uname))) -OSTYPE=SOLARIS -else -$(warning OSTYPE cannot be detected, assuming Linux) -OSTYPE=LINUX -endif -endif -endif -endif -endif - -# Setup platform-specific stuff based on gleaning -ifeq ($(OSTYPE),WIN32) - OBJS += $(OBJS_WIN32) - CPPFLAGS += -DPA_NO_DS -DPA_NO_ASIO \ - -IPortVideoSDL/win32/dslib/include \ - -Ic:/DX90SDK/include-gcc \ - -Ic:/DX90SDK/Samples/C++/DirectShow/BaseClasses - CFLAGS += -mno-cygwin - DYNLDFLAGS = -mno-cygwin -lwinmm -lwsock32 -lcomdlg32 -luser32 -lgdi32 \ - -lole32 -lcomctl32 -lctl3d32 -lstdc++ -lshell32 -loleaut32 \ - -ladvapi32 -luuid \ - -Wl,--output-def,iaxclient.def,--add-stdcall-alias,--enable-stdcall-fixup,--out-implib,$(LIB) - DYNCFLAGS = -DBUILDING_DLL - DYNLIB = iaxclient.dll -endif - -ifeq ($(OSTYPE),LINUX) - CPPFLAGS += -Iportaudio/src/os/unix -IvideoLib/linux/libfg - DYNCFLAGS = -fPIC - DYNLIB = libiaxclient.so - ifeq ($(USE_PA_OSS),1) - OBJS_LINUX += portaudio/src/hostapi/oss/pa_unix_oss.o - CPPFLAGS += -DPA_USE_OSS - endif - ifeq ($(USE_PA_ALSA),1) - OBJS_LINUX += portaudio/src/hostapi/alsa/pa_linux_alsa.o - CPPFLAGS += -DPA_USE_ALSA - endif - ifeq ($(USE_PA_JACK),1) - OBJS_LINUX += portaudio/src/hostapi/jack/pa_jack.o - CPPFLAGS += -DPA_USE_JACK - endif - OBJS += $(OBJS_LINUX) -endif - -ifeq ($(OSTYPE),SOLARIS) - OBJS += $(OBJS_SOLARIS) - # only SPARC solaris machines need the alignment stuff - ifeq (sparc,$(findstring sparc,$(shell uname -a))) - CPPFLAGS += -DALIGN32 - endif - DYNCFLAGS = -fPIC - DYNLIB = libiaxclient.so - CC = gcc -endif - -ifeq ($(OSTYPE),MACOSX) - OBJS += $(OBJS_MACOSX) - - RANLIB = ranlib - CPPFLAGS += -DPA_USE_COREAUDIO=1 -Iportaudio/src/hostapi/coreaudio \ - -I../../theora/include -I/sw/include - - ifeq ($(PRODUCTION_BUILD),1) - CFLAGS += -arch i386 -arch ppc - else - # gcc will only generate dependencies with these options when not - # using multiple -arch options (as used above). - CFLAGS += -MP -MD - endif - - export MACOSX_DEPLOYMENT_TARGET=10.3 - export NEXT_ROOT=/Developer/SDKs/MacOSX10.4u.sdk - - DYNLIB = libiaxclient.dylib - - # Uncomment these lines in to build against version 10.2.7. - #export MACOSX_DEPLOYMENT_TARGET=10.2 - #export NEXT_ROOT=/Developer/SDKs/MacOSX10.2.7.sdk -endif - -ifneq ($(OSTYPE),MACOSX) - CFLAGS += -MP -MD -endif - -ifeq ($(USE_FFMPEG),1) - OBJS += codec_ffmpeg.o - CPPFLAGS += -DUSE_FFMPEG -endif - -ifeq ($(USE_H264_VSS),1) - OBJS += codec_h264_vss.o - CPPFLAGS += -Ivssh_sdk/include -DUSE_H264_VSS -endif - -ifeq ($(AUDIO_ALSA),1) - OBJS += audio_alsa.o - CPPFLAGS += -DAUDIO_ALSA -endif - -OBJS += $(OBJS_IAX2) -#CPPFLAGS += -Ilibiax2/src -DIAXC_IAX2 -DLIBIAX -DDEBUG_SUPPORT -CPPFLAGS += -Ilibiax2/src -DLIBIAX - -ifeq ($(SPAN_EC),1) - OBJS += ec/echo.o - CPPFLAGS += -DSPAN_EC=1 -endif - -ifeq ($(SPEEX_EC),1) - CPPFLAGS += -DSPEEX_EC=1 -endif - -ifeq ($(MEC2_EC),1) - CPPFLAGS += -DUSE_MEC2=1 -endif - -CPPFLAGS += -D$(OSTYPE) - -CXXFLAGS = $(CFLAGS) - -CFLAGS += -std=gnu99 - -# Treat some included libraries specially: -# compile gsm w/o warnings, because it was written to less strict warning systems. -gsm/%.o: gsm/%.c - $(CC) -c $(CPPFLAGS) $(CFLAGS) -w $< -o $@ - -# These objects are kinda wimpy and so we use the less awesome gnu89 -# instead of the more awesome default c99. -$(OBJS_LIBFG) \ -portaudio/src/hostapi/jack/pa_jack.o \ -portaudio/src/hostapi/alsa/pa_linux_alsa.o \ - : CFLAGS += --std=gnu89 - -$(LIB): $(OBJS) - $(RM) $(LIB) - ar cru $(LIB) $(OBJS) - $(RANLIB) $(LIB) - -# libtool -static -o $(LIB) $(OBJS) portaudio/lib/libportaudio.a -# ar cru $(LIB) $(OBJS) - - -MSLIB=iaxclient.lib -MGLIBDIR=c:/mingw/lib -GCCLIBDIR=$(MGLIBDIR)/gcc-lib/mingw32/3.2/ - -GCCLIB=$(GCCLIBDIR)/libgcc.a - -$(MSLIB): $(OBJS) -# rm -f $(MSLIB) - cp $(GCCLIB) $(MSLIB) - ar rs $(MSLIB) $(OBJS) - - -#shared: CFLAGS := $(CFLAGS) $(DYNCFLAGS) -#shared: clean libiaxclient.a -#shared: libiaxclient.a -#ifeq ($(OSTYPE),MACOSX) -# $(CC) -single_module -dylib -dynamiclib -o $(DYNLIB) $(OBJS) $(DYNLDFLAGS) -framework CoreAudio -framework AudioToolbox -framework System -framework Carbon -framework AudioUnit portaudio/lib/libportaudio.a -#else -# $(CC) -shared -o $(DYNLIB) $(OBJS) $(DYNLDFLAGS) -#endif - -plat: - echo Platform is $(OSTYPE) - echo OBJS are $(OBJS) - echo OBJS_LINUX are $(OBJS_LINUX) - -clean: - rm -f $(OBJS) $(LIB) $(addsuffix .d,$(basename $(OBJS))) - --include *.d Copied: trunk/lib/Makefile.am (from rev 1035, branches/team/pete/autobranch/lib/Makefile.am) =================================================================== --- trunk/lib/Makefile.am (rev 0) +++ trunk/lib/Makefile.am 2007-06-14 15:29:29 UTC (rev 1038) @@ -0,0 +1,196 @@ +# Autoconf etc. macros +AUTOMAKE_OPTIONS = subdir-objects + +# Targets +lib_LTLIBRARIES = libiaxclient.la +libiaxclient_la_SOURCES = $(SRCS) +nodist_libiaxclient_la_SOURCES = $(NODIST_SRCS) + +AM_CFLAGS = \ + -I$(srcdir)/portmixer/px_common \ + $(PTHREAD_CFLAGS) \ + $(SPEEX_CFLAGS) \ + $(THEORA_CFLAGS) \ + $(IAX2_CFLAGS) \ + $(PORTAUDIO_CFLAGS) + +AM_CFLAGS += -Wall +AM_CFLAGS += -Wextra +AM_CFLAGS += -Wno-unused-parameter +AM_CFLAGS += -Wpointer-arith +AM_CFLAGS += -DLIBVER='"$(PACKAGE_VERSION)"' + +libiaxclient_la_LIBADD = \ + $(PTHREAD_LIBS) \ + $(IAX2_LIBS) \ + $(PORTAUDIO_LIBS) \ + $(SPEEX_LIBS) \ + $(THEORA_LIBS) \ + $(OGG_LIBS) + +AM_LDFLAGS = \ + -no-undefined \ + -version-info @IAXC_LT_CURRENT@:@IAXC_LT_REVISION@:@IAXC_LT_AGE@ \ + -export-symbols-regex "iaxc_.*" + +include_HEADERS=iaxclient.h + +SRCS = +NODIST_SRCS = + +if WIN32 +SRCS += $(SRCS_WIN32) +libiaxclient_la_LIBADD += -lwinmm -lwsock32 +endif WIN32 + +if LINUX +SRCS += $(SRCS_LINUX) +endif LINUX + +if MACOSX +SRCS += $(SRCS_MACOSX) +endif MACOSX + +if USE_LOCAL_GSM +SRCS += $(SRCS_LIBGSM) +endif + +if USE_LOCAL_IAX2 +SRCS += $(SRCS_IAX2) +# AM_CFLAGS += -DDEBUG_SUPPORT +endif USE_LOCAL_IAX2 + +if USE_LOCAL_ILBC +SRCS += codec_ilbc.c +NODIST_SRCS += $(SRCS_ILBC) +endif USE_LOCAL_ILBC + +if USE_CODEC_GSM +SRCS += codec_gsm.c codec_gsm.h +libiaxclient_la_LIBADD += $(GSM_LIBS) +AM_CFLAGS += $(GSM_CFLAGS) +endif + +SRCS_LIBGSM= \ + gsm/src/add.c \ + gsm/src/code.c \ + gsm/src/debug.c \ + gsm/src/decode.c \ + gsm/src/gsm_create.c \ + gsm/src/gsm_decode.c \ + gsm/src/gsm_destroy.c \ + gsm/src/gsm_encode.c \ + gsm/src/gsm_explode.c \ + gsm/src/gsm_implode.c \ + gsm/src/gsm_option.c \ + gsm/src/gsm_print.c \ + gsm/src/long_term.c \ + gsm/src/lpc.c \ + gsm/src/preprocess.c \ + gsm/src/rpe.c \ + gsm/src/short_term.c \ + gsm/src/table.c \ + gsm/inc/private.h \ + gsm/inc/gsm.h \ + gsm/inc/unproto.h \ + gsm/inc/config.h \ + gsm/inc/proto.h + +SRCS += \ + audio_encode.c \ + audio_encode.h \ + audio_portaudio.c \ + audio_portaudio.h \ + codec_alaw.c \ + codec_alaw.h \ + codec_ilbc.h \ + codec_speex.c \ + codec_speex.h \ + codec_theora.c \ + codec_theora.h \ + codec_ulaw.c \ + codec_ulaw.h \ + iaxclient_lib.c \ + iaxclient_lib.h \ + ringbuffer.c \ + ringbuffer.h \ + portmixer/px_common/portmixer.h \ + spandsp/plc.c \ + spandsp/plc.h \ + video.c \ + video.h \ + videoLib/video_grab.c \ + videoLib/video_grab.h + +SRCS_ILBC= \ + iLBC/anaFilter.c \ + iLBC/iCBSearch.c \ + iLBC/packing.c \ + iLBC/constants.c \ + iLBC/gainquant.c \ + iLBC/iLBC_decode.c \ + iLBC/StateConstructW.c \ + iLBC/createCB.c \ + iLBC/getCBvec.c \ + iLBC/iLBC_encode.c \ + iLBC/StateSearchW.c \ + iLBC/doCPLC.c \ + iLBC/helpfun.c \ + iLBC/syntFilter.c \ + iLBC/enhancer.c \ + iLBC/hpInput.c \ + iLBC/LPCdecode.c \ + iLBC/filter.c \ + iLBC/hpOutput.c \ + iLBC/LPCencode.c \ + iLBC/FrameClassify.c \ + iLBC/iCBConstruct.c \ + iLBC/lsf.c + +SRCS_WIN32= \ + winfuncs.c \ + portmixer/px_win_wmme/px_win_wmme.c + +SRCS_LINUX= \ + portmixer/px_unix_oss/px_unix_oss.c \ + unixfuncs.c \ + videoLib/linux/libfg/capture.c \ + videoLib/linux/libfg/capture.h \ + videoLib/linux/libfg/frame.c \ + videoLib/linux/libfg/frame.h \ + videoLib/linux/libfg/libfg.h \ + videoLib/linux/linuxgrab.c + +SRCS_MACOSX= \ + portmixer/px_mac_core/px_mac_core.c \ + unixfuncs.c \ + videoLib/macosx/SSUtility.c \ + videoLib/macosx/SSUtility.h \ + videoLib/macosx/macgrab.c \ + videoLib/macosx/vdigGrab.c \ + videoLib/macosx/vdigGrab.h + +SRCS_IAX2= \ + libiax2/src/md5.c \ + libiax2/src/iax.c \ + libiax2/src/iax2-parser.c \ + libiax2/src/jitterbuf.c \ + libiax2/src/frame.h \ + libiax2/src/iax2.h \ + libiax2/src/iax2-parser.h \ + libiax2/src/iax-client.h \ + libiax2/src/jitterbuf.h \ + libiax2/src/md5.h + +EXTRA_DIST = \ + sound2c.pl \ + gsm/copyright \ + gsm/readme \ + libiax2/AUTHORS \ + libiax2/ChangeLog \ + libiax2/COPYING \ + libiax2/COPYING.LIB \ + libiax2/NEWS \ + libiax2/README \ + portmixer/LICENSE.txt + Deleted: trunk/lib/TODO =================================================================== --- trunk/lib/TODO 2007-06-14 15:16:42 UTC (rev 1037) +++ trunk/lib/TODO 2007-06-14 15:29:29 UTC (rev 1038) @@ -1,122 +0,0 @@ -Problems: -- Thread creation does not have any safeguards, so in theory one can -create an unlimited number of processing threads. -- There is a producer/consumer race condition in the iaxclient event -queue. When the library is locked, incoming events are queued by the -iaxc_post_event() method and delivered in sequence, once the lock is -released. The event queue is not synchronized. Ocasionally, this will -cause the delivery of an event with type 0, which is filtered out and -an error is reported. This has no apparent negative impact on the -overall operation of the library, but should be addresses nonetheless. -One possible way of solving this would be to lock queue access with -a separate mutex, but care should be exercised to avoid deadlocks. -- The framerate is hardcoded to 15 fps in iax.c. This should be -rectified. -- Linux framegrabber is slow (around 9 fps). -- Mac framegrabber eats too much CPU. -- iaxclient crashes sometimes. Suspect a concurency issue. - -The items beloware old. Most of them have already been implemented. -I am keeping this here for historical and reference reasons - -TODO items: - - -1) Audio driver work: - Properly abstract audio drivers (currently, we use only - portaudio, but we may also want to support others. - The most likely candidate here would be zaptel devices. - - Instead of the "switch" statements in the code, define an audio - driver structure, with - - - function pointers for actual driver entry points. - initialization: (scans available devices, sets up data - structures) - destruction: (stops everything, cleans up) - "start": starts audio for a particular call? - "stop": stops audio for a particular call? - "playsound": plays a particular sound: can be used for - incoming call notification, ringback, dialtone etc? - "select": select input and output devices to use? - [maybe extend this for zap devices to have "ring", etc - functions?] - - - - Common audio driver data members: - a) perhaps an array of devices the driver has found, - with for each device, a device name, an - indication of whether this device is the default - input or output, and whether this device - supports input, output, or both. - - For portaudio, we probably want to switch to the "standard" - portaudio callback interface, and away from pablio, which isn't - really robust enough for our needs once we do this stuff. - - - -2) Codecs: (I think that someone is working on this) - - Currently, the library assumes that all calls will be GSM only, - and further assumes that all frames will be 20ms. It can - control the frame size (within reason) for frames it sends out, - but should deal gracefully with incoming frames that aren't - 20ms. - - Codecs should probably be implemented via a similar set of - structure abstractions as audio drivers, above. They also need - to handle incoming packets which may switch formats abruptly(?). - -DONE (or, at least, mostly done): -============================================================== -Call handling - currently, the library really only supports one call, and not - very well. It should have a collection of calls (either an - array, or a linked list), and keep track of the current state of - each call. - - An array might be easiest to manage, and would map well to a - softphone client. We would then just refer to calls by their - index, and a GUI client might present these like call - appearances on their display. - - Incoming calls might come in on the first free call appearance, - and outgoing calls by default would do the same. - - The state of each call might be similar to phonecore - (incoming_incomplete, incoming, outgoing_incomplete, outgoing), - but we'd also have to keep track of which call, if any, we - currenly have "selected" -- i.e. which one we should connect to - the audio system. - - We'd need to send events to the client whenever a call changed - "state" in any way. - - We can make the number of calls in the array defined at runtime - when the library is initialized. A very simple client like - testcall would just ask for a single call, so it wouldn't have - to worry about a lot of this. - -Events: - We might want to consolidate the (currently three) callbacks - that the library makes to clients, into a single callback, that - passes back a structure with event info. I was thinking of a - structure with an event type, and then a union of different - structures depending on the event type. - - The only thing is that we might want to decide whether or not, - or how clients will "register" for different event types, even - if they're handled through the same callback mechanism. - - Ideally, the library would handle all of the events itself, via - some "default" handlers. (I.e. for messages, it might just print - them to stdout or stderr. For incoming calls, it might accept - them by default). - - So, the choices then are whether the client should register for - individual events, or perhaps it can just decline events as they - happen, and then the library could handle them. - - - Modified: trunk/lib/audio_encode.c =================================================================== --- trunk/lib/audio_encode.c 2007-06-14 15:16:42 UTC (rev 1037) +++ trunk/lib/audio_encode.c 2007-06-14 15:29:29 UTC (rev 1038) @@ -16,16 +16,19 @@ #include "iaxclient_lib.h" #include "iax-client.h" +#ifdef CODEC_GSM #include "codec_gsm.h" +#endif #include "codec_ulaw.h" #include "codec_alaw.h" #include "codec_speex.h" +#include <speex/speex_preprocess.h> #ifdef CODEC_ILBC #include "codec_ilbc.h" #endif -float iaxc_silence_threshold = -99.0f; +float iaxci_silence_threshold = -99.0f; static float input_level = 0.0f; static float output_level = 0.0f; @@ -33,7 +36,7 @@ static SpeexPreprocessState *st = NULL; static int speex_state_size = 0; static int speex_state_rate = 0; -int iaxc_filters = IAXC_FILTER_AGC|IAXC_FILTER_DENOISE|IAXC_FILTER_AAGC|IAXC_FILTER_CN; +int iaxci_filters = IAXC_FILTER_AGC|IAXC_FILTER_DENOISE|IAXC_FILTER_AAGC|IAXC_FILTER_CN; /* use to measure time since last audio was processed */ static struct timeval timeLastInput ; @@ -69,26 +72,25 @@ gettimeofday(&now, 0); - if ( last.tv_sec != 0 && iaxc_usecdiff(&now, &last) < 100000 ) + if ( last.tv_sec != 0 && iaxci_usecdiff(&now, &last) < 100000 ) return 0; last = now; /* if input has not been processed in the last second, set to silent */ - input_db = iaxc_usecdiff(&now, &timeLastInput) < 1000000 ? + input_db = iaxci_usecdiff(&now, &timeLastInput) < 1000000 ? vol_to_db(input_level) : -99.9f; /* if output has not been processed in the last second, set to silent */ - output_db = iaxc_usecdiff(&now, &timeLastOutput) < 1000000 ? + output_db = iaxci_usecdiff(&now, &timeLastOutput) < 1000000 ? vol_to_db(output_level) : -99.9f; - iaxc_do_levels_callback(input_db, output_db); + iaxci_do_levels_callback(input_db, output_db); return 0; } - -void iaxc_set_speex_filters() +static void set_speex_filters() { int i; float f; @@ -98,9 +100,9 @@ i = 1; /* always make VAD decision */ speex_preprocess_ctl(st, SPEEX_PREPROCESS_SET_VAD, &i); - i = (iaxc_filters & IAXC_FILTER_AGC) ? 1 : 0; + i = (iaxci_filters & IAXC_FILTER_AGC) ? 1 : 0; speex_preprocess_ctl(st, SPEEX_PREPROCESS_SET_AGC, &i); - i = (iaxc_filters & IAXC_FILTER_DENOISE) ? 1 : 0; + i = (iaxci_filters & IAXC_FILTER_DENOISE) ? 1 : 0; speex_preprocess_ctl(st, SPEEX_PREPROCESS_SET_DENOISE, &i); /* make vad more sensitive */ @@ -138,22 +140,22 @@ st = speex_preprocess_state_init(len,rate); speex_state_size = len; speex_state_rate = rate; - iaxc_set_speex_filters(); + set_speex_filters(); } calculate_level((short *)audio, len, &input_level); /* only preprocess if we're interested in VAD, AGC, or DENOISE */ - if ( (iaxc_filters & (IAXC_FILTER_DENOISE | IAXC_FILTER_AGC)) || - iaxc_silence_threshold > 0.0f ) + if ( (iaxci_filters & (IAXC_FILTER_DENOISE | IAXC_FILTER_AGC)) || + iaxci_silence_threshold > 0.0f ) silent = !speex_preprocess(st, (spx_int16_t *)audio, NULL); /* Analog AGC: Bring speex AGC gain out to mixer, with lots of hysteresis */ /* use a higher continuation threshold for AAGC than for VAD itself */ if ( !silent && - iaxc_silence_threshold != 0.0f && - (iaxc_filters & IAXC_FILTER_AGC) && - (iaxc_filters & IAXC_FILTER_AAGC) && + iaxci_silence_threshold != 0.0f && + (iaxci_filters & IAXC_FILTER_AGC) && + (iaxci_filters & IAXC_FILTER_AAGC) && st->speech_prob > 0.20f ) { static int i = 0; @@ -189,7 +191,7 @@ /* This is ugly. Basically just don't get volume level if speex thought * we were silent. Just set it to 0 in that case */ - if ( iaxc_silence_threshold > 0.0f && silent ) + if ( iaxci_silence_threshold > 0.0f && silent ) input_level = 0.0f; do_level_callback(); @@ -199,10 +201,10 @@ if ( volume < lowest_volume ) lowest_volume = volume; - if ( iaxc_silence_threshold > 0.0f ) + if ( iaxci_silence_threshold > 0.0f ) return silent; else - return volume < iaxc_silence_threshold; + return volume < iaxci_silence_threshold; } static int output_postprocess(void *audio, int len) @@ -218,17 +220,19 @@ { switch (format & IAXC_AUDIO_FORMAT_MASK) { +#ifdef CODEC_GSM case IAXC_FORMAT_GSM: - return iaxc_audio_codec_gsm_new(); + return codec_audio_gsm_new(); +#endif case IAXC_FORMAT_ULAW: - return iaxc_audio_codec_ulaw_new(); + return codec_audio_ulaw_new(); case IAXC_FORMAT_ALAW: - return iaxc_audio_codec_alaw_new(); + return codec_audio_alaw_new(); case IAXC_FORMAT_SPEEX: - return iaxc_audio_codec_speex_new(&speex_settings); + return codec_audio_speex_new(&speex_settings); #ifdef CODEC_ILBC case IAXC_FORMAT_ILBC: - return iaxc_audio_codec_ilbc_new(); + return codec_audio_ilbc_new(); #endif default: /* ERROR: codec not s... [truncated message content] |