Imported Upstream version 3.3.3
[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-2012 Zmanda, Inc.  All Rights Reserved.
31 #  
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.
36 #  
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
40 #   for more details.
41 #  
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
45 #
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.
51 #
52 #   Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300
53 #   Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
54
55 AC_DEFUN([AC_PROG_XSLTPROC],
56 [
57 XSLTPROC_FLAGS="$1"
58 AC_SUBST(XSLTPROC_FLAGS)
59
60 # The (lack of) whitespace and overquoting here are all necessary for
61 # proper formatting.
62 AC_ARG_WITH(xsltproc,
63 AS_HELP_STRING([--with-xsltproc[[[[[=PATH]]]]]],
64                [Use the xsltproc binary in in PATH.]),
65     [ ac_with_xsltproc=$withval; ],
66     [ ac_with_xsltproc=maybe; ])
67
68 AC_ARG_WITH(xsltproc-flags,
69 AS_HELP_STRING([  --with-xsltproc-flags=FLAGS],
70                [Flags to pass to xsltproc (default $1)]),
71     [ if test "x$withval" == "xno"; then
72         XSLTPROC_FLAGS=''
73     else
74         if test "x$withval" != "xyes"; then
75             XSLTPROC_FLAGS="$withval"
76         fi
77     fi
78         ])
79
80 # search for xsltproc if it wasn't specified
81 if test "$ac_with_xsltproc" = "yes" -o "$ac_with_xsltproc" = "maybe"; then
82     AC_PATH_PROGS(XSLTPROC,xsltproc,,$LOCSYSPATH)
83 else
84     if test "$ac_with_xsltproc" != "no"; then
85         if test -x "$ac_with_xsltproc"; then
86             XSLTPROC="$ac_with_xsltproc";
87         else
88             AMANDA_MSG_WARN([Specified xsltproc of $ac_with_xsltproc isn't executable; searching for an alternative.])
89             AC_PATH_PROGS(XSLTPROC,xsltproc,,$LOCSYSPATH)
90         fi
91     fi
92 fi
93 ])