12a2bd7928029b8420a7645b987b90a4b5ea3f18
[debian/amanda] / config / macro-archive / xsltproc.m4
1 ##### http://autoconf-archive.cryp.to/ac_prog_xsltproc.html
2 #
3 # SYNOPSIS
4 #
5 #   AC_PROG_XSLTPROC([default-flags])
6 #
7 # DESCRIPTION
8 #
9 #   Finds an xsltproc executable.
10 #
11 #   Input:
12 #    default-flags is the default $XSLTPROC_FLAGS, which will be
13 #    overridden if the user specifies --with-xsltproc-flags.
14 #
15 #   Output:
16 #    $XSLTPROC contains the path to xsltproc, or is empty if none was
17 #    found or the user specified --without-xsltproc. $XSLTPROC_FLAGS 
18 #    contains the flags to use with xsltproc.
19 #
20 # LAST MODIFICATION
21 #
22 #   2007-04-17
23 #
24 # AUTHOR
25 #
26 #   Dustin J. Mitchell <dustin@zmanda.com>
27 #
28 # COPYRIGHT
29 #
30 #   Copyright (c) 2007,2008 Zmanda, Inc.  All Rights Reserved.
31 #  
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.
35 #  
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
39 #   for more details.
40 #  
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
44 #
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.
50 #
51 #   Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300
52 #   Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
53
54 AC_DEFUN([AC_PROG_XSLTPROC],
55 [
56 XSLTPROC_FLAGS="$1"
57 AC_SUBST(XSLTPROC_FLAGS)
58
59 # The (lack of) whitespace and overquoting here are all necessary for
60 # proper formatting.
61 AC_ARG_WITH(xsltproc,
62 AS_HELP_STRING([--with-xsltproc[[[[[=PATH]]]]]],
63                [Use the xsltproc binary in in PATH.]),
64     [ ac_with_xsltproc=$withval; ],
65     [ ac_with_xsltproc=maybe; ])
66
67 AC_ARG_WITH(xsltproc-flags,
68 AS_HELP_STRING([  --with-xsltproc-flags=FLAGS],
69                [Flags to pass to xsltproc (default $1)]),
70     [ if test "x$withval" == "xno"; then
71         XSLTPROC_FLAGS=''
72     else
73         if test "x$withval" != "xyes"; then
74             XSLTPROC_FLAGS="$withval"
75         fi
76     fi
77         ])
78
79 # search for xsltproc if it wasn't specified
80 if test "$ac_with_xsltproc" = "yes" -o "$ac_with_xsltproc" = "maybe"; then
81     AC_PATH_PROGS(XSLTPROC,xsltproc,,$LOCSYSPATH)
82 else
83     if test "$ac_with_xsltproc" != "no"; then
84         if test -x "$ac_with_xsltproc"; then
85             XSLTPROC="$ac_with_xsltproc";
86         else
87             AMANDA_MSG_WARN([Specified xsltproc of $ac_with_xsltproc isn't executable; searching for an alternative.])
88             AC_PATH_PROGS(XSLTPROC,xsltproc,,$LOCSYSPATH)
89         fi
90     fi
91 fi
92 ])