3a89a3316b631cb655c55f381795eabd3c0b5699
[m6w6/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 3
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_file`
31 ax_sphinx_build_version=`head -1 version_file`
32 rm version_file
33 AC_MSG_RESULT([$SPHINXBUILD is version "$ax_sphinx_build_version"])
34 $SPHINXBUILD -Q -C -b man -d conftest.d . . >/dev/null 2>&1
35 AS_IF([test $? -eq 0], ,[SPHINXBUILD=])
36 rm -rf conftest.d
37 ])
38 ])
39
40 AS_IF([test -n "${SPHINXBUILD}"],
41 [AC_SUBST([SPHINXBUILD])
42 ifelse([$1], , :, [$1])],
43 [ifelse([$2], , :, [$2])])
44 ])