]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Build System: Fix --disable-xmldoc option.
authorCorey Farrell <git@cfware.com>
Thu, 30 Mar 2017 14:51:14 +0000 (10:51 -0400)
committerCorey Farrell <git@cfware.com>
Wed, 25 Oct 2017 15:26:16 +0000 (10:26 -0500)
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.  Disabling xmldoc also prevents docs
from being automatically generated, but they can still be manually
generated with 'make doc/core-en_US.xml'.

ASTERISK-26639

Change-Id: Ifac562340c09f80c83e0203de098fcac93bf8c44

Makefile
configure
configure.ac
include/asterisk/autoconfig.h.in
include/asterisk/xml.h
main/config_options.c
main/manager.c
makeopts.in

index bb8de13224c19c1fa3ade56d9b2abb1d8af4e4b5..659ffed954d12d9dd4ca9a6e835a68cf89c8dbdd 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -210,7 +210,9 @@ ifeq ($(AST_DEVMODE),yes)
   ifeq ($(AST_DEVMODE_STRICT),yes)
     _ASTCFLAGS+=-Wshadow
   endif
-  ADDL_TARGETS+=validate-docs
+  ifneq ($(DISABLE_XMLDOC),yes)
+    ADDL_TARGETS+=validate-docs
+  endif
 endif
 
 ifneq ($(findstring BSD,$(OSARCH)),)
@@ -248,6 +250,14 @@ ifneq ($(wildcard .svn),)
   ASTERISKVERSIONNUM:=999999
 endif
 
+ifneq ($(DISABLE_XMLDOC),yes)
+  CORE_XMLDOC=doc/core-en_US.xml
+  FULL_XMLDOC=doc/full-en_US.xml
+else
+  CORE_XMLDOC=
+  FULL_XMLDOC=
+endif
+
 _ASTCFLAGS+=$(OPTIONS)
 
 MOD_SUBDIRS:=third-party channels pbx apps codecs formats cdr cel bridges funcs tests main res addons $(LOCAL_MOD_SUBDIRS)
@@ -328,9 +338,9 @@ full: _full
        @echo " +-------------------------------------------+"
 
 
-_all: makeopts $(SUBDIRS) doc/core-en_US.xml $(ADDL_TARGETS)
+_all: makeopts $(SUBDIRS) $(CORE_XMLDOC) $(ADDL_TARGETS)
 
-_full: makeopts $(SUBDIRS) doc/full-en_US.xml $(ADDL_TARGETS)
+_full: makeopts $(SUBDIRS) $(FULL_XMLDOC) $(ADDL_TARGETS)
 
 makeopts: configure
        @echo "****"
@@ -425,7 +435,7 @@ distclean: $(SUBDIRS_DIST_CLEAN) _clean
        rm -f doc/asterisk-ng-doxygen
        rm -f build_tools/menuselect-deps
 
-datafiles: _all doc/core-en_US.xml
+datafiles: _all $(CORE_XMLDOC)
        CFLAGS="$(_ASTCFLAGS) $(ASTCFLAGS)" build_tools/mkpkgconfig "$(DESTDIR)$(libdir)/pkgconfig";
 
 #      # Recursively install contents of the static-http directory, in case
@@ -437,8 +447,10 @@ datafiles: _all doc/core-en_US.xml
                        $(INSTALL) -m 644 $$x "$(DESTDIR)$(ASTDATADIR)/$$x" ; \
                fi \
        done
+ifneq ($(DISABLE_XMLDOC),yes)
        $(INSTALL) -m 644 doc/core-en_US.xml "$(DESTDIR)$(ASTDATADIR)/static-http";
        $(INSTALL) -m 644 doc/appdocsxml.xslt "$(DESTDIR)$(ASTDATADIR)/static-http";
+endif
        if [ -d doc/tex/asterisk ] ; then \
                $(INSTALL) -d "$(DESTDIR)$(ASTDATADIR)/static-http/docs" ; \
                for n in doc/tex/asterisk/* ; do \
@@ -567,9 +579,11 @@ bininstall: _all installdirs $(SUBDIRS_INSTALL) main-bininstall
                for h in $(OLDHEADERS); do rm -f "$(DESTDIR)$(ASTHEADERDIR)/$$h"; done \
        fi
 
+ifneq ($(DISABLE_XMLDOC),yes)
        $(INSTALL) -m 644 doc/core-*.xml "$(DESTDIR)$(ASTDATADIR)/documentation"
        $(INSTALL) -m 644 doc/appdocsxml.xslt "$(DESTDIR)$(ASTDATADIR)/documentation"
        $(INSTALL) -m 644 doc/appdocsxml.dtd "$(DESTDIR)$(ASTDATADIR)/documentation"
+endif
        $(INSTALL) -m 644 doc/asterisk.8 "$(DESTDIR)$(ASTMANDIR)/man8"
        $(INSTALL) -m 644 doc/astdb*.8 "$(DESTDIR)$(ASTMANDIR)/man8"
        $(INSTALL) -m 644 contrib/scripts/astgenkey.8 "$(DESTDIR)$(ASTMANDIR)/man8"
index 784e775ebac255858565334f814e58d2a1c090e0..268347b99a231b1a513b506d2dce9b05e5637031 100755 (executable)
--- a/configure
+++ b/configure
@@ -718,6 +718,7 @@ PBX_DYNAMIC_LIST
 POW_LIB
 PBX_WORKING_FORK
 LIBOBJS
+DISABLE_XMLDOC
 CONFIG_LIBXML2
 UUID_LIB
 UUID_INCLUDE
 # Check whether --enable-xmldoc was given.
 if test "${enable_xmldoc+set}" = set; then :
   enableval=$enable_xmldoc; case "${enableval}" in
-               y|ye|yes) disable_xmldoc=no ;;
-               n|no)  disable_xmldoc=yes ;;
+               y|ye|yes) DISABLE_XMLDOC=no ;;
+               n|no)  DISABLE_XMLDOC=yes ;;
                *) as_fn_error $? "bad value ${enableval} for --disable-xmldoc" "$LINENO" 5  ;;
        esac
 else
-  disable_xmldoc=no
+  DISABLE_XMLDOC=no
 fi
 
 
-if test "${disable_xmldoc}" != "yes"; then
+
+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=""
index 1cdeea93c81f3b1f722612be6b69000e282a92f2..ea6bef1d14be6d6fdf8a27394f490b301b436926 100644 (file)
@@ -659,12 +659,14 @@ AC_ARG_ENABLE([xmldoc],
        [AS_HELP_STRING([--disable-xmldoc],
                [Explicitly disable XML documentation])],
        [case "${enableval}" in
-               y|ye|yes) disable_xmldoc=no ;;
-               n|no)  disable_xmldoc=yes ;;
+               y|ye|yes) DISABLE_XMLDOC=no ;;
+               n|no)  DISABLE_XMLDOC=yes ;;
                *) AC_MSG_ERROR(bad value ${enableval} for --disable-xmldoc)  ;;
-       esac], [disable_xmldoc=no])
+       esac], [DISABLE_XMLDOC=no])
 
-if test "${disable_xmldoc}" != "yes"; then
+AC_SUBST([DISABLE_XMLDOC])
+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}])
 
index 723d84d366d5d416a3740c0c961ee303cef04506..b0b8e82443b58b9961bb6ecde925ec4be79553bc 100644 (file)
@@ -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
index 063e8c0b39f9b19f899962a57d8f7dc71cb6af23..ab7b630a2b1e38c56bf6550cca32b2e635da1794 100644 (file)
@@ -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 */
 
index 40fae161c8378dd982cf92fe05054c4f4fb6a7e3..484eaf6e4961c2883e337e58860f107693d153aa 100644 (file)
@@ -82,7 +82,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[] = {
@@ -100,6 +99,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)
 {
index aece73adb217b934dd6870a95d8a509d7ad985cf..5bc87d5476771b2a4e95e5572ec8a20288783a43 100644 (file)
@@ -1649,8 +1649,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,
@@ -2306,7 +2308,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)
 {
index 4baefa298a54ceced83fe6fe4ce28464be3442dd..1050c91fb310534e5ed5a016bfe7eb0458bdb5ee 100644 (file)
@@ -108,6 +108,7 @@ ASTVARRUNDIR = @astvarrundir@
 
 AST_DEVMODE=@AST_DEVMODE@
 AST_DEVMODE_STRICT=@AST_DEVMODE_STRICT@
+DISABLE_XMLDOC=@DISABLE_XMLDOC@
 NOISY_BUILD=@NOISY_BUILD@
 
 AST_CODE_COVERAGE=@AST_CODE_COVERAGE@