APR_ADDTO(SWITCH_AM_CFLAGS, -DENABLE_ZRTP)
fi
+PA_LIBS=
+
+PKG_CHECK_MODULES(JACK, jack, have_jack=yes, have_jack=no)
+if test "x$have_jack" = "xyes" ; then
+PA_LIBS+=$JACK_LIBS
+fi
+
AC_CHECK_LIB(asound, snd_pcm_open, have_alsa=yes, have_alsa=no)
if test "x$have_alsa" = "xyes" ; then
-ALSA_LIBS=-lasound
+PA_LIBS+=-lasound
fi
-AC_SUBST(ALSA_LIBS)
+
+AC_SUBST(PA_LIBS)
AM_CONDITIONAL([ENABLE_ZRTP],[test "x$enable_zrtp" != "xno"])
mod_portaudio_la_CFLAGS = $(AM_CFLAGS)
mod_portaudio_la_CFLAGS += -I. -I$(PA_DIR)/include -D__EXTENSION__=1
mod_portaudio_la_LIBADD = $(switch_builddir)/libfreeswitch.la $(PALA)
-mod_portaudio_la_LDFLAGS = -avoid-version -module -no-undefined -shared $(ALSA_LIBS)
+mod_portaudio_la_LDFLAGS = -avoid-version -module -no-undefined -shared $(PA_LIBS)
if ISMAC
mod_portaudio_la_LDFLAGS += -framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework Carbon
mod_portaudio_stream_la_CFLAGS = $(AM_CFLAGS)
mod_portaudio_stream_la_CFLAGS += -I. -I$(PA_DIR)/include -D__EXTENSION__=1 -I$(MODPA_DIR)
mod_portaudio_stream_la_LIBADD = $(switch_builddir)/libfreeswitch.la $(PALA)
-mod_portaudio_stream_la_LDFLAGS = -avoid-version -module -no-undefined -shared $(ALSA_LIBS)
+mod_portaudio_stream_la_LDFLAGS = -avoid-version -module -no-undefined -shared $(PA_LIBS)
if ISMAC
mod_portaudio_stream_la_LDFLAGS += -framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework Carbon