summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2021-11-22 12:54:52 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2021-11-22 12:54:52 -0500
commitc4fe3199a6d65212537a59eb0d7e6fad22b9e903 (patch)
tree8056c48812b97b79981182c2d27d6928f89d81b2 /config
parent2fed48f48f7f2f7a6d6f6d020f046efe3c249828 (diff)
downloadpostgresql-c4fe3199a6d65212537a59eb0d7e6fad22b9e903.tar.gz
Probe $PROVE not $PERL while checking for modules needed by TAP tests.
Normally "prove" and "perl" come from the same Perl installation, but we support the case where they don't (mainly because the MSys buildfarm animals need this). In that case, AX_PROG_PERL_MODULES is completely the wrong thing to use, because it's checking what "perl" has. Instead, make a little TAP test script including the required modules, and run that under "prove". We don't need ax_prog_perl_modules.m4 at all after this change, so remove it. Back-patch to all supported branches, for the buildfarm's benefit. (In v10, this also back-patches the effects of commit 264eb03aa.) Andrew Dunstan and Tom Lane, per an observation by Noah Misch Discussion: https://postgr.es/m/E1moZHS-0002Cu-Ei@gemulon.postgresql.org
Diffstat (limited to 'config')
-rw-r--r--config/ax_prog_perl_modules.m477
-rw-r--r--config/check_modules.pl20
2 files changed, 20 insertions, 77 deletions
diff --git a/config/ax_prog_perl_modules.m4 b/config/ax_prog_perl_modules.m4
deleted file mode 100644
index 664e7aae3b..0000000000
--- a/config/ax_prog_perl_modules.m4
+++ /dev/null
@@ -1,77 +0,0 @@
-# ===========================================================================
-# https://www.gnu.org/software/autoconf-archive/ax_prog_perl_modules.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-# AX_PROG_PERL_MODULES([MODULES], [ACTION-IF-TRUE], [ACTION-IF-FALSE])
-#
-# DESCRIPTION
-#
-# Checks to see if the given perl modules are available. If true the shell
-# commands in ACTION-IF-TRUE are executed. If not the shell commands in
-# ACTION-IF-FALSE are run. Note if $PERL is not set (for example by
-# calling AC_CHECK_PROG, or AC_PATH_PROG), AC_CHECK_PROG(PERL, perl, perl)
-# will be run.
-#
-# MODULES is a space separated list of module names. To check for a
-# minimum version of a module, append the version number to the module
-# name, separated by an equals sign.
-#
-# Example:
-#
-# AX_PROG_PERL_MODULES( Text::Wrap Net::LDAP=1.0.3, ,
-# AC_MSG_WARN(Need some Perl modules)
-#
-# LICENSE
-#
-# Copyright (c) 2009 Dean Povey <povey@wedgetail.com>
-#
-# 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 any
-# warranty.
-
-#serial 8
-
-AU_ALIAS([AC_PROG_PERL_MODULES], [AX_PROG_PERL_MODULES])
-AC_DEFUN([AX_PROG_PERL_MODULES],[dnl
-
-m4_define([ax_perl_modules])
-m4_foreach([ax_perl_module], m4_split(m4_normalize([$1])),
- [
- m4_append([ax_perl_modules],
- [']m4_bpatsubst(ax_perl_module,=,[ ])[' ])
- ])
-
-# Make sure we have perl
-if test -z "$PERL"; then
-AC_CHECK_PROG(PERL,perl,perl)
-fi
-
-if test "x$PERL" != x; then
- ax_perl_modules_failed=0
- for ax_perl_module in ax_perl_modules; do
- AC_MSG_CHECKING(for perl module $ax_perl_module)
-
- # Would be nice to log result here, but can't rely on autoconf internals
- modversion=`$PERL -e "use $ax_perl_module; my \\\$x=q($ax_perl_module); \\\$x =~ s/ .*//; \\\$x .= q(::VERSION); eval qq{print \\\\$\\\$x\\n}; exit;" 2>/dev/null`
- if test $? -ne 0; then
- AC_MSG_RESULT(no);
- ax_perl_modules_failed=1
- else
- AC_MSG_RESULT($modversion);
- fi
- done
-
- # Run optional shell commands
- if test "$ax_perl_modules_failed" = 0; then
- :
- $2
- else
- :
- $3
- fi
-else
- AC_MSG_WARN(could not find perl)
-fi])dnl
diff --git a/config/check_modules.pl b/config/check_modules.pl
new file mode 100644
index 0000000000..d5d9ac28c9
--- /dev/null
+++ b/config/check_modules.pl
@@ -0,0 +1,20 @@
+#
+# Verify that required Perl modules are available,
+# in at least the required minimum versions.
+# (The required minimum versions are all quite ancient now,
+# but specify them anyway for documentation's sake.)
+#
+use IPC::Run 0.79;
+
+# Test::More and Time::HiRes are supposed to be part of core Perl,
+# but some distros omit them in a minimal installation.
+use Test::More 0.98;
+use Time::HiRes 1.52;
+
+# While here, we might as well report exactly what versions we found.
+diag("IPC::Run::VERSION: $IPC::Run::VERSION");
+diag("Test::More::VERSION: $Test::More::VERSION");
+diag("Time::HiRes::VERSION: $Time::HiRes::VERSION");
+
+ok(1);
+done_testing();