Skip to content

Commit 0b4fe8e

Browse files
committed
autoconf: check all doc deps, fail if unavailable
Check for the breathe extension in the configure script. Fail if the dependencies are not met, instead of silently disabling the docs build (build is off by default, and currently not so useful).
1 parent cb37e1a commit 0b4fe8e

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

configure.ac

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,19 @@ AC_ARG_ENABLE(docs,
185185
)
186186

187187
if test "x$enable_docs" = xyes; then
188+
AC_MSG_NOTICE([Checking requirements for building docs: doxygen, sphinx + breathe extension])
188189
AC_CHECK_PROGS(DOXYGEN, doxygen)
190+
AS_IF(test "x$DOXYGEN" != "x", [], [AC_MSG_ERROR([doxygen is required to build docs])])
189191
AC_CHECK_PROGS(SPHINX_BUILD, sphinx-build2 sphinx-build-2 sphinx-build3 sphinx-build-3 sphinx-build)
190-
# TODO: the python "breathe" extension is also a dependency to doc building.
191-
# The configure script should check for its existence.
192+
AS_IF(test "x$SPHINX_BUILD" != "x", [], [AC_MSG_ERROR([sphinx is required to build docs])])
193+
AC_MSG_CHECKING(for sphinx extension "breathe")
194+
AS_IF([dnl
195+
python -c "
196+
import breathe
197+
import breathe.exception
198+
breathe.exception.BreatheError" 2> /dev/null],
199+
[AC_MSG_RESULT([yes])],
200+
[AC_MSG_RESULT([no]); AC_MSG_ERROR(the sphinx breathe extension is required to build docs)])
192201
fi
193202
AM_CONDITIONAL(ENABLE_DOCS,
194203
test "x$DOXYGEN" != "x" && test "x$SPHINX_BUILD" != "x")

0 commit comments

Comments
 (0)