More items marked as done.
[tinc] / m4 / perl.m4
1 #serial 1
2
3 dnl From Jim Meyering.
4 dnl Find a new-enough version of Perl.
5 dnl
6
7 AC_DEFUN(jm_PERL,
8 [
9   dnl FIXME: don't hard-code 5.003
10   dnl FIXME: should we cache the result?
11   AC_MSG_CHECKING([for perl5.003 or newer])
12   if test "${PERL+set}" = set; then
13     # `PERL' is set in the user's environment.
14     candidate_perl_names="$PERL"
15     perl_specified=yes
16   else
17     candidate_perl_names='perl perl5'
18     perl_specified=no
19   fi
20
21   found=no
22   AC_SUBST(PERL)
23   PERL="$missing_dir/missing perl"
24   for perl in $candidate_perl_names; do
25     # Run test in a subshell; some versions of sh will print an error if
26     # an executable is not found, even if stderr is redirected.
27     if ( $perl -e 'require 5.003' ) > /dev/null 2>&1; then
28       PERL=$perl
29       found=yes
30       break
31     fi
32   done
33
34   AC_MSG_RESULT($found)
35   test $found = no && AC_MSG_WARN([
36 *** You don't seem to have perl5.003 or newer installed.
37 *** Because of that, you may be unable to regenerate certain files
38 *** if you modify the sources from which they are derived.] )
39 ])