Add shared pkg.m4 file with convenience macros for using pkg-config.
[jra/samba/.git] / m4 / check_perl.m4
1 dnl SMB Build Environment Perl Checks
2 dnl -------------------------------------------------------
3 dnl  Copyright (C) Stefan (metze) Metzmacher 2004
4 dnl  Released under the GNU GPL
5 dnl -------------------------------------------------------
6 dnl
7
8 AC_DEFUN([AC_SAMBA_PERL],
9 [
10 case "$host_os" in
11         *irix*)
12                 # On IRIX, we prefer Freeware or Nekoware Perl, because the
13                 # system perl is so ancient.
14                 AC_PATH_PROG(PERL, perl, "", "/usr/freeware/bin:/usr/nekoware/bin:$PATH")
15                 ;;
16         *)
17                 AC_PATH_PROG(PERL, perl)
18                 ;;
19 esac
20
21 if test x"$PERL" = x""; then
22         AC_MSG_WARN([No version of perl was found!])
23         $2
24 else
25         if test x"$debug" = x"yes";then
26                 PERL="$PERL -W"
27         fi
28         export PERL
29         $1
30 fi
31 ])
32