Add new object for VoicemailUserEntry
[asterisk/asterisk.git] / autoconf / ast_c_declare_check.m4
1 # Check if a given symbol is declared using a certain header.
2 # Check whether SYMBOL (a function, variable, or constant) is declared.
3
4 # AST_C_DECLARE_CHECK([package], [symbol], [header file], [version])
5 AC_DEFUN([AST_C_DECLARE_CHECK],
6 [
7     if test "x${PBX_$1}" != "x1" -a "${USE_$1}" != "no"; then
8         AC_MSG_CHECKING([for $2 declared in $3])
9         saved_cppflags="${CPPFLAGS}"
10         if test "x${$1_DIR}" != "x"; then
11             $1_INCLUDE="-I${$1_DIR}/include"
12         fi
13         CPPFLAGS="${CPPFLAGS} ${$1_INCLUDE}"
14
15         AC_COMPILE_IFELSE(
16             [ AC_LANG_PROGRAM( [#include <$3>],
17                                 [#if !defined($2)
18                                     (void) $2;
19                                 #endif
20                                 ])],
21             [   AC_MSG_RESULT(yes)
22                 PBX_$1=1
23                 AC_DEFINE([HAVE_$1], 1, [Define if your system has $2 declared.])
24                 m4_ifval([$4], [AC_DEFINE([HAVE_$1_VERSION], $4, [Define $1 headers version])])
25             ],
26             [   AC_MSG_RESULT(no) ] 
27         )
28
29         CPPFLAGS="${saved_cppflags}"
30     fi
31 ])