From 3a4b8d06c67ade3e73e93a31a49619a7daac13dc Mon Sep 17 00:00:00 2001 From: Corey Farrell Date: Thu, 30 Mar 2017 10:51:14 -0400 Subject: [PATCH] Build System: Fix --disable-xmldoc option. The configure option to disable XML documentation does not currently work. This patch makes it effective, but also causes an ABI change by removing the ast_xmldoc_* symbols. ASTERISK-26639 #close Change-Id: Ifac562340c09f80c83e0203de098fcac93bf8c44 --- configure | 3 +++ configure.ac | 1 + include/asterisk/autoconfig.h.in | 3 +++ include/asterisk/xml.h | 5 ----- main/config_options.c | 2 +- main/manager.c | 4 ++++ 6 files changed, 12 insertions(+), 6 deletions(-) diff --git a/configure b/configure index b0de484..dfaa587 100755 --- a/configure +++ b/configure @@ -14384,6 +14384,9 @@ fi if test "${disable_xmldoc}" != "yes"; then +$as_echo "#define AST_XML_DOCS 1" >>confdefs.h + + if test "x${PBX_LIBXSLT}" != "x1" -a "${USE_LIBXSLT}" != "no"; then pbxlibdir="" # if --with-LIBXSLT=DIR has been specified, use it. diff --git a/configure.ac b/configure.ac index 37449a1..2ff9759 100644 --- a/configure.ac +++ b/configure.ac @@ -684,6 +684,7 @@ AC_ARG_ENABLE([xmldoc], esac], [disable_xmldoc=no]) if test "${disable_xmldoc}" != "yes"; then + AC_DEFINE([AST_XML_DOCS], 1, [Define to enable XML documentation.]) AST_EXT_LIB_CHECK([LIBXSLT], [xslt], [xsltLoadStylesheetPI], [libxslt/xsltInternals.h], [${LIBXML2_LIB}], [${LIBXML2_INCLUDE}]) AST_EXT_LIB_CHECK([LIBXSLT_CLEANUP], [xslt], [xsltCleanupGlobals], [libxslt/xsltInternals.h], [${LIBXML2_LIB}], [${LIBXML2_INCLUDE}]) diff --git a/include/asterisk/autoconfig.h.in b/include/asterisk/autoconfig.h.in index 2b652bc..5261ce3 100644 --- a/include/asterisk/autoconfig.h.in +++ b/include/asterisk/autoconfig.h.in @@ -10,6 +10,9 @@ /* Define to 1 if internal poll should be used. */ #undef AST_POLL_COMPAT +/* Define to enable XML documentation. */ +#undef AST_XML_DOCS + /* Define to 1 if your system's implementation of mutexes supports comparison of a mutex to its initializer. */ #undef CAN_COMPARE_MUTEX_TO_INIT_VALUE diff --git a/include/asterisk/xml.h b/include/asterisk/xml.h index 063e8c0..ab7b630 100644 --- a/include/asterisk/xml.h +++ b/include/asterisk/xml.h @@ -246,10 +246,5 @@ struct ast_xml_node *ast_xml_xpath_get_first_result(struct ast_xml_xpath_results */ struct ast_xml_xpath_results *ast_xml_query(struct ast_xml_doc *doc, const char *xpath_str); -/* Features using ast_xml_ */ -#ifdef HAVE_LIBXML2 -#define AST_XML_DOCS -#endif - #endif /* _ASTERISK_XML_H */ diff --git a/main/config_options.c b/main/config_options.c index cc8e218..e9a5f2e 100644 --- a/main/config_options.c +++ b/main/config_options.c @@ -81,7 +81,6 @@ struct aco_option { #ifdef AST_XML_DOCS static struct ao2_container *xmldocs; -#endif /* AST_XML_DOCS */ /*! \brief Value of the aco_option_type enum as strings */ static char *aco_option_type_string[] = { @@ -99,6 +98,7 @@ static char *aco_option_type_string[] = { "Unsigned Integer", /* OPT_UINT_T, */ "Boolean", /* OPT_YESNO_T, */ }; +#endif /* AST_XML_DOCS */ void *aco_pending_config(struct aco_info *info) { diff --git a/main/manager.c b/main/manager.c index 0f7adf0..1b05ac5 100644 --- a/main/manager.c +++ b/main/manager.c @@ -1630,8 +1630,10 @@ static AST_RWLIST_HEAD_STATIC(actions, manager_action); /*! \brief list of hooks registered */ static AST_RWLIST_HEAD_STATIC(manager_hooks, manager_custom_hook); +#ifdef AST_XML_DOCS /*! \brief A container of event documentation nodes */ static AO2_GLOBAL_OBJ_STATIC(event_docs); +#endif static int __attribute__((format(printf, 9, 0))) __manager_event_sessions( struct ao2_container *sessions, @@ -2287,7 +2289,9 @@ static int manager_displayconnects(struct mansession_session *session) return ret; } +#ifdef AST_XML_DOCS static void print_event_instance(struct ast_cli_args *a, struct ast_xml_doc_item *instance); +#endif static char *handle_showmancmd(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) { -- 2.9.3