Skip to content

Commit

Permalink
Add detection of libspeex, libgsm and libboost. Add --without-speex a…
Browse files Browse the repository at this point in the history
…nd --without-gsm
  • Loading branch information
benoitg committed Feb 20, 2008
1 parent 95a8c71 commit eeaf86e
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 55 deletions.
67 changes: 46 additions & 21 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ dnl
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
AC_INIT([SFLPhone],[0.7],[sflphoneteam@savoirfairelinux.com],[sflphone])
AC_COPYRIGHT([[Copyright (c) Savoir-Faire Linux 2004-2007]])
AC_COPYRIGHT([[Copyright (c) Savoir-Faire Linux 2004-2008]])
AC_REVISION([$Revision$])

dnl Compute canonical system name
Expand Down Expand Up @@ -192,27 +192,52 @@ PKG_CHECK_MODULES(libdbuscpp, dbus-c++-1 >= ${LIBDBUSCPP_MIN_VERSION})
SFLPHONE_CFLAGS="$SFLPHONE_CFLAGS $libdbuscpp_CFLAGS"
SFLPHONE_LIBS="$SFLPHONE_LIBS $libdbuscpp_LIBS"

dnl Check for speex
AC_ARG_ENABLE(speex,
AS_HELP_STRING(
[--enable-speex],
[compile with speex codec @<:@default=no@:>@]
),
[with_speex=$enableval],
[with_speex=no]
)
# check for libboost (doesn't use pkg-config)
AC_CHECK_HEADER(boost/tokenizer.hpp, , AC_MSG_ERROR("Unable to find the libboost tokenizer headers; you may need to install the libboost-dev package" ) )

# check for libgsm1 (doesn't use pkg-config)
dnl Check for libspeex
AC_ARG_WITH([gsm],
[AS_HELP_STRING([--without-gsm],
[disable support for gsm codec])],
[],
[with_gsm=yes])

LIBGSM=
AS_IF([test "x$with_gsm" != xno],
[AC_CHECK_HEADER([gsm.h], , AC_MSG_FAILURE([Unable to find the libgsm1 headers (you may need to install the dev package). You may use --without-gsm to compile without gsm codec support.]))]
[AC_CHECK_LIB([gsm], [gsm_decode],
[],
[AC_MSG_FAILURE(
[libgsm link test failed. You may use --without-gsm to compile without gsm codec support.])]
)
]
)

AC_DEFINE([HAVE_GSM], test "x$with_gsm" = "xyes", [Define if you have libgsm])
AM_CONDITIONAL(BUILD_GSM, test "x$with_gsm" = "xyes" )

dnl Check for libspeex
AC_ARG_WITH([speex],
[AS_HELP_STRING([--without-speex],
[disable support for speex codec])],
[],
[with_speex=yes])

LIBSPEEX=
AS_IF([test "x$with_speex" != xno],
[AC_CHECK_HEADER([speex/speex.h], , AC_MSG_FAILURE([Unable to find the libspeex headers (you may need to install the dev package). 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.])]
)
]
)

AC_DEFINE([HAVE_SPEEX], test "x$with_speex" = "xyes", [Define if you have libspeex])
AM_CONDITIONAL(BUILD_SPEEX, test "x$with_speex" = "xyes" )

if test "x$with_speex" = "xyes" ; then
AC_CHECK_HEADER([speex/speex.h], [
AC_CHECK_LIB(speex, speex_decode_int,
[
with_speex=yes
], [ with_speex=no ]
)
], [ with_speex=no ]
)
fi
AM_CONDITIONAL(USE_SPEEX, test "x$with_speex" = "xyes" )

dnl Check for IAX
AC_ARG_ENABLE(iax2,
Expand Down
24 changes: 0 additions & 24 deletions m4/speex.m4

This file was deleted.

25 changes: 15 additions & 10 deletions src/audio/codecs/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
sflcodecdir = $(libdir)/sflphone/codecs

noinst_PROGRAMS = libcodec_ulaw.so libcodec_alaw.so libcodec_gsm.so libcodec_speex.so libcodec_ilbc.so
if BUILD_GSM
GSM_LIB = libcodec_gsm.so
libcodec_gsm_so_SOURCES = gsmcodec.cpp
libcodec_gsm_so_CFLAGS = -fPIC -g -Wall
libcodec_gsm_so_LDFLAGS = -shared -lc -lgsm
endif

if BUILD_SPEEX
SPEEX_LIB = libcodec_speex.so
libcodec_speex_so_SOURCES = speexcodec.cpp
libcodec_speex_so_CFLAGS = -fPIC -g -Wall
libcodec_speex_so_LDFLAGS = -shared -lc -lspeex
endif

noinst_PROGRAMS = libcodec_ulaw.so libcodec_alaw.so $(GSM_LIB) $(SPEEX_LIB) libcodec_ilbc.so

noinst_HEADERS = audiocodec.h

Expand All @@ -12,14 +25,6 @@ libcodec_alaw_so_SOURCES = alaw.cpp
libcodec_alaw_so_CFLAGS = -fPIC -g -Wall
libcodec_alaw_so_LDFLAGS = -shared -lc

libcodec_gsm_so_SOURCES = gsmcodec.cpp
libcodec_gsm_so_CFLAGS = -fPIC -g -Wall
libcodec_gsm_so_LDFLAGS = -shared -lc -lgsm

libcodec_speex_so_SOURCES = speexcodec.cpp
libcodec_speex_so_CFLAGS = -fPIC -g -Wall
libcodec_speex_so_LDFLAGS = -shared -lc -lspeex

libcodec_ilbc_so_SOURCES = ilbc.cpp
libcodec_ilbc_so_CFLAGS = -fPIC -g -Wall
libcodec_ilbc_so_LDFLAGS = -shared ilbc/*.o -lc
Expand Down

0 comments on commit eeaf86e

Please sign in to comment.