Update ddm4 and fix OS symbols.
[awesomized/libmemcached] / m4 / ax_prog_sphinx_build.m4
index 270067aa33b568544c567b3c2baf4a6b1b50ab44..653c7bcec8eab47c32ede4095a1857203523e0d7 100644 (file)
 #   and this notice are preserved. This file is offered as-is, without any
 #   warranty.
 
-#serial 3
+#serial 5
 
 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],[
+         [AX_WITH_PROG([SPHINXBUILD],[sphinx-build],[:])
+         AS_IF([test x"SPHINXBUILD" = x":"],
+               [SPHINXBUILD=],
+               [AS_IF([test -x "$SPHINXBUILD"],
+                      [AC_MSG_CHECKING([Checking to see if $SPHINXBUILD is recent])
+                      junk=`$SPHINXBUILD --version &> version_file`
+                      AS_IF([test $? -eq 0],
+                            [ax_sphinx_build_version=`head -1 version_file`],
+                            [junk=`$SPHINXBUILD &> version_file`
+                            ax_sphinx_build_version=`head -1 version_file`
+                            rm version_file
+                            AC_MSG_RESULT([$SPHINXBUILD is version "$ax_sphinx_build_version"])
+                            $SPHINXBUILD -Q -C -b man -d conftest.d . . >/dev/null 2>&1
+                            AS_IF([test $? -eq 0], ,[SPHINXBUILD=])
+                            rm -rf conftest.d ])
+                      ])
+                      rm -f version_file
+               ])
 
-        ${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_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])])
-])
+         AS_IF([test -n "${SPHINXBUILD}"],
+               [AC_SUBST([SPHINXBUILD])
+               ifelse([$1], , :, [$1])],
+               [ifelse([$2], , :, [$2])])
+         ])