build: combine handling of setting docs and man pages

Building the man pages via xsltproc requires "docbook.xsl"
which is part of docbook.

Previously, we would build the man pages solely based on
"--enable-introspection", which checks for the presence of
xsltproc, but not docbook. This can lead to build failure
when docbook is not available, but "--enable-introspection"
is given.

Instead of adding yet another configure option to fine-tune
and say "--with-docbook --disable-gtk-doc", just simplify it.

Now, documentation (both man pages and setting docs) will be generated
with "--enable-gtk-doc" and "--enable-introspection".
If the documentation is not about to be generated, pre-generated docs
will be installed if they are available. That is commonly the case
with a source tarball, but not with a git checkout.
Finally, if documentation is nither generated nor pre-generated,
no documentation will be installed *duh*.

This removes the possibility to treat man pages separate from settings
docs. Now you either generate both, install both pre-generated, or don't
get any of them.

https://bugzilla.gnome.org/show_bug.cgi?id=778551
This commit is contained in:
Thomas Haller 2017-02-13 16:26:20 +01:00
parent 5936a8babe
commit b599f1b743
3 changed files with 26 additions and 38 deletions

View file

@ -86,7 +86,7 @@ SUBDIRS = \
. \
po
if BUILD_SETTING_DOCS
if HAVE_DOCS
SUBDIRS += \
docs/libnm \
@ -128,7 +128,7 @@ DISTCHECK_CONFIGURE_FLAGS = \
dist-configure-check:
@echo "*** 'make dist' requires '--enable-gtk-doc --enable-introspection --with-libnm-glib'. ***"
@false
if !BUILD_SETTING_DOCS
if !BUILD_DOCS
dist_configure_check += dist-configure-check
endif
if !WITH_LEGACY_LIBRARIES
@ -3953,7 +3953,7 @@ xsltproc_flags = \
--stringparam man.authors.section.enabled 0 \
--stringparam man.copyright.section.enabled 0
if HAVE_INTROSPECTION
if BUILD_DOCS
man/%.1 man/%.5 man/%.7 man/%.8: man/%.xml man/common.ent
$(AM_V_GEN) $(XSLTPROC) --output $@ $(xsltproc_flags) http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
@ -4021,22 +4021,16 @@ uninstall-hook-man:
uninstall_hook += uninstall-hook-man
if HAVE_INTROSPECTION
if HAVE_DOCS
install_manpages = true
man_MANS += $(man_pages)
CLEANFILES += $(man_pages)
if SETTING_DOCS_AVAILABLE
man_MANS += $(man_pages_autogen)
endif
if BUILD_DOCS
CLEANFILES += $(man_pages)
CLEANFILES += $(man_pages_autogen)
endif
else
if INSTALL_PREGEN_MANPAGES
install_manpages = true
man_MANS += \
$(man_pages) \
$(man_pages_autogen)
endif
endif
dist_dependencies += $(man_pages)
dist_dependencies += $(man_pages_autogen)

View file

@ -1089,7 +1089,7 @@ AC_DEFINE_UNQUOTED(TEST_NM_PYTHON, "$PYTHON", [Define python path for test binar
GTK_DOC_CHECK(1.0)
# check if we can build setting property documentation
build_setting_docs=no
build_docs=no
if test -n "$INTROSPECTION_MAKEFILE"; then
# If g-i is installed we know we have python, but we might not have pygobject
if ! "$PYTHON" -c 'from gi.repository import GObject' >& /dev/null; then
@ -1101,7 +1101,7 @@ if test -n "$INTROSPECTION_MAKEFILE"; then
have_introspection=yes
if test "$enable_gtk_doc" = "yes"; then
build_setting_docs=yes
build_docs=yes
fi
else
if test "$enable_gtk_doc" = "yes"; then
@ -1112,20 +1112,9 @@ else
have_introspection=no
fi
# check for pre-built setting docs
if test "$build_setting_docs" != "yes" \
-a -f man/nm-settings.xml \
-a -f man/nm-settings-keyfile.xml \
-a -f man/nm-settings-ifcfg-rh.xml \
\
-a -f docs/api/settings-spec.xml \
; then
have_setting_docs=yes
fi
# check for pregenerated manpages to be installed
install_pregen_manpages=no
if test "$enable_gtk_doc" != "yes" \
# check for pregenerated manpages and documentation to be installed
use_pregen_docs=no
if test "$build_docs" != "yes" \
-a -f man/NetworkManager.8 \
-a -f man/NetworkManager.conf.5 \
-a -f man/nm-online.1 \
@ -1136,13 +1125,18 @@ if test "$enable_gtk_doc" != "yes" \
-a -f man/nm-settings-ifcfg-rh.5 \
-a -f man/nm-settings-keyfile.5 \
-a -f man/nm-settings.5 \
\
-a -f man/nm-settings.xml \
-a -f man/nm-settings-keyfile.xml \
-a -f man/nm-settings-ifcfg-rh.xml \
\
-a -f docs/api/settings-spec.xml \
; then
install_pregen_manpages=yes
use_pregen_docs=yes
fi
AM_CONDITIONAL(BUILD_SETTING_DOCS, test "$build_setting_docs" = "yes")
AM_CONDITIONAL(SETTING_DOCS_AVAILABLE, test "$build_setting_docs" = "yes" -o "$have_setting_docs" = "yes")
AM_CONDITIONAL(INSTALL_PREGEN_MANPAGES, test "$install_pregen_manpages" = "yes")
AM_CONDITIONAL(BUILD_DOCS, test "$build_docs" = "yes")
AM_CONDITIONAL(HAVE_DOCS, test "$build_docs" = "yes" -o "$use_pregen_docs" = "yes")
AC_CONFIG_FILES([
Makefile
@ -1232,9 +1226,9 @@ echo " dhcpcd-supports-ipv6: $with_dhcpcd_supports_ipv6"
echo
echo "Miscellaneous:"
echo " documentation: $enable_gtk_doc"
echo " documentation-settings: $build_setting_docs"
echo " introspection: $have_introspection"
echo " have introspection: $have_introspection"
echo " build documentation and manpages: $build_docs"
echo " install pregenerated documentation and manpages: $use_pregen_docs"
echo " tests: $enable_tests"
echo " more-asserts: $more_asserts"
echo " more-logging: $enable_more_logging"

View file

@ -5,7 +5,7 @@ XMLS = $(wildcard $(top_srcdir)/introspection/nm-*.xml)
GENERATED_FILES =
if SETTING_DOCS_AVAILABLE
if BUILD_DOCS
settings-spec.xml: settings-spec.xsl $(top_builddir)/libnm/nm-settings-docs.xml
$(AM_V_GEN) xsltproc --output $@ $^