1 # ===========================================================================
2 # https://github.com/BrianAker/ddm4
3 # ===========================================================================
7 # AX_PROG_SPHINX_BUILD([ACTION-IF-FOUND], [ACTION-IF-NOT_FOUND])
11 # Look for sphinx-build and make sure it is a recent version of it.
15 # Copyright (c) 2012-2013 Brian Aker <brian@tangent.org>
17 # Copying and distribution of this file, with or without modification, are
18 # permitted in any medium without royalty provided the copyright notice
19 # and this notice are preserved. This file is offered as-is, without any
24 AC_DEFUN([AX_PROG_SPHINX_BUILD],
25 [AX_WITH_PROG([SPHINXBUILD],[sphinx-build],[:])
26 AS_IF([test x"SPHINXBUILD" = x":"],
28 [AS_IF([test -x "$SPHINXBUILD"],
29 [AC_MSG_CHECKING([Checking to see if $SPHINXBUILD is recent])
30 junk=`$SPHINXBUILD --version &> version_file`
31 AS_IF([test $? -eq 0],
32 [ax_sphinx_build_version=`head -1 version_file`],
33 [junk=`$SPHINXBUILD &> version_file`
34 ax_sphinx_build_version=`head -1 version_file`
36 $SPHINXBUILD -Q -C -b man -d conftest.d . . >/dev/null 2>&1
37 AS_IF([test $? -eq 0], ,[SPHINXBUILD=])
41 AC_MSG_RESULT(["$ax_sphinx_build_version"])
44 AS_IF([test -n "${SPHINXBUILD}"],
45 [AC_SUBST([SPHINXBUILD])
46 ifelse([$1], , :, [$1])],
47 [ifelse([$2], , :, [$2])])