1 # ===========================================================================
2 # http://autoconf-archive.cryp.to/ac_check_docbook_xslt.html
3 # ===========================================================================
7 # AC_CHECK_DOCBOOK_XSLT([xslt-version])
11 # Check for access to docbook stylesheets of a particular revision. This
12 # macro can be used for multiple versions within the same script.
16 # $1 is the version of docbook to search for; default 'current'.
20 # $HAVE_DOCBOOK_XSLT_VERS will be set to 'yes' or 'no' depending on the
21 # results of the test, where VERS is $1, with '_' substituted for '.'.
22 # $HAVE_DOCBOOK_XSLT will also be set to the same value.
26 # AC_CHECK_DOCBOOK_XSLT(1.72.0)
27 # if test "x$HAVE_DOCBOOK_XSLT_1_72_0" = "xyes"; then
32 # Copyright (c) 2008 Zmanda Inc. <http://www.zmanda.com/>
33 # Copyright (c) 2008 Dustin J. Mitchell <dustin@zmanda.com>
35 # This program is free software; you can redistribute it and/or modify it
36 # under the terms of the GNU General Public License as published by the
37 # Free Software Foundation; either version 2 of the License, or (at your
38 # option) any later version.
40 # This program is distributed in the hope that it will be useful, but
41 # WITHOUT ANY WARRANTY; without even the implied warranty of
42 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
43 # Public License for more details.
45 # You should have received a copy of the GNU General Public License along
46 # with this program. If not, see <http://www.gnu.org/licenses/>.
48 # As a special exception, the respective Autoconf Macro's copyright owner
49 # gives unlimited permission to copy, distribute and modify the configure
50 # scripts that are the output of Autoconf when processing the Macro. You
51 # need not follow the terms of the GNU General Public License when using
52 # or distributing such scripts, even though portions of the text of the
53 # Macro appear in them. The GNU General Public License (GPL) does govern
54 # all other use of the material that constitutes the Autoconf Macro.
56 # This special exception to the GPL applies to versions of the Autoconf
57 # Macro released by the Autoconf Archive. When you make and distribute a
58 # modified version of the Autoconf Macro, you may extend this special
59 # exception to the GPL to apply to your modified version as well.
61 AC_DEFUN([AC_CHECK_DOCBOOK_XSLT],
63 AC_REQUIRE([AC_PROG_XSLTPROC])
65 dnl define a temporary variable for the version, so this macro can be
66 dnl used with multiple versions
68 ifelse(_VERS, [], [define([_VERS], [current])])
70 dnl define variable names ending in _VERS which will actually have the
71 dnl version number as a suffix
72 define([ac_cv_docbook_xslt_VERS], patsubst([ac_cv_docbook_xslt_]_VERS, [\.], [_]))
73 define([HAVE_DOCBOOK_XSLT_VERS], patsubst([HAVE_DOCBOOK_XSLT_]_VERS, [\.], [_]))
75 AC_CACHE_CHECK([for Docbook XSLT version ]_VERS, [ac_cv_docbook_xslt_VERS],
77 ac_cv_docbook_xslt_VERS=no
78 if test -n "$XSLTPROC"; then
79 echo "Trying '$XSLTPROC $XSLTPROC_FLAGS http://docbook.sourceforge.net/release/xsl/_VERS/xhtml/docbook.xsl'" >&AS_MESSAGE_LOG_FD
80 $XSLTPROC $XSLTPROC_FLAGS http://docbook.sourceforge.net/release/xsl/_VERS/xhtml/docbook.xsl >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
82 if test "$?" = 0; then
83 ac_cv_docbook_xslt_VERS=yes
88 HAVE_DOCBOOK_XSLT_VERS="$ac_cv_docbook_xslt_VERS"
89 HAVE_DOCBOOK_XSLT="$HAVE_DOCBOOK_XSLT_VERS"
91 dnl clean up m4 namespace
93 undefine([ac_cv_docbook_xslt_VERS])
94 undefine([HAVE_DOCBOOK_XSLT_VERS])