]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Go back to requiring only Perl 5.6+ for users
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 31 Mar 2023 17:55:29 +0000 (10:55 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 31 Mar 2023 19:52:50 +0000 (12:52 -0700)
Commit 61901a1a14fd50c03cfb1529d091554376fef286 dated 2022-07-10
bumped the Perl requirement to 5.10 or later, because
commit 3a9802d60156809c139e9b4620bf04917e143ee2 dated 2021-08-31
added code using Time::HiRes’s ‘stat’ function, a feature
added in Perl 5.8.9+ or Perl 5.10+, and it was hard
to find Perl 5.8.9 hosts to test with.  Also, requiring Perl 5.10
meant that we could then use operators like Digest::SHA, the // and
//= operators, the regexp \K escape, and ‘state’ variables.

However, that Time::HiRes code, which was taken from Automake, has
recently been made optional by Automake, and it now works again with
Perl 5.6.  And Autoconf is not yet using any other post-5.6 feature,
except when developers run help-extract.pl (something Autoconf users
do not use).  So relax the Autoconf user requirement back to 5.6 as it
was in Autoconf 2.71; although Autoconf developers will need 5.10 or
better, Autoconf users can get by with 5.6.

I ran into this problem when testing the Autoconf release candidate on
Solaris 10, which has Perl 5.8.4.  Oracle says Solaris 10’s
end-of-life is January 2024, so it’s still (barely) a viable porting
target.  Of course with Solaris 10 one must install a recent-enough
GNU m4, but adding a requirement to also install a recent-enough Perl
is a new barrier, and if it’s not needed then it might be better to
wait until it is needed (or until 2024 arrives).

* NEWS: Update news item about Perl 5.6 vs 5.10.
* README-hacking: Bump Perl recommendation to 5.10.
* build-aux/fetch.pl: Do not munge imported code to require 5.10.

16 files changed:
NEWS
README-hacking
build-aux/fetch.pl
configure.ac
lib/Autom4te/C4che.pm
lib/Autom4te/ChannelDefs.pm
lib/Autom4te/Channels.pm
lib/Autom4te/Config.pm
lib/Autom4te/Configure_ac.pm
lib/Autom4te/FileUtils.pm
lib/Autom4te/General.pm
lib/Autom4te/Getopt.pm
lib/Autom4te/Request.pm
lib/Autom4te/XFile.pm
m4/perl-time-hires.m4 [deleted file]
tests/mktests.pl

diff --git a/NEWS b/NEWS
index 884e46f45123c25466e9faf7fdb606688729f699..6a106f155bd35cbf68c513571787485f178b1e8a 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -10,8 +10,15 @@ GNU Autoconf NEWS - User visible changes.
   means Autoconf no longer supports pre-1989 C compilers, as they do
   not support function prototypes.
 
-*** Autoconf now requires perl 5.10 (2007) or later.
-  Generated 'configure' scripts continue to run without perl.
+*** Autoconf developers now need Perl 5.10 (2007) or later.
+  Generated 'configure' scripts continue to run without Perl.
+
+  Although Autoconf users still need only Perl 5.6 (2000) or later,
+  Perl 5.10 or later is recommended for users too, as it avoids some
+  trouble with files that have timestamps separated by less than 1 s.
+  Due to limitations in Perl's API this trouble is not entirely fixed
+  even with Perl 5.36, which cannot represent timestamps separated by
+  238 ns or less, for circa 2023 timestamps on typical platforms.
 
 *** Autoconf now requires GNU M4 1.4.8 (2006) or later.
   Generated 'configure' scripts continue to run without M4.
index 55d73a24abee4b06a3a67240768132c44758dccd..fc8d481a8dfdaf31b9ae47784f05fa86b09a25ea 100644 (file)
@@ -17,7 +17,7 @@ tools we depend upon, including:
 - Automake 1.11+ <https://www.gnu.org/software/automake/>
 - Help2man 1.29+ <https://www.gnu.org/software/help2man/>
 - M4 1.4.16+ <https://www.gnu.org/software/m4/>
-- Perl 5.006+ <https://www.cpan.org/>
+- Perl 5.010+ <https://www.cpan.org/>
 - Texinfo 4.11+ <https://www.gnu.org/software/texinfo/>
 
 The following are useful as well, if you want to be able to run commands
index 1110203573d4b5c91ecec743fa9e93b1414cb00e..f391dcf6e0079ec8b43e300d15434da7c86e9290 100755 (executable)
@@ -240,7 +240,6 @@ sub fetch ($$$$$$)
   # don't use \s here or it will eat blank lines
   $content =~ s/[ \t]+$//gm;
   $content =~ s/\bAutomake::/Autom4te::/g if $edit;
-  $content =~ s/^use 5\.006;$/use 5.010;/mg if $edit;
 
   replace_if_change ($destpath, $content, $quiet);
 }
index 1ec9b2c7d8cde090bb2d8123a566fc390fdcf2a6..5805d7438ace78d591e97ce194b4d4465fa62204 100644 (file)
@@ -153,7 +153,14 @@ AM_MISSING_PROG([HELP2MAN], [help2man])
 ## ------ ##
 
 # We use an absolute name for perl so the #! line in autoscan will work.
-AC_PATH_PERL_WITH_TIME_HIRES_STAT
+AC_PATH_PROG([PERL], [perl], [no])
+AC_SUBST([PERL])dnl
+if test "$PERL" = no; then
+  AC_MSG_ERROR([perl is not found])
+fi
+$PERL -e 'require 5.006;' || {
+   AC_MSG_ERROR([Perl 5.006 or better is required])
+}
 
 # Find out whether the system supports flock
 # Note this test does not try to find out whether it works with this
index b4af79744bf37afc12922f1ed909bfb9a75c91a5..523f15bffef725ab11a8b02d8bc2685087cd8fb4 100644 (file)
@@ -31,7 +31,7 @@ This Perl module handles the cache of M4 runs used by autom4te.
 
 =cut
 
-use 5.010;
+use 5.006;
 use strict;
 use warnings FATAL => 'all';
 
index bf6bf61772d76d6122afcb7fbfb60ff809afbaa5..85ea6f8251c929d5b3ba5a960323613994703bec 100644 (file)
@@ -44,7 +44,7 @@ shorthand function to output on specific channels.
 
 =cut
 
-use 5.010;
+use 5.006;
 use strict;
 use warnings FATAL => 'all';
 
index 89f5f71facdc63e856cb125e629b94b3d1abed86..a2ed0a0b05cc862ec938e5a316279d4c86b7b363 100644 (file)
@@ -66,7 +66,7 @@ etc.) that can also be overridden on a per-message basis.
 
 =cut
 
-use 5.010;
+use 5.006;
 use strict;
 use warnings FATAL => 'all';
 
index 5a80017543bab646399f08b62e34dcd205a5a943..941905d176217fbf5347c993d2bdf60e5fd86eb9 100644 (file)
@@ -25,7 +25,7 @@ package Autom4te::Config;
 # and autoconf's build machinery is not prepared to do that.
 # Revisit after 2.70.
 
-use 5.010;
+use 5.006;
 use strict;
 use warnings FATAL => 'all';
 
index fb00682b1a5df6c4d8250b4daa6056261de83021..a22e8a77be195276e5bb8845e8ac089a703cb63c 100644 (file)
@@ -20,7 +20,7 @@
 
 package Autom4te::Configure_ac;
 
-use 5.010;
+use 5.006;
 use strict;
 use warnings FATAL => 'all';
 
index 2468fe6d8c2cfaf69ddd5cd2c4dd9fe28b231b51..c1e8e8c3e974c8cc8f3aaeb90945626c057ec143 100644 (file)
@@ -34,7 +34,7 @@ This perl module provides various general purpose file handling functions.
 
 =cut
 
-use 5.010;
+use 5.006;
 use strict;
 use warnings FATAL => 'all';
 
index 57a706a7178c1750dbd567d808f6d90fc7aff3f9..ba79eff59a7508a3ac12fbaf8f6f9df2621218b2 100644 (file)
@@ -32,7 +32,7 @@ used in several executables of the Autoconf package.
 
 =cut
 
-use 5.010;
+use 5.006;
 use strict;
 use warnings FATAL => 'all';
 
index fac5e36f4c7e8a573dff1ee66ae4ac3f62162c69..6ad3dad00e814e0f44b004bf98bfe17936095cbe 100644 (file)
@@ -30,7 +30,7 @@ line options in conformance to the GNU Coding standards.
 
 =cut
 
-use 5.010;
+use 5.006;
 use strict;
 use warnings FATAL => 'all';
 
index d3af46bc6ea327daf63459ec182246f3eb9c5a1a..53f9ad7a710f54eae3e4ba6f0c5f841082f7f7ef 100644 (file)
@@ -32,7 +32,7 @@ used in several executables of the Autoconf and Automake packages.
 
 =cut
 
-use 5.010;
+use 5.006;
 use strict;
 use warnings FATAL => 'all';
 
index d6a8602d88f8e2ae1f6caaf000ba48c28e075aa1..5c9c07ea1f6e8b840dac12723d16b8ee49728e37 100644 (file)
@@ -69,7 +69,7 @@ and C<getlines> methods to translate C<\r\n> to C<\n>.
 
 =cut
 
-use 5.010;
+use 5.006;
 use strict;
 use warnings FATAL => 'all';
 
diff --git a/m4/perl-time-hires.m4 b/m4/perl-time-hires.m4
deleted file mode 100644 (file)
index 2d9e64e..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-# perl-time-hires.m4 serial 1
-
-# Copyright (C) 2022-2023 Free Software Foundation, Inc.
-
-# Copying and distribution of this file, with or without modification,
-# are permitted in any medium without royalty provided the copyright
-# notice and this notice are preserved.  This file is offered as-is,
-# without warranty of any kind.
-
-# AClocal_PATH_PROG_GLOBS_FEATURE_CHECK
-# ---------------------------------
-# Like AC_PATH_PROGS_FEATURE_CHECK, but each of 'progs-to-check-for' may
-# be a shell glob, which is expanded once for each path entry.
-# That is, AClocal_PATH_PROG_GLOBS_FEATURE_CHECK([PERL], [perl-*]) will
-# test each program named something like 'perl-*' found anywhere on the
-# path.  Due to the syntax conflict with Autoconf string quoting,
-# character sets (e.g. perl-[56]*) are not supported.
-m4_define([AClocal_PATH_PROG_GLOBS_FEATURE_CHECK],
-[if test -z "$$1"; then
-  ac_path_$1_found=false
-  # Loop through the user's path and test for each of PROGNAME-LIST
-  dnl AS_ESCAPE has been excessively optimized and does not work for anything
-  dnl other than constructing strings.  I have not been able to figure out how
-  dnl to get [ and ] through this process without mangling them, so
-  dnl character sets are not supported for now.
-  _AS_PATH_WALK([$5],
-  [for ac_prog in m4_bpatsubst([$2], [[!?*]], [\\\&])
-   do
-    for ac_exec_ext in '' $ac_executable_extensions; do
-      ac_pathglob_$1="$as_dir$ac_prog$ac_exec_ext"
-      for ac_path_$1 in $ac_pathglob_$1; do
-        AS_EXECUTABLE_P(["$ac_path_$1"]) || continue
-$3
-        $ac_path_$1_found && break 4
-      done
-    done
-  done])dnl
-  if test -z "$ac_cv_path_$1"; then
-    m4_default([$4],
-      [AC_MSG_ERROR([no acceptable m4_bpatsubst([$2], [ .*]) could be dnl
-found in m4_default([$5], [\$PATH])])])
-  fi
-else
-  ac_cv_path_$1=$$1
-fi
-])
-
-# AC_PATH_PERL_WITH_TIME_HIRES_STAT
-# ---------------------------------
-# Check for a version of perl that supports Time::HiRes::stat.
-# This was added to perl core in 5.10 and it's convenient to
-# have a consistent 'use 5.0xx' baseline for all the perl scripts,
-# so that is the version we require, even though technically we
-# could be getting away with 5.8 or even 5.6 in many of the scripts.
-# (Note: Files shared with Automake do not necessarily use our baseline.)
-AC_DEFUN([AC_PATH_PERL_WITH_TIME_HIRES_STAT],
-  [AC_ARG_VAR([PERL], [Location of Perl 5.10 or later.  Defaults to
-    the first program named 'perl', 'perl5*', or 'perl-5.*' on the PATH
-    that meets Autoconf's needs.])
-  AC_CACHE_CHECK([for Perl >=5.10.0 with Time::HiRes::stat],
-                 [ac_cv_path_PERL],
-    [AClocal_PATH_PROG_GLOBS_FEATURE_CHECK(
-        [PERL], [perl perl5* perl-5.*],
-        [AS_ECHO("$as_me:${as_lineno-$LINENO}: trying $ac_path_PERL") \
-             >&AS_MESSAGE_LOG_FD
-         $ac_path_PERL >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD -e '
-  use 5.010;
-  use Time::HiRes qw(stat);
-  1;' \
-         && ac_cv_path_PERL=$ac_path_PERL ac_path_PERL_found=:],
-    [AC_MSG_ERROR([no acceptable perl could be found in \$PATH.
-Perl 5.10.0 or later is required, with Time::HiRes::stat.])])])
-  PERL=$ac_cv_path_PERL
-])
index db6087addf8fac6224f3e5f088e5a624d3f3249d..effed0bcab7007ad7e52f161a45f6c124c323c95 100644 (file)
@@ -17,7 +17,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
-use 5.010;
+use 5.006;
 use strict;
 use warnings FATAL => 'all';