Commit 377f72a6 authored by Dan Winship's avatar Dan Winship

build: fix nm-setting-docs build in various configurations

Certain build configurations (like --enable-gtk-doc
--disable-introspection) were broken with respect to nm-setting-docs.
Fix this. Also, we don't require just gobject-introspection, we need
pygobject specifically as well.
parent 87c48023
......@@ -44,16 +44,15 @@ DISTCHECK_CONFIGURE_FLAGS = \
--enable-ifupdown \
--enable-ifnet
if HAVE_INTROSPECTION
dist-check-introspection:
if BUILD_SETTING_DOCS
dist-check-setting-docs:
else
dist-check-introspection:
@echo "*** gobject-introspection is needed to run 'make dist'. ***"
@echo "*** It was not enabled when 'configure' ran. ***"
dist-check-setting-docs:
@echo "*** gobject-introspection and pygobject are needed to run 'make dist'. ***"
@false
endif
dist: dist-check-introspection
dist: dist-check-setting-docs
DISTCLEANFILES = intltool-extract intltool-merge intltool-update
......
......@@ -38,7 +38,7 @@ nmcli_LDADD = \
$(top_builddir)/libnm-util/libnm-util.la \
$(top_builddir)/libnm-glib/libnm-glib.la
if HAVE_INTROSPECTION
if BUILD_SETTING_DOCS
settings-docs.c: settings-docs.xsl $(top_builddir)/libnm-util/nm-setting-docs.xml
$(AM_V_GEN) xsltproc --output $@ $^
......
......@@ -6368,7 +6368,7 @@ nmc_setting_get_property_allowed_values (NMSetting *setting, const char *prop)
return NULL;
}
#ifdef HAVE_INTROSPECTION
#if defined (BUILD_SETTING_DOCS) || defined (HAVE_SETTING_DOCS)
#include "settings-docs.c"
#else
#define nmc_setting_get_property_doc(setting, prop) _("(not available)")
......
......@@ -267,9 +267,6 @@ AC_SUBST(GUDEV_CFLAGS)
AC_SUBST(GUDEV_LIBS)
GOBJECT_INTROSPECTION_CHECK([0.9.6])
if test -n "$INTROSPECTION_MAKEFILE"; then
AC_DEFINE(HAVE_INTROSPECTION, [1], [Define if you have gobject-introspection])
fi
# Qt4
PKG_CHECK_MODULES(QT, [QtCore >= 4 QtDBus QtNetwork], [have_qt=yes],[have_qt=no])
......@@ -772,6 +769,27 @@ if test "$enable_gtk_doc" != "yes" \
fi
AM_CONDITIONAL(INSTALL_PREGEN_MANPAGES, test "x${install_pregen_manpages}" = "xyes")
# check if we can build setting property documentation
if test -n "$INTROSPECTION_MAKEFILE" -a "$enable_gtk_doc" = "yes"; 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
AC_DEFINE(BUILD_SETTING_DOCS, [1], [Define if you we can build nm-setting-docs.xml])
build_setting_docs=yes
fi
fi
# check for pre-built setting docs
if test "$build_setting_docs" != "yes" \
-a -f man/nm-settings.xml \
-a -f docs/api/settings-spec.xml \
-a -f cli/src/settings-docs.c; then
AC_DEFINE(HAVE_SETTING_DOCS, [1], [Define if you have pre-built settings docs])
have_setting_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")
AC_CONFIG_FILES([
Makefile
......
......@@ -11,7 +11,19 @@ OTHER_FILES= \
$(top_srcdir)/tools/doc-generator.xsl \
$(top_srcdir)/introspection/generic-types.xml
GENERATED_FILES = spec.html settings-spec.xml
GENERATED_FILES = spec.html
if SETTING_DOCS_AVAILABLE
settings-spec.xml: settings-spec.xsl $(top_builddir)/libnm-util/nm-setting-docs.xml
$(AM_V_GEN) xsltproc --output $@ $^
# Top-level SGML file includes (depends on) settings-spec.xml
$(DOC_MAIN_SGML_FILE): settings-spec.xml
GENERATED_FILES += settings-spec.xml
endif
if ENABLE_GTK_DOC
......@@ -20,16 +32,10 @@ spec.html: $(XMLS) $(OTHER_FILES) html-build.stamp
mkdir -p $(builddir)/html/
cp spec.html $(builddir)/html/
settings-spec.xml: settings-spec.xsl $(top_builddir)/libnm-util/nm-setting-docs.xml
$(AM_V_GEN) xsltproc --output $@ $^
all: $(GENERATED_FILES)
endif
# Top-level SGML file includes (depends on) settings-spec.xml
$(DOC_MAIN_SGML_FILE): settings-spec.xml
####################################
# The name of the module.
......
......@@ -54,7 +54,17 @@
setting names (like "wimax" or "bluetooth") to a dictionary of
key/value pairs that represents each itself.
</para>
<xi:include href="settings-spec.xml" />
<xi:include href="settings-spec.xml">
<xi:fallback>
<section>
<title>Configuration Settings</title>
<note><para>
(NetworkManager was built without full introspection support. Setting
documentation is not available.)
</para></note>
</section>
</xi:fallback>
</xi:include>
<section id="secrets-flags">
<title>Secret flag types</title>
<para>
......
......@@ -182,6 +182,10 @@ typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
CLEANFILES += $(gir_DATA) $(typelib_DATA)
endif
if BUILD_SETTING_DOCS
noinst_DATA = nm-setting-docs.xml
nm-setting-docs.xml: generate-setting-docs.py NetworkManager-1.0.gir libnm-util.la
......
......@@ -23,6 +23,10 @@ if ENABLE_GTK_DOC
%.5: %.xml
$(AM_V_GEN) xsltproc $(XSLTPROC_MAN_FLAGS) $<
endif
if BUILD_SETTING_DOCS
nm-settings.xml: nm-settings.xsl $(top_builddir)/libnm-util/nm-setting-docs.xml
$(AM_V_GEN) xsltproc \
--output $@ \
......@@ -45,10 +49,6 @@ docbook_generated_man_pages = \
docbook_autogenerated_man_pages = \
nm-settings.5
generated_man_pages = \
$(docbook_generated_man_pages) \
$(docbook_autogenerated_man_pages)
EXTRA_DIST += \
nm-settings.xml \
nm-settings.xsl \
......@@ -61,13 +61,17 @@ DISTCLEANFILES = \
man_MANS += $(configure_generated_man_pages)
if ENABLE_GTK_DOC
man_MANS += $(generated_man_pages)
CLEANFILES += \
$(docbook_autogenerated_man_pages) \
$(docbook_generated_man_pages)
man_MANS += $(docbook_generated_man_pages)
CLEANFILES += $(docbook_generated_man_pages)
if BUILD_SETTING_DOCS
man_MANS += $(docbook_autogenerated_man_pages)
CLEANFILES += $(docbook_autogenerated_man_pages)
endif
else
if INSTALL_PREGEN_MANPAGES
man_MANS += $(generated_man_pages)
man_MANS += \
$(docbook_generated_man_pages) \
$(docbook_autogenerated_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