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 modify it
33 # under the terms of the GNU General Public License version 2 as published
34 # by the Free Software Foundation.
36 # This program is distributed in the hope that it will be useful, but
37 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
38 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
41 # You should have received a copy of the GNU General Public License along
42 # with this program; if not, write to the Free Software Foundation, Inc.,
43 # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
45 # This special exception to the GPL applies to versions of the
46 # Autoconf Macro released by the Autoconf Macro Archive. When you
47 # make and distribute a modified version of the Autoconf Macro, you
48 # may extend this special exception to the GPL to apply to your
49 # modified version as well.
51 # Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300
52 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
54 AC_DEFUN([AC_CHECK_DOCBOOK_XSLT_MIN],
56 AC_REQUIRE([AC_PROG_XSLTPROC])
58 AC_CACHE_CHECK([for current Docbook XSLT version], [ac_cv_docbook_xslt_current_version],
60 ac_cv_docbook_xslt_current_version=no
62 if test -n "$XSLTPROC"; then
63 cat >conftest.xsl <<EOF
65 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
66 xmlns:fm="http://freshmeat.net/projects/freshmeat-submit/"
68 <xsl:output method="text"/>
69 <xsl:template match="fm:project/fm:Version">
70 <xsl:value-of select="." />
72 <!-- do nothing with any other text -->
73 <xsl:template match="text()"/>
76 echo "Trying '$XSLTPROC $XSLTPROC_FLAGS http://docbook.sourceforge.net/release/xsl/current/VERSION' with input:" >&AS_MESSAGE_LOG_FD
77 echo "====" >&AS_MESSAGE_LOG_FD
78 cat conftest.xsl >&AS_MESSAGE_LOG_FD
79 echo "====" >&AS_MESSAGE_LOG_FD
81 ac_cv_docbook_xslt_current_version=`$XSLTPROC $XSLTPROC_FLAGS conftest.xsl http://docbook.sourceforge.net/release/xsl/current/VERSION 2>&AS_MESSAGE_LOG_FD`
83 if test "$?" != 0; then
84 ac_cv_docbook_xslt_current_version='no'
91 DOCBOOK_XSLT_CURRENT_VERSION="$ac_cv_docbook_xslt_current_version"
92 AC_MSG_CHECKING([whether Docbook XSLT version is $1 or newer])
94 if test x"$DOCBOOK_XSLT_CURRENT_VERSION" = x"no"; then
97 AX_COMPARE_VERSION([$DOCBOOK_XSLT_CURRENT_VERSION], [lt], [$1], [
98 # version is less than required, so mark it as "no"
99 DOCBOOK_XSLT_CURRENT_VERSION=no
102 if test x"$DOCBOOK_XSLT_CURRENT_VERSION" = x"no"; then
105 AC_MSG_RESULT([yes ($DOCBOOK_XSLT_CURRENT_VERSION)])