diff --git a/configure b/configure index cb27ad55c7dac5c2176897458819191aedaa7a28..025b34b81ac892638e6eefb89702bcf178330ccc 100755 --- a/configure +++ b/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.ac Revision: 263724 . +# From configure.ac Revision: 263905 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for asterisk 1.6. # @@ -23573,6 +23573,158 @@ fi fi + if test "x${PBX_DAHDI}" != "x1"; then + { echo "$as_me:$LINENO: checking for DAHDI_RESET_COUNTERS in dahdi/user.h" >&5 +echo $ECHO_N "checking for DAHDI_RESET_COUNTERS in dahdi/user.h... $ECHO_C" >&6; } + saved_cppflags="${CPPFLAGS}" + if test "x${DAHDI_DIR}" != "x"; then + DAHDI_INCLUDE="-I${DAHDI_DIR}/include" + fi + CPPFLAGS="${CPPFLAGS} ${DAHDI_INCLUDE}" + + cat >conftest.$ac_ext <<_ACEOF + /* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <dahdi/user.h> +int +main () +{ +#if defined(DAHDI_RESET_COUNTERS) + 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_DAHDI=1 + +cat >>confdefs.h <<\_ACEOF +#define HAVE_DAHDI 1 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define HAVE_DAHDI_VERSION 230 +_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 + + + + if test "x${PBX_DAHDI}" != "x1"; then + { echo "$as_me:$LINENO: checking for DAHDI_DEFAULT_MTU_MRU in dahdi/user.h" >&5 +echo $ECHO_N "checking for DAHDI_DEFAULT_MTU_MRU in dahdi/user.h... $ECHO_C" >&6; } + saved_cppflags="${CPPFLAGS}" + if test "x${DAHDI_DIR}" != "x"; then + DAHDI_INCLUDE="-I${DAHDI_DIR}/include" + fi + CPPFLAGS="${CPPFLAGS} ${DAHDI_INCLUDE}" + + cat >conftest.$ac_ext <<_ACEOF + /* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <dahdi/user.h> +int +main () +{ +#if defined(DAHDI_DEFAULT_MTU_MRU) + 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_DAHDI=1 + +cat >>confdefs.h <<\_ACEOF +#define HAVE_DAHDI 1 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define HAVE_DAHDI_VERSION 220 +_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 + + + if test "x${PBX_DAHDI}" != "x1"; then { echo "$as_me:$LINENO: checking for DAHDI_CODE in dahdi/user.h" >&5 echo $ECHO_N "checking for DAHDI_CODE in dahdi/user.h... $ECHO_C" >&6; } @@ -23629,6 +23781,10 @@ cat >>confdefs.h <<\_ACEOF _ACEOF +cat >>confdefs.h <<\_ACEOF +#define HAVE_DAHDI_VERSION 200 +_ACEOF + else echo "$as_me: failed program was:" >&5 diff --git a/configure.ac b/configure.ac index c643f5ba9438cbd6195b90495a1e2fd760ce1cd4..944860e0d5ab869774a82fc54b65192f1d7c7193 100644 --- a/configure.ac +++ b/configure.ac @@ -838,7 +838,9 @@ if test "x${OSARCH}" = "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_DEFINE_CHECK([DAHDI], [DAHDI_RESET_COUNTERS], [dahdi/user.h], [230]) +AST_C_DEFINE_CHECK([DAHDI], [DAHDI_DEFAULT_MTU_MRU], [dahdi/user.h], [220]) +AST_C_DEFINE_CHECK([DAHDI], [DAHDI_CODE], [dahdi/user.h], [200]) AST_C_DEFINE_CHECK([DAHDI_HALF_FULL], [DAHDI_POLICY_HALF_FULL], [dahdi/user.h]) diff --git a/include/asterisk/autoconfig.h.in b/include/asterisk/autoconfig.h.in index 15013b0b207ed0e166b32ad3b423c81ea794d80b..f6e1dae7c78aa875a41ab330e16eaab80309fb38 100644 --- a/include/asterisk/autoconfig.h.in +++ b/include/asterisk/autoconfig.h.in @@ -154,6 +154,9 @@ /* Define if your system has the DAHDI_LINEREVERSE_VMWI headers. */ #undef HAVE_DAHDI_LINEREVERSE_VMWI +/* Define DAHDI headers version */ +#undef HAVE_DAHDI_VERSION + /* Define to 1 if your system has /dev/urandom. */ #undef HAVE_DEV_URANDOM diff --git a/include/asterisk/options.h b/include/asterisk/options.h index c76e8332d3f4b86bd757a0efdf77463a9c17986d..e6147aa1ccfa55210cb400e1f401ccf32c6142d7 100644 --- a/include/asterisk/options.h +++ b/include/asterisk/options.h @@ -23,6 +23,8 @@ #ifndef _ASTERISK_OPTIONS_H #define _ASTERISK_OPTIONS_H +#include "asterisk/autoconfig.h" + #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif @@ -95,7 +97,11 @@ enum ast_option_flags { }; /*! These are the options that set by default when Asterisk starts */ +#if (defined(HAVE_DAHDI_VERSION) && HAVE_DAHDI_VERSION >= 230) +#define AST_DEFAULT_OPTIONS AST_OPT_FLAG_TRANSCODE_VIA_SLIN | AST_OPT_FLAG_INTERNAL_TIMING +#else #define AST_DEFAULT_OPTIONS AST_OPT_FLAG_TRANSCODE_VIA_SLIN +#endif #define ast_opt_exec_includes ast_test_flag(&ast_options, AST_OPT_FLAG_EXEC_INCLUDES) #define ast_opt_no_fork ast_test_flag(&ast_options, AST_OPT_FLAG_NO_FORK)