Skip to content

Commit

Permalink
Go back to requiring only Perl 5.6+ for users
Browse files Browse the repository at this point in the history
Commit 61901a1 dated 2022-07-10
bumped the Perl requirement to 5.10 or later, because
commit 3a9802d 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.
  • Loading branch information
eggert committed Mar 31, 2023
1 parent 232cab5 commit 05e295b
Show file tree
Hide file tree
Showing 16 changed files with 29 additions and 90 deletions.
11 changes: 9 additions & 2 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion README-hacking
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion build-aux/fetch.pl
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@ ($$$$$$)
# 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);
}
Expand Down
9 changes: 8 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/Autom4te/C4che.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
2 changes: 1 addition & 1 deletion lib/Autom4te/ChannelDefs.pm
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ shorthand function to output on specific channels.
=cut

use 5.010;
use 5.006;
use strict;
use warnings FATAL => 'all';

Expand Down
2 changes: 1 addition & 1 deletion lib/Autom4te/Channels.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
2 changes: 1 addition & 1 deletion lib/Autom4te/Config.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
2 changes: 1 addition & 1 deletion lib/Autom4te/Configure_ac.pm
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

package Autom4te::Configure_ac;

use 5.010;
use 5.006;
use strict;
use warnings FATAL => 'all';

Expand Down
2 changes: 1 addition & 1 deletion lib/Autom4te/FileUtils.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
2 changes: 1 addition & 1 deletion lib/Autom4te/General.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
2 changes: 1 addition & 1 deletion lib/Autom4te/Getopt.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
2 changes: 1 addition & 1 deletion lib/Autom4te/Request.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
2 changes: 1 addition & 1 deletion lib/Autom4te/XFile.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
74 changes: 0 additions & 74 deletions m4/perl-time-hires.m4

This file was deleted.

2 changes: 1 addition & 1 deletion tests/mktests.pl
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down

0 comments on commit 05e295b

Please sign in to comment.