From 8c1e8530e6c0dc59420a21ab41c10de00643ccdbf3d5b0457def8b4934a5cc43 Mon Sep 17 00:00:00 2001 From: Martin Pluskal Date: Mon, 14 Dec 2020 07:12:21 +0000 Subject: [PATCH 1/6] Accepting request 855597 from home:AndreasStieger:branches:devel:tools:building autoconf 2.70 OBS-URL: https://build.opensuse.org/request/show/855597 OBS-URL: https://build.opensuse.org/package/show/devel:tools:building/autoconf?expand=0&rev=46 --- ac-header-major.patch | 145 --------------------------------- autoconf-2.69.tar.gz | 3 - autoconf-2.69.tar.gz.sig | 12 --- autoconf-2.70.tar.xz | 3 + autoconf-2.70.tar.xz.sig | 16 ++++ autoconf-el.changes | 69 ++++++++++++++++ autoconf-el.spec | 32 ++++---- autoconf-perl-5.17-fixes.patch | 28 ------- autoconf-testsuite.changes | 69 ++++++++++++++++ autoconf-testsuite.spec | 45 +++------- autoconf.changes | 69 ++++++++++++++++ autoconf.spec | 45 +++------- autoreconf-ltdl.diff | 28 +++---- port-tests-to-bash-5.patch | 63 -------------- 14 files changed, 283 insertions(+), 344 deletions(-) delete mode 100644 ac-header-major.patch delete mode 100644 autoconf-2.69.tar.gz delete mode 100644 autoconf-2.69.tar.gz.sig create mode 100644 autoconf-2.70.tar.xz create mode 100644 autoconf-2.70.tar.xz.sig delete mode 100644 autoconf-perl-5.17-fixes.patch delete mode 100644 port-tests-to-bash-5.patch diff --git a/ac-header-major.patch b/ac-header-major.patch deleted file mode 100644 index 61538e2..0000000 --- a/ac-header-major.patch +++ /dev/null @@ -1,145 +0,0 @@ -From e17a30e987d7ee695fb4294a82d987ec3dc9b974 Mon Sep 17 00:00:00 2001 -From: Eric Blake -Date: Wed, 14 Sep 2016 08:17:06 -0500 -Subject: [PATCH] AC_HEADER_MAJOR: port to glibc 2.25 - -glibc 2.25 is deprecating the namespace pollution of -injecting major(), minor(), and makedev() into the compilation -environment, with a warning that insists that users include - instead. However, because the expansion of -AC_HEADER_MAJOR didn't bother checking sys/sysmacros.h until -after probing whether sys/types.h pollutes the namespace, it was -not defining MAJOR_IN_SYSMACROS, with the result that code -compiled with -Werror chokes on the deprecation warnings because -it was not including sysmacros.h. - -In addition to fixing autoconf (which only benefits projects -that rebuild configure after this fix is released), we can also -give a hint to distros on how they can populate config.site with -a cache variable to force pre-existing configure scripts without -the updated macro to behave sanely in the presence of glibc 2.25 -(the documentation is especially useful since that cache variable -is no longer present in autoconf after this patch). - -Note that mingw lacks major/minor/makedev in any of its standard -headers; for that platform, the behavior of this macro is unchanged -(code using the recommended include formula will get a compile error -when trying to use major(), whether before or after this patch); but -for now, it is assumed that programs actually concerned with -creating devices are not worried about portability to mingw. If -desired, a later patch could tighten AC_HEADER_MAJOR to fail at -configure time if the macros are unavailable in any of the three -system headers, but that semantic change is not worth mixing into -this patch. - -* lib/autoconf/headers.m4 (AC_HEADER_MAJOR): Drop check for -major within sys/types.h; it interferes with the need to check -sysmacros.h first. -* doc/autoconf.texi (Particular Headers) : Expand -details on usage, and on workarounds for non-updated projects. - -Signed-off-by: Eric Blake ---- - doc/autoconf.texi | 35 +++++++++++++++++++++++++++++++---- - lib/autoconf/headers.m4 | 30 ++++++++++++++---------------- - 2 files changed, 45 insertions(+), 20 deletions(-) - -diff --git a/doc/autoconf.texi b/doc/autoconf.texi -index 9ad7dc1c5f..4f041bd4ed 100644 ---- a/doc/autoconf.texi -+++ b/doc/autoconf.texi -@@ -5970,10 +5970,37 @@ Particular Headers - @cvindex MAJOR_IN_SYSMACROS - @hdrindex{sys/mkdev.h} - @hdrindex{sys/sysmacros.h} --If @file{sys/types.h} does not define @code{major}, @code{minor}, and --@code{makedev}, but @file{sys/mkdev.h} does, define --@code{MAJOR_IN_MKDEV}; otherwise, if @file{sys/sysmacros.h} does, define --@code{MAJOR_IN_SYSMACROS}. -+Detect the headers required to use @code{makedev}, @code{major}, and -+@code{minor}. These functions may be defined by @file{sys/mkdev.h}, -+@code{sys/sysmacros.h}, or @file{sys/types.h}. -+ -+@code{AC_HEADER_MAJOR} defines @code{MAJOR_IN_MKDEV} if they are in -+@file{sys/mkdev.h}, or @code{MAJOR_IN_SYSMACROS} if they are in -+@file{sys/sysmacros.h}. If neither macro is defined, they are either in -+@file{sys/types.h} or unavailable. -+ -+To properly use these functions, your code should contain something -+like: -+ -+@verbatim -+#include -+#ifdef MAJOR_IN_MKDEV -+# include -+#elif defined MAJOR_IN_SYSMACROS -+# include -+#endif -+@end verbatim -+ -+Note: Configure scripts built with Autoconf 2.69 or earlier will not -+detect a problem if @file{sys/types.h} contains definitions of -+@code{major}, @code{minor}, and/or @code{makedev} that trigger compiler -+warnings upon use. This is known to occur with GNU libc 2.25, where -+those definitions are being deprecated to reduce namespace pollution. -+If it is not practical to use Autoconf 2.70 to regenerate the configure -+script of affected software, you can work around the problem by setting -+@samp{ac_cv_header_sys_types_h_makedev=no}, as an argument to -+@command{configure} or as part of a @file{config.site} site default file -+(@pxref{Site Defaults}). - @end defmac - - @defmac AC_HEADER_RESOLV -diff --git a/lib/autoconf/headers.m4 b/lib/autoconf/headers.m4 -index 0c44973b0c..72262c1eb1 100644 ---- a/lib/autoconf/headers.m4 -+++ b/lib/autoconf/headers.m4 -@@ -427,31 +427,29 @@ fi - - # AC_HEADER_MAJOR - # --------------- -+# Thanks to glibc 2.25 deprecating macros in sys/types.h, coupled with -+# back-compat to autoconf 2.69, we need the following logic: -+# Check whether compiles. -+# If compiles, assume it provides major/minor/makedev. -+# Otherwise, if compiles, assume it provides the macros. -+# Otherwise, either the macros were provided by , or do -+# not exist on the platform. Code trying to use these three macros is -+# assumed to not care about platforms that lack the macros. - AN_FUNCTION([major], [AC_HEADER_MAJOR]) - AN_FUNCTION([makedev], [AC_HEADER_MAJOR]) - AN_FUNCTION([minor], [AC_HEADER_MAJOR]) - AN_HEADER([sys/mkdev.h], [AC_HEADER_MAJOR]) - AC_DEFUN([AC_HEADER_MAJOR], --[AC_CACHE_CHECK(whether sys/types.h defines makedev, -- ac_cv_header_sys_types_h_makedev, --[AC_LINK_IFELSE([AC_LANG_PROGRAM([[@%:@include ]], -- [[return makedev(0, 0);]])], -- [ac_cv_header_sys_types_h_makedev=yes], -- [ac_cv_header_sys_types_h_makedev=no]) --]) -- --if test $ac_cv_header_sys_types_h_makedev = no; then -+[AC_CHECK_HEADERS_ONCE([sys/types.h]) - AC_CHECK_HEADER(sys/mkdev.h, - [AC_DEFINE(MAJOR_IN_MKDEV, 1, - [Define to 1 if `major', `minor', and `makedev' are - declared in .])]) -- -- if test $ac_cv_header_sys_mkdev_h = no; then -- AC_CHECK_HEADER(sys/sysmacros.h, -- [AC_DEFINE(MAJOR_IN_SYSMACROS, 1, -- [Define to 1 if `major', `minor', and `makedev' -- are declared in .])]) -- fi -+if test $ac_cv_header_sys_mkdev_h = no; then -+ AC_CHECK_HEADER(sys/sysmacros.h, -+ [AC_DEFINE(MAJOR_IN_SYSMACROS, 1, -+ [Define to 1 if `major', `minor', and `makedev' -+ are declared in .])]) - fi - ])# AC_HEADER_MAJOR - --- -2.18.0 - diff --git a/autoconf-2.69.tar.gz b/autoconf-2.69.tar.gz deleted file mode 100644 index 2b8d2a4..0000000 --- a/autoconf-2.69.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:954bd69b391edc12d6a4a51a2dd1476543da5c6bbf05a95b59dc0dd6fd4c2969 -size 1927468 diff --git a/autoconf-2.69.tar.gz.sig b/autoconf-2.69.tar.gz.sig deleted file mode 100644 index d2c1d9a..0000000 --- a/autoconf-2.69.tar.gz.sig +++ /dev/null @@ -1,12 +0,0 @@ ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.4.12 (GNU/Linux) -Comment: Public key at http://people.redhat.com/eblake/eblake.gpg - -iQEcBAABCAAGBQJPl2ywAAoJEKeha0olJ0Nq3Q4IAJTtjgjMtPd2PkfaJVdwTMzv -OkCk5TTb+o1SiFFIAjv8ojL74sEFjCGzJn2xr5zauQZ/K5UP8uoCNUmMytbafA+h -KXmzZ0eZzItb+SljmNhzz0/2id/RM/lhbei7YJPZ4NdAM++aEZHVteDHqbEbCiD3 -lOE4RtjOp9C0QKXY04Y6a31CLVsZsPQzJctyKQo7H81iX7JoKfpWhRgYJYwzMYBX -YJ4BeBaP6KHV2qTK9X4Cf8cIpxdJHzD744rV/dqo/b6RnG5H2ynYvuSr4VwtkS7I -z+yEbEbmjvHS3cB8AqnDnnrxLduI1Bp3SgwmpR28VadDp+hk+6HU4F/UpYOcfZk= -=FUb/ ------END PGP SIGNATURE----- diff --git a/autoconf-2.70.tar.xz b/autoconf-2.70.tar.xz new file mode 100644 index 0000000..b49c255 --- /dev/null +++ b/autoconf-2.70.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fa9e227860d9d845c0a07f63b88c8d7a2ae1aa2345fb619384bb8accc19fecc6 +size 1346528 diff --git a/autoconf-2.70.tar.xz.sig b/autoconf-2.70.tar.xz.sig new file mode 100644 index 0000000..a1f3a9a --- /dev/null +++ b/autoconf-2.70.tar.xz.sig @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABCAAdFiEEgvhU885zF0uLYxdAkfzDK2dpqmQFAl/Pyp0ACgkQkfzDK2dp +qmRwHQ/+K6xxNpeHx0jWQk0GRWiYr4d00ViWAXu2El0zdNh3m3DqQGXmHtZten46 +ez1v8gx4bkvStgZZGh4AgFRnR7zp0am32PwLLAGepraxD06YwlAAZgzCztFW0/9b +DQjYXlW8Jfsx0eQRNX5J41od1MCSjLwjCAx5HFUhAeniwBHrvhn/oaxnd451oJm9 +LPD6oc9ccd4hh7Ff5ElWZdzi7eBOGcjox8+6lxcyieeNYOGoMtRvmrrhGV67ym0s +3Yh5nREqMsaxE7NYSuzM0T+pUZJYMal5dbWYvDdycJqLu9/UabSZLuppNVFTyYAK +43v9Xq7CvHRaJpvqhMiczyjlk86cR/SdKItTaY1ZsTATw/j8uxNTH049XIWP7bM1 +oa7ypMMD779Ihk0Ci7Bl9ZJ8tjsPP1jlPRcHLoyam15HDEQcORDk3YiEJMF74XZ4 +t5TTAw/bDPlGB2fHix5IrSipMaLzKHhlzGAl0exQ35liSSqI6eb2DjnyAO1P1hft +S/Ds5CsL0cRfUKzvoQTRuhJMn1caO2IZfWzCgxGKc6g9XMXyRzYCihGNKSvG1/Vl +66Chjbpv4LXFmASLY41eGclK/c+74nwP9GdO+Sn8jCJsFddlU4pXffBDsk1F+r+c +uLbSss93weH5bh6uS0ll6jU36/3YBudxBLQWDtRtW2uV9Vb8MiE= +=6ak1 +-----END PGP SIGNATURE----- diff --git a/autoconf-el.changes b/autoconf-el.changes index 83a35e4..bf94dc0 100644 --- a/autoconf-el.changes +++ b/autoconf-el.changes @@ -1,3 +1,72 @@ +------------------------------------------------------------------- +Sun Dec 13 18:52:47 UTC 2020 - Andreas Stieger + +- autoconf 2.70: + * Warnings about obsolete constructs are now on by default, + these warnings can be turned off with -Wno-obsolete + * Many macros have become pickier about argument quotation + * Many macros no longer AC_REQUIRE as many other macros as they + used to, may expose several classes of latent bugs + * More macros use config.sub and config.guess internally + * Setting CC to a C++ compiler is no longer supported + * Running configure tests with warnings promoted to errors is + not supported + * Including confdefs.h manually may cause test failures + * Older versions of automake and aclocal (< 1.8) are no longer + supported + * AC_CONFIG_SUBDIRS no longer directly supports Cygnus configure + * AC_CHECK_HEADER and AC_CHECK_HEADERS only do a compilation test + * AC_INCLUDES_DEFAULT assumes an ISO C90 compliant C implementation + * AS_ECHO and AS_ECHO_N unconditionally use ‘printf’ + * Configure scripts require support for $( ... ) command + substitution + * AC_INIT now trims extra white space from its arguments + * Macros that take whitespace-separated lists as arguments + now always expand macros within those arguments + * AC_FUNC_STRERROR_R assumes strerror_r is unavailable if it’s + not declared + * AC_OPENMP can’t be used if you have files named ‘mp’ or ‘penmp’ + * Configure scripts now support a ‘--runstatedir’ option + * autoreconf will now run gtkdocize and intltoolize when appropriate + * autoreconf now recognizes AM_GNU_GETTEXT_REQUIRE_VERSION + * autoheader handles secondary config headers better + * AC_PROG_CC now enables C2011 mode if the compiler supports it + * New macro AC_C__GENERIC tests for C2011 _Generic support + * AC_C_VARARRAYS has been aligned with C2011. + * New macro AC_CONFIG_MACRO_DIRS + * AC_USE_SYSTEM_EXTENSIONS knows about more extensions to enable + * New compatibility macro AC_CHECK_INCLUDES_DEFAULT + * AC_REQUIRE_AUX_FILE has been improved + * AC_PROG_LEX has an option to not look for yywrap + * Use of the long-deprecated name ‘configure.in’ for the autoconf + input file now elicits a warning in the “obsolete” category + * Use of the undocumented internal shell variables $as_echo and + $as_echo_n now elicits a warning in the “obsolete” category. + The macros AS_ECHO and AS_ECHO_N should be used instead. + * autoconf will now issue warnings (in the “syntax” category) + if the input file is missing a call to AC_INIT and/or AC_OUTPUT + * autoconf will now issue warnings (in the “syntax” category) + for a non-literal URL argument to AC_INIT, and for a TARNAME + argument to AC_INIT which is either non-literal or contains + characters that should not be used in file names (e.g. ‘*’). + * AC_PROG_CC_STDC, AC_PROG_CC_C89, AC_PROG_CC_C99 are now + obsolete. Applications should use AC_PROG_CC. + * AC_HEADER_STDC and AC_HEADER_TIME are now stubs. + * AC_DIAGNOSE, AC_FATAL, AC_WARNING, and _AC_COMPUTE_INT are now + replaced with modern equivalents by autoupdate. + * AC_CONFIG_HEADER is now diagnosed as obsolete, and replaced with + AC_CONFIG_HEADERS by autoupdate. + * The macro AC_OBSOLETE is obsolete. + * Man pages for config.guess and config.sub are no longer provided + * Bug fixes for compatibility with current Automake, Libtool, + Perl, Texinfo, and shells + * Compatibility fixes for compilers and build environments + * Various autotest enhancements +- drop upstream patches: + * autoconf-perl-5.17-fixes.patch + * port-tests-to-bash-5.patch +- remove obsolete texinfo packaging macros + ------------------------------------------------------------------- Tue Nov 5 23:07:29 UTC 2019 - Stefan Brüns diff --git a/autoconf-el.spec b/autoconf-el.spec index 8deb79a..693ff49 100644 --- a/autoconf-el.spec +++ b/autoconf-el.spec @@ -1,7 +1,7 @@ # # spec file for package autoconf-el # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,20 +16,18 @@ # +%define site_lisp %{_datadir}/emacs/site-lisp Name: autoconf-el -BuildRequires: emacs-nox -BuildRequires: m4 >= 1.4.6 -BuildRequires: xz -Version: 2.69 +Version: 2.70 Release: 0 Summary: Emacs mode for editing GNU Autoconf scripts License: GPL-3.0-or-later -Url: http://www.gnu.org/software/autoconf -BuildRoot: %{_tmppath}/%{name}-%{version}-build -Source: http://ftp.gnu.org/gnu/autoconf/autoconf-%{version}.tar.gz -BuildArch: noarch +URL: https://www.gnu.org/software/autoconf +Source: http://ftp.gnu.org/gnu/autoconf/autoconf-%{version}.tar.xz +BuildRequires: emacs-nox +BuildRequires: m4 >= 1.4.6 Enhances: emacs -%define site_lisp %{_prefix}/share/emacs/site-lisp +BuildArch: noarch %description Emacs mode for editing GNU Autoconf scripts @@ -38,12 +36,16 @@ Emacs mode for editing GNU Autoconf scripts %setup -q -n autoconf-%{version} %build -./configure --prefix=%{_prefix} --infodir=%{_infodir} --mandir=%{_mandir} -make -C lib/emacs %{?_smp_mflags} +%configure +%make_build %install -make -C lib/emacs install DESTDIR=$RPM_BUILD_ROOT -sed 's/^;//' > $RPM_BUILD_ROOT%{site_lisp}/suse-start-%{name}.el <<\EOF +mkdir -p %{buildroot}%{site_lisp} +install -c -m 644 lib/emacs/autoconf-mode.el %{buildroot}%{site_lisp}/autoconf-mode.el +install -c -m 644 lib/emacs/autoconf-mode.elc %{buildroot}%{site_lisp}/autoconf-mode.elc +install -c -m 644 lib/emacs/autotest-mode.el %{buildroot}%{site_lisp}/autotest-mode.el +install -c -m 644 lib/emacs/autotest-mode.elc %{buildroot}%{site_lisp}/autotest-mode.elc +sed 's/^;//' > %{buildroot}%{site_lisp}/suse-start-%{name}.el <<\EOF ;;; %{site_lisp}/suse-start-%{name}.el ; (autoload 'autoconf-mode "autoconf-mode" @@ -60,7 +62,7 @@ sed 's/^;//' > $RPM_BUILD_ROOT%{site_lisp}/suse-start-%{name}.el <<\EOF EOF %files -%defattr(-,root,root) +%license COPYING %{site_lisp}/*.el %{site_lisp}/*.elc diff --git a/autoconf-perl-5.17-fixes.patch b/autoconf-perl-5.17-fixes.patch deleted file mode 100644 index f39a861..0000000 --- a/autoconf-perl-5.17-fixes.patch +++ /dev/null @@ -1,28 +0,0 @@ -From e5654a5591884b92633c7785f325626711e7f7aa Mon Sep 17 00:00:00 2001 -From: Paul Eggert -Date: Tue, 29 Jan 2013 13:46:48 -0800 -Subject: [PATCH] autoscan: port to perl 5.17 - -* bin/autoscan.in (scan_sh_file): Escape '{'. This avoids a -feature that is deprecated in Perl 5.17. Reported by Ray Lauff in -. ---- - bin/autoscan.in | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/bin/autoscan.in b/bin/autoscan.in -index 993a750..db1df79 100644 ---- a/bin/autoscan.in -+++ b/bin/autoscan.in -@@ -358,7 +358,7 @@ sub scan_sh_file ($) - { - # Strip out comments and variable references. - s/#.*//; -- s/\${[^\}]*}//g; -+ s/\$\{[^\}]*}//g; - s/@[^@]*@//g; - - # Tokens in the code. --- -1.7.2.5 - diff --git a/autoconf-testsuite.changes b/autoconf-testsuite.changes index 83a35e4..bf94dc0 100644 --- a/autoconf-testsuite.changes +++ b/autoconf-testsuite.changes @@ -1,3 +1,72 @@ +------------------------------------------------------------------- +Sun Dec 13 18:52:47 UTC 2020 - Andreas Stieger + +- autoconf 2.70: + * Warnings about obsolete constructs are now on by default, + these warnings can be turned off with -Wno-obsolete + * Many macros have become pickier about argument quotation + * Many macros no longer AC_REQUIRE as many other macros as they + used to, may expose several classes of latent bugs + * More macros use config.sub and config.guess internally + * Setting CC to a C++ compiler is no longer supported + * Running configure tests with warnings promoted to errors is + not supported + * Including confdefs.h manually may cause test failures + * Older versions of automake and aclocal (< 1.8) are no longer + supported + * AC_CONFIG_SUBDIRS no longer directly supports Cygnus configure + * AC_CHECK_HEADER and AC_CHECK_HEADERS only do a compilation test + * AC_INCLUDES_DEFAULT assumes an ISO C90 compliant C implementation + * AS_ECHO and AS_ECHO_N unconditionally use ‘printf’ + * Configure scripts require support for $( ... ) command + substitution + * AC_INIT now trims extra white space from its arguments + * Macros that take whitespace-separated lists as arguments + now always expand macros within those arguments + * AC_FUNC_STRERROR_R assumes strerror_r is unavailable if it’s + not declared + * AC_OPENMP can’t be used if you have files named ‘mp’ or ‘penmp’ + * Configure scripts now support a ‘--runstatedir’ option + * autoreconf will now run gtkdocize and intltoolize when appropriate + * autoreconf now recognizes AM_GNU_GETTEXT_REQUIRE_VERSION + * autoheader handles secondary config headers better + * AC_PROG_CC now enables C2011 mode if the compiler supports it + * New macro AC_C__GENERIC tests for C2011 _Generic support + * AC_C_VARARRAYS has been aligned with C2011. + * New macro AC_CONFIG_MACRO_DIRS + * AC_USE_SYSTEM_EXTENSIONS knows about more extensions to enable + * New compatibility macro AC_CHECK_INCLUDES_DEFAULT + * AC_REQUIRE_AUX_FILE has been improved + * AC_PROG_LEX has an option to not look for yywrap + * Use of the long-deprecated name ‘configure.in’ for the autoconf + input file now elicits a warning in the “obsolete” category + * Use of the undocumented internal shell variables $as_echo and + $as_echo_n now elicits a warning in the “obsolete” category. + The macros AS_ECHO and AS_ECHO_N should be used instead. + * autoconf will now issue warnings (in the “syntax” category) + if the input file is missing a call to AC_INIT and/or AC_OUTPUT + * autoconf will now issue warnings (in the “syntax” category) + for a non-literal URL argument to AC_INIT, and for a TARNAME + argument to AC_INIT which is either non-literal or contains + characters that should not be used in file names (e.g. ‘*’). + * AC_PROG_CC_STDC, AC_PROG_CC_C89, AC_PROG_CC_C99 are now + obsolete. Applications should use AC_PROG_CC. + * AC_HEADER_STDC and AC_HEADER_TIME are now stubs. + * AC_DIAGNOSE, AC_FATAL, AC_WARNING, and _AC_COMPUTE_INT are now + replaced with modern equivalents by autoupdate. + * AC_CONFIG_HEADER is now diagnosed as obsolete, and replaced with + AC_CONFIG_HEADERS by autoupdate. + * The macro AC_OBSOLETE is obsolete. + * Man pages for config.guess and config.sub are no longer provided + * Bug fixes for compatibility with current Automake, Libtool, + Perl, Texinfo, and shells + * Compatibility fixes for compilers and build environments + * Various autotest enhancements +- drop upstream patches: + * autoconf-perl-5.17-fixes.patch + * port-tests-to-bash-5.patch +- remove obsolete texinfo packaging macros + ------------------------------------------------------------------- Tue Nov 5 23:07:29 UTC 2019 - Stefan Brüns diff --git a/autoconf-testsuite.spec b/autoconf-testsuite.spec index b9699db..e66b4bd 100644 --- a/autoconf-testsuite.spec +++ b/autoconf-testsuite.spec @@ -1,7 +1,7 @@ # # spec file for package autoconf-testsuite # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,30 +17,24 @@ Name: autoconf-testsuite -Version: 2.69 +Version: 2.70 Release: 0 Summary: A GNU Tool for Automatically Configuring Source Code License: GPL-3.0-or-later -Url: http://www.gnu.org/software/autoconf -Source0: http://ftp.gnu.org/gnu/autoconf/autoconf-%{version}.tar.gz -Source1: http://ftp.gnu.org/gnu/autoconf/autoconf-%{version}.tar.gz.sig +URL: https://www.gnu.org/software/autoconf +Source0: http://ftp.gnu.org/gnu/autoconf/autoconf-%{version}.tar.xz +Source1: http://ftp.gnu.org/gnu/autoconf/autoconf-%{version}.tar.xz.sig Source2: %{name}.keyring Patch0: autoreconf-ltdl.diff -# PATCH-FIX-UPSTREAM autoconf-perl-5.17-fixes.patch dimstar@opensuse.org -- autoscan: port to perl 5.17 (with perl 5.22, it is now fatal). -Patch1: autoconf-perl-5.17-fixes.patch -# PATCH-FIX-UPSTREAM AC_HEADER_MAJOR: port to glibc 2.25 -Patch2: ac-header-major.patch -# PATCH-FIX-UPSTREAM Port tests to Bash 5 -Patch3: port-tests-to-bash-5.patch BuildRequires: help2man BuildRequires: m4 >= 1.4.6 Requires: info Requires: m4 >= 1.4.6 Requires: perl-base >= 5.6 -Requires(post): %{install_info_prereq} -Requires(preun): %{install_info_prereq} -BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildArch: noarch +%if "%{name}" == "autoconf-testsuite" +BuildRequires: gcc-c++ +%endif %description GNU Autoconf is a tool for configuring source code and makefiles. Using @@ -58,43 +52,30 @@ only required for the generation of the scripts, not their use. %prep %setup -q -n autoconf-%{version} %patch0 -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 %build %configure -make %{?_smp_mflags} +%make_build %if "%{name}" == "autoconf-testsuite" %check trap 'test $? -ne 0 && cat tests/testsuite.log' EXIT -make %{?_smp_mflags} check +%make_build check %install %else %install -%{?make_install} %{!?make_install:make install DESTDIR=%{buildroot}} -rm -f %{buildroot}%{_datadir}/emacs/site-lisp/*.el* -# info's dir file is not auto ignored on some systems -rm -rf %{buildroot}%{_infodir}/dir +%make_install %endif -%post -%install_info --info-dir=%{_infodir} %{_infodir}/autoconf.info.gz - -%preun -%install_info_delete --info-dir=%{_infodir} %{_infodir}/autoconf.info.gz - %if "%{name}" == "autoconf" %files -%defattr(-,root,root) %doc AUTHORS NEWS README TODO %license COPYING %{_bindir}/* %{_datadir}/autoconf -%doc %{_infodir}/*.gz -%doc %{_mandir}/man1/*.gz +%{_infodir}/*.gz +%{_mandir}/man1/*.gz %endif %changelog diff --git a/autoconf.changes b/autoconf.changes index 83a35e4..bf94dc0 100644 --- a/autoconf.changes +++ b/autoconf.changes @@ -1,3 +1,72 @@ +------------------------------------------------------------------- +Sun Dec 13 18:52:47 UTC 2020 - Andreas Stieger + +- autoconf 2.70: + * Warnings about obsolete constructs are now on by default, + these warnings can be turned off with -Wno-obsolete + * Many macros have become pickier about argument quotation + * Many macros no longer AC_REQUIRE as many other macros as they + used to, may expose several classes of latent bugs + * More macros use config.sub and config.guess internally + * Setting CC to a C++ compiler is no longer supported + * Running configure tests with warnings promoted to errors is + not supported + * Including confdefs.h manually may cause test failures + * Older versions of automake and aclocal (< 1.8) are no longer + supported + * AC_CONFIG_SUBDIRS no longer directly supports Cygnus configure + * AC_CHECK_HEADER and AC_CHECK_HEADERS only do a compilation test + * AC_INCLUDES_DEFAULT assumes an ISO C90 compliant C implementation + * AS_ECHO and AS_ECHO_N unconditionally use ‘printf’ + * Configure scripts require support for $( ... ) command + substitution + * AC_INIT now trims extra white space from its arguments + * Macros that take whitespace-separated lists as arguments + now always expand macros within those arguments + * AC_FUNC_STRERROR_R assumes strerror_r is unavailable if it’s + not declared + * AC_OPENMP can’t be used if you have files named ‘mp’ or ‘penmp’ + * Configure scripts now support a ‘--runstatedir’ option + * autoreconf will now run gtkdocize and intltoolize when appropriate + * autoreconf now recognizes AM_GNU_GETTEXT_REQUIRE_VERSION + * autoheader handles secondary config headers better + * AC_PROG_CC now enables C2011 mode if the compiler supports it + * New macro AC_C__GENERIC tests for C2011 _Generic support + * AC_C_VARARRAYS has been aligned with C2011. + * New macro AC_CONFIG_MACRO_DIRS + * AC_USE_SYSTEM_EXTENSIONS knows about more extensions to enable + * New compatibility macro AC_CHECK_INCLUDES_DEFAULT + * AC_REQUIRE_AUX_FILE has been improved + * AC_PROG_LEX has an option to not look for yywrap + * Use of the long-deprecated name ‘configure.in’ for the autoconf + input file now elicits a warning in the “obsolete” category + * Use of the undocumented internal shell variables $as_echo and + $as_echo_n now elicits a warning in the “obsolete” category. + The macros AS_ECHO and AS_ECHO_N should be used instead. + * autoconf will now issue warnings (in the “syntax” category) + if the input file is missing a call to AC_INIT and/or AC_OUTPUT + * autoconf will now issue warnings (in the “syntax” category) + for a non-literal URL argument to AC_INIT, and for a TARNAME + argument to AC_INIT which is either non-literal or contains + characters that should not be used in file names (e.g. ‘*’). + * AC_PROG_CC_STDC, AC_PROG_CC_C89, AC_PROG_CC_C99 are now + obsolete. Applications should use AC_PROG_CC. + * AC_HEADER_STDC and AC_HEADER_TIME are now stubs. + * AC_DIAGNOSE, AC_FATAL, AC_WARNING, and _AC_COMPUTE_INT are now + replaced with modern equivalents by autoupdate. + * AC_CONFIG_HEADER is now diagnosed as obsolete, and replaced with + AC_CONFIG_HEADERS by autoupdate. + * The macro AC_OBSOLETE is obsolete. + * Man pages for config.guess and config.sub are no longer provided + * Bug fixes for compatibility with current Automake, Libtool, + Perl, Texinfo, and shells + * Compatibility fixes for compilers and build environments + * Various autotest enhancements +- drop upstream patches: + * autoconf-perl-5.17-fixes.patch + * port-tests-to-bash-5.patch +- remove obsolete texinfo packaging macros + ------------------------------------------------------------------- Tue Nov 5 23:07:29 UTC 2019 - Stefan Brüns diff --git a/autoconf.spec b/autoconf.spec index 31933b1..d62c06c 100644 --- a/autoconf.spec +++ b/autoconf.spec @@ -1,7 +1,7 @@ # # spec file for package autoconf # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,30 +17,24 @@ Name: autoconf -Version: 2.69 +Version: 2.70 Release: 0 Summary: A GNU Tool for Automatically Configuring Source Code License: GPL-3.0-or-later -Url: http://www.gnu.org/software/autoconf -Source0: http://ftp.gnu.org/gnu/autoconf/autoconf-%{version}.tar.gz -Source1: http://ftp.gnu.org/gnu/autoconf/autoconf-%{version}.tar.gz.sig +URL: https://www.gnu.org/software/autoconf +Source0: http://ftp.gnu.org/gnu/autoconf/autoconf-%{version}.tar.xz +Source1: http://ftp.gnu.org/gnu/autoconf/autoconf-%{version}.tar.xz.sig Source2: %{name}.keyring Patch0: autoreconf-ltdl.diff -# PATCH-FIX-UPSTREAM autoconf-perl-5.17-fixes.patch dimstar@opensuse.org -- autoscan: port to perl 5.17 (with perl 5.22, it is now fatal). -Patch1: autoconf-perl-5.17-fixes.patch -# PATCH-FIX-UPSTREAM AC_HEADER_MAJOR: port to glibc 2.25 -Patch2: ac-header-major.patch -# PATCH-FIX-UPSTREAM Port tests to Bash 5 -Patch3: port-tests-to-bash-5.patch BuildRequires: help2man BuildRequires: m4 >= 1.4.6 Requires: info Requires: m4 >= 1.4.6 Requires: perl-base >= 5.6 -Requires(post): %{install_info_prereq} -Requires(preun): %{install_info_prereq} -BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildArch: noarch +%if "%{name}" == "autoconf-testsuite" +BuildRequires: gcc-c++ +%endif %description GNU Autoconf is a tool for configuring source code and makefiles. Using @@ -58,43 +52,30 @@ only required for the generation of the scripts, not their use. %prep %setup -q -n autoconf-%{version} %patch0 -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 %build %configure -make %{?_smp_mflags} +%make_build %if "%{name}" == "autoconf-testsuite" %check trap 'test $? -ne 0 && cat tests/testsuite.log' EXIT -make %{?_smp_mflags} check +%make_build check %install %else %install -%{?make_install} %{!?make_install:make install DESTDIR=%{buildroot}} -rm -f %{buildroot}%{_datadir}/emacs/site-lisp/*.el* -# info's dir file is not auto ignored on some systems -rm -rf %{buildroot}%{_infodir}/dir +%make_install %endif -%post -%install_info --info-dir=%{_infodir} %{_infodir}/autoconf.info.gz - -%preun -%install_info_delete --info-dir=%{_infodir} %{_infodir}/autoconf.info.gz - %if "%{name}" == "autoconf" %files -%defattr(-,root,root) %doc AUTHORS NEWS README TODO %license COPYING %{_bindir}/* %{_datadir}/autoconf -%doc %{_infodir}/*.gz -%doc %{_mandir}/man1/*.gz +%{_infodir}/*.gz +%{_mandir}/man1/*.gz %endif %changelog diff --git a/autoreconf-ltdl.diff b/autoreconf-ltdl.diff index 710046b..2254064 100644 --- a/autoreconf-ltdl.diff +++ b/autoreconf-ltdl.diff @@ -1,22 +1,22 @@ Index: bin/autoreconf.in =================================================================== ---- bin/autoreconf.in.orig 2012-04-25 00:00:28.000000000 +0200 -+++ bin/autoreconf.in 2012-04-25 16:50:22.272144014 +0200 -@@ -470,6 +470,8 @@ sub autoreconf_current_directory () - 'AC_CONFIG_AUX_DIR', - 'AC_CONFIG_HEADERS', - 'AC_CONFIG_SUBDIRS', -+ 'AC_LIBLTDL_CONVENIENCE', -+ 'AC_LIBLTDL_INSTALLABLE', - 'AC_INIT', - 'AC_PROG_LIBTOOL', - 'LT_INIT', -@@ -488,6 +490,8 @@ sub autoreconf_current_directory () - $uses_libtool = 1 if $macro eq "AC_PROG_LIBTOOL" +--- bin/autoreconf.in.orig ++++ bin/autoreconf.in +@@ -595,6 +595,8 @@ sub autoreconf_current_directory ($) + 'AC_CONFIG_AUX_DIR', + 'AC_CONFIG_HEADERS', + 'AC_CONFIG_SUBDIRS', ++ 'AC_LIBLTDL_CONVENIENCE', ++ 'AC_LIBLTDL_INSTALLABLE', + 'AC_INIT', + 'AC_REQUIRE_AUX_FILE', + 'AC_PROG_LIBTOOL', +@@ -620,6 +622,8 @@ sub autoreconf_current_directory ($) + || $macro eq "AM_PROG_LIBTOOL" || $macro eq "LT_INIT"; $uses_libltdl = 1 if $macro eq "LT_CONFIG_LTDL_DIR"; + $uses_libltdl = 1 if $macro eq "AC_LIBLTDL_CONVENIENCE"; + $uses_libltdl = 1 if $macro eq "AC_LIBLTDL_INSTALLABLE"; $uses_autoheader = 1 if $macro eq "AC_CONFIG_HEADERS"; $uses_automake = 1 if $macro eq "AM_INIT_AUTOMAKE"; - push @subdir, split (' ', $args[0]) + $uses_intltool = 1 if $macro eq "IT_PROG_INTLTOOL"; diff --git a/port-tests-to-bash-5.patch b/port-tests-to-bash-5.patch deleted file mode 100644 index 1f53eb3..0000000 --- a/port-tests-to-bash-5.patch +++ /dev/null @@ -1,63 +0,0 @@ -From 5b9db67786a428164abafe626ab11a2754aad528 Mon Sep 17 00:00:00 2001 -From: Ondrej Dubaj -Date: Wed, 28 Aug 2019 07:39:50 +0200 -Subject: [PATCH] Port tests to Bash 5 - -* tests/local.at (AT_CHECK_ENV, AT_CONFIG_CMP): -Add BASH_ARGC, BASH_ARGV to list of variables to be ignored when -comparing variable space dumps. -(AT_CONFIG_CMP): Also ignore LINENO. -* tests/m4sh.at: Also unset LINENO in 'reference' and 'test/test-1'. ---- - tests/local.at | 5 ++++- - tests/m4sh.at | 4 ++-- - 2 files changed, 6 insertions(+), 3 deletions(-) - -diff --git a/tests/local.at b/tests/local.at -index a22958c..852be28 100644 ---- a/tests/local.at -+++ b/tests/local.at -@@ -325,7 +325,7 @@ if test -f state-env.before && test -f state-env.after; then - [AWK|LEX|LEXLIB|LEX_OUTPUT_ROOT|LN_S|M4|MKDIR_P|RANLIB|SET_MAKE|YACC], - [GREP|[EF]GREP|SED], - [[_@]|.[*#?$].], -- [argv|ARGC|LINENO|OLDPWD|PIPESTATUS|RANDOM|SECONDS]))=' \ -+ [argv|ARGC|LINENO|BASH_ARGC|BASH_ARGV|OLDPWD|PIPESTATUS|RANDOM|SECONDS]))=' \ - $act_file || - test $? -eq 1 || echo failed >&2 - ) 2>stderr-$act_file | -@@ -382,6 +382,9 @@ do - /'\'\\\$\''=/ d - /^argv=/ d - /^ARGC=/ d -+ /^BASH_ARGC=/ d -+ /^BASH_ARGV=/ d -+ /^LINENO=/ d - ' $act_file >at_config_vars-$act_file - done - AT_CMP([at_config_vars-$1], [at_config_vars-$2])[]dnl -diff --git a/tests/m4sh.at b/tests/m4sh.at -index e9d70b0..cbdfcb6 100644 ---- a/tests/m4sh.at -+++ b/tests/m4sh.at -@@ -254,7 +254,7 @@ AT_CHECK([autom4te -l m4sh $1.as -o $1]) - # `_oline_', once processed and ran, produces our reference. - # We check that we find ourselves by looking at a string which is - # available only in the original script: `_oline_'. --AT_DATA_LINENO([reference], [false], [__OLINE__], [_oline__]) -+AT_DATA_LINENO([reference], [true], [__OLINE__], [_oline__]) - AT_CHECK([./reference], 0, [stdout]) - - # The reference: -@@ -264,7 +264,7 @@ mv stdout expout - # Be sure to be out of the PATH. - AT_CHECK([mkdir test || exit 77]) - --AT_DATA_LINENO([test/test-1], [false], [__LINENO__], [LINENO]) -+AT_DATA_LINENO([test/test-1], [true], [__LINENO__], [LINENO]) - AT_CHECK([./test/test-1], 0, [expout]) - AT_CHECK([(PATH=test$PATH_SEPARATOR$PATH; export PATH; exec test-1)], - 0, [expout]) --- -1.9.1 - From 30e14cb563e72c5a36fb9eccb9e5872f01ab66b1544879a67a73d50fec2a695d Mon Sep 17 00:00:00 2001 From: Martin Pluskal Date: Mon, 14 Dec 2020 08:06:59 +0000 Subject: [PATCH 2/6] Accepting request 855677 from home:AndreasStieger:branches:devel:tools:building fix changelog OBS-URL: https://build.opensuse.org/request/show/855677 OBS-URL: https://build.opensuse.org/package/show/devel:tools:building/autoconf?expand=0&rev=47 --- autoconf-el.changes | 1 + autoconf-testsuite.changes | 1 + autoconf.changes | 1 + 3 files changed, 3 insertions(+) diff --git a/autoconf-el.changes b/autoconf-el.changes index bf94dc0..51c9fb9 100644 --- a/autoconf-el.changes +++ b/autoconf-el.changes @@ -65,6 +65,7 @@ Sun Dec 13 18:52:47 UTC 2020 - Andreas Stieger - drop upstream patches: * autoconf-perl-5.17-fixes.patch * port-tests-to-bash-5.patch + * ac-header-major.patch - remove obsolete texinfo packaging macros ------------------------------------------------------------------- diff --git a/autoconf-testsuite.changes b/autoconf-testsuite.changes index bf94dc0..51c9fb9 100644 --- a/autoconf-testsuite.changes +++ b/autoconf-testsuite.changes @@ -65,6 +65,7 @@ Sun Dec 13 18:52:47 UTC 2020 - Andreas Stieger - drop upstream patches: * autoconf-perl-5.17-fixes.patch * port-tests-to-bash-5.patch + * ac-header-major.patch - remove obsolete texinfo packaging macros ------------------------------------------------------------------- diff --git a/autoconf.changes b/autoconf.changes index bf94dc0..51c9fb9 100644 --- a/autoconf.changes +++ b/autoconf.changes @@ -65,6 +65,7 @@ Sun Dec 13 18:52:47 UTC 2020 - Andreas Stieger - drop upstream patches: * autoconf-perl-5.17-fixes.patch * port-tests-to-bash-5.patch + * ac-header-major.patch - remove obsolete texinfo packaging macros ------------------------------------------------------------------- From a63372cebc93f69b46b242d82ed0ced040a90e9e3ba96123ded0fe64e4cd8ae6 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Sat, 16 Jan 2021 19:20:19 +0000 Subject: [PATCH 3/6] - add autom4te-always-update-output-file.patch to fix testsuite failures OBS-URL: https://build.opensuse.org/package/show/devel:tools:building/autoconf?expand=0&rev=48 --- autoconf-el.spec | 2 +- autoconf-testsuite.spec | 5 +- autoconf.changes | 6 ++ autoconf.spec | 5 +- autom4te-always-update-output-file.patch | 99 ++++++++++++++++++++++++ 5 files changed, 114 insertions(+), 3 deletions(-) create mode 100644 autom4te-always-update-output-file.patch diff --git a/autoconf-el.spec b/autoconf-el.spec index 693ff49..02d4c93 100644 --- a/autoconf-el.spec +++ b/autoconf-el.spec @@ -1,7 +1,7 @@ # # spec file for package autoconf-el # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed diff --git a/autoconf-testsuite.spec b/autoconf-testsuite.spec index e66b4bd..f6b8f91 100644 --- a/autoconf-testsuite.spec +++ b/autoconf-testsuite.spec @@ -1,7 +1,7 @@ # # spec file for package autoconf-testsuite # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -26,6 +26,8 @@ Source0: http://ftp.gnu.org/gnu/autoconf/autoconf-%{version}.tar.xz Source1: http://ftp.gnu.org/gnu/autoconf/autoconf-%{version}.tar.xz.sig Source2: %{name}.keyring Patch0: autoreconf-ltdl.diff +# PATCH-FIX-UPSTREAM +Patch1: https://git.savannah.gnu.org/cgit/autoconf.git/patch/?id=07130c3e48d12ec155ac5d7630dc7477b6989904#/autom4te-always-update-output-file.patch BuildRequires: help2man BuildRequires: m4 >= 1.4.6 Requires: info @@ -52,6 +54,7 @@ only required for the generation of the scripts, not their use. %prep %setup -q -n autoconf-%{version} %patch0 +%patch1 -p1 %build %configure diff --git a/autoconf.changes b/autoconf.changes index 51c9fb9..51f9861 100644 --- a/autoconf.changes +++ b/autoconf.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Sat Jan 16 18:47:23 UTC 2021 - Dirk Müller + +- add autom4te-always-update-output-file.patch to fix testsuite + failures + ------------------------------------------------------------------- Sun Dec 13 18:52:47 UTC 2020 - Andreas Stieger diff --git a/autoconf.spec b/autoconf.spec index d62c06c..31064b2 100644 --- a/autoconf.spec +++ b/autoconf.spec @@ -1,7 +1,7 @@ # # spec file for package autoconf # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -26,6 +26,8 @@ Source0: http://ftp.gnu.org/gnu/autoconf/autoconf-%{version}.tar.xz Source1: http://ftp.gnu.org/gnu/autoconf/autoconf-%{version}.tar.xz.sig Source2: %{name}.keyring Patch0: autoreconf-ltdl.diff +# PATCH-FIX-UPSTREAM +Patch1: https://git.savannah.gnu.org/cgit/autoconf.git/patch/?id=07130c3e48d12ec155ac5d7630dc7477b6989904#/autom4te-always-update-output-file.patch BuildRequires: help2man BuildRequires: m4 >= 1.4.6 Requires: info @@ -52,6 +54,7 @@ only required for the generation of the scripts, not their use. %prep %setup -q -n autoconf-%{version} %patch0 +%patch1 -p1 %build %configure diff --git a/autom4te-always-update-output-file.patch b/autom4te-always-update-output-file.patch new file mode 100644 index 0000000..d31d2e9 --- /dev/null +++ b/autom4te-always-update-output-file.patch @@ -0,0 +1,99 @@ +From 07130c3e48d12ec155ac5d7630dc7477b6989904 Mon Sep 17 00:00:00 2001 +From: Zack Weinberg +Date: Tue, 29 Dec 2020 15:33:33 -0500 +Subject: =?UTF-8?q?autom4te:=20always=20update=20the=20output=20file,=20ev?= + =?UTF-8?q?en=20if=20it=20hasn=E2=80=99t=20changed?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Automake generates a Makefile rule for regenerating the configure +script, that relies on an invocation of ‘autoconf’ always bumping the +timestamp on the configure script, even if it hasn’t changed. +The patch to make autom4te update the output file atomically +(1725c947144d9bebfe7817c2c5f0d53d884b1297) broke this. + +Fixes several failures in automake’s test suite. + + * bin/autom4te.in (handle_output): Always call update_file with force=1. + * tests/tools.at (autoconf: timestamp changes): New test. +--- + bin/autom4te.in | 4 +++- + tests/tools.at | 46 ++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 49 insertions(+), 1 deletion(-) + +diff --git a/bin/autom4te.in b/bin/autom4te.in +index 4c2b905c..64653a44 100644 +--- a/bin/autom4te.in ++++ b/bin/autom4te.in +@@ -609,7 +609,9 @@ sub handle_output ($$) + } + + $out->close(); +- update_file ($scratchfile, $output, $force) ++ # Always update the file, even if it didn't change; ++ # Automake relies on this. ++ update_file ($scratchfile, $output, 1) + if defined $scratchfile; + + # If no forbidden words, we're done. +diff --git a/tests/tools.at b/tests/tools.at +index 49710202..89b8b63b 100644 +--- a/tests/tools.at ++++ b/tests/tools.at +@@ -662,6 +662,52 @@ arbitrary $text + AT_CLEANUP + + ++# autoconf: timestamp changes ++# --------------------------- ++# Automake needs autoconf to update the timestamp on the configure script ++# whenever configure.ac or aclocal.m4 changes, even if the contents of the ++# configure script have not changed. ++AT_SETUP([autoconf: timestamp changes]) ++ ++AT_DATA([aclocal.m4], ++[[AC_DEFUN([local_KILROY], [# kilroy was here ++]) ++]]) ++ ++AT_DATA_AUTOCONF([configure.ac], ++[[AC_INIT ++AC_PROG_CC ++local_KILROY ++AC_OUTPUT ++]]) ++ ++AT_CHECK_AUTOCONF ++ ++cp configure configure.1 ++sleep 1 ++printf '%s\n' 'AC_LIBSOURCES([foo.c])dn@&t@l' >> configure.ac ++ ++# This step must not use --force. ++# We don't need to check shell syntax, because if all goes well, ++# the script will be unchanged from what it was in the first autoconf ++# pass, and that was already checked. ++AT_CHECK_M4([autoconf]) ++AT_CHECK([cmp configure configure.1]) ++AT_CHECK([test configure -nt configure.1]) ++ ++cp configure configure.2 ++sleep 1 ++printf '%s\n' \ ++ 'AC_DEFUN([unused_MACRO], [# bob was there too' \ ++ '])' >> aclocal.m4 ++ ++# Same as above. ++AT_CHECK_M4([autoconf]) ++AT_CHECK([cmp configure configure.2]) ++AT_CHECK([test configure -nt configure.2]) ++ ++AT_CLEANUP ++ + + ## --------- ## + ## ifnames. ## +-- +cgit v1.2.1 + From da56b3f7cbddac22e012d6b9b662af3bcd778c5c33df8f87221cd4424497e6ca Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Sat, 16 Jan 2021 22:06:09 +0000 Subject: [PATCH 4/6] - add autom4te-always-update-output-file.patch to fix testsuite failures - add autom4te-always-update-output-file.patch to fix testsuite failures OBS-URL: https://build.opensuse.org/package/show/devel:tools:building/autoconf?expand=0&rev=49 --- autoconf-el.changes | 11 + autoconf-testsuite.changes | 11 + autoconf-testsuite.spec | 9 + autoconf.changes | 5 + autoconf.spec | 9 + handle-gettext-alone.patch | 58 + prog-c99-fix-typo.patch | 31 + restore-compatibility-gnu11.patch | 1913 +++++++++++++++++++++++++++++ 8 files changed, 2047 insertions(+) create mode 100644 handle-gettext-alone.patch create mode 100644 prog-c99-fix-typo.patch create mode 100644 restore-compatibility-gnu11.patch diff --git a/autoconf-el.changes b/autoconf-el.changes index 51c9fb9..8dbb554 100644 --- a/autoconf-el.changes +++ b/autoconf-el.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Sat Jan 16 18:47:23 UTC 2021 - Dirk Müller + +- add autom4te-always-update-output-file.patch to fix testsuite + failures +- handle-gettext-alone.patch: support GNU_GETTEXT alone being called + again +- add prog-c99-fix-typo.patch: fix typo in C99 detection +- add restore-compatibility-gnu11.patch: restore compatibility in GNU11 + mode + ------------------------------------------------------------------- Sun Dec 13 18:52:47 UTC 2020 - Andreas Stieger diff --git a/autoconf-testsuite.changes b/autoconf-testsuite.changes index 51c9fb9..8dbb554 100644 --- a/autoconf-testsuite.changes +++ b/autoconf-testsuite.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Sat Jan 16 18:47:23 UTC 2021 - Dirk Müller + +- add autom4te-always-update-output-file.patch to fix testsuite + failures +- handle-gettext-alone.patch: support GNU_GETTEXT alone being called + again +- add prog-c99-fix-typo.patch: fix typo in C99 detection +- add restore-compatibility-gnu11.patch: restore compatibility in GNU11 + mode + ------------------------------------------------------------------- Sun Dec 13 18:52:47 UTC 2020 - Andreas Stieger diff --git a/autoconf-testsuite.spec b/autoconf-testsuite.spec index f6b8f91..157961c 100644 --- a/autoconf-testsuite.spec +++ b/autoconf-testsuite.spec @@ -28,6 +28,12 @@ Source2: %{name}.keyring Patch0: autoreconf-ltdl.diff # PATCH-FIX-UPSTREAM Patch1: https://git.savannah.gnu.org/cgit/autoconf.git/patch/?id=07130c3e48d12ec155ac5d7630dc7477b6989904#/autom4te-always-update-output-file.patch +# PATCH-FIX-UPSTREAM +Patch2: https://git.savannah.gnu.org/cgit/autoconf.git/patch/?id=05972f49ee632cd98057a3caf82ebfb9574846da#/prog-c99-fix-typo.patch +# PATCH-FIX-UPSTREAM +Patch3: https://git.savannah.gnu.org/cgit/autoconf.git/patch/?id=66fdaea3cfb4e758212c1891913e9a59441d49af#/handle-gettext-alone.patch +# PATCH-FIX-UPSTREAM https://git.savannah.gnu.org/cgit/autoconf.git/patch/?id=2d0f19d84ddb13412382674fd48e6fc5c2875d0e +Patch4: restore-compatibility-gnu11.patch BuildRequires: help2man BuildRequires: m4 >= 1.4.6 Requires: info @@ -55,6 +61,9 @@ only required for the generation of the scripts, not their use. %setup -q -n autoconf-%{version} %patch0 %patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 %build %configure diff --git a/autoconf.changes b/autoconf.changes index 51f9861..8dbb554 100644 --- a/autoconf.changes +++ b/autoconf.changes @@ -3,6 +3,11 @@ Sat Jan 16 18:47:23 UTC 2021 - Dirk Müller - add autom4te-always-update-output-file.patch to fix testsuite failures +- handle-gettext-alone.patch: support GNU_GETTEXT alone being called + again +- add prog-c99-fix-typo.patch: fix typo in C99 detection +- add restore-compatibility-gnu11.patch: restore compatibility in GNU11 + mode ------------------------------------------------------------------- Sun Dec 13 18:52:47 UTC 2020 - Andreas Stieger diff --git a/autoconf.spec b/autoconf.spec index 31064b2..5c6de21 100644 --- a/autoconf.spec +++ b/autoconf.spec @@ -28,6 +28,12 @@ Source2: %{name}.keyring Patch0: autoreconf-ltdl.diff # PATCH-FIX-UPSTREAM Patch1: https://git.savannah.gnu.org/cgit/autoconf.git/patch/?id=07130c3e48d12ec155ac5d7630dc7477b6989904#/autom4te-always-update-output-file.patch +# PATCH-FIX-UPSTREAM +Patch2: https://git.savannah.gnu.org/cgit/autoconf.git/patch/?id=05972f49ee632cd98057a3caf82ebfb9574846da#/prog-c99-fix-typo.patch +# PATCH-FIX-UPSTREAM +Patch3: https://git.savannah.gnu.org/cgit/autoconf.git/patch/?id=66fdaea3cfb4e758212c1891913e9a59441d49af#/handle-gettext-alone.patch +# PATCH-FIX-UPSTREAM https://git.savannah.gnu.org/cgit/autoconf.git/patch/?id=2d0f19d84ddb13412382674fd48e6fc5c2875d0e +Patch4: restore-compatibility-gnu11.patch BuildRequires: help2man BuildRequires: m4 >= 1.4.6 Requires: info @@ -55,6 +61,9 @@ only required for the generation of the scripts, not their use. %setup -q -n autoconf-%{version} %patch0 %patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 %build %configure diff --git a/handle-gettext-alone.patch b/handle-gettext-alone.patch new file mode 100644 index 0000000..80e00cf --- /dev/null +++ b/handle-gettext-alone.patch @@ -0,0 +1,58 @@ +From 66fdaea3cfb4e758212c1891913e9a59441d49af Mon Sep 17 00:00:00 2001 +From: Zack Weinberg +Date: Mon, 4 Jan 2021 17:27:37 -0500 +Subject: =?UTF-8?q?autoreconf:=20don=E2=80=99t=20error=20out=20when=20AM?= + =?UTF-8?q?=5FGNU=5FGETTEXT=20is=20used=20alone.?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Some projects intentionally don't call AM_GNU_GETTEXT_(REQUIRE_)VERSION +because they have all of the gettext infrastructure checked into version +control and they want autoreconf to _not_ run autopoint. Therefore, make +the “AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_(REQUIRE_)VERSION” +and “AM_GNU_GETTEXT_(REQUIRE_)VERSION is used, but not AM_GNU_GETTEXT” +diagnostics be warnings again, as they were in 2.69. + +(Technically these diagnostics were always errors, in the sense that +they were reported with a call to Autom4te::Channels::error(), but +prior to 2.70, error() calls made by autoreconf did not cause +autoreconf to exit unsuccessfully, due to an unrelated bug. So people +came to depend on these diagnostics not being fatal.) +--- + bin/autoreconf.in | 18 +++++++++++------- + 1 file changed, 11 insertions(+), 7 deletions(-) + +diff --git a/bin/autoreconf.in b/bin/autoreconf.in +index bb9f316d..9855efbe 100644 +--- a/bin/autoreconf.in ++++ b/bin/autoreconf.in +@@ -644,14 +644,18 @@ sub autoreconf_current_directory ($) + } + } + +- # Gettext consistency checks... +- error($configure_ac, +- "AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION" +- . " or AM_GNU_GETTEXT_REQUIRE_VERSION") ++ # Gettext consistency checks. ++ # Some projects intentionally don't call AM_GNU_GETTEXT_(REQUIRE_)VERSION ++ # because they have all of the gettext infrastructure checked into version ++ # control and they want us to _not_ run autopoint. Therefore, these ++ # diagnostics are only warnings. ++ msg('syntax', $configure_ac, ++ "AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION" ++ . " or AM_GNU_GETTEXT_REQUIRE_VERSION") + if $uses_gettext_via_traces && ! $uses_gettext; +- error($configure_ac, +- "AM_GNU_GETTEXT_VERSION or AM_GNU_GETTEXT_REQUIRE_VERSION is used," +- . " but not AM_GNU_GETTEXT") ++ msg('syntax', $configure_ac, ++ "AM_GNU_GETTEXT_VERSION or AM_GNU_GETTEXT_REQUIRE_VERSION is used," ++ . " but not AM_GNU_GETTEXT") + if $uses_gettext && ! $uses_gettext_via_traces; + + +-- +cgit v1.2.1 + diff --git a/prog-c99-fix-typo.patch b/prog-c99-fix-typo.patch new file mode 100644 index 0000000..3d541ff --- /dev/null +++ b/prog-c99-fix-typo.patch @@ -0,0 +1,31 @@ +From 05972f49ee632cd98057a3caf82ebfb9574846da Mon Sep 17 00:00:00 2001 +From: Zack Weinberg +Date: Tue, 8 Dec 2020 21:35:45 -0500 +Subject: _AC_PROG_CC_C99: fix typo (#110396) + +_AC_PROG_CC_C99 was using the wrong test program. + +Fixes #110396, reported anonymously. + +* lib/autoconf/c.m4 (_AC_PROG_CC_C99): Use the C99 test program, not + the C89 test program. +--- + lib/autoconf/c.m4 | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/autoconf/c.m4 b/lib/autoconf/c.m4 +index fe217cad..601c2df4 100644 +--- a/lib/autoconf/c.m4 ++++ b/lib/autoconf/c.m4 +@@ -1559,7 +1559,7 @@ dnl SVR4 -Xc -D__EXTENSIONS__ + # option to output variable CC to make it so. + AC_DEFUN([_AC_PROG_CC_C99], + [AC_REQUIRE([_AC_C_C99_TEST_PROGRAM])]dnl +-[_AC_C_STD_TRY([c99], [ac_c_conftest_c89_program], ++[_AC_C_STD_TRY([c99], [ac_c_conftest_c99_program], + dnl Try + dnl GCC -std=gnu99 (unused restrictive modes: -std=c99 -std=iso9899:1999) + dnl IBM XL C -qlanglvl=extc1x (V12.1; does not pass C11 test) +-- +cgit v1.2.1 + diff --git a/restore-compatibility-gnu11.patch b/restore-compatibility-gnu11.patch new file mode 100644 index 0000000..e310399 --- /dev/null +++ b/restore-compatibility-gnu11.patch @@ -0,0 +1,1913 @@ +From 2d0f19d84ddb13412382674fd48e6fc5c2875d0e Mon Sep 17 00:00:00 2001 +From: Zack Weinberg +Date: Mon, 21 Dec 2020 14:04:22 -0500 +Subject: Restore compatibility with older std-gnu11.m4. +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Gnulib’s std-gnu11.m4 backports C11 and C++11 detection to autoconf +2.69. It does this by replacing the definitions of AC_PROC_CC and +AC_PROG_CXX and most of their subroutines. In particular, it replaces +the definitions of _AC_PROG_CC_C11, _AC_PROG_CC_C99, and _AC_C_STD_TRY, +but it does *not* replace the definition of _AC_PROG_CC_C89. + +Autoconf commit 131d8c69f31dc6fc8dc93abe1096d52d1fe19fd3 changed the +calling convention of _AC_C_STD_TRY, and changed the internal +definitions of _AC_PROG_CC_C{11,99,89} to match. If std-gnu11.m4 is +in use, our _AC_PROG_CC_C89 calls their _AC_C_STD_TRY with the new +calling convention, and this produces a syntactically invalid +configure script. (This is is fortunate: it could easily have been a +runtime malfunction that only manifested with compilers that only +implement C89, and then we might not have noticed the problem for +years.) + +Gnulib commit a3b3fc85e3e632374811b27cb2111e50fa177e36 makes +std-gnu11.m4 do nothing when used with autoconf >=2.70, but older +versions of the file will circulate for years to come, so this patch +works around the problem in autoconf. It does this by renaming all of +the internal macros involved with C and C++ standard edition +detection, *except* _AC_PROG_CC_C89. AC_PROG_CC now calls +_AC_PROG_CC_STDC_EDITION, which loops over all supported editions +calling _AC_PROG_CC_STDC_EDITION_TRY, which uses the data provided by +the existing _AC_C_C${edition}_TEST_PROGRAM macros and a new set of +macros called _AC_C_C${edition}_OPTIONS to perform the test for that +edition of the standard. Similarly, AC_PROG_CXX calls +_AC_PROG_CXX_STDCXX_EDITION, which loops calling +_AC_PROG_CXX_STDCXX_EDITION_TRY, which uses data from +_AC_CXX_CXX${edition}_TEST_PROGRAM and _AC_CXX_CXX${edition}_OPTIONS. + +_AC_PROG_CC_C89 is the only macro from the old set that we still +define, and its definition is reverted to what std-gnu11.m4 expects it +to be. Nothing in Autoconf proper uses it anymore. + +foreign.at grows a test to verify that the compatibility stub version +of _AC_PROG_CC_C89 does its job. Since this is now the third test +involving an embedded copy of a third-party macro, I broke them all +out of foreign.at to separate files in test/data/. + +In addition to fixing the breakage, this patch should make it easier +to extend C / C++ standard edition detection in the future, by getting +rid of the if-else chains in AC_PROG_CC/CXX and by disentangling the +lists of command-line options to test from the logic. + +I also changed the manual to suggest people refer to the variables +‘ac_prog_cc_stdc’ and ‘ac_prog_cxx_stdcxx’ to learn which edition +of the C and C++ standards are selected; these are much easier to +work with than the ac_cv_prog_cc_cNN cache variables. + +* lib/autoconf/c.m4 (_AC_C_STD_TRY, _AC_PROG_CC_C99, _AC_PROG_CC_C11) + (_AC_CXX_STD_TRY, _AC_PROG_CXX_CXX98, _AC_PROG_CXX_CXX11): Remove macro. + + (_AC_C_C89_OPTIONS, _AC_C_C99_OPTIONS, _AC_C_C11_OPTIONS) + (_AC_PROG_CC_STDC_EDITION, _AC_PROG_CC_STDC_EDITION_TRY) + (_AC_CXX_CXX98_OPTIONS, _AC_CXX_CXX11_OPTIONS) + (_AC_PROG_CXX_STDCXX_EDITION, _AC_PROG_CXX_STDCXX_EDITION_TRY): New macros. + + (_AC_PROG_CC_C89): Convert to compatibility stub for std-gnu11.m4. + + (AC_PROG_CC): Use _AC_PROG_CC_STDC_EDITION. + (AC_PROG_CXX): Use _AC_PROG_CXX_STDCXX_EDITION. + +* tests/data/ax_prog_cc_for_build_v18.m4 +* tests/data/ax_prog_cxx_for_build_v3.m4 +* tests/data/gnulib_std_gnu11_2020_08_17.m4: New files. +* tests/foreign.at (AX_PROG_CC_FOR_BUILD, AX_PROG_CXX_FOR_BUILD): + Remove embedded copy of ax_prog_cc_for_build_v18.m4, + ax_prog_cxx_for_build_v3.m4 respectively. + (gnulib-std-gnu11.m4): New test. +* tests/local.mk: Distribute tests/data/*.m4. + +* doc/autoconf.texi (AC_PROG_CC, AC_PROG_CXX): Document use of + ac_prog_cc_stdc / ac_prog_cxx_stdcxx, respectively, to tell which + edition of the C / C++ standards are selected, instead of looking + through a series of cache variables with awkward definitions. +--- + doc/autoconf.texi | 45 +- + lib/autoconf/c.m4 | 444 +++++++++------- + tests/data/ax_prog_cc_for_build_v18.m4 | 139 +++++ + tests/data/ax_prog_cxx_for_build_v3.m4 | 110 ++++ + tests/data/gnulib_std_gnu11_2020_08_17.m4 | 824 ++++++++++++++++++++++++++++++ + tests/foreign.at | 215 ++------ + tests/local.mk | 7 +- + 7 files changed, 1384 insertions(+), 400 deletions(-) + create mode 100644 tests/data/ax_prog_cc_for_build_v18.m4 + create mode 100644 tests/data/ax_prog_cxx_for_build_v3.m4 + create mode 100644 tests/data/gnulib_std_gnu11_2020_08_17.m4 + +--- a/lib/autoconf/c.m4 ++++ b/lib/autoconf/c.m4 +@@ -498,19 +498,7 @@ else + GCC= + fi + _AC_PROG_CC_G +-dnl +-dnl Set ac_prog_cc_stdc to the supported C version. +-dnl Also set the documented variable ac_cv_prog_cc_stdc; +-dnl its name was chosen when it was cached, but it is no longer cached. +-_AC_PROG_CC_C11([ac_prog_cc_stdc=c11 +- ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11], +- [_AC_PROG_CC_C99([ac_prog_cc_stdc=c99 +- ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99], +- [_AC_PROG_CC_C89([ac_prog_cc_stdc=c89 +- ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89], +- [ac_prog_cc_stdc=no +- ac_cv_prog_cc_stdc=no])])]) +-dnl ++_AC_PROG_CC_STDC_EDITION + AC_LANG_POP(C)dnl + ])# AC_PROG_CC + +@@ -745,13 +733,7 @@ else + GXX= + fi + _AC_PROG_CXX_G +-_AC_PROG_CXX_CXX11([ac_prog_cxx_stdcxx=cxx11 +- ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx11 +- ac_cv_prog_cxx_cxx98=$ac_cv_prog_cxx_cxx11], +- [_AC_PROG_CXX_CXX98([ac_prog_cxx_stdcxx=cxx98 +- ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx98], +- [ac_prog_cxx_stdcxx=no +- ac_cv_prog_cxx_stdcxx=no])]) ++_AC_PROG_CXX_STDCXX_EDITION + AC_LANG_POP(C++)dnl + ])# AC_PROG_CXX + +@@ -1496,114 +1478,170 @@ main (int argc, char **argv) + ]])]) + + +-# _AC_C_STD_TRY(STANDARD, TEST-PROGRAM-HOLDER, OPTION-LIST, +-# ACTION-IF-AVAILABLE, ACTION-IF-UNAVAILABLE) +-# -------------------------------------------------------------- +-# Check whether the C compiler accepts features of STANDARD (e.g `c89', `c99') +-# by trying to compile the program in the shell variable TEST-PROGRAM-HOLDER. +-# Caller is responsible for making sure this variable has been initialized. +-# If compilation fails in the default mode, try again with each compiler +-# option in the space-separated OPTION-LIST; if one helps, append it to CC. +-# If eventually successful, run ACTION-IF-AVAILABLE, else ACTION-IF-UNAVAILABLE. +-AC_DEFUN([_AC_C_STD_TRY], ++# _AC_C_C89_OPTIONS ++# ----------------- ++# Whitespace-separated list of options that might put the C compiler ++# into a mode conforming to ISO C1990 with extensions. Do not try ++# "strictly conforming" modes (e.g. gcc's -std=c90); they break some ++# systems' header files. If more than one option is needed, put ++# shell quotes around the group. ++# ++# AIX circa 2003 -qlanglvl=extc89 ++# old AIX -qlanglvl=ansi ++# Ultrix, OSF/1, Tru64 -std ++# HP-UX 10.20 and later -Ae ++# HP-UX older versions -Aa -D_HPUX_SOURCE ++# SVR4 -Xc -D__EXTENSIONS__ ++m4_define([_AC_C_C89_OPTIONS], [ ++ -qlanglvl=extc89 ++ -qlanglvl=ansi ++ -std ++ -Ae ++ "-Aa -D_HPUX_SOURCE" ++ "-Xc -D__EXTENSIONS__" ++]) ++ ++ ++# _AC_C_C99_OPTIONS ++# ----------------- ++# Whitespace-separated list of options that might put the C compiler ++# into a mode conforming to ISO C1999 with extensions. Do not try ++# "strictly conforming" modes (e.g. gcc's -std=c99); they break some ++# systems' header files. If more than one option is needed, put ++# shell quotes around the group. ++# ++# GCC, Clang -std=gnu99 ++# Intel ICC -std=c99, -c99 (deprecated) ++# Note: because -std=c99 puts GCC in strictly conforming mode, ++# this option must be tested *after* -std=gnu99. ++# IRIX -c99 ++# Tru64 -c99 ++# IBM XL C -qlanglvl=extc1x (V12.1; does not pass C11 test) ++# IBM XL C -qlanglvl=extc99 (pre-V12.1) ++# HP cc -AC99 ++# Solaris -D_STDC_C99= ++# Note: acc's -xc99 option uses linker magic to define the external ++# symbol __xpg4 as if by "int __xpg4 = 1;", which enables C99 ++# behavior for C library functions. This is not wanted here, ++# because it means that a single module compiled with -xc99 alters ++# C runtime behavior for the entire program, not for just the ++# module. Instead, define the (private) symbol _STDC_C99, which ++# suppresses a bogus failure in . The resulting compiler ++# passes the test case here, and that's good enough. ++# For more, please see the thread starting at: ++# https://lists.gnu.org/archive/html/autoconf/2010-12/msg00059.html ++m4_define([_AC_C_C99_OPTIONS], [ ++ -std=gnu99 ++ -std=c99 ++ -c99 ++ -qlanglvl=extc1x ++ -qlanglvl=extc99 ++ -AC99 ++ -D_STDC_C99= ++]) ++ ++ ++# _AC_C_C11_OPTIONS ++# ----------------- ++# Whitespace-separated list of options that might put the C compiler ++# into a mode conforming to ISO C2011 with extensions. Do not try ++# "strictly conforming" modes (e.g. gcc's -std=c11); they break some ++# systems' header files. If more than one option is needed, put ++# shell quotes around the group. ++# ++# GCC, Clang -std=gnu11 ++# ++# For IBM XL C for AIX V16.1 or later, '-std=gnu11' should work if ++# the user configured with CC='xlclang'. Otherwise, do not try ++# -qlanglvl=extc1x as xlc with IBM XL C V16.1 (the latest version as ++# of August 2020) does not pass the C11 test. Instead, try extc1x when ++# compiling the C99 test instead, since it enables _Static_assert and ++# _Noreturn, which is a win. ++m4_define([_AC_C_C11_OPTIONS], [ ++ -std=gnu11 ++]) ++ ++ ++# _AC_PROG_CC_STDC_EDITION_TRY(EDITION) ++# ------------------------------------- ++# Subroutine of _AC_PROG_CC_STDC_EDITION. Not to be called directly. ++# ++# Check whether the C compiler accepts features of EDITION of the ++# C standard. EDITION should be a two-digit year (e.g. 89, 99, 11). ++# (FIXME: Switch to four-digit years for futureproofing.) ++# This is done by compiling the test program defined by ++# _AC_C_C{EDITION}_TEST_PROGRAM, first with no additional ++# command-line options, and then with each of the options ++# in the space-separated list defined by _AC_C_C{EDITION}_OPTIONS. ++# ++# If we find a way to make the test program compile, set cache variable ++# ac_cv_prog_cc_cEDITION to the options required (if any), and add those ++# options to $CC. Set shell variable ac_prog_cc_stdc to `cEDITION', ++# and set shell variable ac_cv_prog_cc_stdc to the options required. ++# (Neither of these variables is AC_SUBSTed. ac_cv_prog_cc_stdc used ++# to be a cache variable and is preserved with this name for backward ++# compatibility.) Otherwise, ac_cv_prog_cc_cEDITION is set to `no' ++# and the other variables are not changed. ++# ++# If ac_prog_cc_stdc is already set to a value other than `no', ++# the shell code produced by this macro does nothing. This is so ++# _AC_PROG_CC_STDC_EDITION can use m4_map to iterate through ++# all the editions. ++AC_DEFUN([_AC_PROG_CC_STDC_EDITION_TRY], + [AC_LANG_ASSERT([C])]dnl +-[AC_MSG_CHECKING([for $CC option to enable ]dnl +-m4_translit($1, [c], [C])[ features]) +-AC_CACHE_VAL([ac_cv_prog_cc_$1], +-[ac_cv_prog_cc_$1=no ++[AC_REQUIRE([_AC_C_C$1_TEST_PROGRAM])]dnl ++[AS_IF([test x$ac_prog_cc_stdc = xno], ++[AC_MSG_CHECKING([for $CC option to enable C$1 features]) ++AC_CACHE_VAL([ac_cv_prog_cc_c$1], ++[ac_cv_prog_cc_c$1=no + ac_save_CC=$CC +-AC_LANG_CONFTEST([AC_LANG_DEFINES_PROVIDED][$][$2]) +-for ac_arg in '' $3 ++AC_LANG_CONFTEST([AC_LANG_DEFINES_PROVIDED][$][ac_c_conftest_c$1_program]) ++for ac_arg in '' m4_normalize(m4_defn([_AC_C_C$1_OPTIONS])) + do + CC="$ac_save_CC $ac_arg" +- _AC_COMPILE_IFELSE([], [ac_cv_prog_cc_$1=$ac_arg]) +- test "x$ac_cv_prog_cc_$1" != "xno" && break ++ _AC_COMPILE_IFELSE([], [ac_cv_prog_cc_c$1=$ac_arg]) ++ test "x$ac_cv_prog_cc_c$1" != "xno" && break + done + rm -f conftest.$ac_ext +-CC=$ac_save_CC +-])# AC_CACHE_VAL +-ac_prog_cc_stdc_options= +-AS_CASE(["x$ac_cv_prog_cc_$1"], +- [x], [AC_MSG_RESULT([none needed])], +- [xno], [AC_MSG_RESULT([unsupported])], +- [ac_prog_cc_stdc_options=" $ac_cv_prog_cc_$1" +- CC="$CC$ac_prog_cc_stdc_options" +- AC_MSG_RESULT([$ac_cv_prog_cc_$1])]) +-AS_IF([test "x$ac_cv_prog_cc_$1" != xno], [$4], [$5]) +-])# _AC_C_STD_TRY +- +- +-# _AC_PROG_CC_C89 ([ACTION-IF-AVAILABLE], [ACTION-IF-UNAVAILABLE]) +-# ---------------------------------------------------------------- +-# If the C compiler is not in ANSI C89 (ISO C90) mode by default, try +-# to add an option to output variable CC to make it so. ++CC=$ac_save_CC]) ++AS_IF([test "x$ac_cv_prog_cc_c$1" = xno], ++ [AC_MSG_RESULT([unsupported])], ++ [AS_IF([test "x$ac_cv_prog_cc_c$1" = x], ++ [AC_MSG_RESULT([none needed])], ++ [AC_MSG_RESULT([$ac_cv_prog_cc_c$1]) ++ CC="$CC $ac_cv_prog_cc_c$1"]) ++ ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c$1 ++ ac_prog_cc_stdc=c$1])]) ++]) ++ ++ ++# _AC_PROG_CC_STDC_EDITION ++# ------------------------ ++# Detect the most recent edition of the ISO C standard that is ++# supported by the C compiler. Add command-line options to $CC, if ++# necessary, to enable support for this edition. Set the shell ++# variable ac_prog_cc_stdc to indicate the edition. ++AC_DEFUN([_AC_PROG_CC_STDC_EDITION], ++[ac_prog_cc_stdc=no ++m4_map([_AC_PROG_CC_STDC_EDITION_TRY], [[11], [99], [89]])]) ++ ++ ++# _AC_PROG_CC_C89(ACTION-IF-SUPPORTED, ACTION-IF-NOT-SUPPORTED) ++# ------------------------------------------------------------- ++# Obsolete internal macro. No longer used by Autoconf itself, but ++# preserved for backward compatibility with pre-December 2020 versions ++# of Gnulib's std-gnu11.m4, which replaced the entire definition of ++# AC_PROG_CC *except* for this macro. Can be removed once everyone is ++# using Autoconf 2.70 and/or a current std-gnu11.m4. + AC_DEFUN([_AC_PROG_CC_C89], +-[AC_REQUIRE([_AC_C_C89_TEST_PROGRAM])]dnl +-[_AC_C_STD_TRY([c89], [ac_c_conftest_c89_program], +-dnl Don't try gcc -ansi; that turns off useful extensions and +-dnl breaks some systems' header files. +-dnl AIX circa 2003 -qlanglvl=extc89 +-dnl old AIX -qlanglvl=ansi +-dnl Ultrix, OSF/1, Tru64 -std +-dnl HP-UX 10.20 and later -Ae +-dnl HP-UX older versions -Aa -D_HPUX_SOURCE +-dnl SVR4 -Xc -D__EXTENSIONS__ +-[-qlanglvl=extc89 -qlanglvl=ansi -std \ +- -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"], [$1], [$2])[]dnl +-])# _AC_PROG_CC_C89 +- +- +-# _AC_PROG_CC_C99 ([ACTION-IF-AVAILABLE], [ACTION-IF-UNAVAILABLE]) +-# ---------------------------------------------------------------- +-# If the C compiler is not in ISO C99 mode by default, try to add an +-# option to output variable CC to make it so. +-AC_DEFUN([_AC_PROG_CC_C99], +-[AC_REQUIRE([_AC_C_C99_TEST_PROGRAM])]dnl +-[_AC_C_STD_TRY([c99], [ac_c_conftest_c99_program], +-dnl Try +-dnl GCC -std=gnu99 (unused restrictive modes: -std=c99 -std=iso9899:1999) +-dnl IBM XL C -qlanglvl=extc1x (V12.1; does not pass C11 test) +-dnl IBM XL C -qlanglvl=extc99 +-dnl (pre-V12.1; unused restrictive mode: -qlanglvl=stdc99) +-dnl HP cc -AC99 +-dnl Intel ICC -std=c99, -c99 (deprecated) +-dnl IRIX -c99 +-dnl Solaris -D_STDC_C99= +-dnl cc's -xc99 option uses linker magic to define the external +-dnl symbol __xpg4 as if by "int __xpg4 = 1;", which enables C99 +-dnl behavior for C library functions. This is not wanted here, +-dnl because it means that a single module compiled with -xc99 +-dnl alters C runtime behavior for the entire program, not for +-dnl just the module. Instead, define the (private) symbol +-dnl _STDC_C99, which suppresses a bogus failure in . +-dnl The resulting compiler passes the test case here, and that's +-dnl good enough. For more, please see the thread starting at: +-dnl https://lists.gnu.org/archive/html/autoconf/2010-12/msg00059.html +-dnl Tru64 -c99 +-dnl with extended modes being tried first. +-[[-std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc1x -qlanglvl=extc99]], [$1], [$2])[]dnl +-])# _AC_PROG_CC_C99 +- +- +-# _AC_PROG_CC_C11 ([ACTION-IF-AVAILABLE], [ACTION-IF-UNAVAILABLE]) +-# ---------------------------------------------------------------- +-# If the C compiler is not in ISO C11 mode by default, try to add an +-# option to output variable CC to make it so. +-AC_DEFUN([_AC_PROG_CC_C11], +-[AC_REQUIRE([_AC_C_C11_TEST_PROGRAM])]dnl +-[_AC_C_STD_TRY([c11], [ac_c_conftest_c11_program], +-dnl Try +-dnl GCC -std=gnu11 (unused restrictive mode: -std=c11) +-dnl with extended modes being tried first. +-dnl +-dnl For IBM XL C for AIX V16.1 or later, '-std=gnu11' should work if +-dnl the user configured with CC='xlclang'. Otherwise, do not try +-dnl -qlanglvl=extc1x as xlc with IBM XL C V16.1 (the latest version as +-dnl of August 2020) does not pass the C11 test. Instead, try extc1x when +-dnl compiling the C99 test instead, since it enables _Static_assert and +-dnl _Noreturn, which is a win. +-[[-std=gnu11]], [$1], [$2])[]dnl +-])# _AC_PROG_CC_C11 ++[AC_REQUIRE([_AC_C_C89_TEST_GLOBALS])]dnl ++[AC_REQUIRE([_AC_C_C89_TEST_MAIN])]dnl ++[_AC_C_STD_TRY([c89], ++ [$ac_c_conftest_c89_globals], [$ac_c_conftest_c89_main], ++ m4_quote(m4_normalize(m4_defn([_AC_C_C89_OPTIONS]))), ++ [$1], ++ [$2])]) ++ + + + # AC_PROG_CC_C89 +@@ -2633,78 +2671,112 @@ main (int argc, char **argv) + " + ]])]) + ++# _AC_CXX_CXX98_OPTIONS ++# --------------------- ++# Whitespace-separated list of options that might put the C++ compiler ++# into a mode conforming to ISO C++ 1998 with extensions. Do not try ++# "strictly conforming" modes (e.g. gcc's -std=c++98); they break some ++# systems' header files. If more than one option is needed, put ++# shell quotes around the group. ++# ++# GCC -std=gnu++98 ++# Intel ICC -std=c++98 ++# Note: because -std=c++98 puts GCC in strictly conforming mode, ++# this option must be tested *after* -std=gnu++98. ++# IBM XL C -qlanglvl=extended ++# HP aC++ -AA ++# Solaris N/A (default) ++# Tru64 N/A (default, but -std gnu could be used) ++m4_define([_AC_CXX_CXX98_OPTIONS], [ ++ -std=gnu++98 ++ -std=c++98 ++ -qlanglvl=extended ++ -AA ++]) + +-# _AC_CXX_STD_TRY(STANDARD, TEST-PROGRAM-HOLDER, OPTION-LIST, +-# ACTION-IF-AVAILABLE, ACTION-IF-UNAVAILABLE) +-# ---------------------------------------------------------------- +-# Check whether the C++ compiler accepts features of STANDARD (e.g `cxx98', +-# `cxx11') by trying to compile the program in the shell variable +-# TEST-PROGRAM-HOLDER. Caller is responsible for making sure this variable +-# has been initialized. If compilation fails in the default mode, try again +-# with each compiler option in the space-separated OPTION-LIST; if one helps, +-# append it to CXX. If eventually successful, run ACTION-IF-AVAILABLE, else +-# ACTION-IF-UNAVAILABLE. ++# _AC_CXX_CXX11_OPTIONS ++# --------------------- ++# Whitespace-separated list of options that might put the C++ compiler ++# into a mode conforming to ISO C++ 2011 with extensions. Do not try ++# "strictly conforming" modes (e.g. gcc's -std=c++11); they break some ++# systems' header files. If more than one option is needed, put ++# shell quotes around the group. ++# ++# GCC -std=gnu++11, -std=gnu++0x ++# Intel ICC -std=c++11, -std=c++0x ++# Note: because -std=c++11 puts GCC in strictly conforming mode, ++# these options must be tested *after* -std=gnu++11. ++# IBM XL C -qlanglvl=extended0x (pre-V12.1) ++# HP aC++ -AA ++# Solaris N/A (no support) ++# Tru64 N/A (no support) ++m4_define([_AC_CXX_CXX11_OPTIONS], [ ++ -std=gnu++11 ++ -std=gnu++0x ++ -std=c++11 ++ -std=c++0x ++ -qlanglvl=extended0x ++ -AA ++]) + +-AC_DEFUN([_AC_CXX_STD_TRY], ++# _AC_PROG_CXX_STDCXX_EDITION_TRY(EDITION) ++# ---------------------------------------- ++# Subroutine of _AC_PROG_CXX_STDCXX_EDITION. Not to be called directly. ++# ++# Check whether the C++ compiler accepts features of EDITION of the ++# C++ standard. EDITION should be a two-digit year (e.g. 98, 11). ++# (FIXME: Switch to four-digit years for futureproofing.) ++# This is done by compiling the test program defined by ++# _AC_C_CXX{EDITION}_TEST_PROGRAM, first with no additional ++# command-line options, and then with each of the options ++# in the space-separated list defined by _AC_C_CXX{EDITION}_OPTIONS. ++# ++# If we find a way to make the test program compile, set cache variable ++# ac_cv_prog_cxx_cxxEDITION to the options required (if any), and add those ++# options to $CXX. Set shell variable ac_prog_cxx_stdcxx to `cxxEDITION', ++# and set shell variable ac_cv_prog_cxx_stdcxx to the options required. ++# (Neither of these variables is AC_SUBSTed. ac_cv_prog_cxx_stdcxx used ++# to be a cache variable and is preserved with this name for backward ++# compatibility.) Otherwise, ac_cv_prog_cxx_cxxEDITION is set to `no' ++# and the other variables are not changed. ++# ++# If ac_prog_cxx_stdcxx is already set to a value other than `no', ++# the shell code produced by this macro does nothing. This is so ++# _AC_PROG_CXX_STDCXX_EDITION can use m4_map to iterate through ++# all the editions. ++AC_DEFUN([_AC_PROG_CXX_STDCXX_EDITION_TRY], + [AC_LANG_ASSERT([C++])]dnl +-[AC_MSG_CHECKING([for $CXX option to enable ]dnl +-m4_translit([$1], [a-wxyz], [A-W+YZ])[ features]) ++[AC_REQUIRE([_AC_CXX_CXX$1_TEST_PROGRAM])]dnl ++[AS_IF([test x$ac_prog_cxx_stdcxx = xno], ++[AC_MSG_CHECKING([for $CXX option to enable C++$1 features]) + AC_CACHE_VAL(ac_cv_prog_cxx_$1, + [ac_cv_prog_cxx_$1=no + ac_save_CXX=$CXX +-AC_LANG_CONFTEST([AC_LANG_DEFINES_PROVIDED][$][$2]) +-for ac_arg in '' $3 ++AC_LANG_CONFTEST([AC_LANG_DEFINES_PROVIDED][$][ac_cxx_conftest_cxx$1_program]) ++for ac_arg in '' m4_normalize(m4_defn([_AC_CXX_CXX$1_OPTIONS])) + do + CXX="$ac_save_CXX $ac_arg" +- _AC_COMPILE_IFELSE([], [ac_cv_prog_cxx_$1=$ac_arg]) +- test "x$ac_cv_prog_cxx_$1" != "xno" && break ++ _AC_COMPILE_IFELSE([], [ac_cv_prog_cxx_cxx$1=$ac_arg]) ++ test "x$ac_cv_prog_cxx_cxx$1" != "xno" && break + done + rm -f conftest.$ac_ext +-CXX=$ac_save_CXX +-])# AC_CACHE_VAL +-ac_prog_cxx_stdcxx_options= +-AS_CASE(["x$ac_cv_prog_cxx_$1"], +- [x], [AC_MSG_RESULT([none needed])], +- [xno], [AC_MSG_RESULT([unsupported])], +- [ac_prog_cxx_stdcxx_options=" $ac_cv_prog_cxx_$1" +- CXX=$CXX$ac_prog_cxx_stdcxx_options +- AC_MSG_RESULT([$ac_cv_prog_cxx_$1])]) +-AS_IF([test "x$ac_cv_prog_cxx_$1" != xno], [$4], [$5]) +-])# _AC_CXX_STD_TRY +- +-# _AC_PROG_CXX_CXX98 ([ACTION-IF-AVAILABLE], [ACTION-IF-UNAVAILABLE]) +-# ------------------------------------------------------------------- +-# If the C++ compiler is not in ISO C++98 mode by default, try to add +-# an option to output variable CXX to make it so. +-AC_DEFUN([_AC_PROG_CXX_CXX98], +-[AC_REQUIRE([_AC_CXX_CXX98_TEST_PROGRAM])]dnl +-[_AC_CXX_STD_TRY([cxx98], [ac_cxx_conftest_cxx98_program], +-dnl Try +-dnl GCC -std=gnu++98 (unused restrictive mode: -std=c++98) +-dnl IBM XL C -qlanglvl=extended +-dnl HP aC++ -AA +-dnl Intel ICC -std=gnu++98 +-dnl Solaris N/A (default) +-dnl Tru64 N/A (default, but -std gnu could be used) +-dnl with extended modes being tried first. +-[[-std=gnu++98 -std=c++98 -qlanglvl=extended -AA]], [$1], [$2])[]dnl +-])# _AC_PROG_CXX_CXX98 +- +-# _AC_PROG_CXX_CXX11 ([ACTION-IF-AVAILABLE], [ACTION-IF-UNAVAILABLE]) +-# ------------------------------------------------------------------- +-# If the C++ compiler is not in ISO CXX11 mode by default, try to add +-# an option to output variable CXX to make it so. +-AC_DEFUN([_AC_PROG_CXX_CXX11], +-[AC_REQUIRE([_AC_CXX_CXX11_TEST_PROGRAM])]dnl +-[_AC_CXX_STD_TRY([cxx11], [ac_cxx_conftest_cxx11_program], +-dnl Try +-dnl GCC -std=gnu++11 (unused restrictive mode: -std=c++11) [and 0x variants] +-dnl IBM XL C -qlanglvl=extended0x +-dnl (pre-V12.1; unused restrictive mode: -qlanglvl=stdcxx11) +-dnl HP aC++ -AA +-dnl Intel ICC -std=c++11 -std=c++0x +-dnl Solaris N/A (no support) +-dnl Tru64 N/A (no support) +-dnl with extended modes being tried first. +-[[-std=gnu++11 -std=c++11 -std=gnu++0x -std=c++0x -qlanglvl=extended0x -AA]], [$1], [$2])[]dnl +-])# _AC_PROG_CXX_CXX11 ++CXX=$ac_save_CXX]) ++AS_IF([test "x$ac_cv_prog_cxx_cxx$1" = xno], ++ [AC_MSG_RESULT([unsupported])], ++ [AS_IF([test "x$ac_cv_prog_cxx_cxx$1" = x], ++ [AC_MSG_RESULT([none needed])], ++ [AC_MSG_RESULT([$ac_cv_prog_cxx_cxx$1]) ++ CXX="$CXX $ac_cv_prog_cxx_cxx$1"]) ++ ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx$1 ++ ac_prog_cxx_stdcxx=cxx$1])]) ++]) ++ ++# _AC_PROG_CXX_STDCXX_EDITION ++# --------------------------- ++# Detect the most recent edition of the ISO C++ standard that is ++# supported by the C++ compiler. Add command-line options to $CXX, ++# if necessary, to enable support for this edition. Set the shell ++# variable ac_prog_cxx_stdcxx to indicate the edition. ++AC_DEFUN([_AC_PROG_CXX_STDCXX_EDITION], ++[ac_prog_cxx_stdcxx=no ++m4_map([_AC_PROG_CXX_STDCXX_EDITION_TRY], [[11], [98]])]) +diff --git a/tests/data/ax_prog_cc_for_build_v18.m4 b/tests/data/ax_prog_cc_for_build_v18.m4 +new file mode 100644 +index 00000000..f7410d74 +--- /dev/null ++++ b/tests/data/ax_prog_cc_for_build_v18.m4 +@@ -0,0 +1,139 @@ ++# =========================================================================== ++# https://www.gnu.org/software/autoconf-archive/ax_prog_cc_for_build.html ++# =========================================================================== ++# ++# SYNOPSIS ++# ++# AX_PROG_CC_FOR_BUILD ++# ++# DESCRIPTION ++# ++# This macro searches for a C compiler that generates native executables, ++# that is a C compiler that surely is not a cross-compiler. This can be ++# useful if you have to generate source code at compile-time like for ++# example GCC does. ++# ++# The macro sets the CC_FOR_BUILD and CPP_FOR_BUILD macros to anything ++# needed to compile or link (CC_FOR_BUILD) and preprocess (CPP_FOR_BUILD). ++# The value of these variables can be overridden by the user by specifying ++# a compiler with an environment variable (like you do for standard CC). ++# ++# It also sets BUILD_EXEEXT and BUILD_OBJEXT to the executable and object ++# file extensions for the build platform, and GCC_FOR_BUILD to `yes' if ++# the compiler we found is GCC. All these variables but GCC_FOR_BUILD are ++# substituted in the Makefile. ++# ++# LICENSE ++# ++# Copyright (c) 2008 Paolo Bonzini ++# ++# 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 18 ++ ++AU_ALIAS([AC_PROG_CC_FOR_BUILD], [AX_PROG_CC_FOR_BUILD]) ++AC_DEFUN([AX_PROG_CC_FOR_BUILD], [dnl ++AC_REQUIRE([AC_PROG_CC])dnl ++AC_REQUIRE([AC_PROG_CPP])dnl ++AC_REQUIRE([AC_CANONICAL_BUILD])dnl ++ ++dnl Use the standard macros, but make them use other variable names ++dnl ++pushdef([ac_cv_prog_CPP], ac_cv_build_prog_CPP)dnl ++pushdef([ac_cv_prog_cc_c89], ac_cv_build_prog_cc_c89)dnl ++pushdef([ac_cv_prog_gcc], ac_cv_build_prog_gcc)dnl ++pushdef([ac_cv_prog_cc_works], ac_cv_build_prog_cc_works)dnl ++pushdef([ac_cv_prog_cc_cross], ac_cv_build_prog_cc_cross)dnl ++pushdef([ac_cv_prog_cc_g], ac_cv_build_prog_cc_g)dnl ++pushdef([ac_cv_c_compiler_gnu], ac_cv_build_c_compiler_gnu)dnl ++pushdef([ac_cv_exeext], ac_cv_build_exeext)dnl ++pushdef([ac_cv_objext], ac_cv_build_objext)dnl ++pushdef([ac_exeext], ac_build_exeext)dnl ++pushdef([ac_objext], ac_build_objext)dnl ++pushdef([CC], CC_FOR_BUILD)dnl ++pushdef([CPP], CPP_FOR_BUILD)dnl ++pushdef([GCC], GCC_FOR_BUILD)dnl ++pushdef([CFLAGS], CFLAGS_FOR_BUILD)dnl ++pushdef([CPPFLAGS], CPPFLAGS_FOR_BUILD)dnl ++pushdef([EXEEXT], BUILD_EXEEXT)dnl ++pushdef([LDFLAGS], LDFLAGS_FOR_BUILD)dnl ++pushdef([OBJEXT], BUILD_OBJEXT)dnl ++pushdef([host], build)dnl ++pushdef([host_alias], build_alias)dnl ++pushdef([host_cpu], build_cpu)dnl ++pushdef([host_vendor], build_vendor)dnl ++pushdef([host_os], build_os)dnl ++pushdef([ac_cv_host], ac_cv_build)dnl ++pushdef([ac_cv_host_alias], ac_cv_build_alias)dnl ++pushdef([ac_cv_host_cpu], ac_cv_build_cpu)dnl ++pushdef([ac_cv_host_vendor], ac_cv_build_vendor)dnl ++pushdef([ac_cv_host_os], ac_cv_build_os)dnl ++pushdef([ac_tool_prefix], ac_build_tool_prefix)dnl ++pushdef([am_cv_CC_dependencies_compiler_type], am_cv_build_CC_dependencies_compiler_type)dnl ++pushdef([am_cv_prog_cc_c_o], am_cv_build_prog_cc_c_o)dnl ++pushdef([cross_compiling], cross_compiling_build)dnl ++ ++cross_compiling_build=no ++ ++ac_build_tool_prefix= ++AS_IF([test -n "$build"], [ac_build_tool_prefix="$build-"], ++ [test -n "$build_alias"],[ac_build_tool_prefix="$build_alias-"]) ++ ++AC_LANG_PUSH([C]) ++AC_PROG_CC ++_AC_COMPILER_EXEEXT ++_AC_COMPILER_OBJEXT ++AC_PROG_CPP ++ ++dnl Restore the old definitions ++dnl ++popdef([cross_compiling])dnl ++popdef([am_cv_prog_cc_c_o])dnl ++popdef([am_cv_CC_dependencies_compiler_type])dnl ++popdef([ac_tool_prefix])dnl ++popdef([ac_cv_host_os])dnl ++popdef([ac_cv_host_vendor])dnl ++popdef([ac_cv_host_cpu])dnl ++popdef([ac_cv_host_alias])dnl ++popdef([ac_cv_host])dnl ++popdef([host_os])dnl ++popdef([host_vendor])dnl ++popdef([host_cpu])dnl ++popdef([host_alias])dnl ++popdef([host])dnl ++popdef([OBJEXT])dnl ++popdef([LDFLAGS])dnl ++popdef([EXEEXT])dnl ++popdef([CPPFLAGS])dnl ++popdef([CFLAGS])dnl ++popdef([GCC])dnl ++popdef([CPP])dnl ++popdef([CC])dnl ++popdef([ac_objext])dnl ++popdef([ac_exeext])dnl ++popdef([ac_cv_objext])dnl ++popdef([ac_cv_exeext])dnl ++popdef([ac_cv_c_compiler_gnu])dnl ++popdef([ac_cv_prog_cc_g])dnl ++popdef([ac_cv_prog_cc_cross])dnl ++popdef([ac_cv_prog_cc_works])dnl ++popdef([ac_cv_prog_cc_c89])dnl ++popdef([ac_cv_prog_gcc])dnl ++popdef([ac_cv_prog_CPP])dnl ++ ++dnl restore global variables ac_ext, ac_cpp, ac_compile, ++dnl ac_link, ac_compiler_gnu (dependant on the current ++dnl language after popping): ++AC_LANG_POP([C]) ++ ++dnl Finally, set Makefile variables ++dnl ++AC_SUBST(BUILD_EXEEXT)dnl ++AC_SUBST(BUILD_OBJEXT)dnl ++AC_SUBST([CFLAGS_FOR_BUILD])dnl ++AC_SUBST([CPPFLAGS_FOR_BUILD])dnl ++AC_SUBST([LDFLAGS_FOR_BUILD])dnl ++]) +diff --git a/tests/data/ax_prog_cxx_for_build_v3.m4 b/tests/data/ax_prog_cxx_for_build_v3.m4 +new file mode 100644 +index 00000000..17c19a89 +--- /dev/null ++++ b/tests/data/ax_prog_cxx_for_build_v3.m4 +@@ -0,0 +1,110 @@ ++# =========================================================================== ++# https://www.gnu.org/software/autoconf-archive/ax_prog_cxx_for_build.html ++# =========================================================================== ++# ++# SYNOPSIS ++# ++# AX_PROG_CXX_FOR_BUILD ++# ++# DESCRIPTION ++# ++# This macro searches for a C++ compiler that generates native ++# executables, that is a C++ compiler that surely is not a cross-compiler. ++# This can be useful if you have to generate source code at compile-time ++# like for example GCC does. ++# ++# The macro sets the CXX_FOR_BUILD and CXXCPP_FOR_BUILD macros to anything ++# needed to compile or link (CXX_FOR_BUILD) and preprocess ++# (CXXCPP_FOR_BUILD). The value of these variables can be overridden by ++# the user by specifying a compiler with an environment variable (like you ++# do for standard CXX). ++# ++# LICENSE ++# ++# Copyright (c) 2008 Paolo Bonzini ++# Copyright (c) 2012 Avionic Design GmbH ++# ++# Based on the AX_PROG_CC_FOR_BUILD macro by Paolo Bonzini. ++# ++# 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 3 ++ ++AU_ALIAS([AC_PROG_CXX_FOR_BUILD], [AX_PROG_CXX_FOR_BUILD]) ++AC_DEFUN([AX_PROG_CXX_FOR_BUILD], [dnl ++AC_REQUIRE([AX_PROG_CC_FOR_BUILD])dnl ++AC_REQUIRE([AC_PROG_CXX])dnl ++AC_REQUIRE([AC_PROG_CXXCPP])dnl ++AC_REQUIRE([AC_CANONICAL_HOST])dnl ++ ++dnl Use the standard macros, but make them use other variable names ++dnl ++pushdef([ac_cv_prog_CXXCPP], ac_cv_build_prog_CXXCPP)dnl ++pushdef([ac_cv_prog_gxx], ac_cv_build_prog_gxx)dnl ++pushdef([ac_cv_prog_cxx_works], ac_cv_build_prog_cxx_works)dnl ++pushdef([ac_cv_prog_cxx_cross], ac_cv_build_prog_cxx_cross)dnl ++pushdef([ac_cv_prog_cxx_g], ac_cv_build_prog_cxx_g)dnl ++pushdef([CXX], CXX_FOR_BUILD)dnl ++pushdef([CXXCPP], CXXCPP_FOR_BUILD)dnl ++pushdef([CXXFLAGS], CXXFLAGS_FOR_BUILD)dnl ++pushdef([CPPFLAGS], CPPFLAGS_FOR_BUILD)dnl ++pushdef([CXXCPPFLAGS], CXXCPPFLAGS_FOR_BUILD)dnl ++pushdef([host], build)dnl ++pushdef([host_alias], build_alias)dnl ++pushdef([host_cpu], build_cpu)dnl ++pushdef([host_vendor], build_vendor)dnl ++pushdef([host_os], build_os)dnl ++pushdef([ac_cv_host], ac_cv_build)dnl ++pushdef([ac_cv_host_alias], ac_cv_build_alias)dnl ++pushdef([ac_cv_host_cpu], ac_cv_build_cpu)dnl ++pushdef([ac_cv_host_vendor], ac_cv_build_vendor)dnl ++pushdef([ac_cv_host_os], ac_cv_build_os)dnl ++pushdef([ac_cxxcpp], ac_build_cxxcpp)dnl ++pushdef([ac_compile], ac_build_compile)dnl ++pushdef([ac_link], ac_build_link)dnl ++ ++save_cross_compiling=$cross_compiling ++save_ac_tool_prefix=$ac_tool_prefix ++cross_compiling=no ++ac_tool_prefix= ++ ++AC_PROG_CXX ++AC_PROG_CXXCPP ++ ++ac_tool_prefix=$save_ac_tool_prefix ++cross_compiling=$save_cross_compiling ++ ++dnl Restore the old definitions ++dnl ++popdef([ac_link])dnl ++popdef([ac_compile])dnl ++popdef([ac_cxxcpp])dnl ++popdef([ac_cv_host_os])dnl ++popdef([ac_cv_host_vendor])dnl ++popdef([ac_cv_host_cpu])dnl ++popdef([ac_cv_host_alias])dnl ++popdef([ac_cv_host])dnl ++popdef([host_os])dnl ++popdef([host_vendor])dnl ++popdef([host_cpu])dnl ++popdef([host_alias])dnl ++popdef([host])dnl ++popdef([CXXCPPFLAGS])dnl ++popdef([CPPFLAGS])dnl ++popdef([CXXFLAGS])dnl ++popdef([CXXCPP])dnl ++popdef([CXX])dnl ++popdef([ac_cv_prog_cxx_g])dnl ++popdef([ac_cv_prog_cxx_cross])dnl ++popdef([ac_cv_prog_cxx_works])dnl ++popdef([ac_cv_prog_gxx])dnl ++popdef([ac_cv_prog_CXXCPP])dnl ++ ++dnl Finally, set Makefile variables ++dnl ++AC_SUBST([CXXFLAGS_FOR_BUILD])dnl ++AC_SUBST([CXXCPPFLAGS_FOR_BUILD])dnl ++]) +diff --git a/tests/data/gnulib_std_gnu11_2020_08_17.m4 b/tests/data/gnulib_std_gnu11_2020_08_17.m4 +new file mode 100644 +index 00000000..db833d82 +--- /dev/null ++++ b/tests/data/gnulib_std_gnu11_2020_08_17.m4 +@@ -0,0 +1,824 @@ ++# Prefer GNU C11 and C++11 to earlier versions. -*- coding: utf-8 -*- ++ ++# This implementation is taken from GNU Autoconf lib/autoconf/c.m4 ++# commit 017d5ddd82854911f0119691d91ea8a1438824d6 ++# dated Sun Apr 3 13:57:17 2016 -0700 ++# This implementation will be obsolete once we can assume Autoconf 2.70 ++# or later is installed everywhere a Gnulib program might be developed. ++ ++ ++# Copyright (C) 2001-2020 Free Software Foundation, Inc. ++ ++# 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. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++# Written by David MacKenzie, with help from ++# Akim Demaille, Paul Eggert, ++# François Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor, ++# Roland McGrath, Noah Friedman, david d zuhn, and many others. ++ ++ ++# AC_PROG_CC([COMPILER ...]) ++# -------------------------- ++# COMPILER ... is a space separated list of C compilers to search for. ++# This just gives the user an opportunity to specify an alternative ++# search list for the C compiler. ++AC_DEFUN_ONCE([AC_PROG_CC], ++[AC_LANG_PUSH(C)dnl ++AC_ARG_VAR([CC], [C compiler command])dnl ++AC_ARG_VAR([CFLAGS], [C compiler flags])dnl ++_AC_ARG_VAR_LDFLAGS()dnl ++_AC_ARG_VAR_LIBS()dnl ++_AC_ARG_VAR_CPPFLAGS()dnl ++m4_ifval([$1], ++ [AC_CHECK_TOOLS(CC, [$1])], ++[AC_CHECK_TOOL(CC, gcc) ++if test -z "$CC"; then ++ dnl Here we want: ++ dnl AC_CHECK_TOOL(CC, cc) ++ dnl but without the check for a tool without the prefix. ++ dnl Until the check is removed from there, copy the code: ++ if test -n "$ac_tool_prefix"; then ++ AC_CHECK_PROG(CC, [${ac_tool_prefix}cc], [${ac_tool_prefix}cc]) ++ fi ++fi ++if test -z "$CC"; then ++ AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) ++fi ++if test -z "$CC"; then ++ AC_CHECK_TOOLS(CC, cl.exe) ++fi ++if test -z "$CC"; then ++ AC_CHECK_TOOL(CC, clang) ++fi ++]) ++ ++test -z "$CC" && AC_MSG_FAILURE([no acceptable C compiler found in \$PATH]) ++ ++# Provide some information about the compiler. ++_AS_ECHO_LOG([checking for _AC_LANG compiler version]) ++set X $ac_compile ++ac_compiler=$[2] ++for ac_option in --version -v -V -qversion -version; do ++ _AC_DO_LIMIT([$ac_compiler $ac_option >&AS_MESSAGE_LOG_FD]) ++done ++ ++m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl ++m4_expand_once([_AC_COMPILER_OBJEXT])[]dnl ++_AC_LANG_COMPILER_GNU ++if test $ac_compiler_gnu = yes; then ++ GCC=yes ++else ++ GCC= ++fi ++_AC_PROG_CC_G ++dnl ++dnl Set ac_prog_cc_stdc to the supported C version. ++dnl Also set the documented variable ac_cv_prog_cc_stdc; ++dnl its name was chosen when it was cached, but it is no longer cached. ++_AC_PROG_CC_C11([ac_prog_cc_stdc=c11 ++ ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11], ++ [_AC_PROG_CC_C99([ac_prog_cc_stdc=c99 ++ ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99], ++ [_AC_PROG_CC_C89([ac_prog_cc_stdc=c89 ++ ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89], ++ [ac_prog_cc_stdc=no ++ ac_cv_prog_cc_stdc=no])])]) ++dnl ++AC_LANG_POP(C)dnl ++])# AC_PROG_CC ++ ++ ++ ++# AC_PROG_CXX([LIST-OF-COMPILERS]) ++# -------------------------------- ++# LIST-OF-COMPILERS is a space separated list of C++ compilers to search ++# for (if not specified, a default list is used). This just gives the ++# user an opportunity to specify an alternative search list for the C++ ++# compiler. ++# aCC HP-UX C++ compiler much better than `CC', so test before. ++# FCC Fujitsu C++ compiler ++# KCC KAI C++ compiler ++# RCC Rational C++ ++# xlC_r AIX C Set++ (with support for reentrant code) ++# xlC AIX C Set++ ++AC_DEFUN([AC_PROG_CXX], ++[AC_LANG_PUSH(C++)dnl ++AC_ARG_VAR([CXX], [C++ compiler command])dnl ++AC_ARG_VAR([CXXFLAGS], [C++ compiler flags])dnl ++_AC_ARG_VAR_LDFLAGS()dnl ++_AC_ARG_VAR_LIBS()dnl ++_AC_ARG_VAR_CPPFLAGS()dnl ++_AC_ARG_VAR_PRECIOUS([CCC])dnl ++if test -z "$CXX"; then ++ if test -n "$CCC"; then ++ CXX=$CCC ++ else ++ AC_CHECK_TOOLS(CXX, ++ [m4_default([$1], ++ [g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++])], ++ g++) ++ fi ++fi ++# Provide some information about the compiler. ++_AS_ECHO_LOG([checking for _AC_LANG compiler version]) ++set X $ac_compile ++ac_compiler=$[2] ++for ac_option in --version -v -V -qversion; do ++ _AC_DO_LIMIT([$ac_compiler $ac_option >&AS_MESSAGE_LOG_FD]) ++done ++ ++m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl ++m4_expand_once([_AC_COMPILER_OBJEXT])[]dnl ++_AC_LANG_COMPILER_GNU ++if test $ac_compiler_gnu = yes; then ++ GXX=yes ++else ++ GXX= ++fi ++_AC_PROG_CXX_G ++_AC_PROG_CXX_CXX11([ac_prog_cxx_stdcxx=cxx11 ++ ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx11 ++ ac_cv_prog_cxx_cxx98=$ac_cv_prog_cxx_cxx11], ++ [_AC_PROG_CXX_CXX98([ac_prog_cxx_stdcxx=cxx98 ++ ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx98], ++ [ac_prog_cxx_stdcxx=no ++ ac_cv_prog_cxx_stdcxx=no])]) ++AC_LANG_POP(C++)dnl ++])# AC_PROG_CXX ++ ++ ++# _AC_C_STD_TRY(STANDARD, TEST-PROLOGUE, TEST-BODY, OPTION-LIST, ++# ACTION-IF-AVAILABLE, ACTION-IF-UNAVAILABLE) ++# -------------------------------------------------------------- ++# Check whether the C compiler accepts features of STANDARD (e.g `c89', `c99') ++# by trying to compile a program of TEST-PROLOGUE and TEST-BODY. If this fails, ++# try again with each compiler option in the space-separated OPTION-LIST; if one ++# helps, append it to CC. If eventually successful, run ACTION-IF-AVAILABLE, ++# else ACTION-IF-UNAVAILABLE. ++AC_DEFUN([_AC_C_STD_TRY], ++[AC_MSG_CHECKING([for $CC option to enable ]m4_translit($1, [c], [C])[ features]) ++AC_CACHE_VAL(ac_cv_prog_cc_$1, ++[ac_cv_prog_cc_$1=no ++ac_save_CC=$CC ++AC_LANG_CONFTEST([AC_LANG_PROGRAM([$2], [$3])]) ++for ac_arg in '' $4 ++do ++ CC="$ac_save_CC $ac_arg" ++ _AC_COMPILE_IFELSE([], [ac_cv_prog_cc_$1=$ac_arg]) ++ test "x$ac_cv_prog_cc_$1" != "xno" && break ++done ++rm -f conftest.$ac_ext ++CC=$ac_save_CC ++])# AC_CACHE_VAL ++ac_prog_cc_stdc_options= ++case "x$ac_cv_prog_cc_$1" in ++ x) ++ AC_MSG_RESULT([none needed]) ;; ++ xno) ++ AC_MSG_RESULT([unsupported]) ;; ++ *) ++ ac_prog_cc_stdc_options=" $ac_cv_prog_cc_$1" ++ CC=$CC$ac_prog_cc_stdc_options ++ AC_MSG_RESULT([$ac_cv_prog_cc_$1]) ;; ++esac ++AS_IF([test "x$ac_cv_prog_cc_$1" != xno], [$5], [$6]) ++])# _AC_C_STD_TRY ++ ++# _AC_C_C99_TEST_HEADER ++# --------------------- ++# A C header suitable for testing for C99. ++AC_DEFUN([_AC_C_C99_TEST_HEADER], ++[[#include ++#include ++#include ++#include ++#include ++#include ++ ++// Check varargs macros. These examples are taken from C99 6.10.3.5. ++#define debug(...) fprintf (stderr, __VA_ARGS__) ++#define showlist(...) puts (#__VA_ARGS__) ++#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) ++static void ++test_varargs_macros (void) ++{ ++ int x = 1234; ++ int y = 5678; ++ debug ("Flag"); ++ debug ("X = %d\n", x); ++ showlist (The first, second, and third items.); ++ report (x>y, "x is %d but y is %d", x, y); ++} ++ ++// Check long long types. ++#define BIG64 18446744073709551615ull ++#define BIG32 4294967295ul ++#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) ++#if !BIG_OK ++ your preprocessor is broken; ++#endif ++#if BIG_OK ++#else ++ your preprocessor is broken; ++#endif ++static long long int bignum = -9223372036854775807LL; ++static unsigned long long int ubignum = BIG64; ++ ++struct incomplete_array ++{ ++ int datasize; ++ double data[]; ++}; ++ ++struct named_init { ++ int number; ++ const wchar_t *name; ++ double average; ++}; ++ ++typedef const char *ccp; ++ ++static inline int ++test_restrict (ccp restrict text) ++{ ++ // See if C++-style comments work. ++ // Iterate through items via the restricted pointer. ++ // Also check for declarations in for loops. ++ for (unsigned int i = 0; *(text+i) != '\0'; ++i) ++ continue; ++ return 0; ++} ++ ++// Check varargs and va_copy. ++static bool ++test_varargs (const char *format, ...) ++{ ++ va_list args; ++ va_start (args, format); ++ va_list args_copy; ++ va_copy (args_copy, args); ++ ++ const char *str = ""; ++ int number = 0; ++ float fnumber = 0; ++ ++ while (*format) ++ { ++ switch (*format++) ++ { ++ case 's': // string ++ str = va_arg (args_copy, const char *); ++ break; ++ case 'd': // int ++ number = va_arg (args_copy, int); ++ break; ++ case 'f': // float ++ fnumber = va_arg (args_copy, double); ++ break; ++ default: ++ break; ++ } ++ } ++ va_end (args_copy); ++ va_end (args); ++ ++ return *str && number && fnumber; ++}]])# _AC_C_C99_TEST_HEADER ++ ++# _AC_C_C99_TEST_BODY ++# ------------------- ++# A C body suitable for testing for C99, assuming the corresponding header. ++AC_DEFUN([_AC_C_C99_TEST_BODY], ++[[ ++ // Check bool. ++ _Bool success = false; ++ ++ // Check restrict. ++ if (test_restrict ("String literal") == 0) ++ success = true; ++ char *restrict newvar = "Another string"; ++ ++ // Check varargs. ++ success &= test_varargs ("s, d' f .", "string", 65, 34.234); ++ test_varargs_macros (); ++ ++ // Check flexible array members. ++ struct incomplete_array *ia = ++ malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); ++ ia->datasize = 10; ++ for (int i = 0; i < ia->datasize; ++i) ++ ia->data[i] = i * 1.234; ++ ++ // Check named initializers. ++ struct named_init ni = { ++ .number = 34, ++ .name = L"Test wide string", ++ .average = 543.34343, ++ }; ++ ++ ni.number = 58; ++ ++ int dynamic_array[ni.number]; ++ dynamic_array[ni.number - 1] = 543; ++ ++ // work around unused variable warnings ++ return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x' ++ || dynamic_array[ni.number - 1] != 543); ++]]) ++ ++# _AC_PROG_CC_C99 ([ACTION-IF-AVAILABLE], [ACTION-IF-UNAVAILABLE]) ++# ---------------------------------------------------------------- ++# If the C compiler is not in ISO C99 mode by default, try to add an ++# option to output variable CC to make it so. This macro tries ++# various options that select ISO C99 on some system or another. It ++# considers the compiler to be in ISO C99 mode if it handles _Bool, ++# // comments, flexible array members, inline, long long int, mixed ++# code and declarations, named initialization of structs, restrict, ++# va_copy, varargs macros, variable declarations in for loops and ++# variable length arrays. ++AC_DEFUN([_AC_PROG_CC_C99], ++[_AC_C_STD_TRY([c99], ++[_AC_C_C99_TEST_HEADER], ++[_AC_C_C99_TEST_BODY], ++dnl Try ++dnl GCC -std=gnu99 (unused restrictive modes: -std=c99 -std=iso9899:1999) ++dnl IBM XL C -qlanglvl=extc1x (V12.1; does not pass C11 test) ++dnl IBM XL C -qlanglvl=extc99 ++dnl (pre-V12.1; unused restrictive mode: -qlanglvl=stdc99) ++dnl HP cc -AC99 ++dnl Intel ICC -std=c99, -c99 (deprecated) ++dnl IRIX -c99 ++dnl Solaris -D_STDC_C99= ++dnl cc's -xc99 option uses linker magic to define the external ++dnl symbol __xpg4 as if by "int __xpg4 = 1;", which enables C99 ++dnl behavior for C library functions. This is not wanted here, ++dnl because it means that a single module compiled with -xc99 ++dnl alters C runtime behavior for the entire program, not for ++dnl just the module. Instead, define the (private) symbol ++dnl _STDC_C99, which suppresses a bogus failure in . ++dnl The resulting compiler passes the test case here, and that's ++dnl good enough. For more, please see the thread starting at: ++dnl https://lists.gnu.org/r/autoconf/2010-12/msg00059.html ++dnl Tru64 -c99 ++dnl with extended modes being tried first. ++[[-std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc1x -qlanglvl=extc99]], [$1], [$2])[]dnl ++])# _AC_PROG_CC_C99 ++ ++ ++# _AC_PROG_CC_C11 ([ACTION-IF-AVAILABLE], [ACTION-IF-UNAVAILABLE]) ++# ---------------------------------------------------------------- ++# If the C compiler is not in ISO C11 mode by default, try to add an ++# option to output variable CC to make it so. This macro tries ++# various options that select ISO C11 on some system or another. It ++# considers the compiler to be in ISO C11 mode if it handles _Alignas, ++# _Alignof, _Noreturn, _Static_assert, UTF-8 string literals, ++# duplicate typedefs, and anonymous structures and unions. ++AC_DEFUN([_AC_PROG_CC_C11], ++[_AC_C_STD_TRY([c11], ++[_AC_C_C99_TEST_HEADER[ ++// Check _Alignas. ++char _Alignas (double) aligned_as_double; ++char _Alignas (0) no_special_alignment; ++extern char aligned_as_int; ++char _Alignas (0) _Alignas (int) aligned_as_int; ++ ++// Check _Alignof. ++enum ++{ ++ int_alignment = _Alignof (int), ++ int_array_alignment = _Alignof (int[100]), ++ char_alignment = _Alignof (char) ++}; ++_Static_assert (0 < -_Alignof (int), "_Alignof is signed"); ++ ++// Check _Noreturn. ++int _Noreturn does_not_return (void) { for (;;) continue; } ++ ++// Check _Static_assert. ++struct test_static_assert ++{ ++ int x; ++ _Static_assert (sizeof (int) <= sizeof (long int), ++ "_Static_assert does not work in struct"); ++ long int y; ++}; ++ ++// Check UTF-8 literals. ++#define u8 syntax error! ++char const utf8_literal[] = u8"happens to be ASCII" "another string"; ++ ++// Check duplicate typedefs. ++typedef long *long_ptr; ++typedef long int *long_ptr; ++typedef long_ptr long_ptr; ++ ++// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. ++struct anonymous ++{ ++ union { ++ struct { int i; int j; }; ++ struct { int k; long int l; } w; ++ }; ++ int m; ++} v1; ++]], ++[_AC_C_C99_TEST_BODY[ ++ v1.i = 2; ++ v1.w.k = 5; ++ _Static_assert ((offsetof (struct anonymous, i) ++ == offsetof (struct anonymous, w.k)), ++ "Anonymous union alignment botch"); ++]], ++dnl Try ++dnl GCC -std=gnu11 (unused restrictive mode: -std=c11) ++dnl with extended modes being tried first. ++dnl ++dnl Do not try -qlanglvl=extc1x, because IBM XL C V12.1 (the latest version as ++dnl of September 2012) does not pass the C11 test. For now, try extc1x when ++dnl compiling the C99 test instead, since it enables _Static_assert and ++dnl _Noreturn, which is a win. If -qlanglvl=extc11 or -qlanglvl=extc1x passes ++dnl the C11 test in some future version of IBM XL C, we'll add it here, ++dnl preferably extc11. ++[[-std=gnu11]], [$1], [$2])[]dnl ++])# _AC_PROG_CC_C11 ++ ++ ++# AC_PROG_CC_C89 ++# -------------- ++# Do not use AU_ALIAS here and in AC_PROG_CC_C99 and AC_PROG_CC_STDC, ++# as that'd be incompatible with how Automake redefines AC_PROG_CC. See ++# . ++AU_DEFUN([AC_PROG_CC_C89], ++ [AC_REQUIRE([AC_PROG_CC])], ++ [$0 is obsolete; use AC_PROG_CC] ++) ++ ++# AC_PROG_CC_C99 ++# -------------- ++AU_DEFUN([AC_PROG_CC_C99], ++ [AC_REQUIRE([AC_PROG_CC])], ++ [$0 is obsolete; use AC_PROG_CC] ++) ++ ++# AC_PROG_CC_STDC ++# --------------- ++AU_DEFUN([AC_PROG_CC_STDC], ++ [AC_REQUIRE([AC_PROG_CC])], ++ [$0 is obsolete; use AC_PROG_CC] ++) ++ ++ ++# AC_C_PROTOTYPES ++# --------------- ++# Check if the C compiler supports prototypes, included if it needs ++# options. ++AC_DEFUN([AC_C_PROTOTYPES], ++[AC_REQUIRE([AC_PROG_CC])dnl ++if test "$ac_prog_cc_stdc" != no; then ++ AC_DEFINE(PROTOTYPES, 1, ++ [Define to 1 if the C compiler supports function prototypes.]) ++ AC_DEFINE(__PROTOTYPES, 1, ++ [Define like PROTOTYPES; this can be used by system headers.]) ++fi ++])# AC_C_PROTOTYPES ++ ++ ++# _AC_CXX_STD_TRY(STANDARD, TEST-PROLOGUE, TEST-BODY, OPTION-LIST, ++# ACTION-IF-AVAILABLE, ACTION-IF-UNAVAILABLE) ++# ---------------------------------------------------------------- ++# Check whether the C++ compiler accepts features of STANDARD (e.g ++# `cxx98', `cxx11') by trying to compile a program of TEST-PROLOGUE ++# and TEST-BODY. If this fails, try again with each compiler option ++# in the space-separated OPTION-LIST; if one helps, append it to CXX. ++# If eventually successful, run ACTION-IF-AVAILABLE, else ++# ACTION-IF-UNAVAILABLE. ++AC_DEFUN([_AC_CXX_STD_TRY], ++[AC_MSG_CHECKING([for $CXX option to enable ]m4_translit(m4_translit($1, [x], [+]), [a-z], [A-Z])[ features]) ++AC_LANG_PUSH(C++)dnl ++AC_CACHE_VAL(ac_cv_prog_cxx_$1, ++[ac_cv_prog_cxx_$1=no ++ac_save_CXX=$CXX ++AC_LANG_CONFTEST([AC_LANG_PROGRAM([$2], [$3])]) ++for ac_arg in '' $4 ++do ++ CXX="$ac_save_CXX $ac_arg" ++ _AC_COMPILE_IFELSE([], [ac_cv_prog_cxx_$1=$ac_arg]) ++ test "x$ac_cv_prog_cxx_$1" != "xno" && break ++done ++rm -f conftest.$ac_ext ++CXX=$ac_save_CXX ++])# AC_CACHE_VAL ++ac_prog_cxx_stdcxx_options= ++case "x$ac_cv_prog_cxx_$1" in ++ x) ++ AC_MSG_RESULT([none needed]) ;; ++ xno) ++ AC_MSG_RESULT([unsupported]) ;; ++ *) ++ ac_prog_cxx_stdcxx_options=" $ac_cv_prog_cxx_$1" ++ CXX=$CXX$ac_prog_cxx_stdcxx_options ++ AC_MSG_RESULT([$ac_cv_prog_cxx_$1]) ;; ++esac ++AC_LANG_POP(C++)dnl ++AS_IF([test "x$ac_cv_prog_cxx_$1" != xno], [$5], [$6]) ++])# _AC_CXX_STD_TRY ++ ++# _AC_CXX_CXX98_TEST_HEADER ++# ------------------------- ++# A C++ header suitable for testing for CXX98. ++AC_DEFUN([_AC_CXX_CXX98_TEST_HEADER], ++[[ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++namespace test { ++ typedef std::vector string_vec; ++ typedef std::pair map_value; ++ typedef std::map map_type; ++ typedef std::set set_type; ++ ++ template ++ class printer { ++ public: ++ printer(std::ostringstream& os): os(os) {} ++ void operator() (T elem) { os << elem << std::endl; } ++ private: ++ std::ostringstream& os; ++ }; ++} ++]])# _AC_CXX_CXX98_TEST_HEADER ++ ++# _AC_CXX_CXX98_TEST_BODY ++# ----------------------- ++# A C++ body suitable for testing for CXX98, assuming the corresponding header. ++AC_DEFUN([_AC_CXX_CXX98_TEST_BODY], ++[[ ++ ++try { ++ // Basic string. ++ std::string teststr("ASCII text"); ++ teststr += " string"; ++ ++ // Simple vector. ++ test::string_vec testvec; ++ testvec.push_back(teststr); ++ testvec.push_back("foo"); ++ testvec.push_back("bar"); ++ if (testvec.size() != 3) { ++ throw std::runtime_error("vector size is not 1"); ++ } ++ ++ // Dump vector into stringstream and obtain string. ++ std::ostringstream os; ++ for (test::string_vec::const_iterator i = testvec.begin(); ++ i != testvec.end(); ++i) { ++ if (i + 1 != testvec.end()) { ++ os << teststr << '\n'; ++ } ++ } ++ // Check algorithms work. ++ std::for_each(testvec.begin(), testvec.end(), test::printer(os)); ++ std::string os_out = os.str(); ++ ++ // Test pair and map. ++ test::map_type testmap; ++ testmap.insert(std::make_pair(std::string("key"), ++ std::make_pair(53,false))); ++ ++ // Test set. ++ int values[] = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3, 14, 19, 17, 8, 6, 20, 16, 2, 11, 1}; ++ test::set_type testset(values, values + sizeof(values)/sizeof(values[0])); ++ std::list testlist(testset.begin(), testset.end()); ++ std::copy(testset.begin(), testset.end(), std::back_inserter(testlist)); ++} catch (const std::exception& e) { ++ std::cerr << "Caught exception: " << e.what() << std::endl; ++ ++ // Test fstream ++ std::ofstream of("test.txt"); ++ of << "Test ASCII text\n" << std::flush; ++ of << "N= " << std::hex << std::setw(8) << std::left << 534 << std::endl; ++ of.close(); ++} ++std::exit(0); ++]]) ++ ++# _AC_CXX_CXX11_TEST_HEADER ++# ------------------------- ++# A C++ header suitable for testing for CXX11. ++AC_DEFUN([_AC_CXX_CXX11_TEST_HEADER], ++[[ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++namespace cxx11test ++{ ++ typedef std::shared_ptr sptr; ++ typedef std::weak_ptr wptr; ++ ++ typedef std::tuple tp; ++ typedef std::array int_array; ++ ++ constexpr int get_val() { return 20; } ++ ++ struct testinit ++ { ++ int i; ++ double d; ++ }; ++ ++ class delegate { ++ public: ++ delegate(int n) : n(n) {} ++ delegate(): delegate(2354) {} ++ ++ virtual int getval() { return this->n; }; ++ protected: ++ int n; ++ }; ++ ++ class overridden : public delegate { ++ public: ++ overridden(int n): delegate(n) {} ++ virtual int getval() override final { return this->n * 2; } ++ }; ++ ++ class nocopy { ++ public: ++ nocopy(int i): i(i) {} ++ nocopy() = default; ++ nocopy(const nocopy&) = delete; ++ nocopy & operator=(const nocopy&) = delete; ++ private: ++ int i; ++ }; ++} ++]])# _AC_CXX_CXX11_TEST_HEADER ++ ++# _AC_CXX_CXX11_TEST_BODY ++# ----------------------- ++# A C++ body suitable for testing for CXX11, assuming the corresponding header. ++AC_DEFUN([_AC_CXX_CXX11_TEST_BODY], ++[[ ++{ ++ // Test auto and decltype ++ std::deque d; ++ d.push_front(43); ++ d.push_front(484); ++ d.push_front(3); ++ d.push_front(844); ++ int total = 0; ++ for (auto i = d.begin(); i != d.end(); ++i) { total += *i; } ++ ++ auto a1 = 6538; ++ auto a2 = 48573953.4; ++ auto a3 = "String literal"; ++ ++ decltype(a2) a4 = 34895.034; ++} ++{ ++ // Test constexpr ++ short sa[cxx11test::get_val()] = { 0 }; ++} ++{ ++ // Test initializer lists ++ cxx11test::testinit il = { 4323, 435234.23544 }; ++} ++{ ++ // Test range-based for and lambda ++ cxx11test::int_array array = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3, 14, 19, 17, 8, 6, 20, 16, 2, 11, 1}; ++ for (int &x : array) { x += 23; } ++ std::for_each(array.begin(), array.end(), [](int v1){ std::cout << v1; }); ++} ++{ ++ using cxx11test::sptr; ++ using cxx11test::wptr; ++ ++ sptr sp(new std::string("ASCII string")); ++ wptr wp(sp); ++ sptr sp2(wp); ++} ++{ ++ cxx11test::tp tuple("test", 54, 45.53434); ++ double d = std::get<2>(tuple); ++ std::string s; ++ int i; ++ std::tie(s,i,d) = tuple; ++} ++{ ++ static std::regex filename_regex("^_?([a-z0-9_.]+-)+[a-z0-9]+$"); ++ std::string testmatch("Test if this string matches"); ++ bool match = std::regex_search(testmatch, filename_regex); ++} ++{ ++ cxx11test::int_array array = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3, 14, 19, 17, 8, 6, 20, 16, 2, 11, 1}; ++ cxx11test::int_array::size_type size = array.size(); ++} ++{ ++ // Test constructor delegation ++ cxx11test::delegate d1; ++ cxx11test::delegate d2(); ++ cxx11test::delegate d3(45); ++} ++{ ++ // Test override and final ++ cxx11test::overridden o1(55464); ++} ++{ ++ // Test nullptr ++ char *c = nullptr; ++} ++{ ++ // Test template brackets ++ std::vector> v1; ++} ++{ ++ // Unicode literals ++ char const *utf8 = u8"UTF-8 string \u2500"; ++ char16_t const *utf16 = u"UTF-8 string \u2500"; ++ char32_t const *utf32 = U"UTF-32 string \u2500"; ++} ++]]) ++ ++# _AC_PROG_CXX_CXX98 ([ACTION-IF-AVAILABLE], [ACTION-IF-UNAVAILABLE]) ++# ------------------------------------------------------------------- ++ ++# If the C++ compiler is not in ISO C++98 mode by default, try to add ++# an option to output variable CXX to make it so. This macro tries ++# various options that select ISO C++98 on some system or another. It ++# considers the compiler to be in ISO C++98 mode if it handles basic ++# features of the std namespace including: string, containers (list, ++# map, set, vector), streams (fstreams, iostreams, stringstreams, ++# iomanip), pair, exceptions and algorithms. ++ ++ ++AC_DEFUN([_AC_PROG_CXX_CXX98], ++[_AC_CXX_STD_TRY([cxx98], ++[_AC_CXX_CXX98_TEST_HEADER], ++[_AC_CXX_CXX98_TEST_BODY], ++dnl Try ++dnl GCC -std=gnu++98 (unused restrictive mode: -std=c++98) ++dnl IBM XL C -qlanglvl=extended ++dnl HP aC++ -AA ++dnl Intel ICC -std=gnu++98 ++dnl Solaris N/A (default) ++dnl Tru64 N/A (default, but -std gnu could be used) ++dnl with extended modes being tried first. ++[[-std=gnu++98 -std=c++98 -qlanglvl=extended -AA]], [$1], [$2])[]dnl ++])# _AC_PROG_CXX_CXX98 ++ ++# _AC_PROG_CXX_CXX11 ([ACTION-IF-AVAILABLE], [ACTION-IF-UNAVAILABLE]) ++# ------------------------------------------------------------------- ++# If the C++ compiler is not in ISO CXX11 mode by default, try to add ++# an option to output variable CXX to make it so. This macro tries ++# various options that select ISO C++11 on some system or another. It ++# considers the compiler to be in ISO C++11 mode if it handles all the ++# tests from the C++98 checks, plus the following: Language features ++# (auto, constexpr, decltype, default/deleted constructors, delegate ++# constructors, final, initializer lists, lambda functions, nullptr, ++# override, range-based for loops, template brackets without spaces, ++# unicode literals) and library features (array, memory (shared_ptr, ++# weak_ptr), regex and tuple types). ++AC_DEFUN([_AC_PROG_CXX_CXX11], ++[_AC_CXX_STD_TRY([cxx11], ++[_AC_CXX_CXX11_TEST_HEADER ++_AC_CXX_CXX98_TEST_HEADER], ++[_AC_CXX_CXX11_TEST_BODY ++_AC_CXX_CXX98_TEST_BODY], ++dnl Try ++dnl GCC -std=gnu++11 (unused restrictive mode: -std=c++11) [and 0x variants] ++dnl IBM XL C -qlanglvl=extended0x ++dnl (pre-V12.1; unused restrictive mode: -qlanglvl=stdcxx11) ++dnl HP aC++ -AA ++dnl Intel ICC -std=c++11 -std=c++0x ++dnl Solaris N/A (no support) ++dnl Tru64 N/A (no support) ++dnl with extended modes being tried first. ++[[-std=gnu++11 -std=c++11 -std=gnu++0x -std=c++0x -qlanglvl=extended0x -AA]], [$1], [$2])[]dnl ++])# _AC_PROG_CXX_CXX11 +diff --git a/tests/foreign.at b/tests/foreign.at +index f3a53420..50e49efc 100644 +--- a/tests/foreign.at ++++ b/tests/foreign.at +@@ -153,111 +153,8 @@ cp "$abs_top_srcdir/build-aux/install-sh" \ + # the second time. Git commit 18c140b50b0619454d4da50d58a318cc257d580a + # broke this usage and the breakage went unnoticed for *eight years*. + +-AT_DATA([aclocal.m4], +-[[# ax_prog_cc_for_build.m4 +-# serial 18 +-# Copyright (c) 2008 Paolo Bonzini +- +-AC_DEFUN([AX_PROG_CC_FOR_BUILD], [ +-AC_REQUIRE([AC_PROG_CC]) +-AC_REQUIRE([AC_PROG_CPP]) +-AC_REQUIRE([AC_CANONICAL_BUILD]) +- +-# Use the standard macros, but make them use other variable names +-m4@&t@_pushdef([ac_cv_prog_CPP], ac_cv_build_prog_CPP) +-m4@&t@_pushdef([ac_cv_prog_cc_c89], ac_cv_build_prog_cc_c89) +-m4@&t@_pushdef([ac_cv_prog_gcc], ac_cv_build_prog_gcc) +-m4@&t@_pushdef([ac_cv_prog_cc_works], ac_cv_build_prog_cc_works) +-m4@&t@_pushdef([ac_cv_prog_cc_cross], ac_cv_build_prog_cc_cross) +-m4@&t@_pushdef([ac_cv_prog_cc_g], ac_cv_build_prog_cc_g) +-m4@&t@_pushdef([ac_cv_c_compiler_gnu], ac_cv_build_c_compiler_gnu) +-m4@&t@_pushdef([ac_cv_exeext], ac_cv_build_exeext) +-m4@&t@_pushdef([ac_cv_objext], ac_cv_build_objext) +-m4@&t@_pushdef([ac_exeext], ac_build_exeext) +-m4@&t@_pushdef([ac_objext], ac_build_objext) +-m4@&t@_pushdef([CC], CC_FOR_BUILD) +-m4@&t@_pushdef([CPP], CPP_FOR_BUILD) +-m4@&t@_pushdef([GCC], GCC_FOR_BUILD) +-m4@&t@_pushdef([CFLAGS], CFLAGS_FOR_BUILD) +-m4@&t@_pushdef([CPPFLAGS], CPPFLAGS_FOR_BUILD) +-m4@&t@_pushdef([EXEEXT], BUILD_EXEEXT) +-m4@&t@_pushdef([LDFLAGS], LDFLAGS_FOR_BUILD) +-m4@&t@_pushdef([OBJEXT], BUILD_OBJEXT) +-m4@&t@_pushdef([host], build) +-m4@&t@_pushdef([host_alias], build_alias) +-m4@&t@_pushdef([host_cpu], build_cpu) +-m4@&t@_pushdef([host_vendor], build_vendor) +-m4@&t@_pushdef([host_os], build_os) +-m4@&t@_pushdef([ac_cv_host], ac_cv_build) +-m4@&t@_pushdef([ac_cv_host_alias], ac_cv_build_alias) +-m4@&t@_pushdef([ac_cv_host_cpu], ac_cv_build_cpu) +-m4@&t@_pushdef([ac_cv_host_vendor], ac_cv_build_vendor) +-m4@&t@_pushdef([ac_cv_host_os], ac_cv_build_os) +-m4@&t@_pushdef([ac_tool_prefix], ac_build_tool_prefix) +-m4@&t@_pushdef([am_cv_CC_dependencies_compiler_type], am_cv_build_CC_dependencies_compiler_type) +-m4@&t@_pushdef([am_cv_prog_cc_c_o], am_cv_build_prog_cc_c_o) +-m4@&t@_pushdef([cross_compiling], cross_compiling_build) +- +-cross_compiling_build=no +- +-ac_build_tool_prefix= +-AS@&t@_IF([test -n "$build"], [ac_build_tool_prefix="$build-"], +- [test -n "$build_alias"],[ac_build_tool_prefix="$build_alias-"]) +- +-AC_LANG_PUSH([C]) +-AC_PROG_CC +-_AC_COMPILER_EXEEXT +-_AC_COMPILER_OBJEXT +-AC_PROG_CPP +- +-# Restore the old definitions +-m4@&t@_popdef([cross_compiling]) +-m4@&t@_popdef([am_cv_prog_cc_c_o]) +-m4@&t@_popdef([am_cv_CC_dependencies_compiler_type]) +-m4@&t@_popdef([ac_tool_prefix]) +-m4@&t@_popdef([ac_cv_host_os]) +-m4@&t@_popdef([ac_cv_host_vendor]) +-m4@&t@_popdef([ac_cv_host_cpu]) +-m4@&t@_popdef([ac_cv_host_alias]) +-m4@&t@_popdef([ac_cv_host]) +-m4@&t@_popdef([host_os]) +-m4@&t@_popdef([host_vendor]) +-m4@&t@_popdef([host_cpu]) +-m4@&t@_popdef([host_alias]) +-m4@&t@_popdef([host]) +-m4@&t@_popdef([OBJEXT]) +-m4@&t@_popdef([LDFLAGS]) +-m4@&t@_popdef([EXEEXT]) +-m4@&t@_popdef([CPPFLAGS]) +-m4@&t@_popdef([CFLAGS]) +-m4@&t@_popdef([GCC]) +-m4@&t@_popdef([CPP]) +-m4@&t@_popdef([CC]) +-m4@&t@_popdef([ac_objext]) +-m4@&t@_popdef([ac_exeext]) +-m4@&t@_popdef([ac_cv_objext]) +-m4@&t@_popdef([ac_cv_exeext]) +-m4@&t@_popdef([ac_cv_c_compiler_gnu]) +-m4@&t@_popdef([ac_cv_prog_cc_g]) +-m4@&t@_popdef([ac_cv_prog_cc_cross]) +-m4@&t@_popdef([ac_cv_prog_cc_works]) +-m4@&t@_popdef([ac_cv_prog_cc_c89]) +-m4@&t@_popdef([ac_cv_prog_gcc]) +-m4@&t@_popdef([ac_cv_prog_CPP]) +- +-# restore global variables ac_ext, ac_cpp, ac_compile, +-# ac_link, ac_compiler_gnu (dependant on the current +-# language after popping): +-AC_LANG_POP([C]) +- +-# Finally, set Makefile variables +-AC_SUBST(BUILD_EXEEXT) +-AC_SUBST(BUILD_OBJEXT) +-AC_SUBST([CFLAGS_FOR_BUILD]) +-AC_SUBST([CPPFLAGS_FOR_BUILD]) +-AC_SUBST([LDFLAGS_FOR_BUILD]) +-]) +-]]) ++cp "$abs_top_srcdir/tests/data/ax_prog_cc_for_build_v18.m4" \ ++ aclocal.m4 + + AT_DATA([configure.ac], + [[AC_INIT([foo], [1.0]) +@@ -290,87 +187,9 @@ cp "$abs_top_srcdir/build-aux/install-sh" \ + # the second time. This usage was never broken (unlike with AC_PROG_CC) + # but it seems sensible to make sure it doesn't *get* broken. + +-AT_DATA([aclocal.m4], +-[[# ax_prog_cxx_for_build.m4 +-# serial 3 +-# Copyright (c) 2008 Paolo Bonzini +-# Copyright (c) 2012 Avionic Design GmbH +- +-AC_DEFUN([AX_PROG_CXX_FOR_BUILD], [ +-AC_LANG_PUSH([C++]) +- +-AC_REQUIRE([AC_PROG_CXX]) +-AC_REQUIRE([AC_PROG_CXXCPP]) +-AC_REQUIRE([AC_CANONICAL_HOST]) +- +-# Use the standard macros, but make them use other variable names +-m4@&t@_pushdef([ac_cv_prog_CXXCPP], ac_cv_build_prog_CXXCPP) +-m4@&t@_pushdef([ac_cv_prog_gxx], ac_cv_build_prog_gxx) +-m4@&t@_pushdef([ac_cv_prog_cxx_works], ac_cv_build_prog_cxx_works) +-m4@&t@_pushdef([ac_cv_prog_cxx_cross], ac_cv_build_prog_cxx_cross) +-m4@&t@_pushdef([ac_cv_prog_cxx_g], ac_cv_build_prog_cxx_g) +-m4@&t@_pushdef([CXX], CXX_FOR_BUILD) +-m4@&t@_pushdef([CXXCPP], CXXCPP_FOR_BUILD) +-m4@&t@_pushdef([CXXFLAGS], CXXFLAGS_FOR_BUILD) +-m4@&t@_pushdef([CPPFLAGS], CPPFLAGS_FOR_BUILD) +-m4@&t@_pushdef([CXXCPPFLAGS], CXXCPPFLAGS_FOR_BUILD) +-m4@&t@_pushdef([host], build) +-m4@&t@_pushdef([host_alias], build_alias) +-m4@&t@_pushdef([host_cpu], build_cpu) +-m4@&t@_pushdef([host_vendor], build_vendor) +-m4@&t@_pushdef([host_os], build_os) +-m4@&t@_pushdef([ac_cv_host], ac_cv_build) +-m4@&t@_pushdef([ac_cv_host_alias], ac_cv_build_alias) +-m4@&t@_pushdef([ac_cv_host_cpu], ac_cv_build_cpu) +-m4@&t@_pushdef([ac_cv_host_vendor], ac_cv_build_vendor) +-m4@&t@_pushdef([ac_cv_host_os], ac_cv_build_os) +-m4@&t@_pushdef([ac_cxxcpp], ac_build_cxxcpp) +-m4@&t@_pushdef([ac_compile], ac_build_compile) +-m4@&t@_pushdef([ac_link], ac_build_link) +- +-save_cross_compiling=$cross_compiling +-save_ac_tool_prefix=$ac_tool_prefix +-cross_compiling=no +-ac_tool_prefix= +- +-AC_PROG_CXX +-AC_PROG_CXXCPP +- +-ac_tool_prefix=$save_ac_tool_prefix +-cross_compiling=$save_cross_compiling +- +-# Restore the old definitions +-m4@&t@_popdef([ac_link]) +-m4@&t@_popdef([ac_compile]) +-m4@&t@_popdef([ac_cxxcpp]) +-m4@&t@_popdef([ac_cv_host_os]) +-m4@&t@_popdef([ac_cv_host_vendor]) +-m4@&t@_popdef([ac_cv_host_cpu]) +-m4@&t@_popdef([ac_cv_host_alias]) +-m4@&t@_popdef([ac_cv_host]) +-m4@&t@_popdef([host_os]) +-m4@&t@_popdef([host_vendor]) +-m4@&t@_popdef([host_cpu]) +-m4@&t@_popdef([host_alias]) +-m4@&t@_popdef([host]) +-m4@&t@_popdef([CXXCPPFLAGS]) +-m4@&t@_popdef([CPPFLAGS]) +-m4@&t@_popdef([CXXFLAGS]) +-m4@&t@_popdef([CXXCPP]) +-m4@&t@_popdef([CXX]) +-m4@&t@_popdef([ac_cv_prog_cxx_g]) +-m4@&t@_popdef([ac_cv_prog_cxx_cross]) +-m4@&t@_popdef([ac_cv_prog_cxx_works]) +-m4@&t@_popdef([ac_cv_prog_gxx]) +-m4@&t@_popdef([ac_cv_prog_CXXCPP]) +- +-# Finally, set Makefile variables +-AC_SUBST([CXXFLAGS_FOR_BUILD]) +-AC_SUBST([CXXCPPFLAGS_FOR_BUILD]) +- +-AC_LANG_POP([C++]) +-]) +-]]) ++cat "$abs_top_srcdir/tests/data/ax_prog_cc_for_build_v18.m4" \ ++ "$abs_top_srcdir/tests/data/ax_prog_cxx_for_build_v3.m4" \ ++ > aclocal.m4 + + AT_DATA([configure.ac], + [[AC_INIT([foo], [1.0]) +@@ -391,3 +210,27 @@ AT_CHECK([grep '^CXX = ..*$' Makefile > /dev/null 2>&1]) + AT_CHECK([grep '^CXX_FOR_BUILD = ..*$' Makefile > /dev/null 2>&1]) + + AT_CLEANUP ++ ++ ++AT_SETUP([gnulib-std-gnu11.m4]) ++ ++# Gnulib's std-gnu11.m4 (last significant change 2016-03-15) overrides ++# most but not all of the internal macros used by AC_PROG_CC and AC_PROG_CXX. ++# Commit 131d8c69f31dc6fc8dc93abe1096d52d1fe19fd3 changed the calling ++# convention of _AC_C_STD_TRY, causing configure scripts that load ++# std-gnu11.m4 to have shell syntax errors. ++ ++cp "$abs_top_srcdir/tests/data/gnulib_std_gnu11_2020_08_17.m4" \ ++ aclocal.m4 ++ ++AT_DATA([configure.ac], ++[[AC_INIT([foo], [1.0]) ++AC_PROG_CC ++AC_PROG_CXX ++AC_OUTPUT ++]]) ++ ++AT_CHECK_AUTOCONF ++AT_CHECK_CONFIGURE ++ ++AT_CLEANUP From 26c712ac3d0d7f1c2863227b97c1d5cac6f3674c14b44d60f17f6987a467db37 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Sat, 30 Jan 2021 12:46:58 +0000 Subject: [PATCH 5/6] Accepting request 867885 from home:AndreasStieger:branches:devel:tools:building autoconf 2.71 OBS-URL: https://build.opensuse.org/request/show/867885 OBS-URL: https://build.opensuse.org/package/show/devel:tools:building/autoconf?expand=0&rev=50 --- autoconf-2.70.tar.xz | 3 - autoconf-2.70.tar.xz.sig | 16 - autoconf-2.71.tar.xz | 3 + autoconf-2.71.tar.xz.sig | 16 + autoconf-el.changes | 15 + autoconf-el.spec | 2 +- autoconf-testsuite.changes | 15 + autoconf-testsuite.spec | 14 +- autoconf.changes | 15 + autoconf.spec | 14 +- autom4te-always-update-output-file.patch | 99 -- handle-gettext-alone.patch | 58 - prog-c99-fix-typo.patch | 31 - restore-compatibility-gnu11.patch | 1913 ---------------------- 14 files changed, 67 insertions(+), 2147 deletions(-) delete mode 100644 autoconf-2.70.tar.xz delete mode 100644 autoconf-2.70.tar.xz.sig create mode 100644 autoconf-2.71.tar.xz create mode 100644 autoconf-2.71.tar.xz.sig delete mode 100644 autom4te-always-update-output-file.patch delete mode 100644 handle-gettext-alone.patch delete mode 100644 prog-c99-fix-typo.patch delete mode 100644 restore-compatibility-gnu11.patch diff --git a/autoconf-2.70.tar.xz b/autoconf-2.70.tar.xz deleted file mode 100644 index b49c255..0000000 --- a/autoconf-2.70.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:fa9e227860d9d845c0a07f63b88c8d7a2ae1aa2345fb619384bb8accc19fecc6 -size 1346528 diff --git a/autoconf-2.70.tar.xz.sig b/autoconf-2.70.tar.xz.sig deleted file mode 100644 index a1f3a9a..0000000 --- a/autoconf-2.70.tar.xz.sig +++ /dev/null @@ -1,16 +0,0 @@ ------BEGIN PGP SIGNATURE----- - -iQIzBAABCAAdFiEEgvhU885zF0uLYxdAkfzDK2dpqmQFAl/Pyp0ACgkQkfzDK2dp -qmRwHQ/+K6xxNpeHx0jWQk0GRWiYr4d00ViWAXu2El0zdNh3m3DqQGXmHtZten46 -ez1v8gx4bkvStgZZGh4AgFRnR7zp0am32PwLLAGepraxD06YwlAAZgzCztFW0/9b -DQjYXlW8Jfsx0eQRNX5J41od1MCSjLwjCAx5HFUhAeniwBHrvhn/oaxnd451oJm9 -LPD6oc9ccd4hh7Ff5ElWZdzi7eBOGcjox8+6lxcyieeNYOGoMtRvmrrhGV67ym0s -3Yh5nREqMsaxE7NYSuzM0T+pUZJYMal5dbWYvDdycJqLu9/UabSZLuppNVFTyYAK -43v9Xq7CvHRaJpvqhMiczyjlk86cR/SdKItTaY1ZsTATw/j8uxNTH049XIWP7bM1 -oa7ypMMD779Ihk0Ci7Bl9ZJ8tjsPP1jlPRcHLoyam15HDEQcORDk3YiEJMF74XZ4 -t5TTAw/bDPlGB2fHix5IrSipMaLzKHhlzGAl0exQ35liSSqI6eb2DjnyAO1P1hft -S/Ds5CsL0cRfUKzvoQTRuhJMn1caO2IZfWzCgxGKc6g9XMXyRzYCihGNKSvG1/Vl -66Chjbpv4LXFmASLY41eGclK/c+74nwP9GdO+Sn8jCJsFddlU4pXffBDsk1F+r+c -uLbSss93weH5bh6uS0ll6jU36/3YBudxBLQWDtRtW2uV9Vb8MiE= -=6ak1 ------END PGP SIGNATURE----- diff --git a/autoconf-2.71.tar.xz b/autoconf-2.71.tar.xz new file mode 100644 index 0000000..5b4d35b --- /dev/null +++ b/autoconf-2.71.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f14c83cfebcc9427f2c3cea7258bd90df972d92eb26752da4ddad81c87a0faa4 +size 1292296 diff --git a/autoconf-2.71.tar.xz.sig b/autoconf-2.71.tar.xz.sig new file mode 100644 index 0000000..c08bfae --- /dev/null +++ b/autoconf-2.71.tar.xz.sig @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABCAAdFiEEgvhU885zF0uLYxdAkfzDK2dpqmQFAmATPzIACgkQkfzDK2dp +qmSrUw//Z0ncEs8SD3qn2+QYUzo5dMZ4BJi/8h9LSlRZnp+OhVqtWgCQhiW/cTaa +UXKRca7JMRTreqMhgLkRE12cEvTIUlfl1QiOluNBq1YzNeG1JMIFEVxi8JiBzCqd +s7cEgIUB0ZhhEtBAAF0ABBDJraaTYJGUxLpvzOltdiRODn6ic9XZdUga7ouWgwLM +5o78OzYXbYz2CP6DrOsfntNol4Fx2gH8hOADWOlUEzCc/580twsm2xMTu8q6+win +yIxTC5yDJdXZnP6JIFD2rrg1tfFkTom2sMVC3feFjrgRqyA4Jcyf8WpmRnC21PzD +NhEO4aejgEmkKCIDudT62vzOhPGZrKPlPA+rMcYX3Jx1rCbozAbIcsGj6mD8q75g +7BYtwJQjKLH2b4pJ0Xl6l4bVnN2o82zdWY5cHE9TI+l5ntU9yooNKlh1IAz3WFwR +PCGd0F/JIXNjBbMzqtjyzYYvlSRDvS+aLg8S+PK/wXbZBEjQOjEI+m1YyOL2N7qM +UiM04x5BNCWG672qg38NISIHJvmBdgCHiwnVLpfstQPw+Y4L8YyMZyrbj3Mtmomo +Woa9oXvv1lVT4W2PleJQ71fq8QpuW+xbM9IXdWoMp1lCEZQ0doJcTFvEhwpW3tca +oEzNdgMghMDB9TFsiTpP1YoOyvAVhRtxWgO1j9pSi3JWQZ3AjKs= +=y3Hc +-----END PGP SIGNATURE----- diff --git a/autoconf-el.changes b/autoconf-el.changes index 8dbb554..93e3aa3 100644 --- a/autoconf-el.changes +++ b/autoconf-el.changes @@ -1,3 +1,18 @@ +------------------------------------------------------------------- +Sat Jan 30 07:20:53 UTC 2021 - Andreas Stieger + +- autoconf 2.71: + * Compilers that support C99 but not C2011 are detected correctly + * Compatibility improved with clang and Oracle C++ + * Compatibility restored with automake's rules for regenerating + configure + * Compatibility restored with old versions of std-gnu11.m4 +- dropped upstream patches: + * prog-c99-fix-typo.patch + * restore-compatibility-gnu11.patch + * autom4te-always-update-output-file.patch + * handle-gettext-alone.patch + ------------------------------------------------------------------- Sat Jan 16 18:47:23 UTC 2021 - Dirk Müller diff --git a/autoconf-el.spec b/autoconf-el.spec index 02d4c93..84b3b5b 100644 --- a/autoconf-el.spec +++ b/autoconf-el.spec @@ -18,7 +18,7 @@ %define site_lisp %{_datadir}/emacs/site-lisp Name: autoconf-el -Version: 2.70 +Version: 2.71 Release: 0 Summary: Emacs mode for editing GNU Autoconf scripts License: GPL-3.0-or-later diff --git a/autoconf-testsuite.changes b/autoconf-testsuite.changes index 8dbb554..93e3aa3 100644 --- a/autoconf-testsuite.changes +++ b/autoconf-testsuite.changes @@ -1,3 +1,18 @@ +------------------------------------------------------------------- +Sat Jan 30 07:20:53 UTC 2021 - Andreas Stieger + +- autoconf 2.71: + * Compilers that support C99 but not C2011 are detected correctly + * Compatibility improved with clang and Oracle C++ + * Compatibility restored with automake's rules for regenerating + configure + * Compatibility restored with old versions of std-gnu11.m4 +- dropped upstream patches: + * prog-c99-fix-typo.patch + * restore-compatibility-gnu11.patch + * autom4te-always-update-output-file.patch + * handle-gettext-alone.patch + ------------------------------------------------------------------- Sat Jan 16 18:47:23 UTC 2021 - Dirk Müller diff --git a/autoconf-testsuite.spec b/autoconf-testsuite.spec index 157961c..498e6d0 100644 --- a/autoconf-testsuite.spec +++ b/autoconf-testsuite.spec @@ -17,7 +17,7 @@ Name: autoconf-testsuite -Version: 2.70 +Version: 2.71 Release: 0 Summary: A GNU Tool for Automatically Configuring Source Code License: GPL-3.0-or-later @@ -26,14 +26,6 @@ Source0: http://ftp.gnu.org/gnu/autoconf/autoconf-%{version}.tar.xz Source1: http://ftp.gnu.org/gnu/autoconf/autoconf-%{version}.tar.xz.sig Source2: %{name}.keyring Patch0: autoreconf-ltdl.diff -# PATCH-FIX-UPSTREAM -Patch1: https://git.savannah.gnu.org/cgit/autoconf.git/patch/?id=07130c3e48d12ec155ac5d7630dc7477b6989904#/autom4te-always-update-output-file.patch -# PATCH-FIX-UPSTREAM -Patch2: https://git.savannah.gnu.org/cgit/autoconf.git/patch/?id=05972f49ee632cd98057a3caf82ebfb9574846da#/prog-c99-fix-typo.patch -# PATCH-FIX-UPSTREAM -Patch3: https://git.savannah.gnu.org/cgit/autoconf.git/patch/?id=66fdaea3cfb4e758212c1891913e9a59441d49af#/handle-gettext-alone.patch -# PATCH-FIX-UPSTREAM https://git.savannah.gnu.org/cgit/autoconf.git/patch/?id=2d0f19d84ddb13412382674fd48e6fc5c2875d0e -Patch4: restore-compatibility-gnu11.patch BuildRequires: help2man BuildRequires: m4 >= 1.4.6 Requires: info @@ -60,10 +52,6 @@ only required for the generation of the scripts, not their use. %prep %setup -q -n autoconf-%{version} %patch0 -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 %build %configure diff --git a/autoconf.changes b/autoconf.changes index 8dbb554..93e3aa3 100644 --- a/autoconf.changes +++ b/autoconf.changes @@ -1,3 +1,18 @@ +------------------------------------------------------------------- +Sat Jan 30 07:20:53 UTC 2021 - Andreas Stieger + +- autoconf 2.71: + * Compilers that support C99 but not C2011 are detected correctly + * Compatibility improved with clang and Oracle C++ + * Compatibility restored with automake's rules for regenerating + configure + * Compatibility restored with old versions of std-gnu11.m4 +- dropped upstream patches: + * prog-c99-fix-typo.patch + * restore-compatibility-gnu11.patch + * autom4te-always-update-output-file.patch + * handle-gettext-alone.patch + ------------------------------------------------------------------- Sat Jan 16 18:47:23 UTC 2021 - Dirk Müller diff --git a/autoconf.spec b/autoconf.spec index 5c6de21..112b920 100644 --- a/autoconf.spec +++ b/autoconf.spec @@ -17,7 +17,7 @@ Name: autoconf -Version: 2.70 +Version: 2.71 Release: 0 Summary: A GNU Tool for Automatically Configuring Source Code License: GPL-3.0-or-later @@ -26,14 +26,6 @@ Source0: http://ftp.gnu.org/gnu/autoconf/autoconf-%{version}.tar.xz Source1: http://ftp.gnu.org/gnu/autoconf/autoconf-%{version}.tar.xz.sig Source2: %{name}.keyring Patch0: autoreconf-ltdl.diff -# PATCH-FIX-UPSTREAM -Patch1: https://git.savannah.gnu.org/cgit/autoconf.git/patch/?id=07130c3e48d12ec155ac5d7630dc7477b6989904#/autom4te-always-update-output-file.patch -# PATCH-FIX-UPSTREAM -Patch2: https://git.savannah.gnu.org/cgit/autoconf.git/patch/?id=05972f49ee632cd98057a3caf82ebfb9574846da#/prog-c99-fix-typo.patch -# PATCH-FIX-UPSTREAM -Patch3: https://git.savannah.gnu.org/cgit/autoconf.git/patch/?id=66fdaea3cfb4e758212c1891913e9a59441d49af#/handle-gettext-alone.patch -# PATCH-FIX-UPSTREAM https://git.savannah.gnu.org/cgit/autoconf.git/patch/?id=2d0f19d84ddb13412382674fd48e6fc5c2875d0e -Patch4: restore-compatibility-gnu11.patch BuildRequires: help2man BuildRequires: m4 >= 1.4.6 Requires: info @@ -60,10 +52,6 @@ only required for the generation of the scripts, not their use. %prep %setup -q -n autoconf-%{version} %patch0 -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 %build %configure diff --git a/autom4te-always-update-output-file.patch b/autom4te-always-update-output-file.patch deleted file mode 100644 index d31d2e9..0000000 --- a/autom4te-always-update-output-file.patch +++ /dev/null @@ -1,99 +0,0 @@ -From 07130c3e48d12ec155ac5d7630dc7477b6989904 Mon Sep 17 00:00:00 2001 -From: Zack Weinberg -Date: Tue, 29 Dec 2020 15:33:33 -0500 -Subject: =?UTF-8?q?autom4te:=20always=20update=20the=20output=20file,=20ev?= - =?UTF-8?q?en=20if=20it=20hasn=E2=80=99t=20changed?= -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Automake generates a Makefile rule for regenerating the configure -script, that relies on an invocation of ‘autoconf’ always bumping the -timestamp on the configure script, even if it hasn’t changed. -The patch to make autom4te update the output file atomically -(1725c947144d9bebfe7817c2c5f0d53d884b1297) broke this. - -Fixes several failures in automake’s test suite. - - * bin/autom4te.in (handle_output): Always call update_file with force=1. - * tests/tools.at (autoconf: timestamp changes): New test. ---- - bin/autom4te.in | 4 +++- - tests/tools.at | 46 ++++++++++++++++++++++++++++++++++++++++++++++ - 2 files changed, 49 insertions(+), 1 deletion(-) - -diff --git a/bin/autom4te.in b/bin/autom4te.in -index 4c2b905c..64653a44 100644 ---- a/bin/autom4te.in -+++ b/bin/autom4te.in -@@ -609,7 +609,9 @@ sub handle_output ($$) - } - - $out->close(); -- update_file ($scratchfile, $output, $force) -+ # Always update the file, even if it didn't change; -+ # Automake relies on this. -+ update_file ($scratchfile, $output, 1) - if defined $scratchfile; - - # If no forbidden words, we're done. -diff --git a/tests/tools.at b/tests/tools.at -index 49710202..89b8b63b 100644 ---- a/tests/tools.at -+++ b/tests/tools.at -@@ -662,6 +662,52 @@ arbitrary $text - AT_CLEANUP - - -+# autoconf: timestamp changes -+# --------------------------- -+# Automake needs autoconf to update the timestamp on the configure script -+# whenever configure.ac or aclocal.m4 changes, even if the contents of the -+# configure script have not changed. -+AT_SETUP([autoconf: timestamp changes]) -+ -+AT_DATA([aclocal.m4], -+[[AC_DEFUN([local_KILROY], [# kilroy was here -+]) -+]]) -+ -+AT_DATA_AUTOCONF([configure.ac], -+[[AC_INIT -+AC_PROG_CC -+local_KILROY -+AC_OUTPUT -+]]) -+ -+AT_CHECK_AUTOCONF -+ -+cp configure configure.1 -+sleep 1 -+printf '%s\n' 'AC_LIBSOURCES([foo.c])dn@&t@l' >> configure.ac -+ -+# This step must not use --force. -+# We don't need to check shell syntax, because if all goes well, -+# the script will be unchanged from what it was in the first autoconf -+# pass, and that was already checked. -+AT_CHECK_M4([autoconf]) -+AT_CHECK([cmp configure configure.1]) -+AT_CHECK([test configure -nt configure.1]) -+ -+cp configure configure.2 -+sleep 1 -+printf '%s\n' \ -+ 'AC_DEFUN([unused_MACRO], [# bob was there too' \ -+ '])' >> aclocal.m4 -+ -+# Same as above. -+AT_CHECK_M4([autoconf]) -+AT_CHECK([cmp configure configure.2]) -+AT_CHECK([test configure -nt configure.2]) -+ -+AT_CLEANUP -+ - - ## --------- ## - ## ifnames. ## --- -cgit v1.2.1 - diff --git a/handle-gettext-alone.patch b/handle-gettext-alone.patch deleted file mode 100644 index 80e00cf..0000000 --- a/handle-gettext-alone.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 66fdaea3cfb4e758212c1891913e9a59441d49af Mon Sep 17 00:00:00 2001 -From: Zack Weinberg -Date: Mon, 4 Jan 2021 17:27:37 -0500 -Subject: =?UTF-8?q?autoreconf:=20don=E2=80=99t=20error=20out=20when=20AM?= - =?UTF-8?q?=5FGNU=5FGETTEXT=20is=20used=20alone.?= -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Some projects intentionally don't call AM_GNU_GETTEXT_(REQUIRE_)VERSION -because they have all of the gettext infrastructure checked into version -control and they want autoreconf to _not_ run autopoint. Therefore, make -the “AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_(REQUIRE_)VERSION” -and “AM_GNU_GETTEXT_(REQUIRE_)VERSION is used, but not AM_GNU_GETTEXT” -diagnostics be warnings again, as they were in 2.69. - -(Technically these diagnostics were always errors, in the sense that -they were reported with a call to Autom4te::Channels::error(), but -prior to 2.70, error() calls made by autoreconf did not cause -autoreconf to exit unsuccessfully, due to an unrelated bug. So people -came to depend on these diagnostics not being fatal.) ---- - bin/autoreconf.in | 18 +++++++++++------- - 1 file changed, 11 insertions(+), 7 deletions(-) - -diff --git a/bin/autoreconf.in b/bin/autoreconf.in -index bb9f316d..9855efbe 100644 ---- a/bin/autoreconf.in -+++ b/bin/autoreconf.in -@@ -644,14 +644,18 @@ sub autoreconf_current_directory ($) - } - } - -- # Gettext consistency checks... -- error($configure_ac, -- "AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION" -- . " or AM_GNU_GETTEXT_REQUIRE_VERSION") -+ # Gettext consistency checks. -+ # Some projects intentionally don't call AM_GNU_GETTEXT_(REQUIRE_)VERSION -+ # because they have all of the gettext infrastructure checked into version -+ # control and they want us to _not_ run autopoint. Therefore, these -+ # diagnostics are only warnings. -+ msg('syntax', $configure_ac, -+ "AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION" -+ . " or AM_GNU_GETTEXT_REQUIRE_VERSION") - if $uses_gettext_via_traces && ! $uses_gettext; -- error($configure_ac, -- "AM_GNU_GETTEXT_VERSION or AM_GNU_GETTEXT_REQUIRE_VERSION is used," -- . " but not AM_GNU_GETTEXT") -+ msg('syntax', $configure_ac, -+ "AM_GNU_GETTEXT_VERSION or AM_GNU_GETTEXT_REQUIRE_VERSION is used," -+ . " but not AM_GNU_GETTEXT") - if $uses_gettext && ! $uses_gettext_via_traces; - - --- -cgit v1.2.1 - diff --git a/prog-c99-fix-typo.patch b/prog-c99-fix-typo.patch deleted file mode 100644 index 3d541ff..0000000 --- a/prog-c99-fix-typo.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 05972f49ee632cd98057a3caf82ebfb9574846da Mon Sep 17 00:00:00 2001 -From: Zack Weinberg -Date: Tue, 8 Dec 2020 21:35:45 -0500 -Subject: _AC_PROG_CC_C99: fix typo (#110396) - -_AC_PROG_CC_C99 was using the wrong test program. - -Fixes #110396, reported anonymously. - -* lib/autoconf/c.m4 (_AC_PROG_CC_C99): Use the C99 test program, not - the C89 test program. ---- - lib/autoconf/c.m4 | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/lib/autoconf/c.m4 b/lib/autoconf/c.m4 -index fe217cad..601c2df4 100644 ---- a/lib/autoconf/c.m4 -+++ b/lib/autoconf/c.m4 -@@ -1559,7 +1559,7 @@ dnl SVR4 -Xc -D__EXTENSIONS__ - # option to output variable CC to make it so. - AC_DEFUN([_AC_PROG_CC_C99], - [AC_REQUIRE([_AC_C_C99_TEST_PROGRAM])]dnl --[_AC_C_STD_TRY([c99], [ac_c_conftest_c89_program], -+[_AC_C_STD_TRY([c99], [ac_c_conftest_c99_program], - dnl Try - dnl GCC -std=gnu99 (unused restrictive modes: -std=c99 -std=iso9899:1999) - dnl IBM XL C -qlanglvl=extc1x (V12.1; does not pass C11 test) --- -cgit v1.2.1 - diff --git a/restore-compatibility-gnu11.patch b/restore-compatibility-gnu11.patch deleted file mode 100644 index e310399..0000000 --- a/restore-compatibility-gnu11.patch +++ /dev/null @@ -1,1913 +0,0 @@ -From 2d0f19d84ddb13412382674fd48e6fc5c2875d0e Mon Sep 17 00:00:00 2001 -From: Zack Weinberg -Date: Mon, 21 Dec 2020 14:04:22 -0500 -Subject: Restore compatibility with older std-gnu11.m4. -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Gnulib’s std-gnu11.m4 backports C11 and C++11 detection to autoconf -2.69. It does this by replacing the definitions of AC_PROC_CC and -AC_PROG_CXX and most of their subroutines. In particular, it replaces -the definitions of _AC_PROG_CC_C11, _AC_PROG_CC_C99, and _AC_C_STD_TRY, -but it does *not* replace the definition of _AC_PROG_CC_C89. - -Autoconf commit 131d8c69f31dc6fc8dc93abe1096d52d1fe19fd3 changed the -calling convention of _AC_C_STD_TRY, and changed the internal -definitions of _AC_PROG_CC_C{11,99,89} to match. If std-gnu11.m4 is -in use, our _AC_PROG_CC_C89 calls their _AC_C_STD_TRY with the new -calling convention, and this produces a syntactically invalid -configure script. (This is is fortunate: it could easily have been a -runtime malfunction that only manifested with compilers that only -implement C89, and then we might not have noticed the problem for -years.) - -Gnulib commit a3b3fc85e3e632374811b27cb2111e50fa177e36 makes -std-gnu11.m4 do nothing when used with autoconf >=2.70, but older -versions of the file will circulate for years to come, so this patch -works around the problem in autoconf. It does this by renaming all of -the internal macros involved with C and C++ standard edition -detection, *except* _AC_PROG_CC_C89. AC_PROG_CC now calls -_AC_PROG_CC_STDC_EDITION, which loops over all supported editions -calling _AC_PROG_CC_STDC_EDITION_TRY, which uses the data provided by -the existing _AC_C_C${edition}_TEST_PROGRAM macros and a new set of -macros called _AC_C_C${edition}_OPTIONS to perform the test for that -edition of the standard. Similarly, AC_PROG_CXX calls -_AC_PROG_CXX_STDCXX_EDITION, which loops calling -_AC_PROG_CXX_STDCXX_EDITION_TRY, which uses data from -_AC_CXX_CXX${edition}_TEST_PROGRAM and _AC_CXX_CXX${edition}_OPTIONS. - -_AC_PROG_CC_C89 is the only macro from the old set that we still -define, and its definition is reverted to what std-gnu11.m4 expects it -to be. Nothing in Autoconf proper uses it anymore. - -foreign.at grows a test to verify that the compatibility stub version -of _AC_PROG_CC_C89 does its job. Since this is now the third test -involving an embedded copy of a third-party macro, I broke them all -out of foreign.at to separate files in test/data/. - -In addition to fixing the breakage, this patch should make it easier -to extend C / C++ standard edition detection in the future, by getting -rid of the if-else chains in AC_PROG_CC/CXX and by disentangling the -lists of command-line options to test from the logic. - -I also changed the manual to suggest people refer to the variables -‘ac_prog_cc_stdc’ and ‘ac_prog_cxx_stdcxx’ to learn which edition -of the C and C++ standards are selected; these are much easier to -work with than the ac_cv_prog_cc_cNN cache variables. - -* lib/autoconf/c.m4 (_AC_C_STD_TRY, _AC_PROG_CC_C99, _AC_PROG_CC_C11) - (_AC_CXX_STD_TRY, _AC_PROG_CXX_CXX98, _AC_PROG_CXX_CXX11): Remove macro. - - (_AC_C_C89_OPTIONS, _AC_C_C99_OPTIONS, _AC_C_C11_OPTIONS) - (_AC_PROG_CC_STDC_EDITION, _AC_PROG_CC_STDC_EDITION_TRY) - (_AC_CXX_CXX98_OPTIONS, _AC_CXX_CXX11_OPTIONS) - (_AC_PROG_CXX_STDCXX_EDITION, _AC_PROG_CXX_STDCXX_EDITION_TRY): New macros. - - (_AC_PROG_CC_C89): Convert to compatibility stub for std-gnu11.m4. - - (AC_PROG_CC): Use _AC_PROG_CC_STDC_EDITION. - (AC_PROG_CXX): Use _AC_PROG_CXX_STDCXX_EDITION. - -* tests/data/ax_prog_cc_for_build_v18.m4 -* tests/data/ax_prog_cxx_for_build_v3.m4 -* tests/data/gnulib_std_gnu11_2020_08_17.m4: New files. -* tests/foreign.at (AX_PROG_CC_FOR_BUILD, AX_PROG_CXX_FOR_BUILD): - Remove embedded copy of ax_prog_cc_for_build_v18.m4, - ax_prog_cxx_for_build_v3.m4 respectively. - (gnulib-std-gnu11.m4): New test. -* tests/local.mk: Distribute tests/data/*.m4. - -* doc/autoconf.texi (AC_PROG_CC, AC_PROG_CXX): Document use of - ac_prog_cc_stdc / ac_prog_cxx_stdcxx, respectively, to tell which - edition of the C / C++ standards are selected, instead of looking - through a series of cache variables with awkward definitions. ---- - doc/autoconf.texi | 45 +- - lib/autoconf/c.m4 | 444 +++++++++------- - tests/data/ax_prog_cc_for_build_v18.m4 | 139 +++++ - tests/data/ax_prog_cxx_for_build_v3.m4 | 110 ++++ - tests/data/gnulib_std_gnu11_2020_08_17.m4 | 824 ++++++++++++++++++++++++++++++ - tests/foreign.at | 215 ++------ - tests/local.mk | 7 +- - 7 files changed, 1384 insertions(+), 400 deletions(-) - create mode 100644 tests/data/ax_prog_cc_for_build_v18.m4 - create mode 100644 tests/data/ax_prog_cxx_for_build_v3.m4 - create mode 100644 tests/data/gnulib_std_gnu11_2020_08_17.m4 - ---- a/lib/autoconf/c.m4 -+++ b/lib/autoconf/c.m4 -@@ -498,19 +498,7 @@ else - GCC= - fi - _AC_PROG_CC_G --dnl --dnl Set ac_prog_cc_stdc to the supported C version. --dnl Also set the documented variable ac_cv_prog_cc_stdc; --dnl its name was chosen when it was cached, but it is no longer cached. --_AC_PROG_CC_C11([ac_prog_cc_stdc=c11 -- ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11], -- [_AC_PROG_CC_C99([ac_prog_cc_stdc=c99 -- ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99], -- [_AC_PROG_CC_C89([ac_prog_cc_stdc=c89 -- ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89], -- [ac_prog_cc_stdc=no -- ac_cv_prog_cc_stdc=no])])]) --dnl -+_AC_PROG_CC_STDC_EDITION - AC_LANG_POP(C)dnl - ])# AC_PROG_CC - -@@ -745,13 +733,7 @@ else - GXX= - fi - _AC_PROG_CXX_G --_AC_PROG_CXX_CXX11([ac_prog_cxx_stdcxx=cxx11 -- ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx11 -- ac_cv_prog_cxx_cxx98=$ac_cv_prog_cxx_cxx11], -- [_AC_PROG_CXX_CXX98([ac_prog_cxx_stdcxx=cxx98 -- ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx98], -- [ac_prog_cxx_stdcxx=no -- ac_cv_prog_cxx_stdcxx=no])]) -+_AC_PROG_CXX_STDCXX_EDITION - AC_LANG_POP(C++)dnl - ])# AC_PROG_CXX - -@@ -1496,114 +1478,170 @@ main (int argc, char **argv) - ]])]) - - --# _AC_C_STD_TRY(STANDARD, TEST-PROGRAM-HOLDER, OPTION-LIST, --# ACTION-IF-AVAILABLE, ACTION-IF-UNAVAILABLE) --# -------------------------------------------------------------- --# Check whether the C compiler accepts features of STANDARD (e.g `c89', `c99') --# by trying to compile the program in the shell variable TEST-PROGRAM-HOLDER. --# Caller is responsible for making sure this variable has been initialized. --# If compilation fails in the default mode, try again with each compiler --# option in the space-separated OPTION-LIST; if one helps, append it to CC. --# If eventually successful, run ACTION-IF-AVAILABLE, else ACTION-IF-UNAVAILABLE. --AC_DEFUN([_AC_C_STD_TRY], -+# _AC_C_C89_OPTIONS -+# ----------------- -+# Whitespace-separated list of options that might put the C compiler -+# into a mode conforming to ISO C1990 with extensions. Do not try -+# "strictly conforming" modes (e.g. gcc's -std=c90); they break some -+# systems' header files. If more than one option is needed, put -+# shell quotes around the group. -+# -+# AIX circa 2003 -qlanglvl=extc89 -+# old AIX -qlanglvl=ansi -+# Ultrix, OSF/1, Tru64 -std -+# HP-UX 10.20 and later -Ae -+# HP-UX older versions -Aa -D_HPUX_SOURCE -+# SVR4 -Xc -D__EXTENSIONS__ -+m4_define([_AC_C_C89_OPTIONS], [ -+ -qlanglvl=extc89 -+ -qlanglvl=ansi -+ -std -+ -Ae -+ "-Aa -D_HPUX_SOURCE" -+ "-Xc -D__EXTENSIONS__" -+]) -+ -+ -+# _AC_C_C99_OPTIONS -+# ----------------- -+# Whitespace-separated list of options that might put the C compiler -+# into a mode conforming to ISO C1999 with extensions. Do not try -+# "strictly conforming" modes (e.g. gcc's -std=c99); they break some -+# systems' header files. If more than one option is needed, put -+# shell quotes around the group. -+# -+# GCC, Clang -std=gnu99 -+# Intel ICC -std=c99, -c99 (deprecated) -+# Note: because -std=c99 puts GCC in strictly conforming mode, -+# this option must be tested *after* -std=gnu99. -+# IRIX -c99 -+# Tru64 -c99 -+# IBM XL C -qlanglvl=extc1x (V12.1; does not pass C11 test) -+# IBM XL C -qlanglvl=extc99 (pre-V12.1) -+# HP cc -AC99 -+# Solaris -D_STDC_C99= -+# Note: acc's -xc99 option uses linker magic to define the external -+# symbol __xpg4 as if by "int __xpg4 = 1;", which enables C99 -+# behavior for C library functions. This is not wanted here, -+# because it means that a single module compiled with -xc99 alters -+# C runtime behavior for the entire program, not for just the -+# module. Instead, define the (private) symbol _STDC_C99, which -+# suppresses a bogus failure in . The resulting compiler -+# passes the test case here, and that's good enough. -+# For more, please see the thread starting at: -+# https://lists.gnu.org/archive/html/autoconf/2010-12/msg00059.html -+m4_define([_AC_C_C99_OPTIONS], [ -+ -std=gnu99 -+ -std=c99 -+ -c99 -+ -qlanglvl=extc1x -+ -qlanglvl=extc99 -+ -AC99 -+ -D_STDC_C99= -+]) -+ -+ -+# _AC_C_C11_OPTIONS -+# ----------------- -+# Whitespace-separated list of options that might put the C compiler -+# into a mode conforming to ISO C2011 with extensions. Do not try -+# "strictly conforming" modes (e.g. gcc's -std=c11); they break some -+# systems' header files. If more than one option is needed, put -+# shell quotes around the group. -+# -+# GCC, Clang -std=gnu11 -+# -+# For IBM XL C for AIX V16.1 or later, '-std=gnu11' should work if -+# the user configured with CC='xlclang'. Otherwise, do not try -+# -qlanglvl=extc1x as xlc with IBM XL C V16.1 (the latest version as -+# of August 2020) does not pass the C11 test. Instead, try extc1x when -+# compiling the C99 test instead, since it enables _Static_assert and -+# _Noreturn, which is a win. -+m4_define([_AC_C_C11_OPTIONS], [ -+ -std=gnu11 -+]) -+ -+ -+# _AC_PROG_CC_STDC_EDITION_TRY(EDITION) -+# ------------------------------------- -+# Subroutine of _AC_PROG_CC_STDC_EDITION. Not to be called directly. -+# -+# Check whether the C compiler accepts features of EDITION of the -+# C standard. EDITION should be a two-digit year (e.g. 89, 99, 11). -+# (FIXME: Switch to four-digit years for futureproofing.) -+# This is done by compiling the test program defined by -+# _AC_C_C{EDITION}_TEST_PROGRAM, first with no additional -+# command-line options, and then with each of the options -+# in the space-separated list defined by _AC_C_C{EDITION}_OPTIONS. -+# -+# If we find a way to make the test program compile, set cache variable -+# ac_cv_prog_cc_cEDITION to the options required (if any), and add those -+# options to $CC. Set shell variable ac_prog_cc_stdc to `cEDITION', -+# and set shell variable ac_cv_prog_cc_stdc to the options required. -+# (Neither of these variables is AC_SUBSTed. ac_cv_prog_cc_stdc used -+# to be a cache variable and is preserved with this name for backward -+# compatibility.) Otherwise, ac_cv_prog_cc_cEDITION is set to `no' -+# and the other variables are not changed. -+# -+# If ac_prog_cc_stdc is already set to a value other than `no', -+# the shell code produced by this macro does nothing. This is so -+# _AC_PROG_CC_STDC_EDITION can use m4_map to iterate through -+# all the editions. -+AC_DEFUN([_AC_PROG_CC_STDC_EDITION_TRY], - [AC_LANG_ASSERT([C])]dnl --[AC_MSG_CHECKING([for $CC option to enable ]dnl --m4_translit($1, [c], [C])[ features]) --AC_CACHE_VAL([ac_cv_prog_cc_$1], --[ac_cv_prog_cc_$1=no -+[AC_REQUIRE([_AC_C_C$1_TEST_PROGRAM])]dnl -+[AS_IF([test x$ac_prog_cc_stdc = xno], -+[AC_MSG_CHECKING([for $CC option to enable C$1 features]) -+AC_CACHE_VAL([ac_cv_prog_cc_c$1], -+[ac_cv_prog_cc_c$1=no - ac_save_CC=$CC --AC_LANG_CONFTEST([AC_LANG_DEFINES_PROVIDED][$][$2]) --for ac_arg in '' $3 -+AC_LANG_CONFTEST([AC_LANG_DEFINES_PROVIDED][$][ac_c_conftest_c$1_program]) -+for ac_arg in '' m4_normalize(m4_defn([_AC_C_C$1_OPTIONS])) - do - CC="$ac_save_CC $ac_arg" -- _AC_COMPILE_IFELSE([], [ac_cv_prog_cc_$1=$ac_arg]) -- test "x$ac_cv_prog_cc_$1" != "xno" && break -+ _AC_COMPILE_IFELSE([], [ac_cv_prog_cc_c$1=$ac_arg]) -+ test "x$ac_cv_prog_cc_c$1" != "xno" && break - done - rm -f conftest.$ac_ext --CC=$ac_save_CC --])# AC_CACHE_VAL --ac_prog_cc_stdc_options= --AS_CASE(["x$ac_cv_prog_cc_$1"], -- [x], [AC_MSG_RESULT([none needed])], -- [xno], [AC_MSG_RESULT([unsupported])], -- [ac_prog_cc_stdc_options=" $ac_cv_prog_cc_$1" -- CC="$CC$ac_prog_cc_stdc_options" -- AC_MSG_RESULT([$ac_cv_prog_cc_$1])]) --AS_IF([test "x$ac_cv_prog_cc_$1" != xno], [$4], [$5]) --])# _AC_C_STD_TRY -- -- --# _AC_PROG_CC_C89 ([ACTION-IF-AVAILABLE], [ACTION-IF-UNAVAILABLE]) --# ---------------------------------------------------------------- --# If the C compiler is not in ANSI C89 (ISO C90) mode by default, try --# to add an option to output variable CC to make it so. -+CC=$ac_save_CC]) -+AS_IF([test "x$ac_cv_prog_cc_c$1" = xno], -+ [AC_MSG_RESULT([unsupported])], -+ [AS_IF([test "x$ac_cv_prog_cc_c$1" = x], -+ [AC_MSG_RESULT([none needed])], -+ [AC_MSG_RESULT([$ac_cv_prog_cc_c$1]) -+ CC="$CC $ac_cv_prog_cc_c$1"]) -+ ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c$1 -+ ac_prog_cc_stdc=c$1])]) -+]) -+ -+ -+# _AC_PROG_CC_STDC_EDITION -+# ------------------------ -+# Detect the most recent edition of the ISO C standard that is -+# supported by the C compiler. Add command-line options to $CC, if -+# necessary, to enable support for this edition. Set the shell -+# variable ac_prog_cc_stdc to indicate the edition. -+AC_DEFUN([_AC_PROG_CC_STDC_EDITION], -+[ac_prog_cc_stdc=no -+m4_map([_AC_PROG_CC_STDC_EDITION_TRY], [[11], [99], [89]])]) -+ -+ -+# _AC_PROG_CC_C89(ACTION-IF-SUPPORTED, ACTION-IF-NOT-SUPPORTED) -+# ------------------------------------------------------------- -+# Obsolete internal macro. No longer used by Autoconf itself, but -+# preserved for backward compatibility with pre-December 2020 versions -+# of Gnulib's std-gnu11.m4, which replaced the entire definition of -+# AC_PROG_CC *except* for this macro. Can be removed once everyone is -+# using Autoconf 2.70 and/or a current std-gnu11.m4. - AC_DEFUN([_AC_PROG_CC_C89], --[AC_REQUIRE([_AC_C_C89_TEST_PROGRAM])]dnl --[_AC_C_STD_TRY([c89], [ac_c_conftest_c89_program], --dnl Don't try gcc -ansi; that turns off useful extensions and --dnl breaks some systems' header files. --dnl AIX circa 2003 -qlanglvl=extc89 --dnl old AIX -qlanglvl=ansi --dnl Ultrix, OSF/1, Tru64 -std --dnl HP-UX 10.20 and later -Ae --dnl HP-UX older versions -Aa -D_HPUX_SOURCE --dnl SVR4 -Xc -D__EXTENSIONS__ --[-qlanglvl=extc89 -qlanglvl=ansi -std \ -- -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"], [$1], [$2])[]dnl --])# _AC_PROG_CC_C89 -- -- --# _AC_PROG_CC_C99 ([ACTION-IF-AVAILABLE], [ACTION-IF-UNAVAILABLE]) --# ---------------------------------------------------------------- --# If the C compiler is not in ISO C99 mode by default, try to add an --# option to output variable CC to make it so. --AC_DEFUN([_AC_PROG_CC_C99], --[AC_REQUIRE([_AC_C_C99_TEST_PROGRAM])]dnl --[_AC_C_STD_TRY([c99], [ac_c_conftest_c99_program], --dnl Try --dnl GCC -std=gnu99 (unused restrictive modes: -std=c99 -std=iso9899:1999) --dnl IBM XL C -qlanglvl=extc1x (V12.1; does not pass C11 test) --dnl IBM XL C -qlanglvl=extc99 --dnl (pre-V12.1; unused restrictive mode: -qlanglvl=stdc99) --dnl HP cc -AC99 --dnl Intel ICC -std=c99, -c99 (deprecated) --dnl IRIX -c99 --dnl Solaris -D_STDC_C99= --dnl cc's -xc99 option uses linker magic to define the external --dnl symbol __xpg4 as if by "int __xpg4 = 1;", which enables C99 --dnl behavior for C library functions. This is not wanted here, --dnl because it means that a single module compiled with -xc99 --dnl alters C runtime behavior for the entire program, not for --dnl just the module. Instead, define the (private) symbol --dnl _STDC_C99, which suppresses a bogus failure in . --dnl The resulting compiler passes the test case here, and that's --dnl good enough. For more, please see the thread starting at: --dnl https://lists.gnu.org/archive/html/autoconf/2010-12/msg00059.html --dnl Tru64 -c99 --dnl with extended modes being tried first. --[[-std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc1x -qlanglvl=extc99]], [$1], [$2])[]dnl --])# _AC_PROG_CC_C99 -- -- --# _AC_PROG_CC_C11 ([ACTION-IF-AVAILABLE], [ACTION-IF-UNAVAILABLE]) --# ---------------------------------------------------------------- --# If the C compiler is not in ISO C11 mode by default, try to add an --# option to output variable CC to make it so. --AC_DEFUN([_AC_PROG_CC_C11], --[AC_REQUIRE([_AC_C_C11_TEST_PROGRAM])]dnl --[_AC_C_STD_TRY([c11], [ac_c_conftest_c11_program], --dnl Try --dnl GCC -std=gnu11 (unused restrictive mode: -std=c11) --dnl with extended modes being tried first. --dnl --dnl For IBM XL C for AIX V16.1 or later, '-std=gnu11' should work if --dnl the user configured with CC='xlclang'. Otherwise, do not try --dnl -qlanglvl=extc1x as xlc with IBM XL C V16.1 (the latest version as --dnl of August 2020) does not pass the C11 test. Instead, try extc1x when --dnl compiling the C99 test instead, since it enables _Static_assert and --dnl _Noreturn, which is a win. --[[-std=gnu11]], [$1], [$2])[]dnl --])# _AC_PROG_CC_C11 -+[AC_REQUIRE([_AC_C_C89_TEST_GLOBALS])]dnl -+[AC_REQUIRE([_AC_C_C89_TEST_MAIN])]dnl -+[_AC_C_STD_TRY([c89], -+ [$ac_c_conftest_c89_globals], [$ac_c_conftest_c89_main], -+ m4_quote(m4_normalize(m4_defn([_AC_C_C89_OPTIONS]))), -+ [$1], -+ [$2])]) -+ - - - # AC_PROG_CC_C89 -@@ -2633,78 +2671,112 @@ main (int argc, char **argv) - " - ]])]) - -+# _AC_CXX_CXX98_OPTIONS -+# --------------------- -+# Whitespace-separated list of options that might put the C++ compiler -+# into a mode conforming to ISO C++ 1998 with extensions. Do not try -+# "strictly conforming" modes (e.g. gcc's -std=c++98); they break some -+# systems' header files. If more than one option is needed, put -+# shell quotes around the group. -+# -+# GCC -std=gnu++98 -+# Intel ICC -std=c++98 -+# Note: because -std=c++98 puts GCC in strictly conforming mode, -+# this option must be tested *after* -std=gnu++98. -+# IBM XL C -qlanglvl=extended -+# HP aC++ -AA -+# Solaris N/A (default) -+# Tru64 N/A (default, but -std gnu could be used) -+m4_define([_AC_CXX_CXX98_OPTIONS], [ -+ -std=gnu++98 -+ -std=c++98 -+ -qlanglvl=extended -+ -AA -+]) - --# _AC_CXX_STD_TRY(STANDARD, TEST-PROGRAM-HOLDER, OPTION-LIST, --# ACTION-IF-AVAILABLE, ACTION-IF-UNAVAILABLE) --# ---------------------------------------------------------------- --# Check whether the C++ compiler accepts features of STANDARD (e.g `cxx98', --# `cxx11') by trying to compile the program in the shell variable --# TEST-PROGRAM-HOLDER. Caller is responsible for making sure this variable --# has been initialized. If compilation fails in the default mode, try again --# with each compiler option in the space-separated OPTION-LIST; if one helps, --# append it to CXX. If eventually successful, run ACTION-IF-AVAILABLE, else --# ACTION-IF-UNAVAILABLE. -+# _AC_CXX_CXX11_OPTIONS -+# --------------------- -+# Whitespace-separated list of options that might put the C++ compiler -+# into a mode conforming to ISO C++ 2011 with extensions. Do not try -+# "strictly conforming" modes (e.g. gcc's -std=c++11); they break some -+# systems' header files. If more than one option is needed, put -+# shell quotes around the group. -+# -+# GCC -std=gnu++11, -std=gnu++0x -+# Intel ICC -std=c++11, -std=c++0x -+# Note: because -std=c++11 puts GCC in strictly conforming mode, -+# these options must be tested *after* -std=gnu++11. -+# IBM XL C -qlanglvl=extended0x (pre-V12.1) -+# HP aC++ -AA -+# Solaris N/A (no support) -+# Tru64 N/A (no support) -+m4_define([_AC_CXX_CXX11_OPTIONS], [ -+ -std=gnu++11 -+ -std=gnu++0x -+ -std=c++11 -+ -std=c++0x -+ -qlanglvl=extended0x -+ -AA -+]) - --AC_DEFUN([_AC_CXX_STD_TRY], -+# _AC_PROG_CXX_STDCXX_EDITION_TRY(EDITION) -+# ---------------------------------------- -+# Subroutine of _AC_PROG_CXX_STDCXX_EDITION. Not to be called directly. -+# -+# Check whether the C++ compiler accepts features of EDITION of the -+# C++ standard. EDITION should be a two-digit year (e.g. 98, 11). -+# (FIXME: Switch to four-digit years for futureproofing.) -+# This is done by compiling the test program defined by -+# _AC_C_CXX{EDITION}_TEST_PROGRAM, first with no additional -+# command-line options, and then with each of the options -+# in the space-separated list defined by _AC_C_CXX{EDITION}_OPTIONS. -+# -+# If we find a way to make the test program compile, set cache variable -+# ac_cv_prog_cxx_cxxEDITION to the options required (if any), and add those -+# options to $CXX. Set shell variable ac_prog_cxx_stdcxx to `cxxEDITION', -+# and set shell variable ac_cv_prog_cxx_stdcxx to the options required. -+# (Neither of these variables is AC_SUBSTed. ac_cv_prog_cxx_stdcxx used -+# to be a cache variable and is preserved with this name for backward -+# compatibility.) Otherwise, ac_cv_prog_cxx_cxxEDITION is set to `no' -+# and the other variables are not changed. -+# -+# If ac_prog_cxx_stdcxx is already set to a value other than `no', -+# the shell code produced by this macro does nothing. This is so -+# _AC_PROG_CXX_STDCXX_EDITION can use m4_map to iterate through -+# all the editions. -+AC_DEFUN([_AC_PROG_CXX_STDCXX_EDITION_TRY], - [AC_LANG_ASSERT([C++])]dnl --[AC_MSG_CHECKING([for $CXX option to enable ]dnl --m4_translit([$1], [a-wxyz], [A-W+YZ])[ features]) -+[AC_REQUIRE([_AC_CXX_CXX$1_TEST_PROGRAM])]dnl -+[AS_IF([test x$ac_prog_cxx_stdcxx = xno], -+[AC_MSG_CHECKING([for $CXX option to enable C++$1 features]) - AC_CACHE_VAL(ac_cv_prog_cxx_$1, - [ac_cv_prog_cxx_$1=no - ac_save_CXX=$CXX --AC_LANG_CONFTEST([AC_LANG_DEFINES_PROVIDED][$][$2]) --for ac_arg in '' $3 -+AC_LANG_CONFTEST([AC_LANG_DEFINES_PROVIDED][$][ac_cxx_conftest_cxx$1_program]) -+for ac_arg in '' m4_normalize(m4_defn([_AC_CXX_CXX$1_OPTIONS])) - do - CXX="$ac_save_CXX $ac_arg" -- _AC_COMPILE_IFELSE([], [ac_cv_prog_cxx_$1=$ac_arg]) -- test "x$ac_cv_prog_cxx_$1" != "xno" && break -+ _AC_COMPILE_IFELSE([], [ac_cv_prog_cxx_cxx$1=$ac_arg]) -+ test "x$ac_cv_prog_cxx_cxx$1" != "xno" && break - done - rm -f conftest.$ac_ext --CXX=$ac_save_CXX --])# AC_CACHE_VAL --ac_prog_cxx_stdcxx_options= --AS_CASE(["x$ac_cv_prog_cxx_$1"], -- [x], [AC_MSG_RESULT([none needed])], -- [xno], [AC_MSG_RESULT([unsupported])], -- [ac_prog_cxx_stdcxx_options=" $ac_cv_prog_cxx_$1" -- CXX=$CXX$ac_prog_cxx_stdcxx_options -- AC_MSG_RESULT([$ac_cv_prog_cxx_$1])]) --AS_IF([test "x$ac_cv_prog_cxx_$1" != xno], [$4], [$5]) --])# _AC_CXX_STD_TRY -- --# _AC_PROG_CXX_CXX98 ([ACTION-IF-AVAILABLE], [ACTION-IF-UNAVAILABLE]) --# ------------------------------------------------------------------- --# If the C++ compiler is not in ISO C++98 mode by default, try to add --# an option to output variable CXX to make it so. --AC_DEFUN([_AC_PROG_CXX_CXX98], --[AC_REQUIRE([_AC_CXX_CXX98_TEST_PROGRAM])]dnl --[_AC_CXX_STD_TRY([cxx98], [ac_cxx_conftest_cxx98_program], --dnl Try --dnl GCC -std=gnu++98 (unused restrictive mode: -std=c++98) --dnl IBM XL C -qlanglvl=extended --dnl HP aC++ -AA --dnl Intel ICC -std=gnu++98 --dnl Solaris N/A (default) --dnl Tru64 N/A (default, but -std gnu could be used) --dnl with extended modes being tried first. --[[-std=gnu++98 -std=c++98 -qlanglvl=extended -AA]], [$1], [$2])[]dnl --])# _AC_PROG_CXX_CXX98 -- --# _AC_PROG_CXX_CXX11 ([ACTION-IF-AVAILABLE], [ACTION-IF-UNAVAILABLE]) --# ------------------------------------------------------------------- --# If the C++ compiler is not in ISO CXX11 mode by default, try to add --# an option to output variable CXX to make it so. --AC_DEFUN([_AC_PROG_CXX_CXX11], --[AC_REQUIRE([_AC_CXX_CXX11_TEST_PROGRAM])]dnl --[_AC_CXX_STD_TRY([cxx11], [ac_cxx_conftest_cxx11_program], --dnl Try --dnl GCC -std=gnu++11 (unused restrictive mode: -std=c++11) [and 0x variants] --dnl IBM XL C -qlanglvl=extended0x --dnl (pre-V12.1; unused restrictive mode: -qlanglvl=stdcxx11) --dnl HP aC++ -AA --dnl Intel ICC -std=c++11 -std=c++0x --dnl Solaris N/A (no support) --dnl Tru64 N/A (no support) --dnl with extended modes being tried first. --[[-std=gnu++11 -std=c++11 -std=gnu++0x -std=c++0x -qlanglvl=extended0x -AA]], [$1], [$2])[]dnl --])# _AC_PROG_CXX_CXX11 -+CXX=$ac_save_CXX]) -+AS_IF([test "x$ac_cv_prog_cxx_cxx$1" = xno], -+ [AC_MSG_RESULT([unsupported])], -+ [AS_IF([test "x$ac_cv_prog_cxx_cxx$1" = x], -+ [AC_MSG_RESULT([none needed])], -+ [AC_MSG_RESULT([$ac_cv_prog_cxx_cxx$1]) -+ CXX="$CXX $ac_cv_prog_cxx_cxx$1"]) -+ ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx$1 -+ ac_prog_cxx_stdcxx=cxx$1])]) -+]) -+ -+# _AC_PROG_CXX_STDCXX_EDITION -+# --------------------------- -+# Detect the most recent edition of the ISO C++ standard that is -+# supported by the C++ compiler. Add command-line options to $CXX, -+# if necessary, to enable support for this edition. Set the shell -+# variable ac_prog_cxx_stdcxx to indicate the edition. -+AC_DEFUN([_AC_PROG_CXX_STDCXX_EDITION], -+[ac_prog_cxx_stdcxx=no -+m4_map([_AC_PROG_CXX_STDCXX_EDITION_TRY], [[11], [98]])]) -diff --git a/tests/data/ax_prog_cc_for_build_v18.m4 b/tests/data/ax_prog_cc_for_build_v18.m4 -new file mode 100644 -index 00000000..f7410d74 ---- /dev/null -+++ b/tests/data/ax_prog_cc_for_build_v18.m4 -@@ -0,0 +1,139 @@ -+# =========================================================================== -+# https://www.gnu.org/software/autoconf-archive/ax_prog_cc_for_build.html -+# =========================================================================== -+# -+# SYNOPSIS -+# -+# AX_PROG_CC_FOR_BUILD -+# -+# DESCRIPTION -+# -+# This macro searches for a C compiler that generates native executables, -+# that is a C compiler that surely is not a cross-compiler. This can be -+# useful if you have to generate source code at compile-time like for -+# example GCC does. -+# -+# The macro sets the CC_FOR_BUILD and CPP_FOR_BUILD macros to anything -+# needed to compile or link (CC_FOR_BUILD) and preprocess (CPP_FOR_BUILD). -+# The value of these variables can be overridden by the user by specifying -+# a compiler with an environment variable (like you do for standard CC). -+# -+# It also sets BUILD_EXEEXT and BUILD_OBJEXT to the executable and object -+# file extensions for the build platform, and GCC_FOR_BUILD to `yes' if -+# the compiler we found is GCC. All these variables but GCC_FOR_BUILD are -+# substituted in the Makefile. -+# -+# LICENSE -+# -+# Copyright (c) 2008 Paolo Bonzini -+# -+# 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 18 -+ -+AU_ALIAS([AC_PROG_CC_FOR_BUILD], [AX_PROG_CC_FOR_BUILD]) -+AC_DEFUN([AX_PROG_CC_FOR_BUILD], [dnl -+AC_REQUIRE([AC_PROG_CC])dnl -+AC_REQUIRE([AC_PROG_CPP])dnl -+AC_REQUIRE([AC_CANONICAL_BUILD])dnl -+ -+dnl Use the standard macros, but make them use other variable names -+dnl -+pushdef([ac_cv_prog_CPP], ac_cv_build_prog_CPP)dnl -+pushdef([ac_cv_prog_cc_c89], ac_cv_build_prog_cc_c89)dnl -+pushdef([ac_cv_prog_gcc], ac_cv_build_prog_gcc)dnl -+pushdef([ac_cv_prog_cc_works], ac_cv_build_prog_cc_works)dnl -+pushdef([ac_cv_prog_cc_cross], ac_cv_build_prog_cc_cross)dnl -+pushdef([ac_cv_prog_cc_g], ac_cv_build_prog_cc_g)dnl -+pushdef([ac_cv_c_compiler_gnu], ac_cv_build_c_compiler_gnu)dnl -+pushdef([ac_cv_exeext], ac_cv_build_exeext)dnl -+pushdef([ac_cv_objext], ac_cv_build_objext)dnl -+pushdef([ac_exeext], ac_build_exeext)dnl -+pushdef([ac_objext], ac_build_objext)dnl -+pushdef([CC], CC_FOR_BUILD)dnl -+pushdef([CPP], CPP_FOR_BUILD)dnl -+pushdef([GCC], GCC_FOR_BUILD)dnl -+pushdef([CFLAGS], CFLAGS_FOR_BUILD)dnl -+pushdef([CPPFLAGS], CPPFLAGS_FOR_BUILD)dnl -+pushdef([EXEEXT], BUILD_EXEEXT)dnl -+pushdef([LDFLAGS], LDFLAGS_FOR_BUILD)dnl -+pushdef([OBJEXT], BUILD_OBJEXT)dnl -+pushdef([host], build)dnl -+pushdef([host_alias], build_alias)dnl -+pushdef([host_cpu], build_cpu)dnl -+pushdef([host_vendor], build_vendor)dnl -+pushdef([host_os], build_os)dnl -+pushdef([ac_cv_host], ac_cv_build)dnl -+pushdef([ac_cv_host_alias], ac_cv_build_alias)dnl -+pushdef([ac_cv_host_cpu], ac_cv_build_cpu)dnl -+pushdef([ac_cv_host_vendor], ac_cv_build_vendor)dnl -+pushdef([ac_cv_host_os], ac_cv_build_os)dnl -+pushdef([ac_tool_prefix], ac_build_tool_prefix)dnl -+pushdef([am_cv_CC_dependencies_compiler_type], am_cv_build_CC_dependencies_compiler_type)dnl -+pushdef([am_cv_prog_cc_c_o], am_cv_build_prog_cc_c_o)dnl -+pushdef([cross_compiling], cross_compiling_build)dnl -+ -+cross_compiling_build=no -+ -+ac_build_tool_prefix= -+AS_IF([test -n "$build"], [ac_build_tool_prefix="$build-"], -+ [test -n "$build_alias"],[ac_build_tool_prefix="$build_alias-"]) -+ -+AC_LANG_PUSH([C]) -+AC_PROG_CC -+_AC_COMPILER_EXEEXT -+_AC_COMPILER_OBJEXT -+AC_PROG_CPP -+ -+dnl Restore the old definitions -+dnl -+popdef([cross_compiling])dnl -+popdef([am_cv_prog_cc_c_o])dnl -+popdef([am_cv_CC_dependencies_compiler_type])dnl -+popdef([ac_tool_prefix])dnl -+popdef([ac_cv_host_os])dnl -+popdef([ac_cv_host_vendor])dnl -+popdef([ac_cv_host_cpu])dnl -+popdef([ac_cv_host_alias])dnl -+popdef([ac_cv_host])dnl -+popdef([host_os])dnl -+popdef([host_vendor])dnl -+popdef([host_cpu])dnl -+popdef([host_alias])dnl -+popdef([host])dnl -+popdef([OBJEXT])dnl -+popdef([LDFLAGS])dnl -+popdef([EXEEXT])dnl -+popdef([CPPFLAGS])dnl -+popdef([CFLAGS])dnl -+popdef([GCC])dnl -+popdef([CPP])dnl -+popdef([CC])dnl -+popdef([ac_objext])dnl -+popdef([ac_exeext])dnl -+popdef([ac_cv_objext])dnl -+popdef([ac_cv_exeext])dnl -+popdef([ac_cv_c_compiler_gnu])dnl -+popdef([ac_cv_prog_cc_g])dnl -+popdef([ac_cv_prog_cc_cross])dnl -+popdef([ac_cv_prog_cc_works])dnl -+popdef([ac_cv_prog_cc_c89])dnl -+popdef([ac_cv_prog_gcc])dnl -+popdef([ac_cv_prog_CPP])dnl -+ -+dnl restore global variables ac_ext, ac_cpp, ac_compile, -+dnl ac_link, ac_compiler_gnu (dependant on the current -+dnl language after popping): -+AC_LANG_POP([C]) -+ -+dnl Finally, set Makefile variables -+dnl -+AC_SUBST(BUILD_EXEEXT)dnl -+AC_SUBST(BUILD_OBJEXT)dnl -+AC_SUBST([CFLAGS_FOR_BUILD])dnl -+AC_SUBST([CPPFLAGS_FOR_BUILD])dnl -+AC_SUBST([LDFLAGS_FOR_BUILD])dnl -+]) -diff --git a/tests/data/ax_prog_cxx_for_build_v3.m4 b/tests/data/ax_prog_cxx_for_build_v3.m4 -new file mode 100644 -index 00000000..17c19a89 ---- /dev/null -+++ b/tests/data/ax_prog_cxx_for_build_v3.m4 -@@ -0,0 +1,110 @@ -+# =========================================================================== -+# https://www.gnu.org/software/autoconf-archive/ax_prog_cxx_for_build.html -+# =========================================================================== -+# -+# SYNOPSIS -+# -+# AX_PROG_CXX_FOR_BUILD -+# -+# DESCRIPTION -+# -+# This macro searches for a C++ compiler that generates native -+# executables, that is a C++ compiler that surely is not a cross-compiler. -+# This can be useful if you have to generate source code at compile-time -+# like for example GCC does. -+# -+# The macro sets the CXX_FOR_BUILD and CXXCPP_FOR_BUILD macros to anything -+# needed to compile or link (CXX_FOR_BUILD) and preprocess -+# (CXXCPP_FOR_BUILD). The value of these variables can be overridden by -+# the user by specifying a compiler with an environment variable (like you -+# do for standard CXX). -+# -+# LICENSE -+# -+# Copyright (c) 2008 Paolo Bonzini -+# Copyright (c) 2012 Avionic Design GmbH -+# -+# Based on the AX_PROG_CC_FOR_BUILD macro by Paolo Bonzini. -+# -+# 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 3 -+ -+AU_ALIAS([AC_PROG_CXX_FOR_BUILD], [AX_PROG_CXX_FOR_BUILD]) -+AC_DEFUN([AX_PROG_CXX_FOR_BUILD], [dnl -+AC_REQUIRE([AX_PROG_CC_FOR_BUILD])dnl -+AC_REQUIRE([AC_PROG_CXX])dnl -+AC_REQUIRE([AC_PROG_CXXCPP])dnl -+AC_REQUIRE([AC_CANONICAL_HOST])dnl -+ -+dnl Use the standard macros, but make them use other variable names -+dnl -+pushdef([ac_cv_prog_CXXCPP], ac_cv_build_prog_CXXCPP)dnl -+pushdef([ac_cv_prog_gxx], ac_cv_build_prog_gxx)dnl -+pushdef([ac_cv_prog_cxx_works], ac_cv_build_prog_cxx_works)dnl -+pushdef([ac_cv_prog_cxx_cross], ac_cv_build_prog_cxx_cross)dnl -+pushdef([ac_cv_prog_cxx_g], ac_cv_build_prog_cxx_g)dnl -+pushdef([CXX], CXX_FOR_BUILD)dnl -+pushdef([CXXCPP], CXXCPP_FOR_BUILD)dnl -+pushdef([CXXFLAGS], CXXFLAGS_FOR_BUILD)dnl -+pushdef([CPPFLAGS], CPPFLAGS_FOR_BUILD)dnl -+pushdef([CXXCPPFLAGS], CXXCPPFLAGS_FOR_BUILD)dnl -+pushdef([host], build)dnl -+pushdef([host_alias], build_alias)dnl -+pushdef([host_cpu], build_cpu)dnl -+pushdef([host_vendor], build_vendor)dnl -+pushdef([host_os], build_os)dnl -+pushdef([ac_cv_host], ac_cv_build)dnl -+pushdef([ac_cv_host_alias], ac_cv_build_alias)dnl -+pushdef([ac_cv_host_cpu], ac_cv_build_cpu)dnl -+pushdef([ac_cv_host_vendor], ac_cv_build_vendor)dnl -+pushdef([ac_cv_host_os], ac_cv_build_os)dnl -+pushdef([ac_cxxcpp], ac_build_cxxcpp)dnl -+pushdef([ac_compile], ac_build_compile)dnl -+pushdef([ac_link], ac_build_link)dnl -+ -+save_cross_compiling=$cross_compiling -+save_ac_tool_prefix=$ac_tool_prefix -+cross_compiling=no -+ac_tool_prefix= -+ -+AC_PROG_CXX -+AC_PROG_CXXCPP -+ -+ac_tool_prefix=$save_ac_tool_prefix -+cross_compiling=$save_cross_compiling -+ -+dnl Restore the old definitions -+dnl -+popdef([ac_link])dnl -+popdef([ac_compile])dnl -+popdef([ac_cxxcpp])dnl -+popdef([ac_cv_host_os])dnl -+popdef([ac_cv_host_vendor])dnl -+popdef([ac_cv_host_cpu])dnl -+popdef([ac_cv_host_alias])dnl -+popdef([ac_cv_host])dnl -+popdef([host_os])dnl -+popdef([host_vendor])dnl -+popdef([host_cpu])dnl -+popdef([host_alias])dnl -+popdef([host])dnl -+popdef([CXXCPPFLAGS])dnl -+popdef([CPPFLAGS])dnl -+popdef([CXXFLAGS])dnl -+popdef([CXXCPP])dnl -+popdef([CXX])dnl -+popdef([ac_cv_prog_cxx_g])dnl -+popdef([ac_cv_prog_cxx_cross])dnl -+popdef([ac_cv_prog_cxx_works])dnl -+popdef([ac_cv_prog_gxx])dnl -+popdef([ac_cv_prog_CXXCPP])dnl -+ -+dnl Finally, set Makefile variables -+dnl -+AC_SUBST([CXXFLAGS_FOR_BUILD])dnl -+AC_SUBST([CXXCPPFLAGS_FOR_BUILD])dnl -+]) -diff --git a/tests/data/gnulib_std_gnu11_2020_08_17.m4 b/tests/data/gnulib_std_gnu11_2020_08_17.m4 -new file mode 100644 -index 00000000..db833d82 ---- /dev/null -+++ b/tests/data/gnulib_std_gnu11_2020_08_17.m4 -@@ -0,0 +1,824 @@ -+# Prefer GNU C11 and C++11 to earlier versions. -*- coding: utf-8 -*- -+ -+# This implementation is taken from GNU Autoconf lib/autoconf/c.m4 -+# commit 017d5ddd82854911f0119691d91ea8a1438824d6 -+# dated Sun Apr 3 13:57:17 2016 -0700 -+# This implementation will be obsolete once we can assume Autoconf 2.70 -+# or later is installed everywhere a Gnulib program might be developed. -+ -+ -+# Copyright (C) 2001-2020 Free Software Foundation, Inc. -+ -+# 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. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+ -+# Written by David MacKenzie, with help from -+# Akim Demaille, Paul Eggert, -+# François Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor, -+# Roland McGrath, Noah Friedman, david d zuhn, and many others. -+ -+ -+# AC_PROG_CC([COMPILER ...]) -+# -------------------------- -+# COMPILER ... is a space separated list of C compilers to search for. -+# This just gives the user an opportunity to specify an alternative -+# search list for the C compiler. -+AC_DEFUN_ONCE([AC_PROG_CC], -+[AC_LANG_PUSH(C)dnl -+AC_ARG_VAR([CC], [C compiler command])dnl -+AC_ARG_VAR([CFLAGS], [C compiler flags])dnl -+_AC_ARG_VAR_LDFLAGS()dnl -+_AC_ARG_VAR_LIBS()dnl -+_AC_ARG_VAR_CPPFLAGS()dnl -+m4_ifval([$1], -+ [AC_CHECK_TOOLS(CC, [$1])], -+[AC_CHECK_TOOL(CC, gcc) -+if test -z "$CC"; then -+ dnl Here we want: -+ dnl AC_CHECK_TOOL(CC, cc) -+ dnl but without the check for a tool without the prefix. -+ dnl Until the check is removed from there, copy the code: -+ if test -n "$ac_tool_prefix"; then -+ AC_CHECK_PROG(CC, [${ac_tool_prefix}cc], [${ac_tool_prefix}cc]) -+ fi -+fi -+if test -z "$CC"; then -+ AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) -+fi -+if test -z "$CC"; then -+ AC_CHECK_TOOLS(CC, cl.exe) -+fi -+if test -z "$CC"; then -+ AC_CHECK_TOOL(CC, clang) -+fi -+]) -+ -+test -z "$CC" && AC_MSG_FAILURE([no acceptable C compiler found in \$PATH]) -+ -+# Provide some information about the compiler. -+_AS_ECHO_LOG([checking for _AC_LANG compiler version]) -+set X $ac_compile -+ac_compiler=$[2] -+for ac_option in --version -v -V -qversion -version; do -+ _AC_DO_LIMIT([$ac_compiler $ac_option >&AS_MESSAGE_LOG_FD]) -+done -+ -+m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl -+m4_expand_once([_AC_COMPILER_OBJEXT])[]dnl -+_AC_LANG_COMPILER_GNU -+if test $ac_compiler_gnu = yes; then -+ GCC=yes -+else -+ GCC= -+fi -+_AC_PROG_CC_G -+dnl -+dnl Set ac_prog_cc_stdc to the supported C version. -+dnl Also set the documented variable ac_cv_prog_cc_stdc; -+dnl its name was chosen when it was cached, but it is no longer cached. -+_AC_PROG_CC_C11([ac_prog_cc_stdc=c11 -+ ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11], -+ [_AC_PROG_CC_C99([ac_prog_cc_stdc=c99 -+ ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99], -+ [_AC_PROG_CC_C89([ac_prog_cc_stdc=c89 -+ ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89], -+ [ac_prog_cc_stdc=no -+ ac_cv_prog_cc_stdc=no])])]) -+dnl -+AC_LANG_POP(C)dnl -+])# AC_PROG_CC -+ -+ -+ -+# AC_PROG_CXX([LIST-OF-COMPILERS]) -+# -------------------------------- -+# LIST-OF-COMPILERS is a space separated list of C++ compilers to search -+# for (if not specified, a default list is used). This just gives the -+# user an opportunity to specify an alternative search list for the C++ -+# compiler. -+# aCC HP-UX C++ compiler much better than `CC', so test before. -+# FCC Fujitsu C++ compiler -+# KCC KAI C++ compiler -+# RCC Rational C++ -+# xlC_r AIX C Set++ (with support for reentrant code) -+# xlC AIX C Set++ -+AC_DEFUN([AC_PROG_CXX], -+[AC_LANG_PUSH(C++)dnl -+AC_ARG_VAR([CXX], [C++ compiler command])dnl -+AC_ARG_VAR([CXXFLAGS], [C++ compiler flags])dnl -+_AC_ARG_VAR_LDFLAGS()dnl -+_AC_ARG_VAR_LIBS()dnl -+_AC_ARG_VAR_CPPFLAGS()dnl -+_AC_ARG_VAR_PRECIOUS([CCC])dnl -+if test -z "$CXX"; then -+ if test -n "$CCC"; then -+ CXX=$CCC -+ else -+ AC_CHECK_TOOLS(CXX, -+ [m4_default([$1], -+ [g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++])], -+ g++) -+ fi -+fi -+# Provide some information about the compiler. -+_AS_ECHO_LOG([checking for _AC_LANG compiler version]) -+set X $ac_compile -+ac_compiler=$[2] -+for ac_option in --version -v -V -qversion; do -+ _AC_DO_LIMIT([$ac_compiler $ac_option >&AS_MESSAGE_LOG_FD]) -+done -+ -+m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl -+m4_expand_once([_AC_COMPILER_OBJEXT])[]dnl -+_AC_LANG_COMPILER_GNU -+if test $ac_compiler_gnu = yes; then -+ GXX=yes -+else -+ GXX= -+fi -+_AC_PROG_CXX_G -+_AC_PROG_CXX_CXX11([ac_prog_cxx_stdcxx=cxx11 -+ ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx11 -+ ac_cv_prog_cxx_cxx98=$ac_cv_prog_cxx_cxx11], -+ [_AC_PROG_CXX_CXX98([ac_prog_cxx_stdcxx=cxx98 -+ ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx98], -+ [ac_prog_cxx_stdcxx=no -+ ac_cv_prog_cxx_stdcxx=no])]) -+AC_LANG_POP(C++)dnl -+])# AC_PROG_CXX -+ -+ -+# _AC_C_STD_TRY(STANDARD, TEST-PROLOGUE, TEST-BODY, OPTION-LIST, -+# ACTION-IF-AVAILABLE, ACTION-IF-UNAVAILABLE) -+# -------------------------------------------------------------- -+# Check whether the C compiler accepts features of STANDARD (e.g `c89', `c99') -+# by trying to compile a program of TEST-PROLOGUE and TEST-BODY. If this fails, -+# try again with each compiler option in the space-separated OPTION-LIST; if one -+# helps, append it to CC. If eventually successful, run ACTION-IF-AVAILABLE, -+# else ACTION-IF-UNAVAILABLE. -+AC_DEFUN([_AC_C_STD_TRY], -+[AC_MSG_CHECKING([for $CC option to enable ]m4_translit($1, [c], [C])[ features]) -+AC_CACHE_VAL(ac_cv_prog_cc_$1, -+[ac_cv_prog_cc_$1=no -+ac_save_CC=$CC -+AC_LANG_CONFTEST([AC_LANG_PROGRAM([$2], [$3])]) -+for ac_arg in '' $4 -+do -+ CC="$ac_save_CC $ac_arg" -+ _AC_COMPILE_IFELSE([], [ac_cv_prog_cc_$1=$ac_arg]) -+ test "x$ac_cv_prog_cc_$1" != "xno" && break -+done -+rm -f conftest.$ac_ext -+CC=$ac_save_CC -+])# AC_CACHE_VAL -+ac_prog_cc_stdc_options= -+case "x$ac_cv_prog_cc_$1" in -+ x) -+ AC_MSG_RESULT([none needed]) ;; -+ xno) -+ AC_MSG_RESULT([unsupported]) ;; -+ *) -+ ac_prog_cc_stdc_options=" $ac_cv_prog_cc_$1" -+ CC=$CC$ac_prog_cc_stdc_options -+ AC_MSG_RESULT([$ac_cv_prog_cc_$1]) ;; -+esac -+AS_IF([test "x$ac_cv_prog_cc_$1" != xno], [$5], [$6]) -+])# _AC_C_STD_TRY -+ -+# _AC_C_C99_TEST_HEADER -+# --------------------- -+# A C header suitable for testing for C99. -+AC_DEFUN([_AC_C_C99_TEST_HEADER], -+[[#include -+#include -+#include -+#include -+#include -+#include -+ -+// Check varargs macros. These examples are taken from C99 6.10.3.5. -+#define debug(...) fprintf (stderr, __VA_ARGS__) -+#define showlist(...) puts (#__VA_ARGS__) -+#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) -+static void -+test_varargs_macros (void) -+{ -+ int x = 1234; -+ int y = 5678; -+ debug ("Flag"); -+ debug ("X = %d\n", x); -+ showlist (The first, second, and third items.); -+ report (x>y, "x is %d but y is %d", x, y); -+} -+ -+// Check long long types. -+#define BIG64 18446744073709551615ull -+#define BIG32 4294967295ul -+#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) -+#if !BIG_OK -+ your preprocessor is broken; -+#endif -+#if BIG_OK -+#else -+ your preprocessor is broken; -+#endif -+static long long int bignum = -9223372036854775807LL; -+static unsigned long long int ubignum = BIG64; -+ -+struct incomplete_array -+{ -+ int datasize; -+ double data[]; -+}; -+ -+struct named_init { -+ int number; -+ const wchar_t *name; -+ double average; -+}; -+ -+typedef const char *ccp; -+ -+static inline int -+test_restrict (ccp restrict text) -+{ -+ // See if C++-style comments work. -+ // Iterate through items via the restricted pointer. -+ // Also check for declarations in for loops. -+ for (unsigned int i = 0; *(text+i) != '\0'; ++i) -+ continue; -+ return 0; -+} -+ -+// Check varargs and va_copy. -+static bool -+test_varargs (const char *format, ...) -+{ -+ va_list args; -+ va_start (args, format); -+ va_list args_copy; -+ va_copy (args_copy, args); -+ -+ const char *str = ""; -+ int number = 0; -+ float fnumber = 0; -+ -+ while (*format) -+ { -+ switch (*format++) -+ { -+ case 's': // string -+ str = va_arg (args_copy, const char *); -+ break; -+ case 'd': // int -+ number = va_arg (args_copy, int); -+ break; -+ case 'f': // float -+ fnumber = va_arg (args_copy, double); -+ break; -+ default: -+ break; -+ } -+ } -+ va_end (args_copy); -+ va_end (args); -+ -+ return *str && number && fnumber; -+}]])# _AC_C_C99_TEST_HEADER -+ -+# _AC_C_C99_TEST_BODY -+# ------------------- -+# A C body suitable for testing for C99, assuming the corresponding header. -+AC_DEFUN([_AC_C_C99_TEST_BODY], -+[[ -+ // Check bool. -+ _Bool success = false; -+ -+ // Check restrict. -+ if (test_restrict ("String literal") == 0) -+ success = true; -+ char *restrict newvar = "Another string"; -+ -+ // Check varargs. -+ success &= test_varargs ("s, d' f .", "string", 65, 34.234); -+ test_varargs_macros (); -+ -+ // Check flexible array members. -+ struct incomplete_array *ia = -+ malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); -+ ia->datasize = 10; -+ for (int i = 0; i < ia->datasize; ++i) -+ ia->data[i] = i * 1.234; -+ -+ // Check named initializers. -+ struct named_init ni = { -+ .number = 34, -+ .name = L"Test wide string", -+ .average = 543.34343, -+ }; -+ -+ ni.number = 58; -+ -+ int dynamic_array[ni.number]; -+ dynamic_array[ni.number - 1] = 543; -+ -+ // work around unused variable warnings -+ return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x' -+ || dynamic_array[ni.number - 1] != 543); -+]]) -+ -+# _AC_PROG_CC_C99 ([ACTION-IF-AVAILABLE], [ACTION-IF-UNAVAILABLE]) -+# ---------------------------------------------------------------- -+# If the C compiler is not in ISO C99 mode by default, try to add an -+# option to output variable CC to make it so. This macro tries -+# various options that select ISO C99 on some system or another. It -+# considers the compiler to be in ISO C99 mode if it handles _Bool, -+# // comments, flexible array members, inline, long long int, mixed -+# code and declarations, named initialization of structs, restrict, -+# va_copy, varargs macros, variable declarations in for loops and -+# variable length arrays. -+AC_DEFUN([_AC_PROG_CC_C99], -+[_AC_C_STD_TRY([c99], -+[_AC_C_C99_TEST_HEADER], -+[_AC_C_C99_TEST_BODY], -+dnl Try -+dnl GCC -std=gnu99 (unused restrictive modes: -std=c99 -std=iso9899:1999) -+dnl IBM XL C -qlanglvl=extc1x (V12.1; does not pass C11 test) -+dnl IBM XL C -qlanglvl=extc99 -+dnl (pre-V12.1; unused restrictive mode: -qlanglvl=stdc99) -+dnl HP cc -AC99 -+dnl Intel ICC -std=c99, -c99 (deprecated) -+dnl IRIX -c99 -+dnl Solaris -D_STDC_C99= -+dnl cc's -xc99 option uses linker magic to define the external -+dnl symbol __xpg4 as if by "int __xpg4 = 1;", which enables C99 -+dnl behavior for C library functions. This is not wanted here, -+dnl because it means that a single module compiled with -xc99 -+dnl alters C runtime behavior for the entire program, not for -+dnl just the module. Instead, define the (private) symbol -+dnl _STDC_C99, which suppresses a bogus failure in . -+dnl The resulting compiler passes the test case here, and that's -+dnl good enough. For more, please see the thread starting at: -+dnl https://lists.gnu.org/r/autoconf/2010-12/msg00059.html -+dnl Tru64 -c99 -+dnl with extended modes being tried first. -+[[-std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc1x -qlanglvl=extc99]], [$1], [$2])[]dnl -+])# _AC_PROG_CC_C99 -+ -+ -+# _AC_PROG_CC_C11 ([ACTION-IF-AVAILABLE], [ACTION-IF-UNAVAILABLE]) -+# ---------------------------------------------------------------- -+# If the C compiler is not in ISO C11 mode by default, try to add an -+# option to output variable CC to make it so. This macro tries -+# various options that select ISO C11 on some system or another. It -+# considers the compiler to be in ISO C11 mode if it handles _Alignas, -+# _Alignof, _Noreturn, _Static_assert, UTF-8 string literals, -+# duplicate typedefs, and anonymous structures and unions. -+AC_DEFUN([_AC_PROG_CC_C11], -+[_AC_C_STD_TRY([c11], -+[_AC_C_C99_TEST_HEADER[ -+// Check _Alignas. -+char _Alignas (double) aligned_as_double; -+char _Alignas (0) no_special_alignment; -+extern char aligned_as_int; -+char _Alignas (0) _Alignas (int) aligned_as_int; -+ -+// Check _Alignof. -+enum -+{ -+ int_alignment = _Alignof (int), -+ int_array_alignment = _Alignof (int[100]), -+ char_alignment = _Alignof (char) -+}; -+_Static_assert (0 < -_Alignof (int), "_Alignof is signed"); -+ -+// Check _Noreturn. -+int _Noreturn does_not_return (void) { for (;;) continue; } -+ -+// Check _Static_assert. -+struct test_static_assert -+{ -+ int x; -+ _Static_assert (sizeof (int) <= sizeof (long int), -+ "_Static_assert does not work in struct"); -+ long int y; -+}; -+ -+// Check UTF-8 literals. -+#define u8 syntax error! -+char const utf8_literal[] = u8"happens to be ASCII" "another string"; -+ -+// Check duplicate typedefs. -+typedef long *long_ptr; -+typedef long int *long_ptr; -+typedef long_ptr long_ptr; -+ -+// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. -+struct anonymous -+{ -+ union { -+ struct { int i; int j; }; -+ struct { int k; long int l; } w; -+ }; -+ int m; -+} v1; -+]], -+[_AC_C_C99_TEST_BODY[ -+ v1.i = 2; -+ v1.w.k = 5; -+ _Static_assert ((offsetof (struct anonymous, i) -+ == offsetof (struct anonymous, w.k)), -+ "Anonymous union alignment botch"); -+]], -+dnl Try -+dnl GCC -std=gnu11 (unused restrictive mode: -std=c11) -+dnl with extended modes being tried first. -+dnl -+dnl Do not try -qlanglvl=extc1x, because IBM XL C V12.1 (the latest version as -+dnl of September 2012) does not pass the C11 test. For now, try extc1x when -+dnl compiling the C99 test instead, since it enables _Static_assert and -+dnl _Noreturn, which is a win. If -qlanglvl=extc11 or -qlanglvl=extc1x passes -+dnl the C11 test in some future version of IBM XL C, we'll add it here, -+dnl preferably extc11. -+[[-std=gnu11]], [$1], [$2])[]dnl -+])# _AC_PROG_CC_C11 -+ -+ -+# AC_PROG_CC_C89 -+# -------------- -+# Do not use AU_ALIAS here and in AC_PROG_CC_C99 and AC_PROG_CC_STDC, -+# as that'd be incompatible with how Automake redefines AC_PROG_CC. See -+# . -+AU_DEFUN([AC_PROG_CC_C89], -+ [AC_REQUIRE([AC_PROG_CC])], -+ [$0 is obsolete; use AC_PROG_CC] -+) -+ -+# AC_PROG_CC_C99 -+# -------------- -+AU_DEFUN([AC_PROG_CC_C99], -+ [AC_REQUIRE([AC_PROG_CC])], -+ [$0 is obsolete; use AC_PROG_CC] -+) -+ -+# AC_PROG_CC_STDC -+# --------------- -+AU_DEFUN([AC_PROG_CC_STDC], -+ [AC_REQUIRE([AC_PROG_CC])], -+ [$0 is obsolete; use AC_PROG_CC] -+) -+ -+ -+# AC_C_PROTOTYPES -+# --------------- -+# Check if the C compiler supports prototypes, included if it needs -+# options. -+AC_DEFUN([AC_C_PROTOTYPES], -+[AC_REQUIRE([AC_PROG_CC])dnl -+if test "$ac_prog_cc_stdc" != no; then -+ AC_DEFINE(PROTOTYPES, 1, -+ [Define to 1 if the C compiler supports function prototypes.]) -+ AC_DEFINE(__PROTOTYPES, 1, -+ [Define like PROTOTYPES; this can be used by system headers.]) -+fi -+])# AC_C_PROTOTYPES -+ -+ -+# _AC_CXX_STD_TRY(STANDARD, TEST-PROLOGUE, TEST-BODY, OPTION-LIST, -+# ACTION-IF-AVAILABLE, ACTION-IF-UNAVAILABLE) -+# ---------------------------------------------------------------- -+# Check whether the C++ compiler accepts features of STANDARD (e.g -+# `cxx98', `cxx11') by trying to compile a program of TEST-PROLOGUE -+# and TEST-BODY. If this fails, try again with each compiler option -+# in the space-separated OPTION-LIST; if one helps, append it to CXX. -+# If eventually successful, run ACTION-IF-AVAILABLE, else -+# ACTION-IF-UNAVAILABLE. -+AC_DEFUN([_AC_CXX_STD_TRY], -+[AC_MSG_CHECKING([for $CXX option to enable ]m4_translit(m4_translit($1, [x], [+]), [a-z], [A-Z])[ features]) -+AC_LANG_PUSH(C++)dnl -+AC_CACHE_VAL(ac_cv_prog_cxx_$1, -+[ac_cv_prog_cxx_$1=no -+ac_save_CXX=$CXX -+AC_LANG_CONFTEST([AC_LANG_PROGRAM([$2], [$3])]) -+for ac_arg in '' $4 -+do -+ CXX="$ac_save_CXX $ac_arg" -+ _AC_COMPILE_IFELSE([], [ac_cv_prog_cxx_$1=$ac_arg]) -+ test "x$ac_cv_prog_cxx_$1" != "xno" && break -+done -+rm -f conftest.$ac_ext -+CXX=$ac_save_CXX -+])# AC_CACHE_VAL -+ac_prog_cxx_stdcxx_options= -+case "x$ac_cv_prog_cxx_$1" in -+ x) -+ AC_MSG_RESULT([none needed]) ;; -+ xno) -+ AC_MSG_RESULT([unsupported]) ;; -+ *) -+ ac_prog_cxx_stdcxx_options=" $ac_cv_prog_cxx_$1" -+ CXX=$CXX$ac_prog_cxx_stdcxx_options -+ AC_MSG_RESULT([$ac_cv_prog_cxx_$1]) ;; -+esac -+AC_LANG_POP(C++)dnl -+AS_IF([test "x$ac_cv_prog_cxx_$1" != xno], [$5], [$6]) -+])# _AC_CXX_STD_TRY -+ -+# _AC_CXX_CXX98_TEST_HEADER -+# ------------------------- -+# A C++ header suitable for testing for CXX98. -+AC_DEFUN([_AC_CXX_CXX98_TEST_HEADER], -+[[ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+namespace test { -+ typedef std::vector string_vec; -+ typedef std::pair map_value; -+ typedef std::map map_type; -+ typedef std::set set_type; -+ -+ template -+ class printer { -+ public: -+ printer(std::ostringstream& os): os(os) {} -+ void operator() (T elem) { os << elem << std::endl; } -+ private: -+ std::ostringstream& os; -+ }; -+} -+]])# _AC_CXX_CXX98_TEST_HEADER -+ -+# _AC_CXX_CXX98_TEST_BODY -+# ----------------------- -+# A C++ body suitable for testing for CXX98, assuming the corresponding header. -+AC_DEFUN([_AC_CXX_CXX98_TEST_BODY], -+[[ -+ -+try { -+ // Basic string. -+ std::string teststr("ASCII text"); -+ teststr += " string"; -+ -+ // Simple vector. -+ test::string_vec testvec; -+ testvec.push_back(teststr); -+ testvec.push_back("foo"); -+ testvec.push_back("bar"); -+ if (testvec.size() != 3) { -+ throw std::runtime_error("vector size is not 1"); -+ } -+ -+ // Dump vector into stringstream and obtain string. -+ std::ostringstream os; -+ for (test::string_vec::const_iterator i = testvec.begin(); -+ i != testvec.end(); ++i) { -+ if (i + 1 != testvec.end()) { -+ os << teststr << '\n'; -+ } -+ } -+ // Check algorithms work. -+ std::for_each(testvec.begin(), testvec.end(), test::printer(os)); -+ std::string os_out = os.str(); -+ -+ // Test pair and map. -+ test::map_type testmap; -+ testmap.insert(std::make_pair(std::string("key"), -+ std::make_pair(53,false))); -+ -+ // Test set. -+ int values[] = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3, 14, 19, 17, 8, 6, 20, 16, 2, 11, 1}; -+ test::set_type testset(values, values + sizeof(values)/sizeof(values[0])); -+ std::list testlist(testset.begin(), testset.end()); -+ std::copy(testset.begin(), testset.end(), std::back_inserter(testlist)); -+} catch (const std::exception& e) { -+ std::cerr << "Caught exception: " << e.what() << std::endl; -+ -+ // Test fstream -+ std::ofstream of("test.txt"); -+ of << "Test ASCII text\n" << std::flush; -+ of << "N= " << std::hex << std::setw(8) << std::left << 534 << std::endl; -+ of.close(); -+} -+std::exit(0); -+]]) -+ -+# _AC_CXX_CXX11_TEST_HEADER -+# ------------------------- -+# A C++ header suitable for testing for CXX11. -+AC_DEFUN([_AC_CXX_CXX11_TEST_HEADER], -+[[ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+namespace cxx11test -+{ -+ typedef std::shared_ptr sptr; -+ typedef std::weak_ptr wptr; -+ -+ typedef std::tuple tp; -+ typedef std::array int_array; -+ -+ constexpr int get_val() { return 20; } -+ -+ struct testinit -+ { -+ int i; -+ double d; -+ }; -+ -+ class delegate { -+ public: -+ delegate(int n) : n(n) {} -+ delegate(): delegate(2354) {} -+ -+ virtual int getval() { return this->n; }; -+ protected: -+ int n; -+ }; -+ -+ class overridden : public delegate { -+ public: -+ overridden(int n): delegate(n) {} -+ virtual int getval() override final { return this->n * 2; } -+ }; -+ -+ class nocopy { -+ public: -+ nocopy(int i): i(i) {} -+ nocopy() = default; -+ nocopy(const nocopy&) = delete; -+ nocopy & operator=(const nocopy&) = delete; -+ private: -+ int i; -+ }; -+} -+]])# _AC_CXX_CXX11_TEST_HEADER -+ -+# _AC_CXX_CXX11_TEST_BODY -+# ----------------------- -+# A C++ body suitable for testing for CXX11, assuming the corresponding header. -+AC_DEFUN([_AC_CXX_CXX11_TEST_BODY], -+[[ -+{ -+ // Test auto and decltype -+ std::deque d; -+ d.push_front(43); -+ d.push_front(484); -+ d.push_front(3); -+ d.push_front(844); -+ int total = 0; -+ for (auto i = d.begin(); i != d.end(); ++i) { total += *i; } -+ -+ auto a1 = 6538; -+ auto a2 = 48573953.4; -+ auto a3 = "String literal"; -+ -+ decltype(a2) a4 = 34895.034; -+} -+{ -+ // Test constexpr -+ short sa[cxx11test::get_val()] = { 0 }; -+} -+{ -+ // Test initializer lists -+ cxx11test::testinit il = { 4323, 435234.23544 }; -+} -+{ -+ // Test range-based for and lambda -+ cxx11test::int_array array = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3, 14, 19, 17, 8, 6, 20, 16, 2, 11, 1}; -+ for (int &x : array) { x += 23; } -+ std::for_each(array.begin(), array.end(), [](int v1){ std::cout << v1; }); -+} -+{ -+ using cxx11test::sptr; -+ using cxx11test::wptr; -+ -+ sptr sp(new std::string("ASCII string")); -+ wptr wp(sp); -+ sptr sp2(wp); -+} -+{ -+ cxx11test::tp tuple("test", 54, 45.53434); -+ double d = std::get<2>(tuple); -+ std::string s; -+ int i; -+ std::tie(s,i,d) = tuple; -+} -+{ -+ static std::regex filename_regex("^_?([a-z0-9_.]+-)+[a-z0-9]+$"); -+ std::string testmatch("Test if this string matches"); -+ bool match = std::regex_search(testmatch, filename_regex); -+} -+{ -+ cxx11test::int_array array = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3, 14, 19, 17, 8, 6, 20, 16, 2, 11, 1}; -+ cxx11test::int_array::size_type size = array.size(); -+} -+{ -+ // Test constructor delegation -+ cxx11test::delegate d1; -+ cxx11test::delegate d2(); -+ cxx11test::delegate d3(45); -+} -+{ -+ // Test override and final -+ cxx11test::overridden o1(55464); -+} -+{ -+ // Test nullptr -+ char *c = nullptr; -+} -+{ -+ // Test template brackets -+ std::vector> v1; -+} -+{ -+ // Unicode literals -+ char const *utf8 = u8"UTF-8 string \u2500"; -+ char16_t const *utf16 = u"UTF-8 string \u2500"; -+ char32_t const *utf32 = U"UTF-32 string \u2500"; -+} -+]]) -+ -+# _AC_PROG_CXX_CXX98 ([ACTION-IF-AVAILABLE], [ACTION-IF-UNAVAILABLE]) -+# ------------------------------------------------------------------- -+ -+# If the C++ compiler is not in ISO C++98 mode by default, try to add -+# an option to output variable CXX to make it so. This macro tries -+# various options that select ISO C++98 on some system or another. It -+# considers the compiler to be in ISO C++98 mode if it handles basic -+# features of the std namespace including: string, containers (list, -+# map, set, vector), streams (fstreams, iostreams, stringstreams, -+# iomanip), pair, exceptions and algorithms. -+ -+ -+AC_DEFUN([_AC_PROG_CXX_CXX98], -+[_AC_CXX_STD_TRY([cxx98], -+[_AC_CXX_CXX98_TEST_HEADER], -+[_AC_CXX_CXX98_TEST_BODY], -+dnl Try -+dnl GCC -std=gnu++98 (unused restrictive mode: -std=c++98) -+dnl IBM XL C -qlanglvl=extended -+dnl HP aC++ -AA -+dnl Intel ICC -std=gnu++98 -+dnl Solaris N/A (default) -+dnl Tru64 N/A (default, but -std gnu could be used) -+dnl with extended modes being tried first. -+[[-std=gnu++98 -std=c++98 -qlanglvl=extended -AA]], [$1], [$2])[]dnl -+])# _AC_PROG_CXX_CXX98 -+ -+# _AC_PROG_CXX_CXX11 ([ACTION-IF-AVAILABLE], [ACTION-IF-UNAVAILABLE]) -+# ------------------------------------------------------------------- -+# If the C++ compiler is not in ISO CXX11 mode by default, try to add -+# an option to output variable CXX to make it so. This macro tries -+# various options that select ISO C++11 on some system or another. It -+# considers the compiler to be in ISO C++11 mode if it handles all the -+# tests from the C++98 checks, plus the following: Language features -+# (auto, constexpr, decltype, default/deleted constructors, delegate -+# constructors, final, initializer lists, lambda functions, nullptr, -+# override, range-based for loops, template brackets without spaces, -+# unicode literals) and library features (array, memory (shared_ptr, -+# weak_ptr), regex and tuple types). -+AC_DEFUN([_AC_PROG_CXX_CXX11], -+[_AC_CXX_STD_TRY([cxx11], -+[_AC_CXX_CXX11_TEST_HEADER -+_AC_CXX_CXX98_TEST_HEADER], -+[_AC_CXX_CXX11_TEST_BODY -+_AC_CXX_CXX98_TEST_BODY], -+dnl Try -+dnl GCC -std=gnu++11 (unused restrictive mode: -std=c++11) [and 0x variants] -+dnl IBM XL C -qlanglvl=extended0x -+dnl (pre-V12.1; unused restrictive mode: -qlanglvl=stdcxx11) -+dnl HP aC++ -AA -+dnl Intel ICC -std=c++11 -std=c++0x -+dnl Solaris N/A (no support) -+dnl Tru64 N/A (no support) -+dnl with extended modes being tried first. -+[[-std=gnu++11 -std=c++11 -std=gnu++0x -std=c++0x -qlanglvl=extended0x -AA]], [$1], [$2])[]dnl -+])# _AC_PROG_CXX_CXX11 -diff --git a/tests/foreign.at b/tests/foreign.at -index f3a53420..50e49efc 100644 ---- a/tests/foreign.at -+++ b/tests/foreign.at -@@ -153,111 +153,8 @@ cp "$abs_top_srcdir/build-aux/install-sh" \ - # the second time. Git commit 18c140b50b0619454d4da50d58a318cc257d580a - # broke this usage and the breakage went unnoticed for *eight years*. - --AT_DATA([aclocal.m4], --[[# ax_prog_cc_for_build.m4 --# serial 18 --# Copyright (c) 2008 Paolo Bonzini -- --AC_DEFUN([AX_PROG_CC_FOR_BUILD], [ --AC_REQUIRE([AC_PROG_CC]) --AC_REQUIRE([AC_PROG_CPP]) --AC_REQUIRE([AC_CANONICAL_BUILD]) -- --# Use the standard macros, but make them use other variable names --m4@&t@_pushdef([ac_cv_prog_CPP], ac_cv_build_prog_CPP) --m4@&t@_pushdef([ac_cv_prog_cc_c89], ac_cv_build_prog_cc_c89) --m4@&t@_pushdef([ac_cv_prog_gcc], ac_cv_build_prog_gcc) --m4@&t@_pushdef([ac_cv_prog_cc_works], ac_cv_build_prog_cc_works) --m4@&t@_pushdef([ac_cv_prog_cc_cross], ac_cv_build_prog_cc_cross) --m4@&t@_pushdef([ac_cv_prog_cc_g], ac_cv_build_prog_cc_g) --m4@&t@_pushdef([ac_cv_c_compiler_gnu], ac_cv_build_c_compiler_gnu) --m4@&t@_pushdef([ac_cv_exeext], ac_cv_build_exeext) --m4@&t@_pushdef([ac_cv_objext], ac_cv_build_objext) --m4@&t@_pushdef([ac_exeext], ac_build_exeext) --m4@&t@_pushdef([ac_objext], ac_build_objext) --m4@&t@_pushdef([CC], CC_FOR_BUILD) --m4@&t@_pushdef([CPP], CPP_FOR_BUILD) --m4@&t@_pushdef([GCC], GCC_FOR_BUILD) --m4@&t@_pushdef([CFLAGS], CFLAGS_FOR_BUILD) --m4@&t@_pushdef([CPPFLAGS], CPPFLAGS_FOR_BUILD) --m4@&t@_pushdef([EXEEXT], BUILD_EXEEXT) --m4@&t@_pushdef([LDFLAGS], LDFLAGS_FOR_BUILD) --m4@&t@_pushdef([OBJEXT], BUILD_OBJEXT) --m4@&t@_pushdef([host], build) --m4@&t@_pushdef([host_alias], build_alias) --m4@&t@_pushdef([host_cpu], build_cpu) --m4@&t@_pushdef([host_vendor], build_vendor) --m4@&t@_pushdef([host_os], build_os) --m4@&t@_pushdef([ac_cv_host], ac_cv_build) --m4@&t@_pushdef([ac_cv_host_alias], ac_cv_build_alias) --m4@&t@_pushdef([ac_cv_host_cpu], ac_cv_build_cpu) --m4@&t@_pushdef([ac_cv_host_vendor], ac_cv_build_vendor) --m4@&t@_pushdef([ac_cv_host_os], ac_cv_build_os) --m4@&t@_pushdef([ac_tool_prefix], ac_build_tool_prefix) --m4@&t@_pushdef([am_cv_CC_dependencies_compiler_type], am_cv_build_CC_dependencies_compiler_type) --m4@&t@_pushdef([am_cv_prog_cc_c_o], am_cv_build_prog_cc_c_o) --m4@&t@_pushdef([cross_compiling], cross_compiling_build) -- --cross_compiling_build=no -- --ac_build_tool_prefix= --AS@&t@_IF([test -n "$build"], [ac_build_tool_prefix="$build-"], -- [test -n "$build_alias"],[ac_build_tool_prefix="$build_alias-"]) -- --AC_LANG_PUSH([C]) --AC_PROG_CC --_AC_COMPILER_EXEEXT --_AC_COMPILER_OBJEXT --AC_PROG_CPP -- --# Restore the old definitions --m4@&t@_popdef([cross_compiling]) --m4@&t@_popdef([am_cv_prog_cc_c_o]) --m4@&t@_popdef([am_cv_CC_dependencies_compiler_type]) --m4@&t@_popdef([ac_tool_prefix]) --m4@&t@_popdef([ac_cv_host_os]) --m4@&t@_popdef([ac_cv_host_vendor]) --m4@&t@_popdef([ac_cv_host_cpu]) --m4@&t@_popdef([ac_cv_host_alias]) --m4@&t@_popdef([ac_cv_host]) --m4@&t@_popdef([host_os]) --m4@&t@_popdef([host_vendor]) --m4@&t@_popdef([host_cpu]) --m4@&t@_popdef([host_alias]) --m4@&t@_popdef([host]) --m4@&t@_popdef([OBJEXT]) --m4@&t@_popdef([LDFLAGS]) --m4@&t@_popdef([EXEEXT]) --m4@&t@_popdef([CPPFLAGS]) --m4@&t@_popdef([CFLAGS]) --m4@&t@_popdef([GCC]) --m4@&t@_popdef([CPP]) --m4@&t@_popdef([CC]) --m4@&t@_popdef([ac_objext]) --m4@&t@_popdef([ac_exeext]) --m4@&t@_popdef([ac_cv_objext]) --m4@&t@_popdef([ac_cv_exeext]) --m4@&t@_popdef([ac_cv_c_compiler_gnu]) --m4@&t@_popdef([ac_cv_prog_cc_g]) --m4@&t@_popdef([ac_cv_prog_cc_cross]) --m4@&t@_popdef([ac_cv_prog_cc_works]) --m4@&t@_popdef([ac_cv_prog_cc_c89]) --m4@&t@_popdef([ac_cv_prog_gcc]) --m4@&t@_popdef([ac_cv_prog_CPP]) -- --# restore global variables ac_ext, ac_cpp, ac_compile, --# ac_link, ac_compiler_gnu (dependant on the current --# language after popping): --AC_LANG_POP([C]) -- --# Finally, set Makefile variables --AC_SUBST(BUILD_EXEEXT) --AC_SUBST(BUILD_OBJEXT) --AC_SUBST([CFLAGS_FOR_BUILD]) --AC_SUBST([CPPFLAGS_FOR_BUILD]) --AC_SUBST([LDFLAGS_FOR_BUILD]) --]) --]]) -+cp "$abs_top_srcdir/tests/data/ax_prog_cc_for_build_v18.m4" \ -+ aclocal.m4 - - AT_DATA([configure.ac], - [[AC_INIT([foo], [1.0]) -@@ -290,87 +187,9 @@ cp "$abs_top_srcdir/build-aux/install-sh" \ - # the second time. This usage was never broken (unlike with AC_PROG_CC) - # but it seems sensible to make sure it doesn't *get* broken. - --AT_DATA([aclocal.m4], --[[# ax_prog_cxx_for_build.m4 --# serial 3 --# Copyright (c) 2008 Paolo Bonzini --# Copyright (c) 2012 Avionic Design GmbH -- --AC_DEFUN([AX_PROG_CXX_FOR_BUILD], [ --AC_LANG_PUSH([C++]) -- --AC_REQUIRE([AC_PROG_CXX]) --AC_REQUIRE([AC_PROG_CXXCPP]) --AC_REQUIRE([AC_CANONICAL_HOST]) -- --# Use the standard macros, but make them use other variable names --m4@&t@_pushdef([ac_cv_prog_CXXCPP], ac_cv_build_prog_CXXCPP) --m4@&t@_pushdef([ac_cv_prog_gxx], ac_cv_build_prog_gxx) --m4@&t@_pushdef([ac_cv_prog_cxx_works], ac_cv_build_prog_cxx_works) --m4@&t@_pushdef([ac_cv_prog_cxx_cross], ac_cv_build_prog_cxx_cross) --m4@&t@_pushdef([ac_cv_prog_cxx_g], ac_cv_build_prog_cxx_g) --m4@&t@_pushdef([CXX], CXX_FOR_BUILD) --m4@&t@_pushdef([CXXCPP], CXXCPP_FOR_BUILD) --m4@&t@_pushdef([CXXFLAGS], CXXFLAGS_FOR_BUILD) --m4@&t@_pushdef([CPPFLAGS], CPPFLAGS_FOR_BUILD) --m4@&t@_pushdef([CXXCPPFLAGS], CXXCPPFLAGS_FOR_BUILD) --m4@&t@_pushdef([host], build) --m4@&t@_pushdef([host_alias], build_alias) --m4@&t@_pushdef([host_cpu], build_cpu) --m4@&t@_pushdef([host_vendor], build_vendor) --m4@&t@_pushdef([host_os], build_os) --m4@&t@_pushdef([ac_cv_host], ac_cv_build) --m4@&t@_pushdef([ac_cv_host_alias], ac_cv_build_alias) --m4@&t@_pushdef([ac_cv_host_cpu], ac_cv_build_cpu) --m4@&t@_pushdef([ac_cv_host_vendor], ac_cv_build_vendor) --m4@&t@_pushdef([ac_cv_host_os], ac_cv_build_os) --m4@&t@_pushdef([ac_cxxcpp], ac_build_cxxcpp) --m4@&t@_pushdef([ac_compile], ac_build_compile) --m4@&t@_pushdef([ac_link], ac_build_link) -- --save_cross_compiling=$cross_compiling --save_ac_tool_prefix=$ac_tool_prefix --cross_compiling=no --ac_tool_prefix= -- --AC_PROG_CXX --AC_PROG_CXXCPP -- --ac_tool_prefix=$save_ac_tool_prefix --cross_compiling=$save_cross_compiling -- --# Restore the old definitions --m4@&t@_popdef([ac_link]) --m4@&t@_popdef([ac_compile]) --m4@&t@_popdef([ac_cxxcpp]) --m4@&t@_popdef([ac_cv_host_os]) --m4@&t@_popdef([ac_cv_host_vendor]) --m4@&t@_popdef([ac_cv_host_cpu]) --m4@&t@_popdef([ac_cv_host_alias]) --m4@&t@_popdef([ac_cv_host]) --m4@&t@_popdef([host_os]) --m4@&t@_popdef([host_vendor]) --m4@&t@_popdef([host_cpu]) --m4@&t@_popdef([host_alias]) --m4@&t@_popdef([host]) --m4@&t@_popdef([CXXCPPFLAGS]) --m4@&t@_popdef([CPPFLAGS]) --m4@&t@_popdef([CXXFLAGS]) --m4@&t@_popdef([CXXCPP]) --m4@&t@_popdef([CXX]) --m4@&t@_popdef([ac_cv_prog_cxx_g]) --m4@&t@_popdef([ac_cv_prog_cxx_cross]) --m4@&t@_popdef([ac_cv_prog_cxx_works]) --m4@&t@_popdef([ac_cv_prog_gxx]) --m4@&t@_popdef([ac_cv_prog_CXXCPP]) -- --# Finally, set Makefile variables --AC_SUBST([CXXFLAGS_FOR_BUILD]) --AC_SUBST([CXXCPPFLAGS_FOR_BUILD]) -- --AC_LANG_POP([C++]) --]) --]]) -+cat "$abs_top_srcdir/tests/data/ax_prog_cc_for_build_v18.m4" \ -+ "$abs_top_srcdir/tests/data/ax_prog_cxx_for_build_v3.m4" \ -+ > aclocal.m4 - - AT_DATA([configure.ac], - [[AC_INIT([foo], [1.0]) -@@ -391,3 +210,27 @@ AT_CHECK([grep '^CXX = ..*$' Makefile > /dev/null 2>&1]) - AT_CHECK([grep '^CXX_FOR_BUILD = ..*$' Makefile > /dev/null 2>&1]) - - AT_CLEANUP -+ -+ -+AT_SETUP([gnulib-std-gnu11.m4]) -+ -+# Gnulib's std-gnu11.m4 (last significant change 2016-03-15) overrides -+# most but not all of the internal macros used by AC_PROG_CC and AC_PROG_CXX. -+# Commit 131d8c69f31dc6fc8dc93abe1096d52d1fe19fd3 changed the calling -+# convention of _AC_C_STD_TRY, causing configure scripts that load -+# std-gnu11.m4 to have shell syntax errors. -+ -+cp "$abs_top_srcdir/tests/data/gnulib_std_gnu11_2020_08_17.m4" \ -+ aclocal.m4 -+ -+AT_DATA([configure.ac], -+[[AC_INIT([foo], [1.0]) -+AC_PROG_CC -+AC_PROG_CXX -+AC_OUTPUT -+]]) -+ -+AT_CHECK_AUTOCONF -+AT_CHECK_CONFIGURE -+ -+AT_CLEANUP From b139af486f4f2760e63b204f64327d05cfa926d60b43c180e712123449950ae7 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Fri, 12 Mar 2021 22:04:31 +0000 Subject: [PATCH 6/6] - use https urls OBS-URL: https://build.opensuse.org/package/show/devel:tools:building/autoconf?expand=0&rev=51 --- autoconf-el.spec | 2 +- autoconf.changes | 5 +++++ autoconf.spec | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/autoconf-el.spec b/autoconf-el.spec index 84b3b5b..d2ca5bb 100644 --- a/autoconf-el.spec +++ b/autoconf-el.spec @@ -23,7 +23,7 @@ Release: 0 Summary: Emacs mode for editing GNU Autoconf scripts License: GPL-3.0-or-later URL: https://www.gnu.org/software/autoconf -Source: http://ftp.gnu.org/gnu/autoconf/autoconf-%{version}.tar.xz +Source: https://ftp.gnu.org/gnu/autoconf/autoconf-%{version}.tar.xz BuildRequires: emacs-nox BuildRequires: m4 >= 1.4.6 Enhances: emacs diff --git a/autoconf.changes b/autoconf.changes index 93e3aa3..cb4f9f6 100644 --- a/autoconf.changes +++ b/autoconf.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Mar 12 22:04:21 UTC 2021 - Dirk Müller + +- use https urls + ------------------------------------------------------------------- Sat Jan 30 07:20:53 UTC 2021 - Andreas Stieger diff --git a/autoconf.spec b/autoconf.spec index 112b920..12c84be 100644 --- a/autoconf.spec +++ b/autoconf.spec @@ -22,8 +22,8 @@ Release: 0 Summary: A GNU Tool for Automatically Configuring Source Code License: GPL-3.0-or-later URL: https://www.gnu.org/software/autoconf -Source0: http://ftp.gnu.org/gnu/autoconf/autoconf-%{version}.tar.xz -Source1: http://ftp.gnu.org/gnu/autoconf/autoconf-%{version}.tar.xz.sig +Source0: https://ftp.gnu.org/gnu/autoconf/autoconf-%{version}.tar.xz +Source1: https://ftp.gnu.org/gnu/autoconf/autoconf-%{version}.tar.xz.sig Source2: %{name}.keyring Patch0: autoreconf-ltdl.diff BuildRequires: help2man