m4: fix output of sphinx-build version check
[awesomized/libmemcached] / m4 / ax_prog_sphinx_build.m4
1 # ===========================================================================
2 # https://github.com/BrianAker/ddm4
3 # ===========================================================================
4 #
5 # SYNOPSIS
6 #
7 # AX_PROG_SPHINX_BUILD([ACTION-IF-FOUND], [ACTION-IF-NOT_FOUND])
8 #
9 # DESCRIPTION
10 #
11 # Look for sphinx-build and make sure it is a recent version of it.
12 #
13 # LICENSE
14 #
15 # Copyright (c) 2012-2013 Brian Aker <brian@tangent.org>
16 #
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
20 # warranty.
21
22 #serial 6
23
24 AC_DEFUN([AX_PROG_SPHINX_BUILD],
25 [AX_WITH_PROG([SPHINXBUILD],[sphinx-build],[:])
26 AS_IF([test x"SPHINXBUILD" = x":"],
27 [SPHINXBUILD=],
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`
35 rm version_file
36 $SPHINXBUILD -Q -C -b man -d conftest.d . . >/dev/null 2>&1
37 AS_IF([test $? -eq 0], ,[SPHINXBUILD=])
38 rm -rf conftest.d ])
39 ])
40 rm -f version_file
41 AC_MSG_RESULT(["$ax_sphinx_build_version"])
42 ])
43
44 AS_IF([test -n "${SPHINXBUILD}"],
45 [AC_SUBST([SPHINXBUILD])
46 ifelse([$1], , :, [$1])],
47 [ifelse([$2], , :, [$2])])
48 ])