#
# SYNOPSIS
#
-# AX_PROG_SPHINX_BUILD
+# AX_PROG_SPHINX_BUILD([ACTION-IF-FOUND], [ACTION-IF-NOT_FOUND])
#
# DESCRIPTION
#
-# Look for sphinx-build
+# Look for sphinx-build and make sure it is a recent version of it.
#
# LICENSE
#
-# Copyright (c) 2012 Brian Aker <brian@tangent.org>
+# Copyright (c) 2012-2013 Brian Aker <brian@tangent.org>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.
-#serial 1
+#serial 3
- AC_DEFUN([AX_PROG_SPHINX_BUILD], [
- AC_CHECK_PROGS([PERL], [perl])
- AC_CHECK_PROGS([DPKG_GENSYMBOLS], [dpkg-gensymbols], [:])
- AC_CHECK_PROGS([LCOV], [lcov], [echo lcov not found])
- AC_CHECK_PROGS([LCOV_GENHTML], [genhtml], [echo genhtml not found])
+AC_DEFUN([AX_PROG_SPHINX_BUILD],
+ [AC_PREREQ([2.63])dnl
+ AC_CHECK_PROGS([SPHINXBUILD], [sphinx-build], [:])
+ AS_IF([test "x${SPHINXBUILD}" != "x:"],[
+ AC_CACHE_CHECK([if sphinx is new enough],[ac_cv_recent_sphinx],[
- AC_CHECK_PROGS([SPHINXBUILD], [sphinx-build], [:])
- AS_IF([test "x${SPHINXBUILD}" != "x:"],[
- AC_CACHE_CHECK([if sphinx is new enough],[ac_cv_recent_sphinx],[
-
- ${SPHINXBUILD} -Q -C -b man -d conftest.d . . >/dev/null 2>&1
- AS_IF([test $? -eq 0],[ac_cv_recent_sphinx=yes],
- [ac_cv_recent_sphinx=no])
- rm -rf conftest.d
- ])
+ ${SPHINXBUILD} -Q -C -b man -d conftest.d . . >/dev/null 2>&1
+ AS_IF([test $? -eq 0],[ac_cv_recent_sphinx=yes],
+ [ac_cv_recent_sphinx=no])
+ rm -rf conftest.d
])
-
- AM_CONDITIONAL(HAVE_DPKG_GENSYMBOLS,[test "x${DPKG_GENSYMBOLS}" != "x:"])
- AM_CONDITIONAL(HAVE_SPHINX,[test "x${SPHINXBUILD}" != "x:"])
- AM_CONDITIONAL(HAVE_RECENT_SPHINX,[test "x${ac_cv_recent_sphinx}" = "xyes"])
])
+
+ AM_CONDITIONAL([HAVE_SPHINX],[test "x${SPHINXBUILD}" != "x:"])
+ AM_CONDITIONAL([HAVE_RECENT_SPHINX],[test "x${ac_cv_recent_sphinx}" = "xyes"])
+
+ AS_IF([test "x${ac_cv_recent_sphinx}" = "xyes"],
+ [ifelse([$2], , :, [$2])],
+ [ifelse([$3], , :, [$3])])
+])