On 2020-07-16 18:17, Tom Lane wrote:
Andres Freund <and...@anarazel.de> writes:
I think it'd be a good plan to adopt the beta on master.

We already have parts of it backpacked, there have been things we couldn't 
easily do because of bugs in 2.69. There aren't that many changes to configure 
it total, and particularly not in the back branches. So I think it'd be ok 
overhead wise.

Yeah.  Because we'd want to rip out those hacks, it's not quite as simple
as "regenerate configure with this other autoconf version"; somebody will
have to do some preliminary investigation and produce a patch for the
autoconf input files.  Peter, were you intending to do that?

Okay, let's take a look.  Attached is a patch series.

v1-0001-Rename-configure.in-to-configure.ac.patch

This is unsurprising.

v1-0002-Update-to-Autoconf-2.69b.patch.bz2

This runs auto(re)conf 2.69b and cleans up a minimal amount of obsoleted stuff.

The bulk of the changes in the produced configure are from the change from echo to printf. Not much else that's too interesting. I think a lot of the compatibility/testing advisories relate to the way you write your configure.ac, not so much to the produced shell code.

v1-0003-Remove-check_decls.m4-obsoleted-by-Autoconf-updat.patch

This is something we had backported and is now no longer necessary. Note that there are no significant changes in the produced configure, which is good.

v1-0004-configure.ac-Remove-_DARWIN_USE_64_BIT_INODE-hack.patch

This is also something that has been obsoleted.

I'm not immediately aware of anything else that can be removed, cleaned, or simplified.

One thing that's annoying is that the release notes claim that configure should now be faster, and some of the changes they have made should support that, but my (limited) testing doesn't bear that out. Most notably, the newly arisen test

checking for g++ option to enable C++11 features... none needed

takes approximately 10 seconds(!) on my machine (for one loop, since "none needed"; good luck if you need more than none).

This clearly depends on a lot of specifics of the environment, so some more testing would be useful. This is perhaps something we can construct some useful feedback for.

--
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
From f13940654f84b8fd0954408c69d5f64134fa5045 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <pe...@eisentraut.org>
Date: Fri, 17 Jul 2020 10:26:27 +0200
Subject: [PATCH v1 1/4] Rename configure.in to configure.ac

---
 config/general.m4            |  2 +-
 configure.in => configure.ac |  4 ++--
 src/backend/catalog/Makefile |  4 ++--
 src/include/pg_config.h.in   |  2 +-
 src/tools/msvc/Solution.pm   | 10 +++++-----
 src/tools/version_stamp.pl   | 12 ++++++------
 6 files changed, 17 insertions(+), 17 deletions(-)
 rename configure.in => configure.ac (99%)

diff --git a/config/general.m4 b/config/general.m4
index 95d65ceb09..140b9737bf 100644
--- a/config/general.m4
+++ b/config/general.m4
@@ -8,7 +8,7 @@
 # argument (other than "yes/no"), etc.
 #
 # The point of this implementation is to reduce code size and
-# redundancy in configure.in and to improve robustness and consistency
+# redundancy in configure.ac and to improve robustness and consistency
 # in the option evaluation code.
 
 
diff --git a/configure.in b/configure.ac
similarity index 99%
rename from configure.in
rename to configure.ac
index 2e05ce2e4d..3f49467ccd 100644
--- a/configure.in
+++ b/configure.ac
@@ -1,5 +1,5 @@
 dnl Process this file with autoconf to produce a configure script.
-dnl configure.in
+dnl configure.ac
 dnl
 dnl Developers, please strive to achieve this order:
 dnl
@@ -21,7 +21,7 @@ AC_INIT([PostgreSQL], [14devel], 
[pgsql-b...@lists.postgresql.org], [], [https:/
 
 m4_if(m4_defn([m4_PACKAGE_VERSION]), [2.69], [], [m4_fatal([Autoconf version 
2.69 is required.
 Untested combinations of 'autoconf' and PostgreSQL versions are not
-recommended.  You can remove the check from 'configure.in' but it is then
+recommended.  You can remove the check from 'configure.ac' but it is then
 your responsibility whether the result works or not.])])
 AC_COPYRIGHT([Copyright (c) 1996-2020, PostgreSQL Global Development Group])
 AC_CONFIG_SRCDIR([src/backend/access/common/heaptuple.c])
diff --git a/src/backend/catalog/Makefile b/src/backend/catalog/Makefile
index 9499bb33e5..93cf6d4368 100644
--- a/src/backend/catalog/Makefile
+++ b/src/backend/catalog/Makefile
@@ -103,10 +103,10 @@ generated-header-symlinks: 
$(top_builddir)/src/include/catalog/header-stamp
 # won't update them if they didn't change (to avoid unnecessary recompiles).
 # Technically, this should depend on Makefile.global which supplies
 # $(MAJORVERSION); but then genbki.pl would need to be re-run after every
-# configure run, even in distribution tarballs.  So depending on configure.in
+# configure run, even in distribution tarballs.  So depending on configure.ac
 # instead is cheating a bit, but it will achieve the goal of updating the
 # version number when it changes.
-bki-stamp: genbki.pl Catalog.pm $(POSTGRES_BKI_SRCS) $(POSTGRES_BKI_DATA) 
$(top_srcdir)/configure.in
+bki-stamp: genbki.pl Catalog.pm $(POSTGRES_BKI_SRCS) $(POSTGRES_BKI_DATA) 
$(top_srcdir)/configure.ac
        $(PERL) $< --include-path=$(top_srcdir)/src/include/ \
                --set-version=$(MAJORVERSION) $(POSTGRES_BKI_SRCS)
        touch $@
diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in
index c199cd46d2..11567064b3 100644
--- a/src/include/pg_config.h.in
+++ b/src/include/pg_config.h.in
@@ -1,4 +1,4 @@
-/* src/include/pg_config.h.in.  Generated from configure.in by autoheader.  */
+/* src/include/pg_config.h.in.  Generated from configure.ac by autoheader.  */
 
 /* Define to the type of arg 1 of 'accept' */
 #undef ACCEPT_TYPE_ARG1
diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm
index a13ca6e02e..4dbfc1f3ec 100644
--- a/src/tools/msvc/Solution.pm
+++ b/src/tools/msvc/Solution.pm
@@ -153,9 +153,9 @@ sub GenerateFiles
        my $package_url;
        my ($majorver, $minorver);
 
-       # Parse configure.in to get version numbers
-       open(my $c, '<', "configure.in")
-         || confess("Could not open configure.in for reading\n");
+       # Parse configure.ac to get version numbers
+       open(my $c, '<', "configure.ac")
+         || confess("Could not open configure.ac for reading\n");
        while (<$c>)
        {
                if (/^AC_INIT\(\[([^\]]+)\], \[([^\]]+)\], \[([^\]]+)\], 
\[([^\]]*)\], \[([^\]]+)\]/
@@ -178,7 +178,7 @@ sub GenerateFiles
                }
        }
        close($c);
-       confess "Unable to parse configure.in for all variables!"
+       confess "Unable to parse configure.ac for all variables!"
          unless $ac_init_found;
 
        if (IsNewer("src/include/pg_config_os.h", "src/include/port/win32.h"))
@@ -826,7 +826,7 @@ EOF
 
 # Read lines from input file and substitute symbols using the same
 # logic that config.status uses.  There should be one call of this for
-# each AC_CONFIG_HEADERS call in configure.in.
+# each AC_CONFIG_HEADERS call in configure.ac.
 #
 # If the "required" argument is true, we also keep track which of our
 # defines have been found and error out if any are left unused at the
diff --git a/src/tools/version_stamp.pl b/src/tools/version_stamp.pl
index 3595587622..36b18d514c 100755
--- a/src/tools/version_stamp.pl
+++ b/src/tools/version_stamp.pl
@@ -9,10 +9,10 @@
 #################################################################
 
 #
-# This script updates the version stamp in configure.in, and also in assorted
+# This script updates the version stamp in configure.ac, and also in assorted
 # other files wherein it's not convenient to obtain the version number from
 # configure's output.  Note that you still have to run autoconf afterward
-# to regenerate configure from the updated configure.in.
+# to regenerate configure from the updated configure.ac.
 #
 # Usage: cd to top of source tree and issue
 #      src/tools/version_stamp.pl MINORVERSION
@@ -74,7 +74,7 @@
 # (this also ensures we're in the right directory)
 
 my $aconfver = "";
-open(my $fh, '<', "configure.in") || die "could not read configure.in: $!\n";
+open(my $fh, '<', "configure.ac") || die "could not read configure.ac: $!\n";
 while (<$fh>)
 {
        if (m/^m4_if\(m4_defn\(\[m4_PACKAGE_VERSION\]\), \[(.*)\], \[\], 
\[m4_fatal/
@@ -86,13 +86,13 @@
 }
 close($fh);
 $aconfver ne ""
-  || die "could not find autoconf version number in configure.in\n";
+  || die "could not find autoconf version number in configure.ac\n";
 
-# Update configure.in and other files that contain version numbers
+# Update configure.ac and other files that contain version numbers
 
 my $fixedfiles = "";
 
-sed_file("configure.in",
+sed_file("configure.ac",
        "-e 's/AC_INIT(\\[PostgreSQL\\], \\[[0-9a-z.]*\\]/AC_INIT([PostgreSQL], 
[$fullversion]/'"
 );
 
-- 
2.27.0

Attachment: v1-0002-Update-to-Autoconf-2.69b.patch.bz2
Description: BZip2 compressed data

From 7100f8efe2ce147a07bb7c4154d9f34a72379520 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <pe...@eisentraut.org>
Date: Fri, 17 Jul 2020 10:26:27 +0200
Subject: [PATCH v1 3/4] Remove check_decls.m4, obsoleted by Autoconf update

---
 aclocal.m4            |   1 -
 config/check_decls.m4 | 116 ------------------------------------------
 2 files changed, 117 deletions(-)
 delete mode 100644 config/check_decls.m4

diff --git a/aclocal.m4 b/aclocal.m4
index bfd34ecec8..a517e949f1 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -4,7 +4,6 @@ m4_include([config/ax_prog_perl_modules.m4])
 m4_include([config/ax_pthread.m4])
 m4_include([config/c-compiler.m4])
 m4_include([config/c-library.m4])
-m4_include([config/check_decls.m4])
 m4_include([config/docbook.m4])
 m4_include([config/general.m4])
 m4_include([config/libtool.m4])
diff --git a/config/check_decls.m4 b/config/check_decls.m4
deleted file mode 100644
index f1b90c5430..0000000000
--- a/config/check_decls.m4
+++ /dev/null
@@ -1,116 +0,0 @@
-# config/check_decls.m4
-
-# This file redefines the standard Autoconf macro _AC_CHECK_DECL_BODY,
-# and adds a supporting function _AC_UNDECLARED_WARNING, to make
-# AC_CHECK_DECLS behave correctly when checking for built-in library
-# functions with clang.
-
-# This is based on commit 82ef7805faffa151e724aa76c245ec590d174580
-# in the Autoconf git repository.  We can drop it if they ever get
-# around to releasing a new version of Autoconf.  In the meantime,
-# it's distributed under Autoconf's license:
-
-# This file is part of Autoconf.  This program is free
-# software; you can redistribute it and/or modify it under the
-# terms of the GNU General Public License as published by the
-# Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# Under Section 7 of GPL version 3, you are granted additional
-# permissions described in the Autoconf Configure Script Exception,
-# version 3.0, as published by the Free Software Foundation.
-#
-# You should have received a copy of the GNU General Public License
-# and a copy of the Autoconf Configure Script Exception along with
-# this program; see the files COPYINGv3 and COPYING.EXCEPTION
-# respectively.  If not, see <http://www.gnu.org/licenses/>.
-
-# Written by David MacKenzie, with help from
-# Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor,
-# Roland McGrath, Noah Friedman, david d zuhn, and many others.
-
-
-# _AC_UNDECLARED_WARNING
-# ----------------------
-# Set ac_[]_AC_LANG_ABBREV[]_decl_warn_flag=yes if the compiler uses a warning,
-# not a more-customary error, to report some undeclared identifiers.  Fail when
-# an affected compiler warns also on valid input.  
_AC_PROG_PREPROC_WORKS_IFELSE
-# solves a related problem.
-AC_DEFUN([_AC_UNDECLARED_WARNING],
-[# The Clang compiler raises a warning for an undeclared identifier that 
matches
-# a compiler builtin function.  All extant Clang versions are affected, as of
-# Clang 3.6.0.  Test a builtin known to every version.  This problem affects 
the
-# C and Objective C languages, but Clang does report an error under C++ and
-# Objective C++.
-#
-# Passing -fno-builtin to the compiler would suppress this problem.  That
-# strategy would have the advantage of being insensitive to stray warnings, but
-# it would make tests less realistic.
-AC_CACHE_CHECK([how $[]_AC_CC[] reports undeclared, standard C functions],
-[ac_cv_[]_AC_LANG_ABBREV[]_decl_report],
-[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [(void) strchr;])],
-  [AS_IF([test -s conftest.err], [dnl
-    # For AC_CHECK_DECL to react to warnings, the compiler must be silent on
-    # valid AC_CHECK_DECL input.  No library function is consistently available
-    # on freestanding implementations, so test against a dummy declaration.
-    # Include always-available headers on the off chance that they somehow
-    # elicit warnings.
-    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([dnl
-#include <float.h>
-#include <limits.h>
-#include <stdarg.h>
-#include <stddef.h>
-extern void ac_decl (int, char *);],
-[@%:@ifdef __cplusplus
-  (void) ac_decl ((int) 0, (char *) 0);
-  (void) ac_decl;
-@%:@else
-  (void) ac_decl;
-@%:@endif
-])],
-      [AS_IF([test -s conftest.err],
-       [AC_MSG_FAILURE([cannot detect from compiler exit status or warnings])],
-       [ac_cv_[]_AC_LANG_ABBREV[]_decl_report=warning])],
-      [AC_MSG_FAILURE([cannot compile a simple declaration test])])],
-    [AC_MSG_FAILURE([compiler does not report undeclared identifiers])])],
-  [ac_cv_[]_AC_LANG_ABBREV[]_decl_report=error])])
-
-case $ac_cv_[]_AC_LANG_ABBREV[]_decl_report in
-  warning) ac_[]_AC_LANG_ABBREV[]_decl_warn_flag=yes ;;
-  *) ac_[]_AC_LANG_ABBREV[]_decl_warn_flag= ;;
-esac
-])# _AC_UNDECLARED_WARNING
-
-# _AC_CHECK_DECL_BODY
-# -------------------
-# Shell function body for AC_CHECK_DECL.
-m4_define([_AC_CHECK_DECL_BODY],
-[  AS_LINENO_PUSH([$[]1])
-  # Initialize each $ac_[]_AC_LANG_ABBREV[]_decl_warn_flag once.
-  AC_DEFUN([_AC_UNDECLARED_WARNING_]_AC_LANG_ABBREV,
-          [_AC_UNDECLARED_WARNING])dnl
-  AC_REQUIRE([_AC_UNDECLARED_WARNING_]_AC_LANG_ABBREV)dnl
-  [as_decl_name=`echo $][2|sed 's/ *(.*//'`]
-  [as_decl_use=`echo $][2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`]
-  AC_CACHE_CHECK([whether $as_decl_name is declared], [$[]3],
-  [ac_save_werror_flag=$ac_[]_AC_LANG_ABBREV[]_werror_flag
-  
ac_[]_AC_LANG_ABBREV[]_werror_flag="$ac_[]_AC_LANG_ABBREV[]_decl_warn_flag$ac_[]_AC_LANG_ABBREV[]_werror_flag"
-  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$[]4],
-[@%:@ifndef $[]as_decl_name
-@%:@ifdef __cplusplus
-  (void) $[]as_decl_use;
-@%:@else
-  (void) $[]as_decl_name;
-@%:@endif
-@%:@endif
-])],
-                  [AS_VAR_SET([$[]3], [yes])],
-                  [AS_VAR_SET([$[]3], [no])])
-  ac_[]_AC_LANG_ABBREV[]_werror_flag=$ac_save_werror_flag])
-  AS_LINENO_POP
-])# _AC_CHECK_DECL_BODY
-- 
2.27.0

From b102290502a1cde85c97f4abdf9b0567db6acc22 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <pe...@eisentraut.org>
Date: Fri, 17 Jul 2020 10:26:27 +0200
Subject: [PATCH v1 4/4] configure.ac: Remove _DARWIN_USE_64_BIT_INODE hack

This is no longer necessary with Autoconf 2.69b.
---
 configure                  | 1 -
 configure.ac               | 5 -----
 src/include/pg_config.h.in | 2 --
 3 files changed, 8 deletions(-)

diff --git a/configure b/configure
index 4c7da12c31..5e621f3a3f 100755
--- a/configure
+++ b/configure
@@ -15957,7 +15957,6 @@ rm -rf conftest*
   fi
 fi
 
-
 fi
 
 # The cast to long int works around a bug in the HP C Compiler
diff --git a/configure.ac b/configure.ac
index 77ee9bee87..648832804a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1592,11 +1592,6 @@ esac
 # defines can affect what is generated for that.
 if test "$PORTNAME" != "win32"; then
    AC_SYS_LARGEFILE
-   dnl Autoconf 2.69's AC_SYS_LARGEFILE believes it's a good idea to #define
-   dnl _DARWIN_USE_64_BIT_INODE, but it isn't: on macOS 10.5 that activates a
-   dnl bug that causes readdir() to sometimes return EINVAL.  On later macOS
-   dnl versions where the feature actually works, it's on by default anyway.
-   AH_VERBATIM([_DARWIN_USE_64_BIT_INODE],[])
 fi
 
 dnl Check for largefile support (must be after AC_SYS_LARGEFILE)
diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in
index 60579cee20..dee2707cc9 100644
--- a/src/include/pg_config.h.in
+++ b/src/include/pg_config.h.in
@@ -941,8 +941,6 @@
    */
 #undef XLOG_BLCKSZ
 
-
-
 /* Number of bits in a file offset, on hosts where this is settable. */
 #undef _FILE_OFFSET_BITS
 
-- 
2.27.0

Reply via email to