Commit Graph

6567 Commits

Author SHA1 Message Date
Paul Eggert
b0ee838e11 maint: update URLs
Most of this is replacing http: with https: when either will do.
2017-09-23 12:49:23 -07:00
Paul Eggert
c5b290f6ae 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.
2017-09-23 12:49:23 -07:00
Paul Eggert
c47935de9e maint: sync from Automake
This just updates comments, notably URLs.
2017-09-23 12:49:23 -07:00
Paul Eggert
d3dcd5895d Prefer HTTPS to FTP and HTTP 2017-09-16 17:48:51 -07:00
Paul Eggert
5a4041daca make fetch 2017-09-16 17:48:51 -07:00
Paul Eggert
9a2f2467b4 "time stamp" -> "timestamp", as per POSIX 2017-09-16 17:16:57 -07:00
Eric Blake
b502e35054 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>
2017-01-25 13:42:01 -06:00
Jim Meyering
60460b91d0 maint: update copyright dates for 2017
* all files: Run "make update-copyright".
* doc/autoconf.texi: Update manually.
2017-01-01 05:18:32 -08:00
Eric Blake
968215e7b4 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>
2016-12-23 10:00:56 -06:00
Eric Blake
a6b2acf29d 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>
2016-12-22 13:34:35 -06:00
Daniel Elstner
78ad1b0b2c 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>
2016-12-21 10:31:54 -06:00
Paolo Bonzini
0e2eecedb1 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>
2016-12-21 08:32:45 -06:00
Paolo Bonzini
c54beb85aa 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>
2016-12-21 08:32:45 -06:00
Eric Blake
0848232967 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>
2016-12-21 08:32:43 -06:00
Eric Blake
d068c0a5ac 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>
2016-12-21 08:32:41 -06:00
Eric Blake
76183791a4 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>
2016-12-21 08:32:39 -06:00
Eric Blake
7377078751 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>
2016-12-21 08:32:36 -06:00
Eric Blake
501ccbbfdb 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>
2016-12-21 08:32:29 -06:00
Eric Blake
4523f7c32b 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>
2016-12-20 13:34:20 -06:00
Bruno Haible
eea950a012 * doc/autoconf.texi (Using Autotest): Stop mentioning Free Recode.
Free Wdiff is now GNU Wdiff again.
2016-12-14 10:29:05 -08:00
Paolo Bonzini
527f183f23 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>
2016-11-04 16:12:52 -05:00
Quinn Grier
b2621a91d7 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.
2016-11-02 12:19:14 -05:00
Pádraig Brady
251cc70252 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.
2016-11-01 15:30:32 -05:00
Paul Eggert
2b4844a760 AC_USE_SYSTEM_EXTENSIONS: Remove stray TR in doc 2016-09-15 12:26:52 -07:00
Paul Eggert
9021c82280 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
2016-09-15 10:10:14 -07:00
Eric Blake
e17a30e987 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>
2016-09-15 09:42:07 -05:00
Paul Eggert
565a6dc50c 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
2016-09-14 12:15:46 -07:00
Paul Eggert
4f08ddfe35 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.
2016-09-13 18:28:47 -07:00
Paul Eggert
0bd5dbd9b2 doc: port to Texinfo 6.3
* doc/autoconf.texi: Remove obsolete @setcontentsaftertitlepage
that provokes a warning from Texinfo 6.3.
2016-09-13 17:51:41 -07:00
Eric Blake
125ec0d7a0 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>
2016-09-13 17:44:02 -05:00
Paul Eggert
ab3086737c 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
2016-05-31 08:57:39 -07:00
Paul Eggert
017d5ddd82 Use American spelling for "initialize"
* lib/autoconf/c.m4: Prefer the spelling "initializer" in comments.
2016-04-03 13:57:40 -07:00
Paul Eggert
dc3dad37db 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.
2016-03-15 10:51:53 -07:00
Paul Eggert
739cdc82b5 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.
2016-03-15 09:34:34 -07:00
Paul Eggert
12aec07e44 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
2016-03-15 08:57:10 -07:00
Paul Eggert
6236291e58 Fix broken URL to Unix history
* doc/autoconf.texi (Systemology): Fix broken URL.
Reported by Tom Wilcox.
2016-03-15 08:16:05 -07:00
Paul Eggert
19fc364cf8 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.
2016-02-22 23:07:29 -08:00
Paul Eggert
04be2b7a29 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.
2016-02-06 17:17:50 -08:00
Paul Eggert
bbfa63cd4a maint: make update-copyright 2016-02-06 17:17:49 -08:00
Paul Eggert
21a3ac968c port to new Autom4te::XFile API 2016-02-06 17:17:49 -08:00
Paul Eggert
2ca0d5755f make fetch 2016-02-06 17:17:49 -08:00
Paul Eggert
14f568f683 Port better to gcc -fsanitize=address
* lib/autoconf/functions.m4 (_AC_FUNC_MALLOC_IF, _AC_FUNC_REALLOC_IF):
Free heap-allocated storage before exiting.
2016-02-06 17:17:48 -08:00
Paul Eggert
09b6e78d15 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.
2016-02-05 21:06:45 -08:00
Paul Eggert
5483deb8ae Document dash ${*-unset} behavior
* doc/autoconf.texi (Shell Substitutions): Document dash
incompatibility.  Problem reported by David Caldwell in:
http://bugs.gnu.org/22556
2016-02-05 14:15:38 -08:00
Thomas Jahns
5ad3567c3c 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
2015-10-08 12:53:34 -07:00
Paul Eggert
244d3f9acb 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.
2015-09-05 07:56:28 -07:00
Paul Eggert
57ec362325 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
2015-08-07 18:09:44 -07:00
Eric Blake
51b89d1ccd 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>
2015-06-04 15:58:24 -06:00
Noah Misch
82ef7805fa 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.
2015-05-13 21:11:47 -04:00
Matěj Týč
d2f0ec8708 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>
2015-04-21 06:37:10 -06:00