From 18016c1ef86f6b6307399229b496547ee6a77291 Mon Sep 17 00:00:00 2001 From: Nicolas Dechesne Date: Mon, 5 Oct 2020 14:19:32 +0200 Subject: bitbake: docs: sphinx: report errors when dependencies are not met (Bitbake rev: 9ae5cce76693d7c12396cee1183aaf371bb3d66c) Signed-off-by: Nicolas Dechesne Signed-off-by: Richard Purdie --- bitbake/doc/Makefile.sphinx | 4 ++++ bitbake/doc/conf.py | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'bitbake') diff --git a/bitbake/doc/Makefile.sphinx b/bitbake/doc/Makefile.sphinx index c663c29540..c9518558bb 100644 --- a/bitbake/doc/Makefile.sphinx +++ b/bitbake/doc/Makefile.sphinx @@ -9,6 +9,10 @@ SOURCEDIR = . BUILDDIR = _build DESTDIR = final +ifeq ($(shell if which $(SPHINXBUILD) >/dev/null 2>&1; then echo 1; else echo 0; fi),0) +$(error "The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed") +endif + # Put it first so that "make" without argument is like "make help". help: @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/bitbake/doc/conf.py b/bitbake/doc/conf.py index 197f2757aa..354dff36f7 100644 --- a/bitbake/doc/conf.py +++ b/bitbake/doc/conf.py @@ -73,7 +73,13 @@ rst_prolog = """ # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # -html_theme = 'sphinx_rtd_theme' +try: + import sphinx_rtd_theme + html_theme = 'sphinx_rtd_theme' +except ImportError: + sys.stderr.write("The Sphinx sphinx_rtd_theme HTML theme was not found.\ + \nPlease make sure to install the sphinx_rtd_theme python package.\n") + sys.exit(1) # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, -- cgit v1.2.3-54-g00ecf