1 ##### http://autoconf-archive.cryp.to/ac_check_docbook_xslt_min.html
5 # AC_CHECK_DOCBOOK_XSLT_MIN(min-xslt-version)
9 # Check that the 'current' version of docbook is at least version
12 # If the test is successful, $DOCBOOK_XSLT_CURRENT_VERSION will be set to the
13 # current docbook version; if not, it will be set to 'no'.
16 # AC_CHECK_DOCBOOK_XSLT_MIN(1.72.0)
17 # if test "x$DOCBOOK_XSLT_CURRENT_VERSION" = "xno"; then
26 # Dustin J. Mitchell <dustin@zmanda.com>
30 # Copyright (c) 2007-2012 Zmanda, Inc. All Rights Reserved.
32 # This program is free software; you can redistribute it and/or
33 # modify it under the terms of the GNU General Public License
34 # as published by the Free Software Foundation; either version 2
35 # of the License, or (at your option) any later version.
37 # This program is distributed in the hope that it will be useful, but
38 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
39 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
42 # You should have received a copy of the GNU General Public License along
43 # with this program; if not, write to the Free Software Foundation, Inc.,
44 # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
46 # This special exception to the GPL applies to versions of the
47 # Autoconf Macro released by the Autoconf Macro Archive. When you
48 # make and distribute a modified version of the Autoconf Macro, you
49 # may extend this special exception to the GPL to apply to your
50 # modified version as well.
52 # Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300
53 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
55 AC_DEFUN([AC_CHECK_DOCBOOK_XSLT_MIN],
57 AC_REQUIRE([AC_PROG_XSLTPROC])
59 AC_CACHE_CHECK([for current Docbook XSLT version], [ac_cv_docbook_xslt_current_version],
61 ac_cv_docbook_xslt_current_version=no
63 if test -n "$XSLTPROC"; then
64 cat >conftest.xsl <<EOF
66 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
67 xmlns:fm="http://freshmeat.net/projects/freshmeat-submit/"
69 <xsl:output method="text"/>
70 <xsl:template match="fm:project/fm:Version">
71 <xsl:value-of select="." />
73 <!-- do nothing with any other text -->
74 <xsl:template match="text()"/>
77 echo "Trying '$XSLTPROC $XSLTPROC_FLAGS http://docbook.sourceforge.net/release/xsl/current/VERSION' with input:" >&AS_MESSAGE_LOG_FD
78 echo "====" >&AS_MESSAGE_LOG_FD
79 cat conftest.xsl >&AS_MESSAGE_LOG_FD
80 echo "====" >&AS_MESSAGE_LOG_FD
82 ac_cv_docbook_xslt_current_version=`$XSLTPROC $XSLTPROC_FLAGS conftest.xsl http://docbook.sourceforge.net/release/xsl/current/VERSION 2>&AS_MESSAGE_LOG_FD`
84 if test "$?" != 0; then
85 ac_cv_docbook_xslt_current_version='no'
92 DOCBOOK_XSLT_CURRENT_VERSION="$ac_cv_docbook_xslt_current_version"
93 AC_MSG_CHECKING([whether Docbook XSLT version is $1 or newer])
95 if test x"$DOCBOOK_XSLT_CURRENT_VERSION" = x"no"; then
98 AX_COMPARE_VERSION([$DOCBOOK_XSLT_CURRENT_VERSION], [lt], [$1], [
99 # version is less than required, so mark it as "no"
100 DOCBOOK_XSLT_CURRENT_VERSION=no
103 if test x"$DOCBOOK_XSLT_CURRENT_VERSION" = x"no"; then
106 AC_MSG_RESULT([yes ($DOCBOOK_XSLT_CURRENT_VERSION)])