From 16a9fc49ddd59ded7e03cea2deb3d33bde788000 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Wed, 12 Nov 2014 15:50:39 -0500 Subject: [PATCH] docs: make the settings docs work from tarball builds docs/api/settings-spec.xml was accidentally not getting disted, because gtk-doc.make explicitly removes all DISTCLEANFILES from distdir. However, it doesn't actually make sense for the settings docs files to be in DISTCLEANFILES anyway; they were put there rather than CLEANFILES (IIRC) so that "make clean" in a tarball build wouldn't delete them and break things. But the right fix is to just make them only be in CLEANFILES when BUILD_SETTING_DOCS is true, and not ever get deleted otherwise. Also adjust the build rules to ensure that the generated docs don't get rebuilt in tarball builds, since that can cause problems when building from a read-only source tree, etc. Meanwhile, in an unrelated but also fatal bug, configure.ac's check for if the generated docs were already present never got updated for the cli/src -> clients/cli move, and so even if we had been disting settings-spec.xml, configure would still think that the tarball didn't have all of the generated docs in it, so SETTING_DOCS_AVAILABLE would be set false and none of the generated docs would get used. https://bugzilla.gnome.org/show_bug.cgi?id=740035 --- clients/cli/Makefile.am | 3 +-- configure.ac | 2 +- docs/api/Makefile.am | 7 ++++++- libnm-util/Makefile.am | 13 ++++++++----- man/Makefile.am | 10 +++++----- 5 files changed, 21 insertions(+), 14 deletions(-) diff --git a/clients/cli/Makefile.am b/clients/cli/Makefile.am index 0820aab04..482de7a83 100644 --- a/clients/cli/Makefile.am +++ b/clients/cli/Makefile.am @@ -55,10 +55,9 @@ settings-docs.c: settings-docs.xsl $(top_builddir)/libnm-util/nm-setting-docs.xm $(AM_V_GEN) xsltproc --output $@ $^ BUILT_SOURCES = settings-docs.c +CLEANFILES = settings-docs.c endif -DISTCLEANFILES = settings-docs.c - EXTRA_DIST = settings-docs.c settings-docs.xsl completiondir = $(datadir)/bash-completion/completions diff --git a/configure.ac b/configure.ac index 5888179c8..c123fe854 100644 --- a/configure.ac +++ b/configure.ac @@ -897,7 +897,7 @@ if test "$build_setting_docs" != "yes" \ -a -f man/nm-settings-keyfile.xml \ -a -f man/nm-settings-ifcfg-rh.xml \ -a -f docs/api/settings-spec.xml \ - -a -f cli/src/settings-docs.c; then + -a -f clients/cli/settings-docs.c; then AC_DEFINE(HAVE_SETTING_DOCS, [1], [Define if you have pre-built settings docs]) have_setting_docs=yes fi diff --git a/docs/api/Makefile.am b/docs/api/Makefile.am index 683340e68..a364da035 100644 --- a/docs/api/Makefile.am +++ b/docs/api/Makefile.am @@ -70,5 +70,10 @@ CLEANFILES += html/* tmpl/* xml/* \ NetworkManager-sections.txt \ NetworkManager-overrides.txt -DISTCLEANFILES = $(GENERATED_FILES) +if BUILD_SETTING_DOCS +CLEANFILES += settings-spec.xml +endif +if ENABLE_GTK_DOC +CLEANFILES += spec.html +endif diff --git a/libnm-util/Makefile.am b/libnm-util/Makefile.am index f0a885afc..51864df15 100644 --- a/libnm-util/Makefile.am +++ b/libnm-util/Makefile.am @@ -191,21 +191,24 @@ if BUILD_SETTING_DOCS noinst_DATA = nm-setting-docs.xml nm-keyfile-docs.xml nm-ifcfg-rh-docs.xml -nm-setting-docs.xml: generate-setting-docs.py NetworkManager-1.0.gir NetworkManager-1.0.typelib libnm-util.la +docs_sources = $(filter-out $(BUILT_SOURCES),$(libnm_util_la_csources)) + +nm-setting-docs.xml: generate-setting-docs.py $(docs_sources) | NetworkManager-1.0.gir NetworkManager-1.0.typelib libnm-util.la export GI_TYPELIB_PATH=$(abs_builddir)$${GI_TYPELIB_PATH:+:$$GI_TYPELIB_PATH}; \ export LD_LIBRARY_PATH=$(abs_builddir)/.libs$${LD_LIBRARY_PATH:+:$$LD_LIBRARY_PATH}; \ $(srcdir)/generate-setting-docs.py \ --gir $(builddir)/NetworkManager-1.0.gir \ --output $@ -nm-keyfile-docs.xml: generate-plugin-docs.pl $(libnm_util_la_csources) +nm-keyfile-docs.xml: generate-plugin-docs.pl $(docs_sources) $(srcdir)/generate-plugin-docs.pl keyfile $(srcdir) $@ -nm-ifcfg-rh-docs.xml: generate-plugin-docs.pl $(libnm_util_la_csources) +nm-ifcfg-rh-docs.xml: generate-plugin-docs.pl $(docs_sources) $(srcdir)/generate-plugin-docs.pl ifcfg-rh $(srcdir) $@ -endif +CLEANFILES += $(noinst_DATA) +EXTRA_DIST += $(noinst_DATA) -DISTCLEANFILES += nm-setting-docs.xml nm-keyfile-docs.xml nm-ifcfg-rh-docs.xml +endif EXTRA_DIST += generate-setting-docs.py generate-plugin-docs.pl diff --git a/man/Makefile.am b/man/Makefile.am index 5d0386ff3..589a3325f 100644 --- a/man/Makefile.am +++ b/man/Makefile.am @@ -48,6 +48,11 @@ nm-settings-ifcfg-rh.xml: nm-settings-ifcfg-rh.xsl $(top_builddir)/libnm-util/nm --stringparam date "`date +'%d %B %Y'`" \ $^ +CLEANFILES += \ + nm-settings.xml \ + nm-settings-keyfile.xml \ + nm-settings-ifcfg-rh.xml + endif configure_generated_man_pages = \ @@ -76,11 +81,6 @@ EXTRA_DIST += \ $(docbook_generated_man_pages:.%=.xml) \ $(docbook_autogenerated_man_pages) -DISTCLEANFILES = \ - nm-settings.xml \ - nm-settings-keyfile.xml \ - nm-settings-ifcfg-rh.xml - man_MANS += $(configure_generated_man_pages) links = nmtui-edit nmtui-connect nmtui-hostname