Use system portaudio library

This removes our in-tree version of portaudio-19 and migrates
mod_portaudio and mod_portaudio_stream to use the system version of
the library.  Our detection of the system library relies on
pkg-config.
This commit is contained in:
Travis Cross
2014-05-21 23:49:16 +00:00
parent 83ba9d82e1
commit a0e19e1c7f
269 changed files with 36 additions and 84800 deletions
+11 -17
View File
@@ -1,25 +1,19 @@
LIBS+=$(PA_LIBS)
include $(top_srcdir)/build/modmake.rulesam
MODNAME=mod_portaudio
PA_DIR=$(switch_srcdir)/libs/portaudio
PALA=$(switch_builddir)/libs/portaudio/lib/libportaudio.la
if HAVE_PORTAUDIO
mod_LTLIBRARIES = mod_portaudio.la
mod_portaudio_la_SOURCES = mod_portaudio.c pablio.c pa_ringbuffer.c
mod_portaudio_la_CFLAGS = -I. -I$(PA_DIR)/include -D__EXTENSION__=1 $(AM_CFLAGS)
mod_portaudio_la_LIBADD = $(switch_builddir)/libfreeswitch.la $(PALA)
mod_portaudio_la_LDFLAGS = -avoid-version -module -no-undefined -shared $(PA_LIBS)
mod_portaudio_la_CFLAGS = $(AM_CFLAGS)
mod_portaudio_la_CPPFLAGS = -I. $(PORTAUDIO_CFLAGS) $(AM_CPPFLAGS)
mod_portaudio_la_LIBADD = $(PORTAUDIO_LIBS) $(switch_builddir)/libfreeswitch.la
mod_portaudio_la_LDFLAGS = -avoid-version -module -no-undefined -shared
if ISMAC
mod_portaudio_la_LDFLAGS += -framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework Carbon
endif
BUILT_SOURCES = $(PALA)
$(mod_portaudio_la_SOURCES) : $(BUILT_SOURCES)
$(PALA): $(PA_DIR) $(PA_DIR)/.update
cd $(switch_builddir)/libs/portaudio && $(MAKE) PORTAUDIO_CFLAGS="$(SWITCH_AM_CFLAGS)"
$(TOUCH_TARGET)
else
install: error
all: error
error:
$(error You must install portaudio19-dev to build $(MODNAME))
endif
@@ -37,8 +37,8 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "pablio.h"
#include <string.h>
#include "pablio.h"
#define MY_EVENT_RINGING "portaudio::ringing"
#define MY_EVENT_MAKE_CALL "portaudio::makecall"
@@ -53,8 +53,8 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "pa_ringbuffer.h"
#include <string.h>
#include "pa_ringbuffer.h"
/****************
* First, we'll define some memory barrier primitives based on the system.
+3 -4
View File
@@ -44,12 +44,11 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "portaudio.h"
#include "pa_ringbuffer.h"
#include "pablio.h"
#include <string.h>
#include <time.h>
#include <portaudio.h>
#include "pa_ringbuffer.h"
#include "pablio.h"
/************************************************************************/
/******** Prototypes ****************************************************/
+2 -3
View File
@@ -51,10 +51,9 @@ extern "C" {
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "pa_ringbuffer.h"
#include "portaudio.h"
#include <string.h>
#include <portaudio.h>
#include "pa_ringbuffer.h"
/*! Maximum number of channels per stream */
#define MAX_IO_CHANNELS 2
@@ -1,25 +1,20 @@
include $(top_srcdir)/build/modmake.rulesam
MODNAME=mod_portaudio_stream
PA_DIR=$(switch_srcdir)/libs/portaudio
PALA=$(switch_builddir)/libs/portaudio/lib/libportaudio.la
MODPA_DIR=$(switch_srcdir)/src/mod/endpoints/mod_portaudio
if HAVE_PORTAUDIO
mod_LTLIBRARIES = mod_portaudio_stream.la
mod_portaudio_stream_la_SOURCES = mod_portaudio_stream.c ../../endpoints/mod_portaudio/pablio.c ../../endpoints/mod_portaudio/pa_ringbuffer.c
mod_portaudio_stream_la_CFLAGS = -I. -I$(PA_DIR)/include -D__EXTENSION__=1 -I$(MODPA_DIR) $(AM_CFLAGS)
mod_portaudio_stream_la_LIBADD = $(switch_builddir)/libfreeswitch.la $(PALA)
mod_portaudio_stream_la_LDFLAGS = -avoid-version -module -no-undefined -shared $(PA_LIBS)
mod_portaudio_stream_la_CFLAGS = $(AM_CFLAGS)
mod_portaudio_stream_la_CPPFLAGS = -I. -I$(MODPA_DIR) $(PORTAUDIO_CFLAGS) $(AM_CPPFLAGS)
mod_portaudio_stream_la_LIBADD = $(PORTAUDIO_LIBS) $(switch_builddir)/libfreeswitch.la
mod_portaudio_stream_la_LDFLAGS = -avoid-version -module -no-undefined -shared
if ISMAC
mod_portaudio_stream_la_LDFLAGS += -framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework Carbon
endif
BUILT_SOURCES = $(PALA)
$(mod_portaudio_stream_la_SOURCES) : $(BUILT_SOURCES)
$(PALA): $(PA_DIR) $(PA_DIR)/.update
cd $(switch_builddir)/libs/portaudio && $(MAKE) PORTAUDIO_CFLAGS="$(SWITCH_AM_CFLAGS)"
$(TOUCH_TARGET)
else
install: error
all: error
error:
$(error You must install portaudio19-dev to build $(MODNAME))
endif
@@ -30,8 +30,8 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "pablio.h"
#include <string.h>
#include "pablio.h"
#define DEFAULT_PREBUFFER_SIZE 1024 * 64
#define SAMPLE_TYPE paInt16