Makefile.ksplice: Rewrite ksplice-cow-check as a wrapper function.
[ksplice.git] / aclocal.m4
blob191dd5de6a282962c17e7b2c0c4a3dc4c596511f
1 # generated automatically by aclocal 1.9.6 -*- Autoconf -*-
3 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4 # 2005  Free Software Foundation, Inc.
5 # This file is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12 # PARTICULAR PURPOSE.
14 dnl @synopsis AC_PROG_PERL_MODULES([MODULES], [ACTION-IF-TRUE], [ACTION-IF-FALSE])
15 dnl
16 dnl Checks to see if the the given perl modules are available. If true
17 dnl the shell commands in ACTION-IF-TRUE are executed. If not the shell
18 dnl commands in ACTION-IF-FALSE are run. Note if $PERL is not set (for
19 dnl example by calling AC_CHECK_PROG, or AC_PATH_PROG),
20 dnl AC_CHECK_PROG(PERL, perl, perl) will be run.
21 dnl
22 dnl Example:
23 dnl
24 dnl   AC_CHECK_PERL_MODULES(Text::Wrap Net::LDAP, ,
25 dnl                         AC_MSG_WARN(Need some Perl modules)
26 dnl
27 dnl @category InstalledPackages
28 dnl @author Dean Povey <povey@wedgetail.com>
29 dnl @version 2002-09-25
30 dnl @license AllPermissive
32 AC_DEFUN([AC_PROG_PERL_MODULES],[dnl
33 ac_perl_modules="$1"
34 # Make sure we have perl
35 if test -z "$PERL"; then
36 AC_CHECK_PROG(PERL,perl,perl)
39 if test "x$PERL" != x; then
40   ac_perl_modules_failed=0
41   for ac_perl_module in $ac_perl_modules; do
42     AC_MSG_CHECKING(for perl module $ac_perl_module)
44     # Would be nice to log result here, but can't rely on autoconf internals
45     $PERL "-M$ac_perl_module" -e exit > /dev/null 2>&1
46     if test $? -ne 0; then
47       AC_MSG_RESULT(no);
48       ac_perl_modules_failed=1
49    else
50       AC_MSG_RESULT(ok);
51     fi
52   done
54   # Run optional shell commands
55   if test "$ac_perl_modules_failed" = 0; then
56     :
57     $2
58   else
59     :
60     $3
61   fi
62 else
63   AC_MSG_WARN(could not find perl)
64 fi])dnl