Commit 17442b78 authored by Tristan Matthews's avatar Tristan Matthews

configure: use pkg-config for speex and speexdsp

Refs #57223

Change-Id: Idd4248e910fbe970c0c67c0ffcda39f7c17e5a41
parent d3453ea4
......@@ -402,12 +402,7 @@ AC_ARG_WITH([speex],
[],
[with_speex=yes])
AS_IF([test "x$with_speex" != xno],
[AC_CHECK_HEADER([speex/speex.h], , AC_MSG_FAILURE([Missing speex development files. You may use --without-speex to compile without speex codec support.]))]
[AC_CHECK_LIB([speex], [speex_decode_int],
[],
[AC_MSG_FAILURE([libspeex link test failed. You may use --without-speex to compile without speex codec support.])])
])
AS_IF([test "x$with_speex" != xno], [PKG_CHECK_MODULES([SPEEX], [speex])])
AC_DEFINE_UNQUOTED([HAVE_SPEEX], `if test "x$with_speex" = "xyes"; then echo 1; else echo 0; fi`, [Define if you have libspeex])
AM_CONDITIONAL(BUILD_SPEEX, test "x$with_speex" = "xyes" )
......@@ -422,15 +417,11 @@ AC_ARG_WITH([speexdsp],
[],
[with_speexdsp=yes])
AS_IF([test "x$with_speexdsp" != xno],
AC_CHECK_HEADER([speex/speex_preprocess.h], , AC_MSG_FAILURE([Missing libspeexdsp development files used for Noise Suppression and Automatic Gain Control.]))
AC_SEARCH_LIBS([speex_preprocess_run], [speexdsp], [], [AC_MSG_ERROR([Unable to find speexdsp development files])])
)
AS_IF([test "x$with_speexdsp" != xno], [PKG_CHECK_MODULES([SPEEXDSP], [speexdsp])])
AC_DEFINE_UNQUOTED([HAVE_SPEEXDSP], `if test "x$with_speexdsp" = "xyes"; then echo 1; else echo 0; fi`, [Define if you have libspeexdsp])
AM_CONDITIONAL(BUILD_SPEEXDSP, test "x$with_speexdsp" = "xyes" )
dnl iLBC is enabled if it's installed
AC_ARG_WITH([with-libilbc],
[AS_HELP_STRING([--with-libilbc],
......
......@@ -39,6 +39,12 @@ libaudio_la_SOURCES = \
dcblocker.cpp
libaudio_la_CXXFLAGS = -I$(top_srcdir)/src
libaudio_la_LDFLAGS =
if BUILD_SPEEXDSP
libaudio_la_CXXFLAGS += @SPEEXDSP_CFLAGS@
libaudio_la_LDFLAGS += @SPEEXDSP_LIBS@
endif
noinst_HEADERS = \
audiobuffer.h \
......@@ -64,7 +70,7 @@ endif
if BUILD_JACK
libaudio_la_LIBADD += ./jack/libjacklayer.la
libaudio_la_LDFLAGS = @JACK_LIBS@ -pthread
libaudio_la_LDFLAGS += @JACK_LIBS@ -pthread
endif
if BUILD_ALSA
......@@ -73,5 +79,5 @@ endif
if BUILD_OPENSL
libaudio_la_LIBADD += ./opensl/libopensl.la
libaudio_la_LDFLAGS = -lOpenSLES
libaudio_la_LDFLAGS += -lOpenSLES
endif
......@@ -17,22 +17,22 @@ endif
if BUILD_SPEEX
SPEEX_NB_LIB = libcodec_speex_nb.so
libcodec_speex_nb_so_SOURCES = speexcodec_nb.cpp speexcodec.h
libcodec_speex_nb_so_CXXFLAGS = -fPIC -g -Wall $(SPEEXDSP)
libcodec_speex_nb_so_LDFLAGS = --shared -lc -lspeex
libcodec_speex_nb_so_CXXFLAGS = -fPIC -g -Wall @SPEEX_CFLAGS@
libcodec_speex_nb_so_LDFLAGS = --shared -lc @SPEEX_LIBS@
libcodec_speex_nb_so_LDADD = libcodecdescriptor.la
INSTALL_SPEEX_NB_RULE = install-libcodec_speex_nb_so
SPEEX_WB_LIB = libcodec_speex_wb.so
libcodec_speex_wb_so_SOURCES = speexcodec_wb.cpp speexcodec.h
libcodec_speex_wb_so_CXXFLAGS = -fPIC -g -Wall $(SPEEXDSP)
libcodec_speex_wb_so_LDFLAGS = --shared -lc -lspeex
libcodec_speex_wb_so_CXXFLAGS = -fPIC -g -Wall @SPEEX_CFLAGS@
libcodec_speex_wb_so_LDFLAGS = --shared -lc @SPEEX_LIBS@
libcodec_speex_wb_so_LDADD = libcodecdescriptor.la
INSTALL_SPEEX_WB_RULE = install-libcodec_speex_wb_so
SPEEX_UB_LIB = libcodec_speex_ub.so
libcodec_speex_ub_so_SOURCES = speexcodec_ub.cpp speexcodec.h
libcodec_speex_ub_so_CXXFLAGS = -fPIC -g -Wall $(SPEEXDSP)
libcodec_speex_ub_so_LDFLAGS = --shared -lc -lspeex
libcodec_speex_ub_so_CXXFLAGS = -fPIC -g -Wall @SPEEX_CFLAGS@
libcodec_speex_ub_so_LDFLAGS = --shared -lc @SPEEX_LIBS@
libcodec_speex_ub_so_LDADD = libcodecdescriptor.la
INSTALL_SPEEX_UB_RULE = install-libcodec_speex_ub_so
endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment