<p>Joshua Colp <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/6877">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  George Joseph: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved; Approved for Submit

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">Build System: Fix --disable-xmldoc option.<br><br>The configure option to disable XML documentation does not currently<br>work.  This patch makes it effective, but also causes an ABI change by<br>removing the ast_xmldoc_* symbols.  Disabling xmldoc also prevents docs<br>from being automatically generated, but they can still be manually<br>generated with 'make doc/core-en_US.xml'.<br><br>ASTERISK-26639<br><br>Change-Id: Ifac562340c09f80c83e0203de098fcac93bf8c44<br>---<br>M Makefile<br>M configure<br>M configure.ac<br>M include/asterisk/autoconfig.h.in<br>M include/asterisk/xml.h<br>M main/config_options.c<br>M main/manager.c<br>M makeopts.in<br>8 files changed, 42 insertions(+), 18 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/Makefile b/Makefile<br>index 85a1152..8048f59 100644<br>--- a/Makefile<br>+++ b/Makefile<br>@@ -209,7 +209,9 @@<br>   ifeq ($(AST_DEVMODE_STRICT),yes)<br>     _ASTCFLAGS+=-Wshadow<br>   endif<br>-  ADDL_TARGETS+=validate-docs<br>+  ifneq ($(DISABLE_XMLDOC),yes)<br>+    ADDL_TARGETS+=validate-docs<br>+  endif<br> endif<br> <br> ifneq ($(findstring BSD,$(OSARCH)),)<br>@@ -245,6 +247,14 @@<br> <br> ifneq ($(wildcard .svn),)<br>   ASTERISKVERSIONNUM:=999999<br>+endif<br>+<br>+ifneq ($(DISABLE_XMLDOC),yes)<br>+  CORE_XMLDOC=doc/core-en_US.xml<br>+  FULL_XMLDOC=doc/full-en_US.xml<br>+else<br>+  CORE_XMLDOC=<br>+  FULL_XMLDOC=<br> endif<br> <br> _ASTCFLAGS+=$(OPTIONS)<br>@@ -327,9 +337,9 @@<br>   @echo " +-------------------------------------------+"<br> <br> <br>-_all: makeopts $(SUBDIRS) doc/core-en_US.xml $(ADDL_TARGETS)<br>+_all: makeopts $(SUBDIRS) $(CORE_XMLDOC) $(ADDL_TARGETS)<br> <br>-_full: makeopts $(SUBDIRS) doc/full-en_US.xml $(ADDL_TARGETS)<br>+_full: makeopts $(SUBDIRS) $(FULL_XMLDOC) $(ADDL_TARGETS)<br> <br> makeopts: configure<br>      @echo "****"<br>@@ -424,7 +434,7 @@<br>   rm -f doc/asterisk-ng-doxygen<br>         rm -f build_tools/menuselect-deps<br> <br>-datafiles: _all doc/core-en_US.xml<br>+datafiles: _all $(CORE_XMLDOC)<br>    CFLAGS="$(_ASTCFLAGS) $(ASTCFLAGS)" build_tools/mkpkgconfig "$(DESTDIR)$(libdir)/pkgconfig";<br> <br> # # Recursively install contents of the static-http directory, in case<br>@@ -436,8 +446,10 @@<br>                    $(INSTALL) -m 644 $$x "$(DESTDIR)$(ASTDATADIR)/$$x" ; \<br>             fi \<br>  done<br>+ifneq ($(DISABLE_XMLDOC),yes)<br>  $(INSTALL) -m 644 doc/core-en_US.xml "$(DESTDIR)$(ASTDATADIR)/static-http";<br>         $(INSTALL) -m 644 doc/appdocsxml.xslt "$(DESTDIR)$(ASTDATADIR)/static-http";<br>+endif<br>        if [ -d doc/tex/asterisk ] ; then \<br>           $(INSTALL) -d "$(DESTDIR)$(ASTDATADIR)/static-http/docs" ; \<br>                for n in doc/tex/asterisk/* ; do \<br>@@ -566,9 +578,11 @@<br>              for h in $(OLDHEADERS); do rm -f "$(DESTDIR)$(ASTHEADERDIR)/$$h"; done \<br>    fi<br> <br>+ifneq ($(DISABLE_XMLDOC),yes)<br>         $(INSTALL) -m 644 doc/core-*.xml "$(DESTDIR)$(ASTDATADIR)/documentation"<br>    $(INSTALL) -m 644 doc/appdocsxml.xslt "$(DESTDIR)$(ASTDATADIR)/documentation"<br>       $(INSTALL) -m 644 doc/appdocsxml.dtd "$(DESTDIR)$(ASTDATADIR)/documentation"<br>+endif<br>        $(INSTALL) -m 644 doc/asterisk.8 "$(DESTDIR)$(ASTMANDIR)/man8"<br>      $(INSTALL) -m 644 doc/astdb*.8 "$(DESTDIR)$(ASTMANDIR)/man8"<br>        $(INSTALL) -m 644 contrib/scripts/astgenkey.8 "$(DESTDIR)$(ASTMANDIR)/man8"<br>diff --git a/configure b/configure<br>index 588fbfd..8bcf938 100755<br>--- a/configure<br>+++ b/configure<br>@@ -718,6 +718,7 @@<br> POW_LIB<br> PBX_WORKING_FORK<br> LIBOBJS<br>+DISABLE_XMLDOC<br> CONFIG_LIBXML2<br> UUID_LIB<br> UUID_INCLUDE<br>@@ -14660,16 +14661,20 @@<br> # Check whether --enable-xmldoc was given.<br> if test "${enable_xmldoc+set}" = set; then :<br>   enableval=$enable_xmldoc; case "${enableval}" in<br>-           y|ye|yes) disable_xmldoc=no ;;<br>-               n|no)  disable_xmldoc=yes ;;<br>+         y|ye|yes) DISABLE_XMLDOC=no ;;<br>+               n|no)  DISABLE_XMLDOC=yes ;;<br>          *) as_fn_error $? "bad value ${enableval} for --disable-xmldoc" "$LINENO" 5  ;;<br>   esac<br> else<br>-  disable_xmldoc=no<br>+  DISABLE_XMLDOC=no<br> fi<br> <br> <br>-if test "${disable_xmldoc}" != "yes"; then<br>+<br>+if test "${DISABLE_XMLDOC}" != "yes"; then<br>+<br>+$as_echo "#define AST_XML_DOCS 1" >>confdefs.h<br>+<br> <br> if test "x${PBX_LIBXSLT}" != "x1" -a "${USE_LIBXSLT}" != "no"; then<br>    pbxlibdir=""<br>diff --git a/configure.ac b/configure.ac<br>index c729b94..3fe9044 100644<br>--- a/configure.ac<br>+++ b/configure.ac<br>@@ -690,12 +690,14 @@<br>   [AS_HELP_STRING([--disable-xmldoc],<br>           [Explicitly disable XML documentation])],<br>     [case "${enableval}" in<br>-            y|ye|yes) disable_xmldoc=no ;;<br>-               n|no)  disable_xmldoc=yes ;;<br>+         y|ye|yes) DISABLE_XMLDOC=no ;;<br>+               n|no)  DISABLE_XMLDOC=yes ;;<br>          *) AC_MSG_ERROR(bad value ${enableval} for --disable-xmldoc)  ;;<br>-     esac], [disable_xmldoc=no])<br>+  esac], [DISABLE_XMLDOC=no])<br> <br>-if test "${disable_xmldoc}" != "yes"; then<br>+AC_SUBST([DISABLE_XMLDOC])<br>+if test "${DISABLE_XMLDOC}" != "yes"; then<br>+        AC_DEFINE([AST_XML_DOCS], 1, [Define to enable XML documentation.])<br>         AST_EXT_LIB_CHECK([LIBXSLT], [xslt], [xsltLoadStylesheetPI], [libxslt/xsltInternals.h], [${LIBXML2_LIB}], [${LIBXML2_INCLUDE}])<br>         AST_EXT_LIB_CHECK([LIBXSLT_CLEANUP], [xslt], [xsltCleanupGlobals], [libxslt/xsltInternals.h], [${LIBXML2_LIB}], [${LIBXML2_INCLUDE}])<br> <br>diff --git a/include/asterisk/autoconfig.h.in b/include/asterisk/autoconfig.h.in<br>index f85ad8d..5865c0a 100644<br>--- a/include/asterisk/autoconfig.h.in<br>+++ b/include/asterisk/autoconfig.h.in<br>@@ -9,6 +9,9 @@<br> /* Define to 1 if internal poll should be used. */<br> #undef AST_POLL_COMPAT<br> <br>+/* Define to enable XML documentation. */<br>+#undef AST_XML_DOCS<br>+<br> /* Define to 1 if your system's implementation of mutexes supports comparison<br>    of a mutex to its initializer. */<br> #undef CAN_COMPARE_MUTEX_TO_INIT_VALUE<br>diff --git a/include/asterisk/xml.h b/include/asterisk/xml.h<br>index 063e8c0..ab7b630 100644<br>--- a/include/asterisk/xml.h<br>+++ b/include/asterisk/xml.h<br>@@ -246,10 +246,5 @@<br>  */<br> struct ast_xml_xpath_results *ast_xml_query(struct ast_xml_doc *doc, const char *xpath_str);<br> <br>-/* Features using ast_xml_ */<br>-#ifdef HAVE_LIBXML2<br>-#define AST_XML_DOCS<br>-#endif<br>-<br> #endif /* _ASTERISK_XML_H */<br> <br>diff --git a/main/config_options.c b/main/config_options.c<br>index 8eacbda..3c0959e 100644<br>--- a/main/config_options.c<br>+++ b/main/config_options.c<br>@@ -80,7 +80,6 @@<br> <br> #ifdef AST_XML_DOCS<br> static struct ao2_container *xmldocs;<br>-#endif /* AST_XML_DOCS */<br> <br> /*! \brief Value of the aco_option_type enum as strings */<br> static char *aco_option_type_string[] = {<br>@@ -98,6 +97,7 @@<br>    "Unsigned Integer",   /* OPT_UINT_T, */<br>     "Boolean",                    /* OPT_YESNO_T, */<br> };<br>+#endif /* AST_XML_DOCS */<br> <br> void *aco_pending_config(struct aco_info *info)<br> {<br>diff --git a/main/manager.c b/main/manager.c<br>index 5c0b318..079dab7 100644<br>--- a/main/manager.c<br>+++ b/main/manager.c<br>@@ -1653,8 +1653,10 @@<br> /*! \brief list of hooks registered */<br> static AST_RWLIST_HEAD_STATIC(manager_hooks, manager_custom_hook);<br> <br>+#ifdef AST_XML_DOCS<br> /*! \brief A container of event documentation nodes */<br> static AO2_GLOBAL_OBJ_STATIC(event_docs);<br>+#endif<br> <br> static int __attribute__((format(printf, 9, 0))) __manager_event_sessions(<br>    struct ao2_container *sessions,<br>@@ -2305,7 +2307,9 @@<br>        return ret;<br> }<br> <br>+#ifdef AST_XML_DOCS<br> static void print_event_instance(struct ast_cli_args *a, struct ast_xml_doc_item *instance);<br>+#endif<br> <br> static char *handle_showmancmd(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)<br> {<br>diff --git a/makeopts.in b/makeopts.in<br>index 7d0347d..30bc2e2 100644<br>--- a/makeopts.in<br>+++ b/makeopts.in<br>@@ -108,6 +108,7 @@<br> <br> AST_DEVMODE=@AST_DEVMODE@<br> AST_DEVMODE_STRICT=@AST_DEVMODE_STRICT@<br>+DISABLE_XMLDOC=@DISABLE_XMLDOC@<br> NOISY_BUILD=@NOISY_BUILD@<br> <br> AST_CODE_COVERAGE=@AST_CODE_COVERAGE@<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/6877">change 6877</a>. To unsubscribe, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/6877"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: Ifac562340c09f80c83e0203de098fcac93bf8c44 </div>
<div style="display:none"> Gerrit-Change-Number: 6877 </div>
<div style="display:none"> Gerrit-PatchSet: 3 </div>
<div style="display:none"> Gerrit-Owner: Corey Farrell <git@cfware.com> </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>