Binaural synthesis (confbridge): Adds libfftw3 as dependency.

Adds libfftw3 to the build chain that is is going to be used for binaural
synthesis by bridge_softmix.

ASTERISK-26292

Change-Id: Iedc2f174e4ccb39ae5d9e698e339c6a17155867b
This commit is contained in:
frahaase 2016-08-12 18:22:40 +02:00 committed by Joshua Colp
parent 8b58db0962
commit dd6fc1bb7d
5 changed files with 175 additions and 1 deletions

View File

@ -54,6 +54,7 @@ PORTAUDIO=@PBX_PORTAUDIO@
PRI=@PBX_PRI@
OPENR2=@PBX_OPENR2@
RESAMPLE=@PBX_RESAMPLE@
FFTW3=@PBX_FFTW3@
RADIUS=@PBX_RADIUS@
LAUNCHD=@PBX_LAUNCHD@
SPANDSP=@PBX_SPANDSP@

161
configure vendored
View File

@ -841,6 +841,10 @@ PBX_RESAMPLE
RESAMPLE_DIR
RESAMPLE_INCLUDE
RESAMPLE_LIB
PBX_FFTW3
FFTW3_DIR
FFTW3_INCLUDE
FFTW3_LIB
PBX_RADIUS
RADIUS_DIR
RADIUS_INCLUDE
@ -1330,6 +1334,7 @@ infodir
docdir
oldincludedir
includedir
runstatedir
localstatedir
sharedstatedir
sysconfdir
@ -1412,6 +1417,7 @@ with_portaudio
with_pri
with_pwlib
with_radius
with_fftw3
with_resample
with_sdl
with_SDL_image
@ -1511,6 +1517,7 @@ datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
runstatedir='${localstatedir}/run'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@ -1763,6 +1770,15 @@ do
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
-runstatedir | --runstatedir | --runstatedi | --runstated \
| --runstate | --runstat | --runsta | --runst | --runs \
| --run | --ru | --r)
ac_prev=runstatedir ;;
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
| --run=* | --ru=* | --r=*)
runstatedir=$ac_optarg ;;
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@ -1900,7 +1916,7 @@ fi
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
libdir localedir mandir
libdir localedir mandir runstatedir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
@ -2053,6 +2069,7 @@ Fine tuning of the installation directories:
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
@ -2160,6 +2177,7 @@ Optional Packages:
--with-pri=PATH use ISDN PRI files in PATH
--with-pwlib=PATH use PWlib files in PATH
--with-radius=PATH use Radius Client files in PATH
--with-fftw3=PATH use LIBFFTW3 files in PATH
--with-resample=PATH use LIBRESAMPLE files in PATH
--with-sdl=PATH use Sdl files in PATH
--with-SDL_image=PATH use Sdl Image files in PATH
@ -11802,6 +11820,38 @@ fi
FFTW3_DESCRIP="LIBFFTW3"
FFTW3_OPTION="fftw3"
PBX_FFTW3=0
# Check whether --with-fftw3 was given.
if test "${with_fftw3+set}" = set; then :
withval=$with_fftw3;
case ${withval} in
n|no)
USE_FFTW3=no
# -1 is a magic value used by menuselect to know that the package
# was disabled, other than 'not found'
PBX_FFTW3=-1
;;
y|ye|yes)
ac_mandatory_list="${ac_mandatory_list} FFTW3"
;;
*)
FFTW3_DIR="${withval}"
ac_mandatory_list="${ac_mandatory_list} FFTW3"
;;
esac
fi
RESAMPLE_DESCRIP="LIBRESAMPLE"
RESAMPLE_OPTION="resample"
PBX_RESAMPLE=0
@ -28971,6 +29021,115 @@ fi
if test "x${PBX_FFTW3}" != "x1" -a "${USE_FFTW3}" != "no"; then
pbxlibdir=""
# if --with-FFTW3=DIR has been specified, use it.
if test "x${FFTW3_DIR}" != "x"; then
if test -d ${FFTW3_DIR}/lib; then
pbxlibdir="-L${FFTW3_DIR}/lib"
else
pbxlibdir="-L${FFTW3_DIR}"
fi
fi
pbxfuncname="fftw_alloc_real"
if test "x${pbxfuncname}" = "x" ; then # empty lib, assume only headers
AST_FFTW3_FOUND=yes
else
ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
CFLAGS="${CFLAGS} "
as_ac_Lib=`$as_echo "ac_cv_lib_fftw3_${pbxfuncname}" | $as_tr_sh`
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lfftw3" >&5
$as_echo_n "checking for ${pbxfuncname} in -lfftw3... " >&6; }
if eval \${$as_ac_Lib+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lfftw3 ${pbxlibdir} -lfftw3 $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char ${pbxfuncname} ();
int
main ()
{
return ${pbxfuncname} ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
eval "$as_ac_Lib=yes"
else
eval "$as_ac_Lib=no"
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
eval ac_res=\$$as_ac_Lib
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then :
AST_FFTW3_FOUND=yes
else
AST_FFTW3_FOUND=no
fi
CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
fi
# now check for the header.
if test "${AST_FFTW3_FOUND}" = "yes"; then
FFTW3_LIB="${pbxlibdir} -lfftw3 -lfftw3"
# if --with-FFTW3=DIR has been specified, use it.
if test "x${FFTW3_DIR}" != "x"; then
FFTW3_INCLUDE="-I${FFTW3_DIR}/include"
fi
FFTW3_INCLUDE="${FFTW3_INCLUDE} "
if test "xfftw3.h" = "x" ; then # no header, assume found
FFTW3_HEADER_FOUND="1"
else # check for the header
ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
CPPFLAGS="${CPPFLAGS} ${FFTW3_INCLUDE}"
ac_fn_c_check_header_mongrel "$LINENO" "fftw3.h" "ac_cv_header_fftw3_h" "$ac_includes_default"
if test "x$ac_cv_header_fftw3_h" = xyes; then :
FFTW3_HEADER_FOUND=1
else
FFTW3_HEADER_FOUND=0
fi
CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
fi
if test "x${FFTW3_HEADER_FOUND}" = "x0" ; then
FFTW3_LIB=""
FFTW3_INCLUDE=""
else
if test "x${pbxfuncname}" = "x" ; then # only checking headers -> no library
FFTW3_LIB=""
fi
PBX_FFTW3=1
cat >>confdefs.h <<_ACEOF
#define HAVE_FFTW3 1
_ACEOF
fi
fi
fi
if test "$PBX_FFTW3" = "1"; then
$as_echo "#define HAVE_FFTW 1" >>confdefs.h
fi
if test "x${PBX_SPANDSP}" != "x1" -a "${USE_SPANDSP}" != "no"; then
if test "xminimum version of SpanDSP" != "x"; then

View File

@ -538,6 +538,7 @@ AST_EXT_LIB_SETUP_OPTIONAL([PRI_REVERSE_CHARGE], [ISDN reverse charge], [PRI], [
# ------------------------------------^
AST_EXT_LIB_SETUP([PWLIB], [PWlib], [pwlib])
AST_EXT_LIB_SETUP([RADIUS], [Radius Client], [radius])
AST_EXT_LIB_SETUP([FFTW3], [LIBFFTW3], [fftw3])
AST_EXT_LIB_SETUP([RESAMPLE], [LIBRESAMPLE], [resample])
AST_EXT_LIB_SETUP([SDL], [Sdl], [sdl])
AST_EXT_LIB_SETUP([SDL_IMAGE], [Sdl Image], [SDL_image])
@ -2270,6 +2271,10 @@ AST_EXT_LIB_CHECK([PRI_REVERSE_CHARGE], [pri], [pri_sr_set_reversecharge], [libp
# ------------------------------------^
AST_EXT_LIB_CHECK([RESAMPLE], [resample], [resample_open], [libresample.h], [-lm])
AST_EXT_LIB_CHECK([FFTW3], [fftw3], [fftw_alloc_real], [fftw3.h], [-lfftw3])
if test "$PBX_FFTW3" = "1"; then
AC_DEFINE([HAVE_FFTW], 1, [Define 1 if your system has fftw.])
fi
AST_C_COMPILE_CHECK([SPANDSP], [
#if SPANDSP_RELEASE_DATE < 20080516

View File

@ -239,6 +239,12 @@
/* Define to 1 if you have the `ffsll' function. */
#undef HAVE_FFSLL
/* Define 1 if your system has fftw. */
#undef HAVE_FFTW
/* Define to 1 if you have the LIBFFTW3 library. */
#undef HAVE_FFTW3
/* Define to 1 if you have the `floor' function. */
#undef HAVE_FLOOR

View File

@ -259,6 +259,9 @@ PYTHONDEV_LIB=@PYTHONDEV_LIB@
RESAMPLE_INCLUDE=@RESAMPLE_INCLUDE@
RESAMPLE_LIB=@RESAMPLE_LIB@
FFTW3_INCLUDE=@FFTW3_INCLUDE@
FFTW3_LIB=@FFTW3_LIB@
RT_LIB=@RT_LIB@
SS7_INCLUDE=@SS7_INCLUDE@