freeswitch/libs/portaudio/bindings/cpp/build/gnu/configure.ac

215 lines
6.0 KiB
Plaintext
Raw Normal View History

New mod_portaudio (sponspred by eWorldCom http://www.eworldcom.hu/) This updates mod_portaudio to use the new v19 api and also contains major behavioural changes. This initial check-in should be tested to find any obscure use cases that lead to crashes etc... All of the old api interface commands are now depricated and any attempt to use them should cause a polite warning asking you to try the new single "pa" command. New Features: *) Mulitiple calls with hold/call switching. *) Inbound calls can play a ring file on specified device. (global and per call) *) Optional hold music for backgrounded calls. (global and per call) Example dialplan usage: <extension name="2000"> <condition field="destination_number" expression="^2000$"> <!--if the next 3 lines are omitted the defaults will be used from portaudio.conf--> <action application="set" data="pa_ring_file=/sounds/myring.wav"/> <action application="set" data="pa_hold_file=/sounds/myhold.wav"/> <action application="set" data="export_vars=pa_ring_file,pa_hold_file"/> <action application="bridge" data="portaudio"/> </condition> </extension> Example API interface usage: call extension 1000 > pa call 1000 call extension 1001 putting the other call on hold > pa call 1001 swap the calls between hold and active > pa switch view the current calls > pa list forground the call with id 1 > pa switch 1 background all calls > pa switch none send a dtmf string (1234) to the current call > pa dtmf 1234 answer the oldest unanswered inbound call > pa answer answer the call with id 1 > pa answer 1 hangup the active call > pa hangup hangup the call with id 1 > pa hangup 1 get device info > pa dump print usage summary > pa help USAGE: -------------------------------------------------------------------------------- pa help pa dump pa call <dest> [<dialplan> <cid_name> <cid_num> <rate>] pa answer [<call_id>] pa hangup [<call_id>] pa list pa switch [<call_id>|none] pa_dtmf <digit string> -------------------------------------------------------------------------------- The source of the portaudio v19 library will also be checked in for the sake of the build system. git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3981 d0543943-73ff-0310-b7d9-9358b9ac24b2
2007-01-17 19:10:03 +00:00
#
# PortAudioCpp V19 autoconf input file
# Shamelessly ripped from the PortAudio one by Dominic Mazzoni
# Ludwig Schwardt
#
# Require autoconf >= 2.13
AC_PREREQ(2.13)
AC_INIT([PortAudioCpp], [12])
AC_CONFIG_SRCDIR([../../include/portaudiocpp/PortAudioCpp.hxx])
###### Top-level directory of pacpp
###### This makes it easy to shuffle the build directories
###### Also edit AC_CONFIG_SRCDIR above (wouldn't accept this variable)!
PACPP_ROOT="../.."
######
###### SET THIS TO PORTAUDIO DIRECTORY
######
PORTAUDIO="$PACPP_ROOT/../portaudio"
# Various other variables and flags
PACPP_INC="$PACPP_ROOT/include"
INCLUDES="-I$PACPP_INC -I$PORTAUDIO -I$PORTAUDIO/pa_common"
CFLAGS="-g -O2 -Wall -ansi -pedantic $INCLUDES"
CXXFLAGS="$CFLAGS"
PALIBDIR="$PORTAUDIO/lib"
# Checks for programs
AC_PROG_CC
AC_PROG_CXX
AC_PROG_LN_S
AC_PROG_RANLIB
AC_PROG_INSTALL
AC_PATH_PROG(AR, ar, no)
if [[ $AR = "no" ]] ; then
AC_MSG_ERROR("Could not find ar - needed to create a library");
fi
# This must be one of the first tests we do or it will fail...
AC_C_BIGENDIAN
# Transfer these variables to the Makefile
AC_SUBST(PACPP_ROOT)
AC_SUBST(PORTAUDIO)
AC_SUBST(PADLL)
AC_SUBST(PACPP_DLL)
AC_SUBST(PACPP_INC)
AC_SUBST(SHARED_FLAGS)
AC_SUBST(DLL_LIBS)
AC_SUBST(CXXFLAGS)
##################### CHECK FOR INSTALLED PACKAGES ############################
# checks for various host APIs and arguments to configure that
# turn them on or off
AC_CHECK_LIB(asound, snd_pcm_open, have_alsa=yes, have_alsa=no)
# Determine the host description for the subsequent test.
# PKG_CHECK_MODULES seems to check and set the host variable also, but
# that then requires pkg-config availability which is not standard on
# MinGW systems and can be a pain to install.
AC_CANONICAL_HOST
PKG_CHECK_MODULES(JACK, jack, have_jack=yes, have_jack=no)
AC_ARG_WITH(alsa,
[ --with-alsa (default=auto)],
with_alsa=$withval, with_alsa="yes")
AC_ARG_WITH(jack,
[ --with-jack (default=auto)],
with_jack=$withval, with_jack="yes")
AC_ARG_WITH(oss,
[ --with-oss (default=yes)],
with_oss=$withval, with_oss="yes")
AC_ARG_WITH(host_os,
[ --with-host_os (no default)],
host_os=$withval)
AC_ARG_WITH(winapi,
[ --with-winapi ((wmme/directx/asio) default=wmme)],
with_winapi=$withval, with_winapi="wmme")
# Mac API added for ASIO, can have other api's listed
AC_ARG_WITH(macapi,
[ --with-macapi (asio) default=asio)],
with_macapi=$withval, with_macapi="asio")
AC_ARG_WITH(asiodir,
[ --with-asiodir (default=/usr/local/asiosdk2)],
with_asiodir=$withval, with_asiodir="/usr/local/asiosdk2")
AC_ARG_WITH(dxdir,
[ --with-dxdir (default=/usr/local/dx7sdk)],
with_dxdir=$withval, with_dxdir="/usr/local/dx7sdk")
##################### HOST-SPECIFIC LIBRARY SETTINGS ##########################
case "${host_os}" in
darwin* )
# Mac OS X configuration
LIBS="-framework AudioUnit -framework AudioToolbox -framework CoreAudio";
PADLL="libportaudio.dylib";
PACPP_DLL="libportaudiocpp.dylib";
SHARED_FLAGS="-framework AudioUnit -framework AudioToolbox";
SHARED_FLAGS="$SHARED_FLAGS -framework CoreAudio -dynamiclib";
if [[ $with_macapi = "asio" ]] ; then
if [[ $with_asiodir ]] ; then
ASIODIR="$with_asiodir";
else
ASIODIR="/usr/local/asiosdk2";
fi
echo "ASIODIR: $ASIODIR";
fi
;;
mingw* )
# MingW configuration
echo "WINAPI: $with_winapi"
if [[ $with_winapi = "directx" ]] ; then
if [[ $with_dxdir ]] ; then
DXDIR="$with_dxdir";
else
DXDIR="/usr/local/dx7sdk";
fi
echo "DXDIR: $DXDIR"
LIBS="-L$PALIBDIR -lportaudio"
LIBS="$LIBS -lwinmm -lm -ldsound -lole32";
PADLL="portaudio.dll";
PACPP_DLL="portaudiocpp.dll";
SHARED_FLAGS="-shared -mthreads";
DLL_LIBS="-lwinmm -lm -L./dx7sdk/lib -ldsound -lole32";
CFLAGS="$CFLAGS -DPA_NO_WMME -DPA_NO_ASIO";
CXXFLAGS="$CFLAGS"
elif [[ $with_winapi = "asio" ]] ; then
if [[ $with_asiodir ]] ; then
ASIODIR="$with_asiodir";
else
ASIODIR="/usr/local/asiosdk2";
fi
echo "ASIODIR: $ASIODIR"
LIBS="-L$PALIBDIR -lportaudio"
LIBS="$LIBS -lwinmm -lm -lstdc++ -lole32 -luuid";
PADLL="portaudio.dll";
PACPP_DLL="portaudiocpp.dll";
SHARED_FLAGS="-shared -mthreads";
DLL_LIBS="-lwinmm -lm -lstdc++ -lole32 -luuid";
CFLAGS="$CFLAGS -ffast-math -fomit-frame-pointer -DPA_NO_WMME -DPA_NO_DS -DWINDOWS";
CXXFLAGS="$CFLAGS";
else # WMME default
LIBS="-L$PALIBDIR -lportaudio"
LIBS="$LIBS -lwinmm -lm -lstdc++ -lole32 -luuid";
PADLL="portaudio.dll";
PACPP_DLL="portaudiocpp.dll";
SHARED_FLAGS="-shared -mthreads";
DLL_LIBS="-lwinmm";
CFLAGS="$CFLAGS -DPA_NO_DS -DPA_NO_ASIO";
CXXFLAGS="$CFLAGS";
fi
;;
cygwin* )
# Cygwin configuration
LIBS="-L$PALIBDIR -lportaudio"
LIBS="$LIBS -lwinmm -lm";
PADLL="portaudio.dll";
PACPP_DLL="portaudiocpp.dll";
SHARED_FLAGS="-shared -mthreads";
DLL_LIBS="-lwinmm";
;;
*)
# Unix OSS configuration
AC_CHECK_LIB(pthread, pthread_create,
,
AC_MSG_ERROR([libpthread not found!]))
LIBS="$LIBS -L$PALIBDIR -lportaudio"
if [[ $have_jack = "yes" ] && [ $with_jack != "no" ]] ; then
LIBS="$LIBS $JACK_LIBS"
CFLAGS="$CFLAGS $JACK_CFLAGS"
AC_DEFINE(PA_USE_JACK)
fi
if [[ $have_alsa = "yes" ] && [ $with_alsa != "no" ]] ; then
LIBS="$LIBS -lasound"
AC_DEFINE(PA_USE_ALSA)
fi
if [[ $with_oss != "no" ]] ; then
AC_DEFINE(PA_USE_OSS)
fi
LIBS="$LIBS -lm -lpthread";
PADLL="libportaudio.so";
PACPP_DLL="libportaudiocpp.so";
SHARED_FLAGS="-shared";
esac
AC_CONFIG_FILES([Makefile])
AC_OUTPUT