Index: NEWS =================================================================== RCS file: /cvs/autoconf/NEWS,v retrieving revision 1.139 diff -u -u -r1.139 NEWS --- NEWS 2001/01/15 07:40:11 1.139 +++ NEWS 2001/01/24 08:48:44 @@ -209,6 +209,9 @@ AC_FUNC_ERROR_AT_LINE, AC_FUNC_OBSTACK, AC_FUNC_STRTOD, AC_FUNC_FSEEKO. New. +- AC_PROG_GNU_M4, AC_PROG_PERL + New. + - AC_FUNC_GETGROUPS Sets GETGROUPS_LIBS. Index: acspecific.m4 =================================================================== RCS file: /cvs/autoconf/acspecific.m4,v retrieving revision 1.331 diff -u -u -r1.331 acspecific.m4 --- acspecific.m4 2001/01/23 17:04:36 1.331 +++ acspecific.m4 2001/01/24 08:48:46 @@ -297,6 +297,39 @@ ])# AC_PROG_LN_S +# AC_PROG_PERL([MIN-VERSION]) +# --------------------------- +AC_DEFUN([AC_PROG_PERL], +[# find perl binary +AC_MSG_CHECKING([for perl]) +AC_CACHE_VAL(ac_cv_prog_PERL, +[ifelse([$1],,, + [echo "configure:__oline__: ...version $1 required" >&AS_MESSAGE_LOG_FD]) + # allow user to override + if test -n "$PERL"; then + ac_try="$PERL" + else + ac_try="perl perl5" + fi + + for ac_prog in $ac_try; do + echo "configure:__oline__: trying $ac_prog" >&AS_MESSAGE_LOG_FD + if ($ac_prog -e 'printf "found version %g\n", $[@:>@];' ifelse([$1],,, + [-e 'require $1;'])) 1>&AS_MESSAGE_LOG_FD 2>&1; then + ac_cv_prog_PERL=$ac_prog + break + fi + done])dnl +PERL="$ac_cv_prog_PERL" +if test -n "$PERL"; then + AC_MSG_RESULT($PERL) +else + AC_MSG_RESULT(no) +fi +AC_SUBST(PERL)dnl +])# AC_PROG_PERL + + # AC_RSH # ------ # I don't know what it used to do, but it no longer does. Index: configure.in =================================================================== RCS file: /cvs/autoconf/configure.in,v retrieving revision 1.39 diff -u -u -r1.39 configure.in --- configure.in 2001/01/24 07:54:32 1.39 +++ configure.in 2001/01/24 08:48:48 @@ -18,7 +18,7 @@ fi # This is needed because Automake does not seem to realize there is # a AC-SUBST inside AC-PROG-GNU-M4. Grmph! -AC_SUBST(M4) +AC_SUBST([M4]) # `autoconf' and `ifnames' use AWK. AC_PROG_AWK @@ -27,14 +27,14 @@ AM_MISSING_PROG(HELP2MAN, help2man, $missing_dir) # We use a path for perl so the #! line in autoscan will work. -AC_PATH_PROG(PERL, perl, no) -AC_SUBST(PERL)dnl -AC_SUBST(PERLSCRIPTS)dnl -if test "$PERL" != no; then +AC_PROG_PERL(5.004) +AC_SUBST([PERLSCRIPTS])dnl +if test -n "$PERL"; then PERLSCRIPTS=autoscan else - AC_MSG_WARN([autoscan will not be built since perl is not found]) + AC_MSG_WARN([autoscan will not be built since perl >= 5.004 was not found]) fi +AC_SUBST([PERL]) AC_PROG_INSTALL Index: doc/autoconf.texi =================================================================== RCS file: /cvs/autoconf/doc/autoconf.texi,v retrieving revision 1.423 diff -u -u -r1.423 autoconf.texi --- doc/autoconf.texi 2001/01/24 08:24:44 1.423 +++ doc/autoconf.texi 2001/01/24 08:48:54 @@ -2811,6 +2811,35 @@ @end example @end defmac address@hidden AC_PROG_PERL (@ovar{version}) address@hidden PROG_PERL address@hidden PERL +If @code{perl} is found (at least version @var{version} is specified), +set output variable @code{PERL} to the name of its executable. +Otherwise, leave it empty. By default, @code{perl} and @code{perl5} are +tried, but you can use the @code{PERL} variable to override the list of +executables to check. + +When using @var{version}, make sure you use Perl's version numbering +conventions: @samp{5.6} is seen as version 5, subversion 600 (not 6); +you need to use @samp{5.006} to require perl 5.6.0. + address@hidden +PERL="perl myperl" +AC_PROG_PERL +if test -n "$PERL"; then + AC_DEFINE(HAVE_PERL, 1, [Define if you have perl or myperl.]) +fi address@hidden example + address@hidden +AC_PROG_PERL([5.006]) +if test -z "$PERL"; then + AC_MSG_ERROR([This package requires at least version 5.6 of perl.]) +fi address@hidden example address@hidden defmac + @defmac AC_PROG_RANLIB @maindex PROG_RANLIB @ovindex RANLIB