[svn-commits] jpeeler: branch jpeeler/chan_dahdi14 r119797 - in /team/jpeeler/chan_dahdi14:...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Jun 2 10:49:33 CDT 2008


Author: jpeeler
Date: Mon Jun  2 10:49:33 2008
New Revision: 119797

URL: http://svn.digium.com/view/asterisk?view=rev&rev=119797
Log:
add AST_C_DEFINE_CHECK macro from trunk

Modified:
    team/jpeeler/chan_dahdi14/acinclude.m4
    team/jpeeler/chan_dahdi14/channels/chan_zap.c
    team/jpeeler/chan_dahdi14/configure
    team/jpeeler/chan_dahdi14/configure.ac
    team/jpeeler/chan_dahdi14/include/asterisk/autoconfig.h.in

Modified: team/jpeeler/chan_dahdi14/acinclude.m4
URL: http://svn.digium.com/view/asterisk/team/jpeeler/chan_dahdi14/acinclude.m4?view=diff&rev=119797&r1=119796&r2=119797
==============================================================================
--- team/jpeeler/chan_dahdi14/acinclude.m4 (original)
+++ team/jpeeler/chan_dahdi14/acinclude.m4 Mon Jun  2 10:49:33 2008
@@ -99,6 +99,54 @@
       exit 1
    fi
 fi
+])
+
+# The next three functions check for the availability of a given package.
+# AST_C_DEFINE_CHECK looks for the presence of a #define in a header file,
+# AST_C_COMPILE_CHECK can be used for testing for various items in header files,
+# AST_EXT_LIB_CHECK looks for a symbol in a given library, or at least
+#   for the presence of a header file.
+# AST_EXT_TOOL_CHECK looks for a symbol in using $1-config to determine CFLAGS and LIBS
+#
+# They are only run if PBX_$1 != 1 (where $1 is the package),
+# so you can call them multiple times and stop at the first matching one.
+# On success, they both set PBX_$1 = 1, set $1_INCLUDE and $1_LIB as applicable,
+# and also #define HAVE_$1 1 and #define HAVE_$1_VERSION ${last_argument}
+# in autoconfig.h so you can tell which test succeeded.
+# They should be called after AST_EXT_LIB_SETUP($1, ...)
+
+# Check if a given macro is defined in a certain header.
+
+# AST_C_DEFINE_CHECK([package], [macro name], [header file], [version])
+AC_DEFUN([AST_C_DEFINE_CHECK],
+[
+    if test "x${PBX_$1}" != "x1"; then
+    AC_MSG_CHECKING([for $2 in $3])
+    saved_cppflags="${CPPFLAGS}"
+    if test "x${$1_DIR}" != "x"; then
+        $1_INCLUDE="-I${$1_DIR}/include"
+    fi
+    CPPFLAGS="${CPPFLAGS} ${$1_INCLUDE}"
+
+    AC_COMPILE_IFELSE(
+        [ 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.])
+        AC_DEFINE([HAVE_$1_VERSION], $4, [Define $1 headers version])
+        ],
+        [   AC_MSG_RESULT(no) ] 
+    )
+    CPPFLAGS="${saved_cppflags}"
+    fi
+    AC_SUBST(PBX_$1)
 ])
 
 # AST_C_COMPILE_CHECK can be used for testing for various items in header files

Modified: team/jpeeler/chan_dahdi14/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/team/jpeeler/chan_dahdi14/channels/chan_zap.c?view=diff&rev=119797&r1=119796&r2=119797
==============================================================================
--- team/jpeeler/chan_dahdi14/channels/chan_zap.c (original)
+++ team/jpeeler/chan_dahdi14/channels/chan_zap.c Mon Jun  2 10:49:33 2008
@@ -10102,7 +10102,7 @@
 	return RESULT_FAILURE;
 }
 
-static char dahdi_show_cadences_help[] =
+static char dahdi_show_cadences_usage[] =
 "Usage: dahdi show cadences\n"
 "       Shows all cadences currently defined\n";
 
@@ -10220,7 +10220,7 @@
 static struct ast_cli_entry dahdi_cli[] = {
 	{ { "dahdi", "show", "cadences", NULL },
 	handle_dahdi_show_cadences, "List cadences",
-	dahdi_show_cadences_help },
+	dahdi_show_cadences_usage },
 
 	{ { "dahdi", "show", "channels", NULL},
 	dahdi_show_channels, "Show active DAHDI channels",

Modified: team/jpeeler/chan_dahdi14/configure.ac
URL: http://svn.digium.com/view/asterisk/team/jpeeler/chan_dahdi14/configure.ac?view=diff&rev=119797&r1=119796&r2=119797
==============================================================================
--- team/jpeeler/chan_dahdi14/configure.ac (original)
+++ team/jpeeler/chan_dahdi14/configure.ac Mon Jun  2 10:49:33 2008
@@ -176,6 +176,7 @@
 AST_EXT_LIB_SETUP([CURL], [cURL], [curl])
 AST_EXT_LIB_SETUP([CAP], [POSIX 1.e capabilities], [cap])
 AST_EXT_LIB_SETUP([CURSES], [curses], [curses])
+AST_EXT_LIB_SETUP([DAHDI], [DAHDI], [dahdi])
 AST_EXT_LIB_SETUP([GNUTLS], [GNU TLS support (used for iksemel only)], [gnutls])
 AST_EXT_LIB_SETUP([GSM], [GSM], [gsm], [, or 'internal'])
 AST_EXT_LIB_SETUP([IKSEMEL], [Iksemel Jabber Library], [iksemel])
@@ -434,6 +435,8 @@
 if test "x${host_os}" = "xlinux-gnu" ; then
   AST_EXT_LIB_CHECK([CAP], [cap], [cap_from_text], [sys/capability.h])
 fi
+
+AST_C_DEFINE_CHECK([DAHDI], [DAHDI_CODE], [dahdi/user.h])
 
 AST_C_COMPILE_CHECK([GETIFADDRS], [struct ifaddrs *p; getifaddrs(&p)], [ifaddrs.h])
 
@@ -1408,7 +1411,7 @@
 AST_EXT_LIB_CHECK([ZLIB], [z], [compress], [zlib.h])
 
 if test "${USE_ZAPTEL}" != "no"; then
-   AC_MSG_CHECKING(for DAHDI_DIAL_OP_CANCEL in zaptel/zaptel.h)
+   AC_MSG_CHECKING(for ZT_DIAL_OP_CANCEL in zaptel/zaptel.h)
    saved_cppflags="${CPPFLAGS}"
    if test "x${ZAPTEL_DIR}" != "x"; then
       CPPFLAGS="${CPPFLAGS} -I${ZAPTEL_DIR}/include"
@@ -1417,7 +1420,7 @@
 	[
 	AC_LANG_PROGRAM(
 	[#include <zaptel/zaptel.h>],
-	[int foo = DAHDI_DIAL_OP_CANCEL;])
+	[int foo = ZT_DIAL_OP_CANCEL;])
 	],
 	[	AC_MSG_RESULT(yes) 
 		ac_cv_zaptel_h="yes" 
@@ -1444,7 +1447,7 @@
 fi
 
 if test "${PBX_ZAPTEL}" = 1; then
-   AC_MSG_CHECKING(for DAHDI_EVENT_REMOVED in zaptel/zaptel.h)
+   AC_MSG_CHECKING(for ZT_EVENT_REMOVED in zaptel/zaptel.h)
    saved_cppflags="${CPPFLAGS}"
    if test "x${ZAPTEL_DIR}" != "x"; then
       CPPFLAGS="${CPPFLAGS} -I${ZAPTEL_DIR}/include"
@@ -1453,7 +1456,7 @@
 	[
 	AC_LANG_PROGRAM(
 	[#include <zaptel/zaptel.h>],
-	[int foo = DAHDI_EVENT_REMOVED;])
+	[int foo = ZT_EVENT_REMOVED;])
 	],
 	[	AC_MSG_RESULT(yes) 
 		ac_cv_zaptel_vldtmf="yes" 
@@ -1466,7 +1469,7 @@
    if test "${ac_cv_zaptel_vldtmf}" = "yes"; then
 	PBX_ZAPTEL_VLDTMF=1
    fi
-   AC_MSG_CHECKING(for DAHDI_TCOP_ALLOCATE in zaptel/zaptel.h)
+   AC_MSG_CHECKING(for ZT_TCOP_ALLOCATE in zaptel/zaptel.h)
    saved_cppflags="${CPPFLAGS}"
    if test "x${ZAPTEL_DIR}" != "x"; then
       CPPFLAGS="${CPPFLAGS} -I${ZAPTEL_DIR}/include"
@@ -1475,7 +1478,7 @@
 	[
 	AC_LANG_PROGRAM(
 	[#include <zaptel/zaptel.h>],
-	[int foo = DAHDI_TCOP_ALLOCATE;])
+	[int foo = ZT_TCOP_ALLOCATE;])
 	],
 	[	AC_MSG_RESULT(yes) 
 		ac_cv_zaptel_transcode="yes" 

Modified: team/jpeeler/chan_dahdi14/include/asterisk/autoconfig.h.in
URL: http://svn.digium.com/view/asterisk/team/jpeeler/chan_dahdi14/include/asterisk/autoconfig.h.in?view=diff&rev=119797&r1=119796&r2=119797
==============================================================================
--- team/jpeeler/chan_dahdi14/include/asterisk/autoconfig.h.in (original)
+++ team/jpeeler/chan_dahdi14/include/asterisk/autoconfig.h.in Mon Jun  2 10:49:33 2008
@@ -73,6 +73,12 @@
 
 /* Define to indicate the ${CURSES_DESCRIP} library */
 #undef HAVE_CURSES
+
+/* Define if your system has the DAHDI headers. */
+#undef HAVE_DAHDI
+
+/* Define DAHDI headers version */
+#undef HAVE_DAHDI_VERSION
 
 /* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
    */




More information about the svn-commits mailing list