Enable bundling of jansson, require 2.11.

Change-Id: Ib3111b151d37cbda40768cf2a8a9c6cf6c5c7cbd
This commit is contained in:
Corey Farrell
2018-07-16 16:08:20 -04:00
parent c40412bd13
commit d2dace81d4
22 changed files with 642 additions and 354 deletions

View File

@@ -423,6 +423,15 @@ AC_SUBST(AST_CODE_COVERAGE)
AST_CHECK_RAII()
AST_CHECK_STRSEP_ARRAY_BOUNDS()
JANSSON_BUNDLED=no
AC_ARG_WITH([jansson-bundled],
[AS_HELP_STRING([--with-jansson-bundled],
[Use bundled jansson library])],
[case "${withval}" in
y|yes) JANSSON_BUNDLED=yes ;;
*) JANSSON_BUNDLED=no ;;
esac])
PJPROJECT_BUNDLED=yes
AH_TEMPLATE(m4_bpatsubst([[HAVE_PJPROJECT_BUNDLED]], [(.*)]), [Define to 1 when using the bundled pjproject.])
@@ -652,11 +661,19 @@ fi
AC_SUBST(UUID_INCLUDE)
AC_SUBST(UUID_LIB)
# Find required JSON support.
AST_EXT_LIB_CHECK([JANSSON], [jansson], [json_dumps], [jansson.h])
# Find required JSON support if bundled is not enabled.
if test "$JANSSON_BUNDLED" = "no" ; then
# json_sprintf is available in 2.11+
AST_EXT_LIB_CHECK([JANSSON], [jansson], [json_sprintf], [jansson.h])
if test "${PBX_JANSSON}" != 1; then
AC_MSG_ERROR([*** JSON support not found (this typically means the libjansson development package is missing)])
if test "${PBX_JANSSON}" != 1; then
AC_MSG_NOTICE(*** Asterisk requires libjansson >= 2.11 and no system copy was found.)
AC_MSG_NOTICE(*** Please install the 'libjansson' development package or)
AC_MSG_NOTICE(*** use './configure --with-jansson-bundled')
exit 1
fi
else
PBX_JANSSON=1
fi
# See if clock_gettime is in librt