]> git.ipfire.org Git - thirdparty/autoconf.git/log
thirdparty/autoconf.git
5 years agoStop using up_to_date_p
Paul Eggert [Mon, 29 Jun 2020 23:51:08 +0000 (16:51 -0700)] 
Stop using up_to_date_p

* bin/autom4te.in (up_to_date): Rewrite to stop using
up_to_date_p, which has been removed from Automake.

5 years agomake fetch
Paul Eggert [Mon, 29 Jun 2020 23:51:08 +0000 (16:51 -0700)] 
make fetch

5 years agoSave and check Autom4te version in cache
Paul Eggert [Mon, 29 Jun 2020 23:51:08 +0000 (16:51 -0700)] 
Save and check Autom4te version in cache

Problem reported in <https://bugs.debian.org/219621>.
* bin/autom4te.in: Save and check autom4te version number into cache index.
* lib/Autom4te/C4che.pm (save): New arg $version.  All callers changed.
(good_version): New sub.

5 years agoFix undefined behavior in AC_SYS_LARGEFILE
Paul Eggert [Mon, 29 Jun 2020 23:51:08 +0000 (16:51 -0700)] 
Fix undefined behavior in AC_SYS_LARGEFILE

* lib/autoconf/specific.m4 (_AC_SYS_LARGEFILE_TEST_INCLUDES):
Avoid undefined behavior on platforms where off_t is 32 bits.  See:
https://bugs.debian.org/742780

5 years agoLook for AM_PROG_LIBTOOL too
Andreas Barth [Mon, 29 Jun 2020 23:51:08 +0000 (16:51 -0700)] 
Look for AM_PROG_LIBTOOL too

This helps out dh-autoreconf on Debian
<https://bugs.debian.org/759739>.
* bin/autoreconf.in (autoreconf_current_directory):
* lib/autom4te.in (args): Look for AM_PROG_LIBTOOL too.
Copyright-paperwork-exempt: Yes

5 years agoDefine $as_echo and $as_echo_n for backward compatibility.
Zack Weinberg [Fri, 13 Mar 2020 18:50:50 +0000 (14:50 -0400)] 
Define $as_echo and $as_echo_n for backward compatibility.

Commit 2b59b6f8a79b8bf77e178ff4e5aa0ede433d39cf removed the internal
shell variables $as_echo and $as_echo_n.  It turns out that these are
used by several widely-used third-party m4 files (notably both
gnulib-common.m4 from gnulib, and ax_pthread.m4 from the Autoconf
macro archive) as well as any number of existing configure.ac’s.

Restore these shell variables, unconditionally defining them to use
printf.  Issue -Wobsolete warnings if they are used, recommending the
use of AS_ECHO and AS_ECHO_N respectively.  Add a test which checks
both that they do work and that they trigger warnings.

5 years ago_AS_REEXEC_WITH_SHELL: don’t use AS_EXIT.
Zack Weinberg [Fri, 13 Mar 2020 17:38:46 +0000 (13:38 -0400)] 
_AS_REEXEC_WITH_SHELL: don’t use AS_EXIT.

If _AS_REEXEC_WITH_SHELL fails to exec the selected “better” shell
interpreter, and that failure somehow doesn’t terminate the process,
it calls AS_EXIT([255]).  This expands to an invocation of as_fn_exit.
However, the definition of as_fn_exit goes into the M4SH-INIT-FN
diversion, whereas _AS_REEXEC_WITH_SHELL goes into the M4SH-SANITIZE
diversion, so as_fn_exit won’t be defined at the point of this use.
We can’t move the definition of as_fn_exit earlier, because we don’t
know that the shell supports shell functions until after we get to the
end of the M4SH-SANITIZE diversion.

This is only a theoretical bug because, as the comments say, “all the
known shells bail out after a failed exec.”  However, a shell that
doesn’t bail out will instead give the user a flood of nonsensical
error messages (starting with “as_fn_exit: not found” and then going
on to choke on the rest of the script) so I think we should fix it
anyway.  There shouldn’t be any problem with using a plain ‘exit’ at
this point; no traps are active yet, and we are exiting with an
explicit error code.

5 years agoREADME-hacking: re-configure from scratch during bootstrap.
Zack Weinberg [Fri, 13 Mar 2020 17:35:01 +0000 (13:35 -0400)] 
README-hacking: re-configure from scratch during bootstrap.

When building autoconf from a git checkout, recommend running
‘make distclean’ and a second ‘./configure’ after regenerating
autoconf’s own configure script using the just-built autoconf.
If one only runs ‘make check’ at that point, some configure-time
tests will not be repeated using the new code, such as detection
of a “better” shell.

5 years agoFix _AS_DETECT_BETTER_SHELL breakage
Paul Eggert [Fri, 13 Mar 2020 00:00:44 +0000 (17:00 -0700)] 
Fix _AS_DETECT_BETTER_SHELL breakage

Problem reported by Zack Weinberg in:
https://lists.gnu.org/r/autoconf/2020-03/msg00017.html
* lib/m4sugar/m4sh.m4 (_AS_RUN): Use sh -c instead of
the no-longer-existent $as_echo.  This fixes a bug introduced
in 2013-01-28T03:44:45Z!gary@gnu.org.

5 years agoFix `make syntax-check'.
Zack Weinberg [Wed, 26 Feb 2020 15:27:38 +0000 (10:27 -0500)] 
Fix `make syntax-check'.

There are two errors caught by make syntax-check currently.

First, the recent make update-copyright
(d78a7dd95fed24e417dfb4d08124a9ce7c1f7d1e) missed autoconf.texi, I
think because there are a bunch of .texi files in doc/ whose copyright
years should *not* be updated (e.g. standards.texi, fdl.texi) and the
exclusion pattern is too broad.  I can't actually *find* the exclusion
pattern in the twisty maze of .mk files, all alike, so I just manually
updated autoconf.texi.

Second, it objects to an edit to an old section of NEWS.  This is
because of d3dcd5895d64f6c86275c9333e2760a867e540e7, which is a
legitimate change (replacing http:// with https:// in a URL) so the
correct action is to change old_NEWS_hash to match.

* doc/autoconf.texi: Update copyright year.
* cfg.mk (old_NEWS_hash): Update to acknowledge commit
d3dcd5895d64f6c86275c9333e2760a867e540e7.

5 years agoMention 32-bit GNU/Linux 64-bit inodes
Paul Eggert [Sat, 22 Feb 2020 01:23:10 +0000 (17:23 -0800)] 
Mention 32-bit GNU/Linux 64-bit inodes

* lib/autoconf/specific.m4 (AC_SYS_LARGEFILE):
In a comment, mention 64-bit inode problem on 32-bit GNU/Linux.
This is taken from Gnulib.

5 years agoRemove definition of _DARWIN_USE_64_BIT_INODE
Paul Eggert [Sat, 22 Feb 2020 01:17:45 +0000 (17:17 -0800)] 
Remove definition of _DARWIN_USE_64_BIT_INODE

It’s not needed in currently-supported macOS versions, and was
problematic anyway in MacOS X 10.5 which was the only version that
could use it.  Problem reported by Peter Eisentraut in:
https://lists.gnu.org/r/bug-autoconf/2020-02/msg00004.html
* lib/autoconf/specific.m4 (AC_SYS_LARGEFILE):
Don’t define _DARWIN_USE_64_BIT_INODE.

5 years agomaint: make update-copyright
Jim Meyering [Wed, 1 Jan 2020 19:45:50 +0000 (11:45 -0800)] 
maint: make update-copyright

5 years agoDocument AIX 7.2 printf command gotcha
Paul Eggert [Wed, 25 Dec 2019 22:18:49 +0000 (14:18 -0800)] 
Document AIX 7.2 printf command gotcha

* doc/autoconf.texi (Limitations of Builtins):
Document AIX 7.2 sh printf problem with octal escapes.

5 years agoFix terminology typo in mkdir -p check
Paul Eggert [Sun, 6 Oct 2019 08:37:56 +0000 (01:37 -0700)] 
Fix terminology typo in mkdir -p check

* lib/autoconf/programs.m4 (AC_PROG_MKDIR_P): Say “race-free”, not
“thread-safe”.  Problem reported by Reuben Thomas in:
https://lists.gnu.org/r/bug-autoconf/2019-09/msg00003.html

5 years agoPort tests to Bash 5
Ondrej Dubaj [Wed, 28 Aug 2019 05:39:50 +0000 (07:39 +0200)] 
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'.

6 years agoPort AC_C_BIGENDIAN to recent clang
Paul Eggert [Wed, 29 May 2019 20:00:26 +0000 (13:00 -0700)] 
Port AC_C_BIGENDIAN to recent clang

Problem and trivial patch reported by Matthieu Gautier in:
https://lists.gnu.org/r/bug-autoconf/2019-05/msg00006.html
* lib/autoconf/c.m4 (AC_C_BIGENDIAN): Use unsigned short for
values greater than 2**15 - 1.

6 years agodoc/autoconf.texi: fix spelling/grammar nits
Jim Meyering [Thu, 23 Nov 2017 14:58:38 +0000 (06:58 -0800)] 
doc/autoconf.texi: fix spelling/grammar nits

6 years agoAC_CHECK_DECL: when cached, don't overwrite a werror flag
Noah Misch [Sun, 25 Nov 2018 04:57:43 +0000 (20:57 -0800)] 
AC_CHECK_DECL: when cached, don't overwrite a werror flag

* lib/autoconf/general.m4 (_AC_CHECK_DECL_BODY): Restore werror flags
inside the AC_CACHE_CHECK that saves them.  Commit
82ef7805faffa151e724aa76c245ec590d174580 broke this.  From Tom Lane
(trivial change).
* tests/semantics.at (AC_CHECK_DECLS): Test this.

7 years agolib: use list of unsafe chars, not safe ones
Paul Eggert [Tue, 20 Mar 2018 03:19:01 +0000 (20:19 -0700)] 
lib: use list of unsafe chars, not safe ones

* lib/autoconf/general.m4 (_AC_INIT_CONFIG_LOG):
Rely on list of unsafe chars instead of list of safe ones.
This corresponds more closely to POSIX and should result
in less quoting.
* lib/autoconf/status.m4 (_AC_OUTPUT_CONFIG_STATUS):
Adjust to this change.
x

7 years agofix quoting
Daniel Colascione [Sun, 4 Mar 2018 21:28:23 +0000 (13:28 -0800)] 
fix quoting

7 years agoFix test suite with modern Perl
Daniel Colascione [Sun, 4 Mar 2018 21:36:55 +0000 (13:36 -0800)] 
Fix test suite with modern Perl

7 years agolib: fix update_file timestamps
Paul Eggert [Sun, 29 Oct 2017 20:00:55 +0000 (13:00 -0700)] 
lib: fix update_file timestamps

Problem reported by Bruno Haible in:
https://savannah.gnu.org/support/?109406
* lib/Autom4te/FileUtils.pm (update_file): Use rename + system
instead of move, since move truncates file timestamps.

7 years agomaint: update URLs
Paul Eggert [Sat, 23 Sep 2017 19:45:22 +0000 (12:45 -0700)] 
maint: update URLs

Most of this is replacing http: with https: when either will do.

7 years agolib: check ‘install file dir/’
Paul Eggert [Sat, 23 Sep 2017 18:21:04 +0000 (11:21 -0700)] 
lib: check ‘install file dir/’

* lib/autoconf/programs.m4 (AC_PROG_INSTALL): Check that the
system install program works when the destination name has a
trailing slash.  This helped catch problems in an experimental and
never-published version of GNU Coreutils, and is a good thing to
check in general.

7 years agomaint: sync from Automake
Paul Eggert [Sat, 23 Sep 2017 17:34:04 +0000 (10:34 -0700)] 
maint: sync from Automake

This just updates comments, notably URLs.

7 years agoPrefer HTTPS to FTP and HTTP
Paul Eggert [Sun, 17 Sep 2017 00:48:19 +0000 (17:48 -0700)] 
Prefer HTTPS to FTP and HTTP

7 years agomake fetch
Paul Eggert [Sun, 17 Sep 2017 00:37:03 +0000 (17:37 -0700)] 
make fetch

7 years ago"time stamp" -> "timestamp", as per POSIX
Paul Eggert [Sun, 17 Sep 2017 00:16:14 +0000 (17:16 -0700)] 
"time stamp" -> "timestamp", as per POSIX

8 years agodoc: emphasize that config.h must be first
Eric Blake [Wed, 25 Jan 2017 19:36:04 +0000 (13:36 -0600)] 
doc: emphasize that config.h must be first

* doc/autoconf.texi (C and Posix Variants, System Services):
Remind user to include config.h first.
(Configuration Headers): Give another reason why config.h must be
first, and mention that only .c files need it.
Based on discussion on bugs.debian.org/158969

Signed-off-by: Eric Blake <eblake@redhat.com>
8 years agomaint: update copyright dates for 2017
Jim Meyering [Sun, 1 Jan 2017 13:17:07 +0000 (05:17 -0800)] 
maint: update copyright dates for 2017

* all files: Run "make update-copyright".
* doc/autoconf.texi: Update manually.

8 years agodoc: Mention effect of 'autoreconf -fi' on INSTALL
Eric Blake [Thu, 22 Dec 2016 23:16:08 +0000 (17:16 -0600)] 
doc: Mention effect of 'autoreconf -fi' on INSTALL

Several projects have a bootstrap script that invokes
'autoreconf -fi' as part of a fresh version control checkout,
in order to avoid storing common files in version control,
while also allowing contributors to rerun bootstrap to pick
up the benefits of any upgrade of one of the autotools.

However, the documentation did not make it obvious that such
a setup will overwrite any customizations to files like
INSTALL, if those files are stored in version control, when
automake still considers that file to be standard based on
AM_INIT_AUTOMAKE settings.  In such a case, a mere
'autoreconf -i' is good for the bootstrap script, while a
separate 'autoreconf -f' is good for picking up on an upgrade
of any autotools.

* bin/autoreconf.in (help): Mention standard files.
* doc/autoconf.texi (autoreconf Invocation): Add more text, including
warning that mixing --force and --install may undo customizations,
and that the set of files impacted is controlled by automake.
Reported by Emil Laine <laine.emil@gmail.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
8 years agodoc: Patterns in m4_pattern_forbid cause error, not warning
Eric Blake [Thu, 22 Dec 2016 19:03:21 +0000 (13:03 -0600)] 
doc: Patterns in m4_pattern_forbid cause error, not warning

The example text regarding a desired literal AC_DC in output
claimed that the result would trigger a warning if one does
not use creative quoting; but in reality, autoconf's use of
m4_pattern_forbid to reserve the entire AC_ namespace makes
it a hard error.  Reword the section to mention the use of
m4_pattern_allow() as the fix, and beef up the example to
better demonstrate the problem.

* doc/autoconf.texi (Autoconf Language): Improve AC_DC example.
Reported by Gavin Smith <gavinsmith0123@gmail.com>.
Signed-off-by: Eric Blake <eblake@redhat.com>
8 years agoautoheader: check templates of all config headers
Daniel Elstner [Wed, 21 Dec 2016 16:15:46 +0000 (17:15 +0100)] 
autoheader: check templates of all config headers

* bin/autoheader.in: When checking for missing templates, take
all config headers into account, not just the one generated by
autoheader.  This makes it possible to use AC_DEFINE() for
secondary headers without duplicating the template into the
first header.
* tests/tools.at: Add a check for autoheader with multiple
config headers.
* NEWS: Document the new behavior.
Message-Id: <1482336946.31331.2.camel@gmail.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
8 years agoautoconf: prefer an unrolled loop for trivial AC_CHECK_HEADERS
Paolo Bonzini [Mon, 31 Oct 2016 17:08:07 +0000 (18:08 +0100)] 
autoconf: prefer an unrolled loop for trivial AC_CHECK_HEADERS

An unrolled loop avoids the cost of spawning sed in AS_TR_SH and
AS_TR_CPP.  Prefer it if there is nothing in the second and third
argument of AC_CHECK_HEADERS and the first argument is a literal.

* lib/autoconf/headers.m4 (AC_CHECK_HEADERS): Unroll loop if safe.
(_AC_CHECK_HEADERS): Move basic implementation here.
(AC_CHECK_INCLUDES_DEFAULT): Remove unnecessary arguments after the first.

Signed-off-by: Paolo Bonzini <bonzini@gnu.org>
Message-Id: <1477933688-4884-3-git-send-email-bonzini@gnu.org>
[eblake: perform AC_CHECK_HEADERS_ONCE changes separately, use
dnl to reduce generated blank lines]
Signed-off-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
8 years agoautoconf: prefer an unrolled loop for trivial AC_CHECK_FUNCS
Paolo Bonzini [Fri, 4 Nov 2016 01:08:28 +0000 (20:08 -0500)] 
autoconf: prefer an unrolled loop for trivial AC_CHECK_FUNCS

An unrolled loop avoids the cost of spawning sed in AS_TR_SH and
AS_TR_CPP.  Prefer it if there is nothing in the second and third
argument of AC_CHECK_FUNCS and the first argument is a literal.

* lib/autoconf/functions.m4 (AC_CHECK_FUNCS): Unroll loop if safe.
(_AC_CHECK_FUNCS): Move basic implementation here.

Signed-off-by: Paolo Bonzini <bonzini@gnu.org>
Message-Id: <1477933688-4884-2-git-send-email-bonzini@gnu.org>
[eblake: perform AC_CHECK_FUNCS_ONCE changes separately, use
dnl to reduce generated blank lines]
Signed-off-by: Eric Blake <eblake@redhat.com>
8 years agoAC_CHECK_HEADERS_ONCE: hoist cache name computation to m4 time
Eric Blake [Wed, 21 Dec 2016 14:32:43 +0000 (08:32 -0600)] 
AC_CHECK_HEADERS_ONCE: hoist cache name computation to m4 time

Rather than perform a sed script on each element of the
$ac_header_c_list to compute the corresponding cache name, we
can inline enough of AC_CHECK_HEADER to bypass the normal
polymorphic code, and instead directly use the literal
header and cache name that we are consuming from the list.

The resulting configure script is roughly unchanged in size,
but performs slightly faster.

* lib/autoconf/headers.m4 (AC_CHECK_HEADER_COMPILE): Split out shell
function registration...
(_AC_CHECK_HEADER_COMPILE_FN): ...to here.
(_AC_HEADERS_EXPANSION): Use it to inline enough of AC_CHECK_HEADER
to operate on a literal rather than a shell variable, for fewer sed
calls.

Signed-off-by: Eric Blake <eblake@redhat.com>
8 years agoAC_CHECK_FUNCS_ONCE: hoist cache name computation to m4 time
Eric Blake [Fri, 4 Nov 2016 01:03:06 +0000 (20:03 -0500)] 
AC_CHECK_FUNCS_ONCE: hoist cache name computation to m4 time

Rather than perform a sed script on each element of the
$ac_func_c_list to compute the corresponding cache name, we
can inline enough of AC_CHECK_FUNC to bypass the normal
polymorphic code, and instead directly use the literal
function name that we are consuming from the list.

While at it, we can use echo instead of cat to append to
confdefs.h, for another process shaved.

The resulting configure script is roughly unchanged in size,
but performs slightly faster.

* lib/autoconf/functions.m4 (AC_CHECK_FUNC): Split out shell
function registration...
(_AC_CHECK_FUNC_FN): ...to here.
(_AC_FUNCS_EXPANSION): Use it to inline enough of AC_CHECK_FUNC to
operate on a literal rather than a shell variable, for fewer sed
calls.

Signed-off-by: Eric Blake <eblake@redhat.com>
8 years agoAC_CHECK_HEADERS_ONCE: hoist CPP name computation to m4 time
Eric Blake [Wed, 21 Dec 2016 14:32:39 +0000 (08:32 -0600)] 
AC_CHECK_HEADERS_ONCE: hoist CPP name computation to m4 time

Rather than perform a sed script on each element of the
$ac_header_c_list to compute the corresponding CPP name, we can
make the list store a series of triples of header names, shell-safe
names, and CPP names all computed at m4 time.

The resulting configure script is slightly larger based on
how many headers are checked once, but also performs
slightly faster.

There is still a sed call in AC_CHECK_HEADER for computing the
cache variable name; that will be dealt with next.  That patch
will also be the one that takes advantage of the shell-safe name.

* lib/autoconf/headers.m4 (_AC_CHECK_HEADER_ONCE): Track the shell
and CPP name in the list...
(_AC_HEADERS_EXPANSION): ...and rewrite the list walk to parse off
triples of arguments, for fewer sed calls.

Signed-off-by: Eric Blake <eblake@redhat.com>
8 years agoAC_CHECK_FUNCS_ONCE: hoist CPP name computation to m4 time
Eric Blake [Fri, 4 Nov 2016 01:03:06 +0000 (20:03 -0500)] 
AC_CHECK_FUNCS_ONCE: hoist CPP name computation to m4 time

Rather than perform a sed script on each element of the
$ac_func_c_list to compute the corresponding CPP name, we can
make the list store a series of pairs of function names and
CPP names all computed at m4 time.

The resulting configure script is slightly larger based on
how many function names are checked once, but also performs
slightly faster.

There is still a sed call in AC_CHECK_FUNC for computing the
cache variable name; that will be dealt with next.

* lib/autoconf/functions.m4 (_AC_CHECK_FUNC_ONCE): Track the CPP
name in the list...
(_AC_FUNCS_EXPANSION): ...and rewrite the list walk to parse off
pairs of arguments, for fewer sed calls.

Signed-off-by: Eric Blake <eblake@redhat.com>
8 years agoAC_CHECK_HEADERS_ONCE: honor current AC_LANG
Eric Blake [Wed, 21 Dec 2016 14:32:29 +0000 (08:32 -0600)] 
AC_CHECK_HEADERS_ONCE: honor current AC_LANG

Previously, AC_CHECK_HEADERS_ONCE collected a list of header names
to check, but ran the checks using the AC_LANG that was active
during the first encounter of the macro.  In practice, this is
usually the C language, and we haven't had actual reports of projects
attempting to use AC_CHECK_HEADERS_ONCE across multiple languages,
rather this was discovered by code inspection.

With this patch, the code now tracks a separate per-language list of
names to check.  Note, however, that it is only possible to check for
a given header name in one language; attempting to add a name again
under AC_CHECK_HEADERS_ONCE while a different language is active is a
no-op (this still makes sense because the side-effect of defining
the CPP macro HAVE_HEADER does not include a language prefix).

* lib/autoconf/headers.m4 (_AC_CHECK_HEADER_ONCE)
(_AC_HEADERS_EXPANSION):
* NEWS: Mention it.

Signed-off-by: Eric Blake <eblake@redhat.com>
8 years agoAC_CHECK_FUNCS_ONCE: honor current AC_LANG
Eric Blake [Thu, 3 Nov 2016 15:28:07 +0000 (10:28 -0500)] 
AC_CHECK_FUNCS_ONCE: honor current AC_LANG

Previously, AC_CHECK_FUNCS_ONCE collected a list of function names
to check, but ran the checks using the AC_LANG that was active
during the first encounter of the macro.  In practice, this is
usually the C language, and we haven't had actual reports of projects
attempting to use AC_CHECK_FUNCS_ONCE across multiple languages,
rather this was discovered by code inspection.

With this patch, the code now tracks a separate per-language list of
names to check.  Note, however, that it is only possible to check for
a given function name in one language; attempting to add a name again
under AC_CHECK_FUNCS_ONCE while a different language is active is a
no-op (this still makes sense because the side-effect of defining
the CPP macro HAVE_FUNC does not include a language prefix).

* lib/autoconf/functions.m4 (_AC_CHECK_FUNC_ONCE)
(_AC_FUNCS_EXPANSION):
* NEWS: Mention it.

Signed-off-by: Eric Blake <eblake@redhat.com>
8 years ago* doc/autoconf.texi (Using Autotest): Stop mentioning Free Recode.
Bruno Haible [Wed, 14 Dec 2016 18:28:46 +0000 (10:28 -0800)] 
* doc/autoconf.texi (Using Autotest): Stop mentioning Free Recode.

Free Wdiff is now GNU Wdiff again.

8 years agoautoconf: refine quadrigraph test in _AC_DEFINE_UNQUOTED
Paolo Bonzini [Mon, 31 Oct 2016 17:08:08 +0000 (18:08 +0100)] 
autoconf: refine quadrigraph test in _AC_DEFINE_UNQUOTED

It is a very common case that a quadrigraph appears in the argument of
_AC_DEFINE_UNQUOTED, because "#define" is expanded through a quadrigraph.
Therefore, restrict the quadrigraph tests to "$" (for "$(" and "${")
and "(" (for "$(").

At the same time, "#" should not be used inside AC_ECHO because it confuses
m4's comment parsing.  This pre-existing latent bug is caught by test 251:

   AC_DEFINE_UNQUOTED([bar], [[%!_!# X]])

Previously the quadrigraph in "@%:@define bar %!_!# X" made Autoconf fall back
to cat anyway.  Now that Autoconf is not fooled by the quadrigraph, the test
catches that "#" is not special-cased.  Kudos to Eric for coming up with it!

* lib/autoconf/general (_AC_DEFINE_UNQUOTED): Do not blindly
use cat on all quadrigraphs.

Signed-off-by: Paolo Bonzini <bonzini@gnu.org>
Message-Id: <1477933688-4884-4-git-send-email-bonzini@gnu.org>

8 years agodoc: fix an infinitely recursing example
Quinn Grier [Wed, 2 Nov 2016 05:58:25 +0000 (00:58 -0500)] 
doc: fix an infinitely recursing example

The "single" macro infinitely recurses because its expansion contains
the unquoted text " single-". The "double" macro almost has the same
problem, but it is protected by extra quotes. In any case, the macro
names being repeated in the macro definitions is not necessary.

This commit changes the macro names to "foo" and "bar", which are taken
from a very similar example in the GNU M4 1.4.17 manual. See lines 1971
to 1980 of v1.4.17:doc/m4.texi in the GNU M4 Git repository.

* doc/autoconf.texi (Quoting and Parameters): Fix broken example.

8 years agodoc: detail inconsistencies in sed word boundary handling
Pádraig Brady [Sun, 30 Oct 2016 16:58:09 +0000 (16:58 +0000)] 
doc: detail inconsistencies in sed word boundary handling

* doc/autoconf.texi (Limitations of usual tools): Display a
table showing where the various syntaxes for word boundaries
are supported.

8 years agoAC_USE_SYSTEM_EXTENSIONS: Remove stray TR in doc
Paul Eggert [Thu, 15 Sep 2016 19:26:26 +0000 (12:26 -0700)] 
AC_USE_SYSTEM_EXTENSIONS: Remove stray TR in doc

8 years agoAC_USE_SYSTEM_EXTENSIONS: port to more ISO C TSes
Paul Eggert [Thu, 15 Sep 2016 17:08:56 +0000 (10:08 -0700)] 
AC_USE_SYSTEM_EXTENSIONS: port to more ISO C TSes

* doc/autoconf.texi (C and Posix Variants): Rename from "Posix
Variants", and document updated behavior.
* lib/autoconf/specific.m4 (AC_USE_SYSTEM_EXTENSIONS): Also define
__STDC_WANT_IEC_60559_ATTRIBS_EXT__,
__STDC_WANT_IEC_60559_DFP_EXT__,
__STDC_WANT_IEC_60559_TYPES_EXT__, and
__STDC_WANT_MATH_SPEC_FUNCS__.  From a suggestion by Joseph Myers in:
http://lists.gnu.org/archive/html/autoconf-patches/2016-09/msg00011.html

8 years agoAC_HEADER_MAJOR: port to glibc 2.25
Eric Blake [Wed, 14 Sep 2016 13:17:06 +0000 (08:17 -0500)] 
AC_HEADER_MAJOR: port to glibc 2.25

glibc 2.25 is deprecating the namespace pollution of <sys/types.h>
injecting major(), minor(), and makedev() into the compilation
environment, with a warning that insists that users include
<sys/sysmacros.h> 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) <AC_HEADER_MAJOR>: Expand
details on usage, and on workarounds for non-updated projects.

Signed-off-by: Eric Blake <eblake@redhat.com>
8 years agodoc: resplit lines to avoid Texinfo chaos
Paul Eggert [Wed, 14 Sep 2016 19:14:45 +0000 (12:14 -0700)] 
doc: resplit lines to avoid Texinfo chaos

* doc/autoconf.texi (Introduction): Resplit lines to avoid
Texinfo 6.3 incompatibility with Perl 5.22.  See:
http://lists.gnu.org/archive/html/bug-texinfo/2016-09/msg00037.html

8 years agoAC_USE_SYSTEM_EXTENSIONS: port to recent ISO C
Paul Eggert [Wed, 14 Sep 2016 01:28:19 +0000 (18:28 -0700)] 
AC_USE_SYSTEM_EXTENSIONS: port to recent ISO C

* lib/autoconf/specific.m4 (AC_USE_SYSTEM_EXTENSIONS):
Also define __STDC_WANT_IEC_60559_BFP_EXT__,
__STDC_WANT_IEC_60559_FUNCS_EXT__, and __STDC_WANT_LIB_EXT2__.
* NEWS, doc/autoconf.texi (Posix Variants):
Document this.  Also, document other changes in this area
that were not properly documented before.

8 years agodoc: port to Texinfo 6.3
Paul Eggert [Wed, 14 Sep 2016 00:51:18 +0000 (17:51 -0700)] 
doc: port to Texinfo 6.3

* doc/autoconf.texi: Remove obsolete @setcontentsaftertitlepage
that provokes a warning from Texinfo 6.3.

8 years agodoc: use @xref correctly
Eric Blake [Tue, 13 Sep 2016 22:44:02 +0000 (17:44 -0500)] 
doc: use @xref correctly

Silences this warning from new-enough texinfo:
./doc/autoconf.texi:14236: warning: @xref node name should not contain `.'

* doc/autoconf.texi (Macro Definitions): No need for .info.

Signed-off-by: Eric Blake <eblake@redhat.com>
9 years agoPort AC_CHECK_HEADER_STDBOOL to C++11
Paul Eggert [Tue, 31 May 2016 15:57:20 +0000 (08:57 -0700)] 
Port AC_CHECK_HEADER_STDBOOL to C++11

* lib/autoconf/headers.m4: Port to C++11.
Problem reported by David Seifert in:
http://lists.gnu.org/archive/html/bug-gnulib/2016-05/msg00052.html

9 years agoUse American spelling for "initialize"
Paul Eggert [Sun, 3 Apr 2016 20:57:17 +0000 (13:57 -0700)] 
Use American spelling for "initialize"

* lib/autoconf/c.m4: Prefer the spelling "initializer" in comments.

9 years agoautom4te: fix problem when tracing to '-'
Paul Eggert [Tue, 15 Mar 2016 17:51:26 +0000 (10:51 -0700)] 
autom4te: fix problem when tracing to '-'

* bin/autom4te.in (handle_traces): When $output is '-', use
stdout rather than creating a file named '-'.  This fixes a problem
introduced by the recent port to the new Autom4te::XFile API.

9 years agoAlso try clang
Paul Eggert [Tue, 15 Mar 2016 16:34:11 +0000 (09:34 -0700)] 
Also try clang

Problem reported by Václav Zeman in:
http://lists.gnu.org/archive/html/autoconf/2012-10/msg00000.html
* lib/autoconf/c.m4 (AC_PROG_CC, AC_PROG_OBJC): Also try clang.
(AC_PROG_CXX): Also try clang++.
These are at the end of the existing lists, to avoid compatibility
issues in older installations.

9 years agoPort C11 and C++11 testing to clang
Paul Eggert [Tue, 15 Mar 2016 15:56:43 +0000 (08:56 -0700)] 
Port C11 and C++11 testing to clang

* lib/autoconf/c.m4 (_AC_C_C99_TEST_HEADER):
Include stddef.h, for offsetof.
(_AC_PROG_CC_C11): Limit _Static_assert to integer constant
expressions.  Suggested by Nick Bowler in:
http://lists.gnu.org/archive/html/autoconf/2016-02/msg00009.html
(_AC_CXX_CXX11_TEST_BODY): Don't use string literals to initialize
non-const pointers.  Suggested by Mike Miller in:
http://lists.gnu.org/archive/html/autoconf/2016-02/msg00008.html

9 years agoFix broken URL to Unix history
Paul Eggert [Tue, 15 Mar 2016 15:15:35 +0000 (08:15 -0700)] 
Fix broken URL to Unix history

* doc/autoconf.texi (Systemology): Fix broken URL.
Reported by Tom Wilcox.

9 years agoAC_C_RESTRICT: port better to non-GCC + glibc
Paul Eggert [Tue, 23 Feb 2016 07:07:02 +0000 (23:07 -0800)] 
AC_C_RESTRICT: port better to non-GCC + glibc

Problem reported by Dwight Guth in:
http://lists.gnu.org/archive/html/bug-autoconf/2016-02/msg00006.html
* lib/autoconf/c.m4 (AC_C_RESTRICT): Prefer __restrict__ to __restrict.
Also, fix and update some comments.

9 years agoMove config.* man pages to its source tree
Paul Eggert [Sun, 7 Feb 2016 01:16:35 +0000 (17:16 -0800)] 
Move config.* man pages to its source tree

Suggested by Ben Elliston in:
https://lists.gnu.org/archive/html/autoconf-patches/2015-11/msg00000.html
* man/config.guess.x, man/config.sub.x: Remove.
* NEWS: Mention this.
* man/local.mk (dist_man_MANS): Remove them.
($(mansrcdir)/config.guess.1, $(mansrcdir)/config.sub.1): Remove rules.

9 years agomaint: make update-copyright
Paul Eggert [Sun, 7 Feb 2016 01:08:27 +0000 (17:08 -0800)] 
maint: make update-copyright

9 years agoport to new Autom4te::XFile API
Paul Eggert [Sat, 6 Feb 2016 20:56:55 +0000 (12:56 -0800)] 
port to new Autom4te::XFile API

9 years agomake fetch
Paul Eggert [Sat, 6 Feb 2016 20:39:10 +0000 (12:39 -0800)] 
make fetch

9 years agoPort better to gcc -fsanitize=address
Paul Eggert [Sat, 6 Feb 2016 18:13:50 +0000 (10:13 -0800)] 
Port better to gcc -fsanitize=address

* lib/autoconf/functions.m4 (_AC_FUNC_MALLOC_IF, _AC_FUNC_REALLOC_IF):
Free heap-allocated storage before exiting.

9 years agoFix memory leak in AC_FUNC_MMAP
Paul Eggert [Sat, 6 Feb 2016 05:06:20 +0000 (21:06 -0800)] 
Fix memory leak in AC_FUNC_MMAP

* lib/autoconf/functions.m4 (AC_FUNC_MMAP): Fix memory leak
in test case, found by configuring with gcc -fsanitize=address.

9 years agoDocument dash ${*-unset} behavior
Paul Eggert [Fri, 5 Feb 2016 22:15:07 +0000 (14:15 -0800)] 
Document dash ${*-unset} behavior

* doc/autoconf.texi (Shell Substitutions): Document dash
incompatibility.  Problem reported by David Caldwell in:
http://bugs.gnu.org/22556

9 years agoAdd -mdir flag for NAG Fortran compiler
Thomas Jahns [Thu, 8 Oct 2015 08:12:41 +0000 (10:12 +0200)] 
Add -mdir flag for NAG Fortran compiler

* lib/autoconf/fortran.m4 (AC_FC_MODULE_OUTPUT_FLAG):
Also try -mdir.  Also, prefer autoconf macros instead of verbatim shell
code and make tests safer.
Copyright-paperwork-exempt: yes

9 years agotests: port to recent libtool diagnostics
Paul Eggert [Sat, 5 Sep 2015 14:55:52 +0000 (07:55 -0700)] 
tests: port to recent libtool diagnostics

Problem reported by Christian Fafard in:
http://lists.gnu.org/archive/html/bug-autoconf/2015-09/msg00009.html
* tests/foreign.at (libtool): Run the scripts in the C locale,
so that we need not worry about localized quotes in their output.

10 years agoAdd /opt/X11/include to X search path
Paul Eggert [Sat, 8 Aug 2015 01:09:17 +0000 (18:09 -0700)] 
Add /opt/X11/include to X search path

* lib/autoconf/libs.m4 (_AC_PATH_X_DIRECT):
Add /opt/X11/include for OS X.
Problem reported by Daniel Macks at:
http://lists.gnu.org/archive/html/bug-autoconf/2015-08/msg00002.html

10 years agodoc: mention 'for' syntax issue on older shells
Eric Blake [Thu, 4 Jun 2015 20:00:29 +0000 (14:00 -0600)] 
doc: mention 'for' syntax issue on older shells

Based on a report by Michael Felt, via Paul Eggert on the
coreutils list.

* doc/autoconf.texi (Limitations of Builtins) <for>: Document
problem with 'for var in ;'.

Signed-off-by: Eric Blake <eblake@redhat.com>
10 years agoAC_CHECK_DECL, AC_CHECK_DECLS: port to the Clang compiler
Noah Misch [Thu, 14 May 2015 01:11:47 +0000 (21:11 -0400)] 
AC_CHECK_DECL, AC_CHECK_DECLS: port to the Clang compiler

* lib/autoconf/general.m4 (_AC_UNDECLARED_WARNING): New macro.
(_AC_CHECK_DECL_BODY): Call it once per language; treat warnings as
errors when its verdict indicates that.
* tests/semantics.at (AC_CHECK_DECLS): Add a macro call that relies on
the new semantics.  Avoid -Wmissing-variable-declarations warnings.
* doc/autoconf.texi (Generic Declarations): Document the implications.
* NEWS: Mention this change.

10 years agom4_pattern_forbid: better documentation
Matěj Týč [Thu, 16 Apr 2015 21:00:24 +0000 (23:00 +0200)] 
m4_pattern_forbid: better documentation

Give a more concrete description of what the m4_pattern_forbid
thingy that pretends it is a macro accepts as an argument.

Copyright-paper-exempt: Yes
Signed-off-by: Eric Blake <eblake@redhat.com>
10 years agolib: use shorter way to test if variable is set
Eric Blake [Wed, 15 Apr 2015 22:31:34 +0000 (16:31 -0600)] 
lib: use shorter way to test if variable is set

Based on an idea by Bernhard Reutner-Fischer.

We frequently used the idiom of 'test "${var+set}" = set' to
test if $var was set to a non-empty string, but this can portably
be trimmed to a more compact 'test ${var+y}' for a smaller
configure file.  Testing that a variable is not set can be done
with '${var+false} :' (although the value of $? is not reliably
1 when the variable is set).

The code for AS_VAR_TEST_SET already used the form '${var+:} false',
but it is slightly longer, and does not guarantee $? of 1.

Tested on coreutils, where the resulting configure file is about
1k smaller.

* doc/autoconf.texi (Shell Substitutions): Prefer shorter sequence
for testing if a variable is set.
(Limitations of Builtins) <test (strings)>: Document it.
* configure.ac: Use it.
* lib/autoconf/c.m4 (_AC_PROG_CC_G, _AC_PROG_CXX_G)
(_AC_PROG_OBJC_G, _AC_PROG_OBJCXX_G): Likewise.
* lib/autoconf/fortran.m4 (_AC_PROG_FC_G): Likewise.
* lib/autoconf/general.m4 (_AC_ENABLE_IF_ACTION, AC_CACHE_SAVE):
Likewise.
* lib/autoconf/lang.m4 (_AC_COMPILER_EXEEXT_DEFAULT): Likewise.
* lib/autoconf/programs.m4 (AC_PROG_INSTALL, AC_PROG_MKDIR_P)
(_AC_PROG_LEX_YYTEXT_DECL): Likewise.
* lib/autoconf/status.m4 (_AC_OUTPUT_MAIN_LOOP): Likewise.
* lib/autotest/general.m4 (AT_INIT): Likewise.
* tests/base.at (AC_CACHE_CHECK): Likewise.
* tests/m4sh.at (LINENO): Likewise.
* lib/m4sugar/m4sh.m4 (_AS_BOURNE_COMPATIBLE)
(_AS_DETECT_BETTER_SHELL, _AS_SHELL_SANITIZE)
(_AS_PATH_SEPARATOR_PREPARE): Likewise.
(AS_VAR_TEST_SET): Use shorter sequence.

Signed-off-by: Eric Blake <eblake@redhat.com>
10 years agom4_set_foreach: minor optimization
Eric Blake [Tue, 21 Apr 2015 12:14:33 +0000 (06:14 -0600)] 
m4_set_foreach: minor optimization

As a minor optimization, most macros in m4sugar.m4 try to avoid
output of 'dnl' in the expansion, to reduce the number of macros
that must be expanded at each call site.

* lib/m4sugar/m4sugar.m4 (m4_set_foreach): Don't expand dnl in all
callers.

Signed-off-by: Eric Blake <eblake@redhat.com>
10 years agom4sugar: fix pop typo in m4_set_foreach
Nick Bowler [Tue, 21 Apr 2015 06:57:18 +0000 (23:57 -0700)] 
m4sugar: fix pop typo in m4_set_foreach

* lib/m4sugar/m4sugar.m4 (m4_set_foreach): Pop macro definition.
Copyright-paperwork-exempt: Yes

10 years agoAC_PROG_MKDIR_P: reduce macro output size
Eric Blake [Thu, 9 Apr 2015 14:47:10 +0000 (08:47 -0600)] 
AC_PROG_MKDIR_P: reduce macro output size

Merging two case globs into one gives slightly smaller files and
less time spent in shell globbing on systems that lack GNU mkdir.

* lib/autoconf/programs.m4 (AC_PROG_MKDIR_P): Combine two GNU cases.

Signed-off-by: Eric Blake <eblake@redhat.com>
10 years agoAC_PROG_MKDIR_P: Also accept BusyBox mkdir -p
Bernhard Reutner-Fischer [Thu, 9 Apr 2015 12:43:30 +0000 (14:43 +0200)] 
AC_PROG_MKDIR_P: Also accept BusyBox mkdir -p

* lib/autoconf/programs.m4 (AC_PROG_MKDIR_P): Accept BusyBox.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
10 years agotests: avoid two false-positive parallel test failures
Jim Meyering [Sun, 1 Feb 2015 19:41:27 +0000 (11:41 -0800)] 
tests: avoid two false-positive parallel test failures

* tests/local.mk (check-local): Add a leading "+",
to void false-positive test failures when running
them in parallel.  Before this change, running e.g.,
"make check TESTSUITEFLAGS=--jobs=15" would always
fail the two "make"-invoking tests: "C unit tests"
and "C unit tests (EXEEXT)".
(installcheck-local): Likewise for "installcheck".

10 years agodoc: -f is now portable for cp and ln
Paul Eggert [Fri, 2 Jan 2015 21:02:48 +0000 (13:02 -0800)] 
doc: -f is now portable for cp and ln

This follows up on a comment by Glenn Morris in:
http://lists.gnu.org/archive/html/emacs-devel/2015-01/msg00011.html
* doc/autoconf.texi (Limitations of Usual Tools):
Remove circa-1990 advice about avoiding cp -f and ln -f.
Although that advice was reasonable for the early 1990s, the -f
option is portable for both cp and ln nowadays.  These options
were standardized in POSIX 1003.2-1992, and pre-POSIX systems such
as SunOS 4 are no longer of practical concern.

10 years agomaint: bump copyright year
Paul Eggert [Fri, 2 Jan 2015 21:01:08 +0000 (13:01 -0800)] 
maint: bump copyright year

* doc/autoconf.texi: Update copyright year.
This had to be done by hand.

10 years agomaint: bump copyright to 2015
Paul Eggert [Fri, 2 Jan 2015 20:59:21 +0000 (12:59 -0800)] 
maint: bump copyright to 2015

* all files: Run 'make update-copyright'.

10 years agoFix spurious testsuite failure when /bin/sh is dash
Stefano Lattarini [Wed, 17 Dec 2014 12:03:35 +0000 (13:03 +0100)] 
Fix spurious testsuite failure when /bin/sh is dash

The testsuite used slightly different logic in the code employed to
decide whether a test should be skipped due to a limitation of the
selected shell, and in the code running the test itself.

* tests/autotest.at (Syntax error): Adjust.
(parallel syntax error): Likewise.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
10 years agotests: avoid spurious test failure with libtool 2.4.3
Gary V. Vaughan [Mon, 3 Nov 2014 06:25:03 +0000 (07:25 +0100)] 
tests: avoid spurious test failure with libtool 2.4.3

Based on a report by Bruce Dubbs.

* tests/foreign.at (Libtool): Be tolerant of 'quote' replacing the
older `quote'.

Signed-off-by: Eric Blake <eblake@redhat.com>
10 years agodocs: mention that not all values can be exported
Eric Blake [Sun, 28 Sep 2014 00:24:06 +0000 (18:24 -0600)] 
docs: mention that not all values can be exported

There has been a LOT of news about bash's Shell Shock bug lately.
Document some of the ramifications it has on portable scripting.

* doc/autoconf.texi (Limitations of Builtins) <export>: Add some
details about Shell Shock CVE-2014-6271.

Signed-off-by: Eric Blake <eblake@redhat.com>
10 years agodoc: distinguish GCC from GNU C, etc.
Paul Eggert [Mon, 8 Sep 2014 17:15:34 +0000 (10:15 -0700)] 
doc: distinguish GCC from GNU C, etc.

* doc/autoconf.texi (C Compiler, Objective C Compiler)
(Objective C++ Compiler, Fortran Compiler): Be more careful about
distinguishing GNU C from GCC, and similarly for other languages.
Problem reported by Marko Lindqvist in:
http://lists.gnu.org/archive/html/autoconf/2014-09/msg00027.html

10 years agoautoconf: clarify "checking" message for GNU-compatible compiliers
Paul Eggert [Mon, 8 Sep 2014 16:25:08 +0000 (09:25 -0700)] 
autoconf: clarify "checking" message for GNU-compatible compiliers

Problem reported by Bastien Chevreux in:
http://lists.gnu.org/archive/html/autoconf/2014-09/msg00022.html
and idea for fix by Eric Blake in:
http://lists.gnu.org/archive/html/autoconf/2014-09/msg00025.html
* doc/autoconf.texi (Running the Preprocessor)
(Present But Cannot Be Compiled):
Adjust examples to match current behavior.
* lib/autoconf/lang.m4 (_AC_LANG_COMPILER_GNU): Say
"checking whether the compiler supports GNU C", not
"checking whether we are using the GNU C compiler".

10 years agoautoconf: fix typo in previous change
Paul Eggert [Tue, 2 Sep 2014 19:08:24 +0000 (12:08 -0700)] 
autoconf: fix typo in previous change

* lib/autoconf/c.m4 (AC_C_RESTRICT): Fix typo in previous change.

10 years agoautoconf: port 'restrict' to GCC 4.2.1
Paul Eggert [Tue, 2 Sep 2014 18:43:32 +0000 (11:43 -0700)] 
autoconf: port 'restrict' to GCC 4.2.1

* lib/autoconf/c.m4 (AC_C_RESTRICT): Detect GCC bug 14050.
Problem reported by Marco Munari for OpenBSD 5.5.

11 years agocross-compiling: handling modern platforms able to run foreign binaries.
Jehan [Wed, 2 Oct 2013 05:53:50 +0000 (18:53 +1300)] 
cross-compiling: handling modern platforms able to run foreign binaries.

* lib/autoconf/lang.m4 (_AC_COMPILER_EXEEXT_CROSS):
When only --host is set, and no --build, but in the end, the resulting
computed $build and $host are different, set $cross_compiling = yes.
Indeed we can't rely only on a successful test program run, because false
positives occur on some platforms. In particular modern GNU/Linux
distributions set Wine to automatically handle Windows binaries.
Consequently $cross_compiling gets set to "no" even though we are in an
obvious cross-compilation case.
(tiny change)

11 years agoautoconf: modernize AC_C_VARARRAYS for C11
Paul Eggert [Fri, 8 Aug 2014 00:16:40 +0000 (17:16 -0700)] 
autoconf: modernize AC_C_VARARRAYS for C11

* lib/autoconf/c.m4 (AC_C_VARARRAYS): Define __STDC_NO_VLA__ if
VLAs are not supported, as this is what C11 does.  The old macro
HAVE_C_VARARRAYS is still defined if they are supported, but is
now obsolescent.  Also, check for VLA bug in GCC 3.4.3.
* doc/autoconf.texi (C Compiler), NEWS: Document the above.

11 years agodoc: Solaris 11 supports $(...)
Paul Eggert [Thu, 7 Aug 2014 23:08:49 +0000 (16:08 -0700)] 
doc: Solaris 11 supports $(...)

* doc/autoconf.texi (Shell Substitutions): Say that $(...) isn't
working in Solaris 10 and earlier, not in "recent releases".

11 years agodoc: modernize character encoding
Paul Eggert [Thu, 7 Aug 2014 22:03:38 +0000 (15:03 -0700)] 
doc: modernize character encoding

* doc/autoconf.texi: Specify @documentencoding UTF-8.  Don't abuse
'`' to mean open quote, unless Texinfo already interprets it that
way.  Be more careful about hyphen versus minus versus endash
versus emdash.

11 years agom4sh: allow trailing newlines in shell conditions
Eric Blake [Thu, 17 Jul 2014 20:52:57 +0000 (14:52 -0600)] 
m4sh: allow trailing newlines in shell conditions

Dimitrios Apostolou reported getting a shell syntax error for
this construct in his configure.ac:

AM_CONDITIONAL([HAVE_LIBXML2],
    [test "x$with_libxml2" != xno &&
     test "x$ac_cv_lib_xml2_xmlFirstElementChild" = xyes]
)

He analyzed it to a root cause: his trailing newline, coupled
with an 'if $2; then' construct in the macro body, resulted in
configure containing:
if test ... xyes
; then
where the semicolon is a syntax error in shell; and proposed
a patch to automake to fix his use case.

While that macro is not under our control, it does highlight
the fact that the shell can use either ; or newline to
terminate a conditional prior to the next keyword in a compound
statement.  If we use newline, we gain two benefits - the
configure file is slightly smaller (more lines, but fewer
bytes), and any user that doesn't realize that unquoted
trailing newlines in a macro argument are still significant
can still generate valid shell code when their argument is
used in a shell compound statement.

* lib/m4sugar/m4sh.m4 (AS_IF, _AS_IF, _AS_CLEAN_DIR): Prefer
newline over semicolon to end user-supplied conditionals.
* lib/autoconf/general.m4 (AC_CONFIG_AUX_DIRS): Likewise.
* lib/autoconf/libs.m4 (AC_SEARCH_LIBS): Likewise.
* lib/autoconf/programs.m4 (_AC_PATH_PROGS_FEATURE_CHECK):
Likewise.
* tests/m4sh.at (AS_IF and AS_CASE): Test it.

Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agomaint: add to THANKS
Eric Blake [Fri, 30 May 2014 15:03:10 +0000 (09:03 -0600)] 
maint: add to THANKS

* THANKS: Update.

Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agoAC_INIT: quote invalid feature names
Eric Blake [Fri, 30 May 2014 14:55:10 +0000 (08:55 -0600)] 
AC_INIT: quote invalid feature names

Changes:
   configure: error: invalid feature name: debug
to
   configure: error: invalid feature name: `debug '
to make it obvious if trailing space is the reason why a feature
name was rejected; similar to existing error messages elsewhere
about invalid shell variable names.

* lib/autoconf/general.m4 (_AC_INIT_PARSE_ENABLE2): Add quotes.
Reported by Noel Grandin.

Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agoautoconf: fix typo in description generated by AC_RUN_IFELSE
Paul Eggert [Mon, 12 May 2014 05:15:40 +0000 (22:15 -0700)] 
autoconf: fix typo in description generated by AC_RUN_IFELSE

* lib/autoconf/general.m4 (_AC_RUN_IFELSE): "run" not "link"
in description.

11 years agoChange main () to main (void) for C/C++
Vincent Lefevre [Sun, 5 Jan 2014 03:50:02 +0000 (04:50 +0100)] 
Change main () to main (void) for C/C++

This patch changes "main ()" to "main (void)" for C/C++.
See: http://lists.gnu.org/archive/html/bug-autoconf/2014-01/msg00005.html

On my machine, before this patch, 3 tests were failing:

  38: tools.at:1329      autom4te cache locking
 218: autotest.at:1893   C unit tests
      ac_config_testdir at_tested autotest
 219: autotest.at:1948   C unit tests (EXEEXT)
      ac_config_testdir at_tested autotest

With this patch, 2 tests were failing:

 218: autotest.at:1893   C unit tests
      ac_config_testdir at_tested autotest
 219: autotest.at:1948   C unit tests (EXEEXT)
      ac_config_testdir at_tested autotest

(I suspect that 38 is unrelated.)

Signed-off-by: Vincent Lefevre <vincent@vinc17.net>
Copyright-paperwork-exempt: Yes

11 years agodoc: give an example of using the macro for pkg-config
Eric Blake [Mon, 27 Jan 2014 18:33:07 +0000 (11:33 -0700)] 
doc: give an example of using the macro for pkg-config

The autoconf manual doesn't mention any examples of actually
using m4_pattern_forbid.  Yet this is the perfect macro for
avoiding the all-too-common failure mode of configure dying with:

      checking if libxml2 is present... ./configure: line 11586: syntax
 error
 near unexpected token `LIBXML2,'
      ./configure: line 11586: `PKG_CHECK_MODULES(LIBXML2, libxml-2.0>=
 2.6.19,'

for developers that forgot to install pkg-config.  While we don't
necessarily advertise the use of PKG_CHECK_MODULES, it is a
common enough situation that the manual should make it easier to
help developers learn about missing third-party macros.

Based on a mailing list report by Daniel Pocock:
http://lists.gnu.org/archive/html/autoconf/2014-01/msg00030.html

* doc/autoconf.texi (Forbidden Patterns): Add examples.

Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agotests: don't let config.site affect testsuite
Eric Blake [Wed, 1 Jan 2014 23:46:48 +0000 (16:46 -0700)] 
tests: don't let config.site affect testsuite

Test 236 "configure directories" failed for me on 64-bit Fedora 20;
it boiled down to the system's config.site causing libdir to
default to /usr/lib64 instead of the autoconf default of /usr/lib.

* tests/base.at (configure directories): Neutralize any preinstalled
config.site from the system.

Signed-off-by: Eric Blake <eblake@redhat.com>