1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
|
dnl
dnl Find perl and make sure it's perl5
dnl '
dnl
AC_ARG_WITH(perl, --with-perl=path specify a pathname for perl, d=$withval, d="")
# Next line is the minimum version of perl required.
# 5.000 and 5.001 are generally scorned because of age and bugs.
PERL_VERSION=${PERL_VERSION:-5.002}
PERL_PLACES=`echo $PATH | sed 's/:/ /g'`
PERL_OPTIONAL=${PERL_OPTIONAL:-false}
dnl
dnl CHECK_PERL_VERSION(PATHNAME,VERSION)
dnl
AC_DEFUN(CHECK_PERL_VERSION,
[
echo $[$1] -e "require $[$2]" 1>&AC_FD_CC
if $[$1] -e "require $[$2]" 2>&AC_FD_CC
then
: good version
else
: non-good version => zero pathname
AC_MSG_RESULT([ not version $[$2]])
[$1]=''
fi
])
NS_CHECK_ANY_PATH(perl,$PERL_PLACES,$d,$d,PERL,no)
if test "x$PERL" != x
then
PERL=$PERL/perl
CHECK_PERL_VERSION(PERL,PERL_VERSION)
fi
dnl fall back on ``perl5''
if test "x$PERL" = "x"
then
NS_CHECK_ANY_PATH(perl5,$PERL_PLACES,$d,$d,PERL,no)
if test "x$PERL" != "x"
then
PERL=$PERL/perl5
CHECK_PERL_VERSION(PERL,PERL_VERSION)
fi
fi
if test "x$PERL" = x
then
if $PERL_OPTIONAL
then
AC_MSG_RESULT([ perl version $PERL_VERSION not found])
else
AC_MSG_ERROR(Cannot find Perl 5.)
fi
fi
AC_SUBST(PERL)
|