Commit 3a5bf051 authored by Dan Williams's avatar Dan Williams

build: always generate docs at dist time (bgo #700093)

dist tarballs shouldn't ever be released without the documentation,
and this allows us to build the tarballs with pre-generated docs
that get installed on the end system, but don't need to be built
there.  So the end system doesn't need gtk-doc installed, only
the dist system does.

https://bugzilla.gnome.org/show_bug.cgi?id=700093
parent f762fa58
......@@ -32,7 +32,7 @@ EXTRA_DIST = \
DISTCHECK_CONFIGURE_FLAGS = \
--with-tests=yes \
--with-docs=yes \
--enable-gtk-doc \
--enable-more-warnings=yes \
--with-udev-dir=$$dc_install_base/lib/udev \
--with-wext=no \
......
......@@ -603,19 +603,14 @@ VAPIGEN_CHECK(0.17.1.24)
# Tests, utilities and documentation
AC_ARG_ENABLE(tests, AS_HELP_STRING([--enable-tests=root|yes|no], [Build NetworkManager tests (default: yes)]))
AC_ARG_WITH(valgrind, AS_HELP_STRING([--with-valgrind=yes|no|path], [Use valgrind to memory-check the tests (default: yes)]))
AC_ARG_ENABLE(doc, AS_HELP_STRING([--enable-doc], [Build NetworkManager documentation (default: no)]))
# Fallback to --with-tests and with-docs
# Fallback to --with-tests
AC_ARG_WITH(tests, AS_HELP_STRING([--with-tests], [Build NetworkManager tests (deprecated)]))
AC_ARG_WITH(docs, AS_HELP_STRING([--with-docs], [Build NetworkManager documentation (deprecated)]))
AS_IF([test -n "$with_tests"], enable_tests="$with_tests")
AS_IF([test -n "$with_docs"], enable_doc="$with_docs")
# Default to --enable-tests --with-valgrind --disable-docs
# Default to --enable-tests --with-valgrind
AS_IF([test -z "$enable_tests"], enable_tests="yes")
AS_IF([test -z "$with_valgrind"], with_valgrind="yes")
AS_IF([test -z "$enable_doc"], enable_doc="no")
# Normalize values
AS_IF([test "$enable_tests" != "yes" -a "$enable_tests" != "root"], enable_tests="no")
AS_IF([test "$enable_doc" != "yes"], enable_doc="no")
# Search for tools
AS_IF([test "$with_valgrind" == "yes"],
[AC_PATH_PROGS(with_valgrind, valgrind, no)])
......@@ -625,11 +620,21 @@ AM_CONDITIONAL(RUN_ROOT_TESTS, test "$enable_tests" == "root")
AS_IF([test "$with_valgrind" != "no"],
AC_SUBST(VALGRIND_RULES, "TESTS_ENVIRONMENT = G_SLICE=always-malloc G_DEBUG=gc-friendly \$(LIBTOOL) --mode=execute $with_valgrind --quiet --error-exitcode=1 --leak-check=full --gen-suppressions=all --suppressions=\$(top_srcdir)/valgrind.suppressions"),
AC_SUBST(VALGRIND_RULES, []))
AM_CONDITIONAL(ENABLE_DOC, test "$enable_doc" = "yes")
# Add gtk-doc conditionals
enable_gtk_doc="$enable_doc"
GTK_DOC_CHECK(1.0)
# check for pregenerated manpages to be installed
install_pregen_manpages=no
if test "$enable_gtk_doc" != "yes" \
-a -f man/NetworkManager.conf.5 \
-a -f man/nm-settings.5 \
-a -f man/NetworkManager.8; then
install_pregen_manpages=yes
fi
AM_CONDITIONAL(INSTALL_PREGEN_MANPAGES, test "x${install_pregen_manpages}" = "xyes")
echo " man: $install_pregen_manpages"
AC_CONFIG_FILES([
Makefile
include/Makefile
......@@ -762,7 +767,7 @@ echo " dhcpcd: $with_dhcpcd"
echo
echo "Miscellaneous:"
echo " documentation: $enable_doc"
echo " documentation: $enable_gtk_doc"
echo " tests: $enable_tests"
echo " valgrind: $with_valgrind"
echo " code coverage: $enable_code_coverage"
......
if ENABLE_DOC
SUBDIRS = libnm-glib libnm-util api
SUBDIRS = api libnm-glib libnm-util
endif
AUTOMAKE_OPTIONS = 1.7
if ENABLE_DOC
XSLTPROC = xsltproc --xinclude --nonet
XMLS = $(wildcard $(top_srcdir)/introspection/nm-*.xml)
......@@ -15,21 +13,24 @@ OTHER_FILES= \
GENERATED_FILES = spec.html settings-spec.xml
if ENABLE_GTK_DOC
spec.html: $(XMLS) $(OTHER_FILES) html-build.stamp
$(XSLTPROC) --path "$(top_builddir)/introspection:$(top_srcdir)/introspection" $(top_srcdir)/tools/doc-generator.xsl $(top_builddir)/introspection/all.xml > $@
mkdir -p $(builddir)/html/
cp $@ $(builddir)/html/
# settings-spec.xml should *not* be DISTed because it must be regenerated
# whenever the libnm-util source changes
settings-spec.xml: $(top_builddir)/tools/generate-settings-spec $(top_builddir)/libnm-util/libnm-util.la
$(top_builddir)/tools/generate-settings-spec book $@
rm -f $(builddir)/settings-spec.xml
$(top_builddir)/tools/generate-settings-spec book $(builddir)/settings-spec.xml
all: $(GENERATED_FILES)
endif
# Top-level SGML file includes (depends on) settings-spec.xml
$(DOC_MAIN_SGML_FILE): settings-spec.xml
all: $(GENERATED_FILES)
####################################
# The name of the module.
......@@ -56,17 +57,9 @@ include $(top_srcdir)/gtk-doc.make
####################################
EXTRA_DIST += spec.html
CLEANFILES += $(GENERATED_FILES)
else
EXTRA_DIST =
CLEANFILES =
endif
EXTRA_DIST += version.xml.in
EXTRA_DIST += version.xml.in $(GENERATED_FILES)
CLEANFILES += html/* tmpl/* xml/* \
NetworkManager-sections.txt \
NetworkManager-overrides.txt
NetworkManager-overrides.txt \
$(GENERATED_FILES)
......@@ -2,8 +2,6 @@ man_MANS =
CLEANFILES =
EXTRA_DIST =
if ENABLE_DOC
XSLTPROC = xsltproc
XSLTPROC_FLAGS = \
......@@ -17,6 +15,8 @@ XSLTPROC_FLAGS = \
XSLTPROC_MAN_FLAGS = $(XSLTPROC_FLAGS) http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl
if ENABLE_GTK_DOC
%.8: %.xml
$(AM_V_GEN) xsltproc $(XSLTPROC_MAN_FLAGS) $<
......@@ -26,8 +26,8 @@ XSLTPROC_MAN_FLAGS = $(XSLTPROC_FLAGS) http://docbook.sourceforge.net/release/xs
nm-settings.xml: $(top_builddir)/tools/generate-settings-spec $(top_builddir)/libnm-util/libnm-util.la
rm -f $(builddir)/$@
$(top_builddir)/tools/generate-settings-spec refentry $(builddir)/$@
CLEANFILES += nm-settings.xml
endif
configure_generated_man_pages = \
nmcli.1 \
......@@ -38,17 +38,29 @@ docbook_generated_man_pages = \
NetworkManager.8 \
NetworkManager.conf.5
CLEANFILES += $(docbook_generated_man_pages)
EXTRA_DIST += $(docbook_generated_man_pages:.%=.xml)
docbook_autogenerated_man_pages = \
nm-settings.5
CLEANFILES += $(docbook_autogenerated_man_pages)
generated_man_pages = \
$(docbook_generated_man_pages) \
$(docbook_autogenerated_man_pages)
man_MANS += \
$(configure_generated_man_pages) \
$(docbook_generated_man_pages) \
EXTRA_DIST += \
$(docbook_generated_man_pages:.%=.xml) \
$(docbook_autogenerated_man_pages)
CLEANFILES += \
$(docbook_autogenerated_man_pages) \
$(docbook_generated_man_pages) \
nm-settings.xml
man_MANS += $(configure_generated_man_pages)
if ENABLE_GTK_DOC
man_MANS += $(generated_man_pages)
else
if INSTALL_PREGEN_MANPAGES
man_MANS += $(generated_man_pages)
endif
endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment