diff options
author | Sean Bright <sean@malleable.com> | 2014-10-27 17:54:32 +0000 |
---|---|---|
committer | Sean Bright <sean@malleable.com> | 2014-10-27 17:54:32 +0000 |
commit | 88d9d3f1fc8352c7348a7616f2b35e3a99081fb4 (patch) | |
tree | f49690c7860552720479ccd8dab6fc8eab254349 /configure | |
parent | b23580afe68a42dd4b465a010d09928e5999cde1 (diff) |
configure: Add autoconf check for libopus.
Because opus transcoding support cannot be included in the standard Asterisk
distribution, a few codec_opus implementations have popped up. To make it
easier for people to drop in opus support in their own installations, this
patch adds configure checks for libopus.
Review: https://reviewboard.asterisk.org/r/4106/
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@426234 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 155 |
1 files changed, 149 insertions, 6 deletions
@@ -1,5 +1,5 @@ #! /bin/sh -# From configure.ac Revision: 421230 . +# From configure.ac Revision: 425965 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for asterisk trunk. # @@ -930,6 +930,10 @@ PBX_OSPTK OSPTK_DIR OSPTK_INCLUDE OSPTK_LIB +PBX_OPUS +OPUS_DIR +OPUS_INCLUDE +OPUS_LIB PBX_OPENR2 OPENR2_DIR OPENR2_INCLUDE @@ -1315,6 +1319,7 @@ with_netsnmp with_newt with_ogg with_openr2 +with_opus with_osptk with_oss with_postgres @@ -2052,6 +2057,7 @@ Optional Packages: --with-newt=PATH use newt files in PATH --with-ogg=PATH use OGG files in PATH --with-openr2=PATH use MFR2 files in PATH + --with-opus=PATH use Opus files in PATH --with-osptk=PATH use OSP Toolkit files in PATH --with-oss=PATH use Open Sound System files in PATH --with-postgres=PATH use PostgreSQL files in PATH @@ -10048,6 +10054,38 @@ fi + OPUS_DESCRIP="Opus" + OPUS_OPTION="opus" + PBX_OPUS=0 + +# Check whether --with-opus was given. +if test "${with_opus+set}" = set; then : + withval=$with_opus; + case ${withval} in + n|no) + USE_OPUS=no + # -1 is a magic value used by menuselect to know that the package + # was disabled, other than 'not found' + PBX_OPUS=-1 + ;; + y|ye|yes) + ac_mandatory_list="${ac_mandatory_list} OPUS" + ;; + *) + OPUS_DIR="${withval}" + ac_mandatory_list="${ac_mandatory_list} OPUS" + ;; + esac + +fi + + + + + + + + OSPTK_DESCRIP="OSP Toolkit" OSPTK_OPTION="osptk" PBX_OSPTK=0 @@ -13248,7 +13286,7 @@ else We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -13294,7 +13332,7 @@ else We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -13318,7 +13356,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -13363,7 +13401,7 @@ else We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -13387,7 +13425,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -26939,6 +26977,111 @@ fi + +if test "x${PBX_OPUS}" != "x1" -a "${USE_OPUS}" != "no"; then + pbxlibdir="" + # if --with-OPUS=DIR has been specified, use it. + if test "x${OPUS_DIR}" != "x"; then + if test -d ${OPUS_DIR}/lib; then + pbxlibdir="-L${OPUS_DIR}/lib" + else + pbxlibdir="-L${OPUS_DIR}" + fi + fi + pbxfuncname="opus_encoder_create" + if test "x${pbxfuncname}" = "x" ; then # empty lib, assume only headers + AST_OPUS_FOUND=yes + else + ast_ext_lib_check_save_CFLAGS="${CFLAGS}" + CFLAGS="${CFLAGS} " + as_ac_Lib=`$as_echo "ac_cv_lib_opus_${pbxfuncname}" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lopus" >&5 +$as_echo_n "checking for ${pbxfuncname} in -lopus... " >&6; } +if eval \${$as_ac_Lib+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lopus ${pbxlibdir} $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_OPUS_FOUND=yes +else + AST_OPUS_FOUND=no +fi + + CFLAGS="${ast_ext_lib_check_save_CFLAGS}" + fi + + # now check for the header. + if test "${AST_OPUS_FOUND}" = "yes"; then + OPUS_LIB="${pbxlibdir} -lopus " + # if --with-OPUS=DIR has been specified, use it. + if test "x${OPUS_DIR}" != "x"; then + OPUS_INCLUDE="-I${OPUS_DIR}/include" + fi + OPUS_INCLUDE="${OPUS_INCLUDE} " + if test "xopus/opus.h" = "x" ; then # no header, assume found + OPUS_HEADER_FOUND="1" + else # check for the header + ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" + CPPFLAGS="${CPPFLAGS} ${OPUS_INCLUDE}" + ac_fn_c_check_header_mongrel "$LINENO" "opus/opus.h" "ac_cv_header_opus_opus_h" "$ac_includes_default" +if test "x$ac_cv_header_opus_opus_h" = xyes; then : + OPUS_HEADER_FOUND=1 +else + OPUS_HEADER_FOUND=0 +fi + + + CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" + fi + if test "x${OPUS_HEADER_FOUND}" = "x0" ; then + OPUS_LIB="" + OPUS_INCLUDE="" + else + if test "x${pbxfuncname}" = "x" ; then # only checking headers -> no library + OPUS_LIB="" + fi + PBX_OPUS=1 + cat >>confdefs.h <<_ACEOF +#define HAVE_OPUS 1 +_ACEOF + + fi + fi +fi + + + if test "${USE_PWLIB}" != "no"; then if test -n "${PWLIB_DIR}"; then PWLIBDIR="${PWLIB_DIR}" |