Update rules for sphinx`
[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 3
23
24 AC_DEFUN([AX_PROG_SPHINX_BUILD],
25 [AC_PREREQ([2.63])dnl
26 AC_CHECK_PROGS([SPHINXBUILD], [sphinx-build], [:])
27 AS_IF([test "x${SPHINXBUILD}" != "x:"],[
28 AC_CACHE_CHECK([if sphinx is new enough],[ac_cv_recent_sphinx],[
29
30 ${SPHINXBUILD} -Q -C -b man -d conftest.d . . >/dev/null 2>&1
31 AS_IF([test $? -eq 0],[ac_cv_recent_sphinx=yes],
32 [ac_cv_recent_sphinx=no])
33 rm -rf conftest.d
34 ])
35 ])
36
37 AM_CONDITIONAL([HAVE_SPHINX],[test "x${SPHINXBUILD}" != "x:"])
38 AM_CONDITIONAL([HAVE_RECENT_SPHINX],[test "x${ac_cv_recent_sphinx}" = "xyes"])
39
40 AS_IF([test "x${ac_cv_recent_sphinx}" = "xyes"],
41 [ifelse([$2], , :, [$2])],
42 [ifelse([$3], , :, [$3])])
43 ])