From bddaf8169d73afff39218300ea1dc8e27cee8de9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dagfinn=20Ilmari=20Manns=C3=A5ker?= <ilmari@ilmari.org>
Date: Tue, 5 Oct 2021 00:03:33 +0100
Subject: [PATCH 2/2] configure: require perl 5.8.1 for --with-perl

Commit 56adf3703c77295b63a71a42e602df247132e409 in 2010 added `use
5.008001;` to `plc_perlboot.pl, but didn't update the configure check.
---
 config/perl.m4 | 4 ++--
 configure      | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/config/perl.m4 b/config/perl.m4
index 059e31c476..1d7c07d245 100644
--- a/config/perl.m4
+++ b/config/perl.m4
@@ -11,11 +11,11 @@ if test "$PERL"; then
   pgac_perl_version=`$PERL -v 2>/dev/null | sed -n ['s/This is perl.*v[a-z ]*\([0-9]\.[0-9][0-9.]*\).*$/\1/p']`
   AC_MSG_NOTICE([using perl $pgac_perl_version])
   if echo "$pgac_perl_version" | sed ['s/[.a-z_]/ /g'] | \
-    $AWK '{ if ([$]1 == 5 && [$]2 >= 8) exit 1; else exit 0;}'
+    $AWK '{ if ([$]1 == 5 && ([$]2 > 8 || ($[2] == 8 && [$]3 >= 1))) exit 1; else exit 0;}'
   then
     AC_MSG_WARN([
 *** The installed version of Perl, $PERL, is too old to use with PostgreSQL.
-*** Perl version 5.8 or later is required, but this is $pgac_perl_version.])
+*** Perl version 5.8.1 or later is required, but this is $pgac_perl_version.])
     PERL=""
   fi
 fi
diff --git a/configure b/configure
index 7542fe30a1..e0012400b3 100755
--- a/configure
+++ b/configure
@@ -9949,14 +9949,14 @@ if test "$PERL"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: using perl $pgac_perl_version" >&5
 $as_echo "$as_me: using perl $pgac_perl_version" >&6;}
   if echo "$pgac_perl_version" | sed 's/[.a-z_]/ /g' | \
-    $AWK '{ if ($1 == 5 && $2 >= 8) exit 1; else exit 0;}'
+    $AWK '{ if ($1 == 5 && ($2 > 8 || ($2 == 8 && $3 >= 1))) exit 1; else exit 0;}'
   then
     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
 *** The installed version of Perl, $PERL, is too old to use with PostgreSQL.
-*** Perl version 5.8 or later is required, but this is $pgac_perl_version." >&5
+*** Perl version 5.8.1 or later is required, but this is $pgac_perl_version." >&5
 $as_echo "$as_me: WARNING:
 *** The installed version of Perl, $PERL, is too old to use with PostgreSQL.
-*** Perl version 5.8 or later is required, but this is $pgac_perl_version." >&2;}
+*** Perl version 5.8.1 or later is required, but this is $pgac_perl_version." >&2;}
     PERL=""
   fi
 fi
-- 
2.30.2

