Add protection to chan_zap build when NEONMWI events are not defined
authorDoug Bailey <dbailey@digium.com>
Fri, 22 Feb 2008 23:56:55 +0000 (23:56 +0000)
committerDoug Bailey <dbailey@digium.com>
Fri, 22 Feb 2008 23:56:55 +0000 (23:56 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@104045 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_zap.c
configure
configure.ac

index 360f5ad..6155242 100644 (file)
@@ -7313,8 +7313,10 @@ static void *mwi_thread(void *data)
                        res = zt_get_event(mtd->pvt->subs[SUB_REAL].zfd);
 
                        switch (res) {
+#ifdef HAVE_ZAPTEL_NEONMWI
                        case ZT_EVENT_NEONMWI_ACTIVE:
                        case ZT_EVENT_NEONMWI_INACTIVE:
+#endif
                        case ZT_EVENT_NONE:
                        case ZT_EVENT_BITSCHANGED:
                                break;
@@ -7639,6 +7641,7 @@ static int handle_init_event(struct zt_pvt *i, int event)
                                i->channel);
                zap_destroy_channel_bynum(i->channel);
                break;
+#ifdef HAVE_ZAPTEL_NEONMWI
        case ZT_EVENT_NEONMWI_ACTIVE:
                if (i->mwimonitor_neon) {
                        notify_message(i->mailbox, 1);
@@ -7651,6 +7654,7 @@ static int handle_init_event(struct zt_pvt *i, int event)
                        ast_log(LOG_NOTICE, "NEON MWI cleared for channel %d, mailbox %s\n", i->channel, i->mailbox);
                }
                break;
+#endif
        }
        return 0;
 }
index c1dc8e7..7a4b433 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.ac Revision: 103813 .
+# From configure.ac Revision: 104019 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.61 for asterisk 1.6.
 #
@@ -933,6 +933,10 @@ ZAPTEL_HWGAIN_LIB
 ZAPTEL_HWGAIN_INCLUDE
 ZAPTEL_HWGAIN_DIR
 PBX_ZAPTEL_HWGAIN
+ZAPTEL_NEONMWI_LIB
+ZAPTEL_NEONMWI_INCLUDE
+ZAPTEL_NEONMWI_DIR
+PBX_ZAPTEL_NEONMWI
 ZAPTEL_ECHOCANPARAMS_LIB
 ZAPTEL_ECHOCANPARAMS_INCLUDE
 ZAPTEL_ECHOCANPARAMS_DIR
@@ -1634,6 +1638,8 @@ Optional Packages:
                           use Zaptel VLDTMF Support files in PATH
   --with-zaptel_hwgain=PATH
                           use Zaptel Hardware Gain Support files in PATH
+  --with-zaptel_neonmwi=PATH
+                          use Zaptel Neon MWI Support files in PATH
   --with-zaptel_echocanparams=PATH
                           use Zaptel Echo Canceler Parameter Support files in
                           PATH
@@ -9385,6 +9391,34 @@ fi
 
 
 
+    ZAPTEL_NEONMWI_DESCRIP="Zaptel Neon MWI Support"
+    ZAPTEL_NEONMWI_OPTION="zaptel_neonmwi"
+
+# Check whether --with-zaptel_neonmwi was given.
+if test "${with_zaptel_neonmwi+set}" = set; then
+  withval=$with_zaptel_neonmwi;
+       case ${withval} in
+       n|no)
+       USE_ZAPTEL_NEONMWI=no
+       ;;
+       y|ye|yes)
+       ac_mandatory_list="${ac_mandatory_list} ZAPTEL_NEONMWI"
+       ;;
+       *)
+       ZAPTEL_NEONMWI_DIR="${withval}"
+       ac_mandatory_list="${ac_mandatory_list} ZAPTEL_NEONMWI"
+       ;;
+       esac
+
+fi
+
+    PBX_ZAPTEL_NEONMWI=0
+
+
+
+
+
+
     ZAPTEL_ECHOCANPARAMS_DESCRIP="Zaptel Echo Canceler Parameter Support"
     ZAPTEL_ECHOCANPARAMS_OPTION="zaptel_echocanparams"
 
@@ -46391,6 +46425,83 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
     fi
 
 
+# Check for neon mwi support
+
+    if test "x${PBX_ZAPTEL_NEONMWI}" != "x1" -a "${USE_ZAPTEL_NEONMWI}" != "no"; then
+       { echo "$as_me:$LINENO: checking for ZT_EVENT_NEONMWI_ACTIVE in zaptel/zaptel.h" >&5
+echo $ECHO_N "checking for ZT_EVENT_NEONMWI_ACTIVE in zaptel/zaptel.h... $ECHO_C" >&6; }
+       saved_cppflags="${CPPFLAGS}"
+       if test "x${ZAPTEL_NEONMWI_DIR}" != "x"; then
+           ZAPTEL_NEONMWI_INCLUDE="-I${ZAPTEL_NEONMWI_DIR}/include"
+       fi
+       CPPFLAGS="${CPPFLAGS} ${ZAPTEL_NEONMWI_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_EVENT_NEONMWI_ACTIVE)
+                               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_NEONMWI=1
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_ZAPTEL_NEONMWI 1
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_ZAPTEL_NEONMWI_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 channel alarm support
 
     if test "x${PBX_ZAPTEL_CHANALARMS}" != "x1" -a "${USE_ZAPTEL_CHANALARMS}" != "no"; then
@@ -50802,6 +50913,10 @@ 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_NEONMWI_LIB!$ZAPTEL_NEONMWI_LIB$ac_delim
+ZAPTEL_NEONMWI_INCLUDE!$ZAPTEL_NEONMWI_INCLUDE$ac_delim
+ZAPTEL_NEONMWI_DIR!$ZAPTEL_NEONMWI_DIR$ac_delim
+PBX_ZAPTEL_NEONMWI!$PBX_ZAPTEL_NEONMWI$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
@@ -50852,7 +50967,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` = 70; then
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 74; then
     break
   elif $ac_last_try; then
     { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
index 82a7d4e..85e7aa2 100644 (file)
@@ -254,6 +254,7 @@ AST_EXT_LIB_SETUP([ZAPTEL], [Zaptel], [zaptel])
 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_NEONMWI], [Zaptel Neon MWI Support], [zaptel_neonmwi])
 AST_EXT_LIB_SETUP([ZAPTEL_ECHOCANPARAMS], [Zaptel Echo Canceler Parameter Support], [zaptel_echocanparams])
 AST_EXT_LIB_SETUP([ZAPTEL_CHANALARMS], [Zaptel Channel Alarm Support], [zaptel_chanalarms])
 
@@ -1430,6 +1431,9 @@ AST_C_DEFINE_CHECK([ZAPTEL_TRANSCODE], [ZT_TCOP_ALLOCATE], [zaptel/zaptel.h])
 # Check for hwgain support
 AST_C_DEFINE_CHECK([ZAPTEL_HWGAIN], [ZT_SET_HWGAIN], [zaptel/zaptel.h])
 
+# Check for neon mwi support
+AST_C_DEFINE_CHECK([ZAPTEL_NEONMWI], [ZT_EVENT_NEONMWI_ACTIVE], [zaptel/zaptel.h])
+
 # Check for channel alarm support
 AST_C_COMPILE_CHECK([ZAPTEL_CHANALARMS], [size_t foo = sizeof(struct zt_params_v1)], [zaptel/zaptel.h])