diff options
author | David M. Lee <dlee@digium.com> | 2013-01-11 22:31:42 +0000 |
---|---|---|
committer | David M. Lee <dlee@digium.com> | 2013-01-11 22:31:42 +0000 |
commit | 7695ea2643456ab0c837f958cc484d26529e1098 (patch) | |
tree | 7abdff9c18abeac805e93f788d6e51b835796df7 /configure | |
parent | 2db3cc2e26bc275c0a3e372a53fe25f2a7b4cc7a (diff) |
Add JSON API for Asterisk.
This provides a JSON API by pulling in and wrapping the Jansson JSON
library[1]. The Asterisk API basically mirrors the Jansson
functionality, with a few minor tweaks.
* Some names have been asteriskified to protect the innocent.
* Jansson provides both reference-stealing and reference-borrowing
versions of several API's. The Asterisk API is exclusively
reference-stealing for operations that put elements into arrays and
objects.
* No support for doubles, since we usually don't need that.
* Coming along for the ride is the ast_test_validate macro, which made
the unit tests much easier to write.
[1]: http://www.digip.org/jansson/
(issue ASTERISK-20887)
(closes issue ASTERISK-20888)
Review: https://reviewboard.asterisk.org/r/2264/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@378915 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 145 |
1 files changed, 144 insertions, 1 deletions
@@ -1,5 +1,5 @@ #! /bin/sh -# From configure.ac Revision: 377977 . +# From configure.ac Revision: 377981 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for asterisk trunk. # @@ -974,6 +974,10 @@ PBX_KQUEUE KQUEUE_DIR KQUEUE_INCLUDE KQUEUE_LIB +PBX_JANSSON +JANSSON_DIR +JANSSON_INCLUDE +JANSSON_LIB PBX_JACK JACK_DIR JACK_INCLUDE @@ -1245,6 +1249,7 @@ with_inotify with_iodbc with_isdnnet with_jack +with_jansson with_kqueue with_ldap with_libcurl @@ -1972,6 +1977,7 @@ Optional Packages: --with-iodbc=PATH use iODBC files in PATH --with-isdnnet=PATH use ISDN4Linux files in PATH --with-jack=PATH use Jack Audio Connection Kit files in PATH + --with-jansson=PATH use Jansson JSON library files in PATH --with-kqueue=PATH use kqueue support files in PATH --with-ldap=PATH use OpenLDAP files in PATH --with-libcurl=DIR look for the curl library in DIR @@ -8911,6 +8917,38 @@ fi + JANSSON_DESCRIP="Jansson JSON library" + JANSSON_OPTION="jansson" + PBX_JANSSON=0 + +# Check whether --with-jansson was given. +if test "${with_jansson+set}" = set; then : + withval=$with_jansson; + case ${withval} in + n|no) + USE_JANSSON=no + # -1 is a magic value used by menuselect to know that the package + # was disabled, other than 'not found' + PBX_JANSSON=-1 + ;; + y|ye|yes) + ac_mandatory_list="${ac_mandatory_list} JANSSON" + ;; + *) + JANSSON_DIR="${withval}" + ac_mandatory_list="${ac_mandatory_list} JANSSON" + ;; + esac + +fi + + + + + + + + KQUEUE_DESCRIP="kqueue support" KQUEUE_OPTION="kqueue" PBX_KQUEUE=0 @@ -19865,6 +19903,111 @@ fi + +if test "x${PBX_JANSSON}" != "x1" -a "${USE_JANSSON}" != "no"; then + pbxlibdir="" + # if --with-JANSSON=DIR has been specified, use it. + if test "x${JANSSON_DIR}" != "x"; then + if test -d ${JANSSON_DIR}/lib; then + pbxlibdir="-L${JANSSON_DIR}/lib" + else + pbxlibdir="-L${JANSSON_DIR}" + fi + fi + pbxfuncname="json_dumps" + if test "x${pbxfuncname}" = "x" ; then # empty lib, assume only headers + AST_JANSSON_FOUND=yes + else + ast_ext_lib_check_save_CFLAGS="${CFLAGS}" + CFLAGS="${CFLAGS} " + as_ac_Lib=`$as_echo "ac_cv_lib_jansson_${pbxfuncname}" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -ljansson" >&5 +$as_echo_n "checking for ${pbxfuncname} in -ljansson... " >&6; } +if eval \${$as_ac_Lib+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ljansson ${pbxlibdir} $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char ${pbxfuncname} (); +int +main () +{ +return ${pbxfuncname} (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$as_ac_Lib=yes" +else + eval "$as_ac_Lib=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +eval ac_res=\$$as_ac_Lib + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : + AST_JANSSON_FOUND=yes +else + AST_JANSSON_FOUND=no +fi + + CFLAGS="${ast_ext_lib_check_save_CFLAGS}" + fi + + # now check for the header. + if test "${AST_JANSSON_FOUND}" = "yes"; then + JANSSON_LIB="${pbxlibdir} -ljansson " + # if --with-JANSSON=DIR has been specified, use it. + if test "x${JANSSON_DIR}" != "x"; then + JANSSON_INCLUDE="-I${JANSSON_DIR}/include" + fi + JANSSON_INCLUDE="${JANSSON_INCLUDE} " + if test "xjansson.h" = "x" ; then # no header, assume found + JANSSON_HEADER_FOUND="1" + else # check for the header + ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" + CPPFLAGS="${CPPFLAGS} ${JANSSON_INCLUDE}" + ac_fn_c_check_header_mongrel "$LINENO" "jansson.h" "ac_cv_header_jansson_h" "$ac_includes_default" +if test "x$ac_cv_header_jansson_h" = xyes; then : + JANSSON_HEADER_FOUND=1 +else + JANSSON_HEADER_FOUND=0 +fi + + + CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" + fi + if test "x${JANSSON_HEADER_FOUND}" = "x0" ; then + JANSSON_LIB="" + JANSSON_INCLUDE="" + else + if test "x${pbxfuncname}" = "x" ; then # only checking headers -> no library + JANSSON_LIB="" + fi + PBX_JANSSON=1 + cat >>confdefs.h <<_ACEOF +#define HAVE_JANSSON 1 +_ACEOF + + fi + fi +fi + + + # BSD (and OS X) equivalent of inotify if test "x${PBX_KQUEUE}" != "x1" -a "${USE_KQUEUE}" != "no"; then |