improve AC_C_DEFINE_CHECK to not try to evaluate the macro being checked for, but...
authorKevin P. Fleming <kpfleming@digium.com>
Wed, 2 Jan 2008 19:34:33 +0000 (19:34 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Wed, 2 Jan 2008 19:34:33 +0000 (19:34 +0000)
finish implementation of check for Zaptel HWGAIN support
add check for Zaptel ECHOCANCEL_PARAMS support

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

acinclude.m4
configure
configure.ac
include/asterisk/autoconfig.h.in

index f1df5e5..f094043 100644 (file)
@@ -100,7 +100,14 @@ AC_DEFUN([AST_C_DEFINE_CHECK],
        CPPFLAGS="${CPPFLAGS} ${$1_INCLUDE}"
 
        AC_COMPILE_IFELSE(
-           [ AC_LANG_PROGRAM( [#include <$3>], [int foo = $2;]) ],
+           [ AC_LANG_PROGRAM( [#include <$3>],
+                              [#if defined($2)
+                               int foo = 0;
+                               #else
+                               int foo = bar;
+                               #endif
+                               0
+                              ])],
            [   AC_MSG_RESULT(yes)
                PBX_$1=1
                AC_DEFINE([HAVE_$1], 1, [Define if your system has the $1 headers.])
index aa55e41..69fdc12 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.ac Revision: 95624 .
+# From configure.ac Revision: 95817 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.61 for asterisk 1.4.
 #
@@ -924,6 +924,14 @@ ZAPTEL_VLDTMF_LIB
 ZAPTEL_VLDTMF_INCLUDE
 ZAPTEL_VLDTMF_DIR
 PBX_ZAPTEL_VLDTMF
+ZAPTEL_HWGAIN_LIB
+ZAPTEL_HWGAIN_INCLUDE
+ZAPTEL_HWGAIN_DIR
+PBX_ZAPTEL_HWGAIN
+ZAPTEL_ECHOCANPARAMS_LIB
+ZAPTEL_ECHOCANPARAMS_INCLUDE
+ZAPTEL_ECHOCANPARAMS_DIR
+PBX_ZAPTEL_ECHOCANPARAMS
 SDL_LIB
 SDL_INCLUDE
 SDL_DIR
@@ -1614,9 +1622,14 @@ Optional Packages:
   --with-z=PATH           use zlib files in PATH
   --with-zaptel=PATH      use Zaptel files in PATH
   --with-zaptel_transcode=PATH
-                          use Zaptel_transcode files in PATH
+                          use Zaptel Transcoder Support files in PATH
   --with-zaptel_vldtmf=PATH
-                          use Zaptel_vldtmf files in PATH
+                          use Zaptel VLDTMF Support files in PATH
+  --with-zaptel_hwgain=PATH
+                          use Zaptel Hardware Gain Support files in PATH
+  --with-zaptel_echocanparams=PATH
+                          use Zaptel Echo Canceler Parameter Support files in
+                          PATH
   --with-sdl=PATH         use Sdl files in PATH
   --with-SDL_image=PATH   use Sdl Image library files in PATH
   --with-avcodec=PATH     use Ffmpeg and avcodec library files in PATH
@@ -9251,7 +9264,7 @@ fi
 
 
 
-    ZAPTEL_TRANSCODE_DESCRIP="Zaptel_transcode"
+    ZAPTEL_TRANSCODE_DESCRIP="Zaptel Transcoder Support"
     ZAPTEL_TRANSCODE_OPTION="zaptel_transcode"
 
 # Check whether --with-zaptel_transcode was given.
@@ -9279,7 +9292,7 @@ fi
 
 
 
-    ZAPTEL_VLDTMF_DESCRIP="Zaptel_vldtmf"
+    ZAPTEL_VLDTMF_DESCRIP="Zaptel VLDTMF Support"
     ZAPTEL_VLDTMF_OPTION="zaptel_vldtmf"
 
 # Check whether --with-zaptel_vldtmf was given.
@@ -9307,6 +9320,62 @@ fi
 
 
 
+    ZAPTEL_HWGAIN_DESCRIP="Zaptel Hardware Gain Support"
+    ZAPTEL_HWGAIN_OPTION="zaptel_hwgain"
+
+# Check whether --with-zaptel_hwgain was given.
+if test "${with_zaptel_hwgain+set}" = set; then
+  withval=$with_zaptel_hwgain;
+       case ${withval} in
+       n|no)
+       USE_ZAPTEL_HWGAIN=no
+       ;;
+       y|ye|yes)
+       ac_mandatory_list="${ac_mandatory_list} ZAPTEL_HWGAIN"
+       ;;
+       *)
+       ZAPTEL_HWGAIN_DIR="${withval}"
+       ac_mandatory_list="${ac_mandatory_list} ZAPTEL_HWGAIN"
+       ;;
+       esac
+
+fi
+
+    PBX_ZAPTEL_HWGAIN=0
+
+
+
+
+
+
+    ZAPTEL_ECHOCANPARAMS_DESCRIP="Zaptel Echo Canceler Parameter Support"
+    ZAPTEL_ECHOCANPARAMS_OPTION="zaptel_echocanparams"
+
+# Check whether --with-zaptel_echocanparams was given.
+if test "${with_zaptel_echocanparams+set}" = set; then
+  withval=$with_zaptel_echocanparams;
+       case ${withval} in
+       n|no)
+       USE_ZAPTEL_ECHOCANPARAMS=no
+       ;;
+       y|ye|yes)
+       ac_mandatory_list="${ac_mandatory_list} ZAPTEL_ECHOCANPARAMS"
+       ;;
+       *)
+       ZAPTEL_ECHOCANPARAMS_DIR="${withval}"
+       ac_mandatory_list="${ac_mandatory_list} ZAPTEL_ECHOCANPARAMS"
+       ;;
+       esac
+
+fi
+
+    PBX_ZAPTEL_ECHOCANPARAMS=0
+
+
+
+
+
+
 
     SDL_DESCRIP="Sdl"
     SDL_OPTION="sdl"
@@ -16600,7 +16669,13 @@ cat >>conftest.$ac_ext <<_ACEOF
 int
 main ()
 {
-int foo = PTHREAD_RWLOCK_INITIALIZER;
+#if defined(PTHREAD_RWLOCK_INITIALIZER)
+                               int foo = 0;
+                               #else
+                               int foo = bar;
+                               #endif
+                               0
+
   ;
   return 0;
 }
@@ -16669,7 +16744,13 @@ cat >>conftest.$ac_ext <<_ACEOF
 int
 main ()
 {
-int foo = PTHREAD_RWLOCK_PREFER_WRITER_NP;
+#if defined(PTHREAD_RWLOCK_PREFER_WRITER_NP)
+                               int foo = 0;
+                               #else
+                               int foo = bar;
+                               #endif
+                               0
+
   ;
   return 0;
 }
@@ -16738,7 +16819,13 @@ cat >>conftest.$ac_ext <<_ACEOF
 int
 main ()
 {
-int foo = PTHREAD_MUTEX_RECURSIVE_NP;
+#if defined(PTHREAD_MUTEX_RECURSIVE_NP)
+                               int foo = 0;
+                               #else
+                               int foo = bar;
+                               #endif
+                               0
+
   ;
   return 0;
 }
@@ -16807,7 +16894,13 @@ cat >>conftest.$ac_ext <<_ACEOF
 int
 main ()
 {
-int foo = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
+#if defined(PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP)
+                               int foo = 0;
+                               #else
+                               int foo = bar;
+                               #endif
+                               0
+
   ;
   return 0;
 }
@@ -17585,7 +17678,13 @@ cat >>conftest.$ac_ext <<_ACEOF
 int
 main ()
 {
-int foo = RTLD_NOLOAD;
+#if defined(RTLD_NOLOAD)
+                               int foo = 0;
+                               #else
+                               int foo = bar;
+                               #endif
+                               0
+
   ;
   return 0;
 }
@@ -17655,7 +17754,13 @@ cat >>conftest.$ac_ext <<_ACEOF
 int
 main ()
 {
-int foo = IP_MTU_DISCOVER;
+#if defined(IP_MTU_DISCOVER)
+                               int foo = 0;
+                               #else
+                               int foo = bar;
+                               #endif
+                               0
+
   ;
   return 0;
 }
@@ -33803,7 +33908,13 @@ cat >>conftest.$ac_ext <<_ACEOF
 int
 main ()
 {
-int foo = Fac_RESULT;
+#if defined(Fac_RESULT)
+                               int foo = 0;
+                               #else
+                               int foo = bar;
+                               #endif
+                               0
+
   ;
   return 0;
 }
@@ -33872,7 +33983,13 @@ cat >>conftest.$ac_ext <<_ACEOF
 int
 main ()
 {
-int foo = Fac_ERROR;
+#if defined(Fac_ERROR)
+                               int foo = 0;
+                               #else
+                               int foo = bar;
+                               #endif
+                               0
+
   ;
   return 0;
 }
@@ -44557,7 +44674,13 @@ cat >>conftest.$ac_ext <<_ACEOF
 int
 main ()
 {
-int foo = ZT_TONE_DTMF_BASE;
+#if defined(ZT_TONE_DTMF_BASE)
+                               int foo = 0;
+                               #else
+                               int foo = bar;
+                               #endif
+                               0
+
   ;
   return 0;
 }
@@ -44626,7 +44749,13 @@ cat >>conftest.$ac_ext <<_ACEOF
 int
 main ()
 {
-int foo = ZT_DIAL_OP_CANCEL;
+#if defined(ZT_DIAL_OP_CANCEL)
+                               int foo = 0;
+                               #else
+                               int foo = bar;
+                               #endif
+                               0
+
   ;
   return 0;
 }
@@ -44697,7 +44826,13 @@ cat >>conftest.$ac_ext <<_ACEOF
 int
 main ()
 {
-int foo = ZT_EVENT_REMOVED;
+#if defined(ZT_EVENT_REMOVED)
+                               int foo = 0;
+                               #else
+                               int foo = bar;
+                               #endif
+                               0
+
   ;
   return 0;
 }
@@ -44747,7 +44882,84 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
     fi
 
 
-# Check for transcode support
+# Check for echo canceler parameters support
+
+    if test "x${PBX_ZAPTEL_ECHOCANPARAMS}" != "x1" -a "${USE_ZAPTEL_ECHOCANPARAMS}" != "no"; then
+       { echo "$as_me:$LINENO: checking for ZT_ECHOCANCEL_PARAMS in zaptel/zaptel.h" >&5
+echo $ECHO_N "checking for ZT_ECHOCANCEL_PARAMS in zaptel/zaptel.h... $ECHO_C" >&6; }
+       saved_cppflags="${CPPFLAGS}"
+       if test "x${ZAPTEL_ECHOCANPARAMS_DIR}" != "x"; then
+           ZAPTEL_ECHOCANPARAMS_INCLUDE="-I${ZAPTEL_ECHOCANPARAMS_DIR}/include"
+       fi
+       CPPFLAGS="${CPPFLAGS} ${ZAPTEL_ECHOCANPARAMS_INCLUDE}"
+
+       cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <zaptel/zaptel.h>
+int
+main ()
+{
+#if defined(ZT_ECHOCANCEL_PARAMS)
+                               int foo = 0;
+                               #else
+                               int foo = bar;
+                               #endif
+                               0
+
+  ;
+  return 0;
+}
+_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
+     { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+               PBX_ZAPTEL_ECHOCANPARAMS=1
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_ZAPTEL_ECHOCANPARAMS 1
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_ZAPTEL_ECHOCANPARAMS_VERSION
+_ACEOF
+
+
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+              { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+       CPPFLAGS="${saved_cppflags}"
+    fi
+
+
+# Check for transcoder support
 
     if test "x${PBX_ZAPTEL_TRANSCODE}" != "x1" -a "${USE_ZAPTEL_TRANSCODE}" != "no"; then
        { echo "$as_me:$LINENO: checking for ZT_TCOP_ALLOCATE in zaptel/zaptel.h" >&5
@@ -44768,7 +44980,13 @@ cat >>conftest.$ac_ext <<_ACEOF
 int
 main ()
 {
-int foo = ZT_TCOP_ALLOCATE;
+#if defined(ZT_TCOP_ALLOCATE)
+                               int foo = 0;
+                               #else
+                               int foo = bar;
+                               #endif
+                               0
+
   ;
   return 0;
 }
@@ -44839,7 +45057,13 @@ cat >>conftest.$ac_ext <<_ACEOF
 int
 main ()
 {
-int foo = ZT_SET_HWGAIN;
+#if defined(ZT_SET_HWGAIN)
+                               int foo = 0;
+                               #else
+                               int foo = bar;
+                               #endif
+                               0
+
   ;
   return 0;
 }
@@ -49072,6 +49296,14 @@ ZAPTEL_VLDTMF_LIB!$ZAPTEL_VLDTMF_LIB$ac_delim
 ZAPTEL_VLDTMF_INCLUDE!$ZAPTEL_VLDTMF_INCLUDE$ac_delim
 ZAPTEL_VLDTMF_DIR!$ZAPTEL_VLDTMF_DIR$ac_delim
 PBX_ZAPTEL_VLDTMF!$PBX_ZAPTEL_VLDTMF$ac_delim
+ZAPTEL_HWGAIN_LIB!$ZAPTEL_HWGAIN_LIB$ac_delim
+ZAPTEL_HWGAIN_INCLUDE!$ZAPTEL_HWGAIN_INCLUDE$ac_delim
+ZAPTEL_HWGAIN_DIR!$ZAPTEL_HWGAIN_DIR$ac_delim
+PBX_ZAPTEL_HWGAIN!$PBX_ZAPTEL_HWGAIN$ac_delim
+ZAPTEL_ECHOCANPARAMS_LIB!$ZAPTEL_ECHOCANPARAMS_LIB$ac_delim
+ZAPTEL_ECHOCANPARAMS_INCLUDE!$ZAPTEL_ECHOCANPARAMS_INCLUDE$ac_delim
+ZAPTEL_ECHOCANPARAMS_DIR!$ZAPTEL_ECHOCANPARAMS_DIR$ac_delim
+PBX_ZAPTEL_ECHOCANPARAMS!$PBX_ZAPTEL_ECHOCANPARAMS$ac_delim
 SDL_LIB!$SDL_LIB$ac_delim
 SDL_INCLUDE!$SDL_INCLUDE$ac_delim
 SDL_DIR!$SDL_DIR$ac_delim
@@ -49117,7 +49349,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` = 56; then
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 64; then
     break
   elif $ac_last_try; then
     { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
index 1a64cf5..19d12cb 100644 (file)
@@ -250,8 +250,10 @@ AST_EXT_LIB_SETUP([VPB], [Voicetronix API], [vpb])
 AST_EXT_LIB_SETUP([X11], [X11 support], [x11])
 AST_EXT_LIB_SETUP([ZLIB], [zlib], [z])
 AST_EXT_LIB_SETUP([ZAPTEL], [Zaptel], [zaptel])
-AST_EXT_LIB_SETUP([ZAPTEL_TRANSCODE], [Zaptel_transcode], [zaptel_transcode])
-AST_EXT_LIB_SETUP([ZAPTEL_VLDTMF], [Zaptel_vldtmf], [zaptel_vldtmf])
+AST_EXT_LIB_SETUP([ZAPTEL_TRANSCODE], [Zaptel Transcoder Support], [zaptel_transcode])
+AST_EXT_LIB_SETUP([ZAPTEL_VLDTMF], [Zaptel VLDTMF Support], [zaptel_vldtmf])
+AST_EXT_LIB_SETUP([ZAPTEL_HWGAIN], [Zaptel Hardware Gain Support], [zaptel_hwgain])
+AST_EXT_LIB_SETUP([ZAPTEL_ECHOCANPARAMS], [Zaptel Echo Canceler Parameter Support], [zaptel_echocanparams])
 
 AST_EXT_LIB_SETUP([SDL], [Sdl], [sdl])
 AST_EXT_LIB_SETUP([SDL_IMAGE], [Sdl Image library], [SDL_image])
@@ -1143,7 +1145,10 @@ AST_C_DEFINE_CHECK([ZAPTEL], [ZT_DIAL_OP_CANCEL], [zaptel/zaptel.h], [90])
 # Check for VLDTMF support
 AST_C_DEFINE_CHECK([ZAPTEL_VLDTMF], [ZT_EVENT_REMOVED], [zaptel/zaptel.h])
 
-# Check for transcode support
+# Check for echo canceler parameters support
+AST_C_DEFINE_CHECK([ZAPTEL_ECHOCANPARAMS], [ZT_ECHOCANCEL_PARAMS], [zaptel/zaptel.h])
+
+# Check for transcoder support
 AST_C_DEFINE_CHECK([ZAPTEL_TRANSCODE], [ZT_TCOP_ALLOCATE], [zaptel/zaptel.h])
 
 # Check for Zaptel hwgain support
index 16697b4..d7251ab 100644 (file)
 /* Define this to indicate the ${ZAPTEL_DESCRIP} library */
 #undef HAVE_ZAPTEL
 
+/* Define if your system has the ZAPTEL_ECHOCANPARAMS headers. */
+#undef HAVE_ZAPTEL_ECHOCANPARAMS
+
+/* Define ZAPTEL_ECHOCANPARAMS headers version */
+#undef HAVE_ZAPTEL_ECHOCANPARAMS_VERSION
+
 /* Define if your system has the ZAPTEL_HWGAIN headers. */
 #undef HAVE_ZAPTEL_HWGAIN