Merged revisions 115327 via svnmerge from
authorJoshua Colp <jcolp@digium.com>
Mon, 5 May 2008 22:13:57 +0000 (22:13 +0000)
committerJoshua Colp <jcolp@digium.com>
Mon, 5 May 2008 22:13:57 +0000 (22:13 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r115327 | file | 2008-05-05 19:10:05 -0300 (Mon, 05 May 2008) | 2 lines

Make sure that either the main speex library contains preprocess functions or that speexdsp does. If both fail then speex stuff can not be built.

........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@115328 65c4cc65-6c06-0410-ace0-fbb531ad65f3

build_tools/menuselect-deps.in
codecs/codec_speex.c
configure
configure.ac
funcs/func_speex.c
include/asterisk/autoconfig.h.in

index f724fe3..aa76d56 100644 (file)
@@ -32,6 +32,7 @@ PRI=@PBX_PRI@
 RADIUS=@PBX_RADIUS@
 SPEEX=@PBX_SPEEX@
 SPEEXDSP=@PBX_SPEEXDSP@
+SPEEX_PREPROCESS=@PBX_SPEEX_PREPROCESS@
 SQLITE3=@PBX_SQLITE3@
 SQLITE=@PBX_SQLITE@
 SS7=@PBX_SS7@
index 035f995..4946931 100644 (file)
@@ -32,6 +32,7 @@
 
 /*** MODULEINFO
        <depend>speex</depend>
+       <depend>speex_preprocess</depend>
        <use>speexdsp</use>
  ***/
 
index 2627f05..d0478dc 100755 (executable)
--- a/configure
+++ b/configure
@@ -963,6 +963,7 @@ OPENH323_INCDIR
 OPENH323_LIBDIR
 OPENH323_SUFFIX
 OPENH323_BUILD
+PBX_SPEEX_PREPROCESS
 CONFIG_GMIME
 PBX_ZAPTEL_VLDTMF
 PBX_ZAPTEL_ECHOCANPARAMS
@@ -41742,6 +41743,272 @@ _ACEOF
 fi
 
 
+# See if the main speex library contains the preprocess functions
+
+if test "x${PBX_SPEEX_PREPROCESS}" != "x1" -a "${USE_SPEEX_PREPROCESS}" != "no"; then
+   pbxlibdir=""
+   # if --with-SPEEX_PREPROCESS=DIR has been specified, use it.
+   if test "x${SPEEX_PREPROCESS_DIR}" != "x"; then
+      if test -d ${SPEEX_PREPROCESS_DIR}/lib; then
+        pbxlibdir="-L${SPEEX_PREPROCESS_DIR}/lib"
+      else
+        pbxlibdir="-L${SPEEX_PREPROCESS_DIR}"
+      fi
+   fi
+   pbxfuncname="speex/speex.h"
+   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
+      AST_SPEEX_PREPROCESS_FOUND=yes
+   else
+      as_ac_Lib=`echo "ac_cv_lib_speex_preprocess_ctl_${pbxfuncname}" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for ${pbxfuncname} in -lspeex_preprocess_ctl" >&5
+echo $ECHO_N "checking for ${pbxfuncname} in -lspeex_preprocess_ctl... $ECHO_C" >&6; }
+if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lspeex_preprocess_ctl ${pbxlibdir}  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  eval "$as_ac_Lib=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       eval "$as_ac_Lib=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+ac_res=`eval echo '${'$as_ac_Lib'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_Lib'}'` = yes; then
+  AST_SPEEX_PREPROCESS_FOUND=yes
+else
+  AST_SPEEX_PREPROCESS_FOUND=no
+fi
+
+   fi
+
+   # now check for the header.
+   if test "${AST_SPEEX_PREPROCESS_FOUND}" = "yes"; then
+      SPEEX_PREPROCESS_LIB="${pbxlibdir} -lspeex_preprocess_ctl "
+      # if --with-SPEEX_PREPROCESS=DIR has been specified, use it.
+      if test "x${SPEEX_PREPROCESS_DIR}" != "x"; then
+        SPEEX_PREPROCESS_INCLUDE="-I${SPEEX_PREPROCESS_DIR}/include"
+      fi
+      SPEEX_PREPROCESS_INCLUDE="${SPEEX_PREPROCESS_INCLUDE} "
+      if test "x-lm" = "x" ; then      # no header, assume found
+         SPEEX_PREPROCESS_HEADER_FOUND="1"
+      else                             # check for the header
+         saved_cppflags="${CPPFLAGS}"
+         CPPFLAGS="${CPPFLAGS} ${SPEEX_PREPROCESS_INCLUDE} "
+        if test "${ac_cv_header__lm+set}" = set; then
+  { echo "$as_me:$LINENO: checking for -lm" >&5
+echo $ECHO_N "checking for -lm... $ECHO_C" >&6; }
+if test "${ac_cv_header__lm+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header__lm" >&5
+echo "${ECHO_T}$ac_cv_header__lm" >&6; }
+else
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking -lm usability" >&5
+echo $ECHO_N "checking -lm usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <-lm>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking -lm presence" >&5
+echo $ECHO_N "checking -lm presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <-lm>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: -lm: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: -lm: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: -lm: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: -lm: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: -lm: present but cannot be compiled" >&5
+echo "$as_me: WARNING: -lm: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: -lm:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: -lm:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: -lm: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: -lm: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: -lm:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: -lm:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: -lm: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: -lm: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: -lm: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: -lm: in the future, the compiler will take precedence" >&2;}
+    ( cat <<\_ASBOX
+## ------------------------------- ##
+## Report this to www.asterisk.org ##
+## ------------------------------- ##
+_ASBOX
+     ) | sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for -lm" >&5
+echo $ECHO_N "checking for -lm... $ECHO_C" >&6; }
+if test "${ac_cv_header__lm+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_header__lm=$ac_header_preproc
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header__lm" >&5
+echo "${ECHO_T}$ac_cv_header__lm" >&6; }
+
+fi
+if test $ac_cv_header__lm = yes; then
+  SPEEX_PREPROCESS_HEADER_FOUND=1
+else
+  SPEEX_PREPROCESS_HEADER_FOUND=0
+fi
+
+
+         CPPFLAGS="${saved_cppflags}"
+      fi
+      if test "x${SPEEX_PREPROCESS_HEADER_FOUND}" = "x0" ; then
+         SPEEX_PREPROCESS_LIB=""
+         SPEEX_PREPROCESS_INCLUDE=""
+      else
+         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
+           SPEEX_PREPROCESS_LIB=""
+        fi
+         PBX_SPEEX_PREPROCESS=1
+         # XXX don't know how to evaluate the description (third argument) in AC_DEFINE_UNQUOTED
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_SPEEX_PREPROCESS 1
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_SPEEX_PREPROCESS_VERSION
+_ACEOF
+
+      fi
+   fi
+fi
+
+if test "${PBX_SPEEX_PREPROCESS}" = 1; then
+   PBX_SPEEX_PREPROCESS=1
+fi
+
 
 if test "x${PBX_SPEEXDSP}" != "x1" -a "${USE_SPEEXDSP}" != "no"; then
    pbxlibdir=""
@@ -42003,6 +42270,11 @@ _ACEOF
    fi
 fi
 
+if test "${PBX_SPEEXDSP}" = 1; then
+   PBX_SPEEX_PREPROCESS=1
+fi
+
+
 
 
 if test "x${PBX_SQLITE}" != "x1" -a "${USE_SQLITE}" != "no"; then
@@ -50727,6 +50999,7 @@ OPENH323_INCDIR!$OPENH323_INCDIR$ac_delim
 OPENH323_LIBDIR!$OPENH323_LIBDIR$ac_delim
 OPENH323_SUFFIX!$OPENH323_SUFFIX$ac_delim
 OPENH323_BUILD!$OPENH323_BUILD$ac_delim
+PBX_SPEEX_PREPROCESS!$PBX_SPEEX_PREPROCESS$ac_delim
 CONFIG_GMIME!$CONFIG_GMIME$ac_delim
 PBX_ZAPTEL_VLDTMF!$PBX_ZAPTEL_VLDTMF$ac_delim
 PBX_ZAPTEL_ECHOCANPARAMS!$PBX_ZAPTEL_ECHOCANPARAMS$ac_delim
@@ -50743,7 +51016,7 @@ CURL_CONFIG!$CURL_CONFIG$ac_delim
 LTLIBOBJS!$LTLIBOBJS$ac_delim
 _ACEOF
 
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 67; then
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 68; then
     break
   elif $ac_last_try; then
     { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
index 6dbd99b..9f5428a 100644 (file)
@@ -1314,7 +1314,18 @@ AST_EXT_LIB_CHECK([RADIUS], [radiusclient-ng], [rc_read_config], [radiusclient-n
 
 AST_EXT_LIB_CHECK([SPEEX], [speex], [speex_encode], [speex/speex.h], [-lm])
 
+# See if the main speex library contains the preprocess functions
+AST_EXT_LIB_CHECK([SPEEX_PREPROCESS], [speex_preprocess_ctl], [speex/speex.h], [-lm])
+if test "${PBX_SPEEX_PREPROCESS}" = 1; then
+   PBX_SPEEX_PREPROCESS=1
+fi
+
 AST_EXT_LIB_CHECK([SPEEXDSP], [speexdsp], [speex_preprocess_ctl], [speex/speex.h], [-lm])
+if test "${PBX_SPEEXDSP}" = 1; then
+   PBX_SPEEX_PREPROCESS=1
+fi
+
+AC_SUBST(PBX_SPEEX_PREPROCESS)
 
 AST_EXT_LIB_CHECK([SQLITE], [sqlite], [sqlite_exec], [sqlite.h])
 
index 81cba38..afceb98 100644 (file)
@@ -31,6 +31,8 @@
 
 /*** MODULEINFO
        <depend>speex</depend>
+       <depend>speex_preprocess</depend>
+       <use>speexdsp</use>
  ***/
 
 #include "asterisk.h"
index d4806a5..4b4d37b 100644 (file)
 /* Define to indicate the ${SPEEXDSP_DESCRIP} library version */
 #undef HAVE_SPEEXDSP_VERSION
 
+/* Define this to indicate the ${SPEEX_PREPROCESS_DESCRIP} library */
+#undef HAVE_SPEEX_PREPROCESS
+
+/* Define to indicate the ${SPEEX_PREPROCESS_DESCRIP} library version */
+#undef HAVE_SPEEX_PREPROCESS_VERSION
+
 /* Define to indicate the ${SPEEX_DESCRIP} library version */
 #undef HAVE_SPEEX_VERSION