]> git.ipfire.org Git - thirdparty/autoconf.git/log
thirdparty/autoconf.git
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>
11 years agomaint: fix 'make syntax-check' findings
Eric Blake [Wed, 1 Jan 2014 23:32:04 +0000 (16:32 -0700)] 
maint: fix 'make syntax-check' findings

Fix syntax check warnings that are unrelated to the new copyright
year.

* lib/local.mk (lib/autoscan/autoscan.list): Reduce indent, to
avoid mix of tab and 8 spaces.
* bin/local.mk (bin/autoconf.in): Likewise.
* lib/autoconf/c.m4 (_AC_CXX_CXX98_TEST_BODY): Use consistent case
in message.

Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agomaint: bump copyright to 2014
Eric Blake [Thu, 3 Jan 2013 21:58:52 +0000 (14:58 -0700)] 
maint: bump copyright to 2014

Done via 'make update-copyright', since all files are effectively
modified and distributed this year via public version control.

* all files: Update copyright year.

11 years agoExpose the checks done by AC_INCLUDES_DEFAULT as a public macro.
Zack Weinberg [Sun, 15 Sep 2013 21:16:18 +0000 (17:16 -0400)] 
Expose the checks done by AC_INCLUDES_DEFAULT as a public macro.

 * lib/autoconf/headers.m4 (_AC_INCLUDES_DEFAULT_REQUIREMENTS):
   Rename to AC_CHECK_INCLUDES_DEFAULT.  All callers changed.
   (AC_HEADER_STDC, AC_UNISTD_H): Use AC_CHECK_INCLUDES_DEFAULT instead
   of previous kludge.

 * doc/autoconf.texi, NEWS: Document AC_CHECK_INCLUDES_DEFAULT.

11 years agoUse AC_CHECK_{DECLS,FUNCS,HEADERS}_ONCE more in specific-check macros.
Zack Weinberg [Sun, 15 Sep 2013 16:24:45 +0000 (12:24 -0400)] 
Use AC_CHECK_{DECLS,FUNCS,HEADERS}_ONCE more in specific-check macros.

 * lib/autoconf/functions.m4 (AC_FUNC_CHOWN): No need to check for unistd.h.
   (_AC_LIBOBJ_FNMATCH): Use AC_CHECK_DECLS_ONCE and AC_CHECK_FUNCS_ONCE.
   (_AC_LIBOBJ_GETLOADAVG): Use AC_CHECK_FUNCS_ONCE for setlocale.
   (AC_FUNC_MMAP): Use AC_CHECK_FUNCS_ONCE for getpagesize.
   (AC_FUNC_SELECT_ARGTYPES): Use AC_CHECK_HEADERS_ONCE for sys/select.h and
   sys/socket.h.
   (AC_FUNC_STRERROR_R): Use AC_CHECK_DECLS_ONCE + AC_CHECK_FUNCS_ONCE for
   strerror_r.
   (AC_FUNC_UTIME_NULL): Use AC_CHECK_HEADERS_ONCE for utime.h.
   (AC_FUNC_FORK): Use AC_CHECK_HEADERS_ONCE and AC_CHECK_FUNCS_ONCE.
   (AC_FUNC_VPRINTF): Use AC_CHECK_FUNCS_ONCE for vprintf (but not _doprnt).

 * lib/autoconf/headers.m4 (AC_HEADER_TIME, AC_MEMORY_H): Use
   AC_CHECK_HEADERS_ONCE.

11 years agoUse AC_CHECK_HEADERS_ONCE for the tests done by AC_INCLUDES_DEFAULT.
Zack Weinberg [Sat, 14 Sep 2013 16:42:15 +0000 (12:42 -0400)] 
Use AC_CHECK_HEADERS_ONCE for the tests done by AC_INCLUDES_DEFAULT.

 * lib/autoconf/headers.m4 (AC_CHECK_HEADERS_ONCE): Divide into a public
   macro that AC_REQUIREs _AC_INCLUDES_DEFAULT_REQUIREMENTS, and ...
   (_AC_CHECK_HEADERS_ONCE): ... a private macro, that doesn't.
   (_AC_HEADERS_EXPANSION): Use $ac_includes_default, not
   AC_INCLUDES_DEFAULT.
   (_AC_INCLUDES_DEFAULT_REQUIREMENTS): Use AC_CHECK_HEADERS_ONCE.

11 years agoModernize AC_INCLUDES_DEFAULT and friends.
Zack Weinberg [Sat, 14 Sep 2013 16:22:49 +0000 (12:22 -0400)] 
Modernize AC_INCLUDES_DEFAULT and friends.

 * lib/autoconf/headers.m4 (_AC_INCLUDES_DEFAULT_REQUIREMENTS):
   Include stddef.h, stdlib.h, and string.h unconditionally.
   Don't include memory.h at all.
   Don't use AC_HEADER_STDC.
   Don't check for stddef.h, stdlib.h, string.h, or memory.h.
   For compatibility, unconditionally define STDC_HEADERS,
   HAVE_STDLIB_H, and HAVE_STRING_H.
   (AN_HEADER list): Remove C89 headers, and memory.h from list.
   (AC_HEADER_STDC, AC_UNISTD_H): AU_DEFUN to trigger
   _AC_INCLUDES_DEFAULT_REQUIREMENTS if it hasn't already happened,
   and do nothing else.
   (AC_HEADER_TIME): AU_DEFUN, and define TIME_WITH_SYS_TIME unconditionally
   as long as sys/time.h is present.
   (AC_USG, AC_MEMORY_H): Assume existence of string.h.
 * lib/autoconf/functions.m4 (_AC_FUNC_MALLOC_IF, _AC_FUNC_REALLOC_IF):
   Don't use AC_HEADER_STDC. Assume stdlib.h exists.
   (AC_FUNC_MKTIME): Don't use AC_HEADER_TIME.  Assume time.h exists.
   (AC_FUNC_ALLOCA): Assume stdlib.h exists.
   (_AC_LIBOBJ_FNMATCH): Assume wchar.h and wctype.h exist.
   (_AC_LIBOBJ_GETLOADAVG): Assume locale.h exists.
   (AC_FUNC_MMAP): Assume stdlib.h exists.
 * tests/tools.at: Use AC_WORDS_BIGENDIAN instead of AC_STDC_HEADERS in
   autoupdate test.

 * NEWS, doc/autoconf.texi: Document changes. Remove obsolete advice.

11 years agoAC_CHECK_HEADER/AC_CHECK_HEADERS: complete transition to compile tests.
Zack Weinberg [Sat, 14 Sep 2013 00:42:04 +0000 (20:42 -0400)] 
AC_CHECK_HEADER/AC_CHECK_HEADERS: complete transition to compile tests.

* lib/autoconf/headers.m4 (AC_CHECK_HEADER): Use _AC_CHECK_HEADER_COMPILE
  by default.  Continue to use _AC_CHECK_HEADER_PREPROC if fourth arg is '-'.
  (_AC_CHECK_HEADER_PREPROC): Issue a deprecation warning.
  (_AC_CHECK_HEADER_MONGREL, _AC_CHECK_HEADER_MONGREL_BODY): Remove.

* tests/c.at, tests/semantics.at: Update uses of AC_CHECK_HEADER(S).
* doc/autoconf.texi, NEWS: Document change.

11 years ago* tests/local.at (AT_CHECK_M4): Support 'stderr' as fourth argument.
Zack Weinberg [Fri, 13 Sep 2013 15:26:08 +0000 (11:26 -0400)] 
* tests/local.at (AT_CHECK_M4): Support 'stderr' as fourth argument.

11 years agoadmin: mention recent copyright assignments
Eric Blake [Thu, 13 Oct 2011 20:51:29 +0000 (14:51 -0600)] 
admin: mention recent copyright assignments

* AUTHORS: Update list.

Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agoAC_INIT: add --runstatedir option to configure
Eric Blake [Thu, 12 Sep 2013 21:11:29 +0000 (15:11 -0600)] 
AC_INIT: add --runstatedir option to configure

http://lwn.net/Articles/436012/ documents that many distros
are now preferring to use /run rather than /var/run for
storage of pid files and other per-process temporary files
that must not be cleaned out during arbitrary TMPDIR sweeps.
As such, the GNU Coding Standards were recently changed to
recommend a new configure option to make it easy to choose
this directory at configure time.  This patch adds support
for the option to all configure scripts built by autoconf.

* general.m4 (_AC_INIT_PARSE_ARGS): Add new directory option.
(_AC_INIT_HELP): Document it.
* doc/autoconf.texi (Installation Directory Variables): Document
new option.
(Site Defaults): Mention typical use within a distro.
* NEWS: Mention the addition.

Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agoAC_PROG_CC: also try $CC -version, for cl6x compiler
Eric Blake [Thu, 12 Sep 2013 15:23:35 +0000 (09:23 -0600)] 
AC_PROG_CC: also try $CC -version, for cl6x compiler

Anaïs Bouque reported that the cl6x compiler only understands -version:
https://lists.gnu.org/archive/html/bug-autoconf/2013-07/msg00003.html

* c.m4 (AC_PROG_CC): Add another version probe.
* THANKS: Update.

Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agodoc: mention how to set early defaults
Eric Blake [Thu, 5 Sep 2013 20:14:55 +0000 (14:14 -0600)] 
doc: mention how to set early defaults

Jonathan Lebon reported an issue to me off-list about a regression
in libvirt's configure script, which I traced to a patch that
rearranged code that was checking $with_library compared to the
AC_ARG_WITH that actually set $with_library [1].  As the whole point
of the libvirt patch was to refactor code to make maintenance
easier by hiding the AC_ARG_WITH in a helper macro for a net
reduction in lines, it makes sense to actually document how to
check what value a variable has prior to the AC_ARG_WITH usage.

Alas, although the functionality for this has been present in
autoconf for ages, the documentation has been lacking.

[1] libvirt.org/git/?p=libvirt.git;a=commitdiff;h=654c709

* doc/autoconf.texi (Diversion support) <m4_divert_text>: Add
anchor.
(External Software) <AC_ARG_WITH>: Demonstrate how to use DEFAULTS
diversion, for earlier defaults.
(Package Options) <AC_ARG_ENABLE>: Likewise.
* THANKS: Add Jonathan Lebon.

Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agodoc: 'configure && make', not 'configure; make' (Bug#15066)
Paul Eggert [Sat, 10 Aug 2013 15:12:07 +0000 (08:12 -0700)] 
doc: 'configure && make', not 'configure; make' (Bug#15066)

* doc/install.texi (Basic Installation): Say '&&', not ';'.

12 years agodoc: don't push 'static inline'
Paul Eggert [Sun, 30 Jun 2013 00:49:27 +0000 (17:49 -0700)] 
doc: don't push 'static inline'

* doc/autoconf.texi (Function Portability): Use plain 'static',
not 'static inline', in example.  These days, 'static' is enough;
optimizing compilers can figure out the 'inline' on their own.

12 years ago* lib/autoconf/functions.m4 (HAVE_DOPRNT): Fix missing-comma typo.
Paul Eggert [Fri, 21 Jun 2013 18:00:38 +0000 (11:00 -0700)] 
* lib/autoconf/functions.m4 (HAVE_DOPRNT): Fix missing-comma typo.

Reported by Peter Breitenlohner in:
http://lists.gnu.org/archive/html/autoconf-patches/2013-06/msg00007.html

12 years agoAC_PROG_CC: don't check whether $CC supports "-c -o" together
Stefano Lattarini [Sun, 26 May 2013 21:25:45 +0000 (23:25 +0200)] 
AC_PROG_CC: don't check whether $CC supports "-c -o" together

This reverts commit ce48964f.  The extra code added by that commit was
planned to be used by future version of Automake, but the implementation
and future directions there have in the meantime be changed in a way
that makes the extra code in Autoconf superfluous.  Just get rid of it.

* lib/autoconf/c.m4 (AC_PROG_CC): Adjust.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agomaint: sync few files from upstream
Stefano Lattarini [Sun, 26 May 2013 20:49:49 +0000 (22:49 +0200)] 
maint: sync few files from upstream

* build-aux/config.guess: This file.
* lib/Autom4te/Channels.pm: And this one.
* maint.mk: And this one.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agobuild: remove refs to obsolescent 'mkinstalldir' script and variable
Stefano Lattarini [Mon, 6 May 2013 09:21:08 +0000 (11:21 +0200)] 
build: remove refs to obsolescent 'mkinstalldir' script and variable

* .gitignore: Here.
* Makefile.am (check-coverage-run): Use $(MKDIR_P) rather than
$(mkinstalldirs).

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agobuild: remove last make recursion (for subdir 'man')
Stefano Lattarini [Sun, 5 May 2013 21:11:52 +0000 (23:11 +0200)] 
build: remove last make recursion (for subdir 'man')

* Makefile.am (SUBDIRS): Remove (its last component 'man' has just
been removed).
(SUFFIXES): New, defined to empty, to be updated later by included
files.
($(srcdir)/man/local.mk): Include this.
* configure.ac (AC_CONFIG_FILES): Drop 'man/Makefile'.
* lib/freeze.mk (SUFFIXES): Extend with '+=' rather than defining
with '='.
* man/Makefile.am: Rename ...
* man/local.mk: ... like this, and adjust throughout.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agobuild: no more recursion for 'tests' subdir
Stefano Lattarini [Sun, 5 May 2013 19:43:54 +0000 (21:43 +0200)] 
build: no more recursion for 'tests' subdir

* Makefile.am (SUBDIRS): Drop 'tests'.  Adjust comments.
(DISTCLEANFILES, MAINTAINERCLEANFILES): Define to empty, to be
updated later.
(MAINTAINERCLEANFILES): Adjust later definition to use '+='
rather than '='.
($(srcdir)/tests/local.mk): Include this.
* configure.ac (AC_CONFIG_FILES): Drop 'tests/Makefile'.
* lib/freeze.mk ($(AUTOM4TE_CFG)): Drop now-redundant remake rule.
($(build_libdir)/m4sugar/version.m4): Likewise.
* tests/Makefile.am: Rename ...
* tests/local.mk: ... like this, and adjust (quite heavily).
* tests/mktests.sh: Adjust to generate output files and temporary
files in the tests subdirectory rather than in the current
directory.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agobuild: fixup: don't define ETAGS_ARGS multiple times
Stefano Lattarini [Sun, 5 May 2013 19:26:15 +0000 (21:26 +0200)] 
build: fixup: don't define ETAGS_ARGS multiple times

* Makefile.am (ETAGS_ARGS): Define to empty, to be updated later.
* bin/local.mk (ETAGS_ARGS): Append to it, rather than re-defining it.
* lib/local.mk (ETAGS_ARGS): Likewise.  Also, do not bother appending
"--lang=perl" once again, as that is already done in 'bin/local.mk'.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agobuild: avoid repeating the same etags args several times
Stefano Lattarini [Sun, 5 May 2013 19:20:55 +0000 (21:20 +0200)] 
build: avoid repeating the same etags args several times

* lib/local.mk: Here.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agobuild: no more recursion for lib 'subdir'
Stefano Lattarini [Sun, 5 May 2013 19:05:43 +0000 (21:05 +0200)] 
build: no more recursion for lib 'subdir'

* Makefile.am (SUBDIRS): Drop 'lib'.
(edit): New, shared among the recipes in 'lib/local.mk' and
'bin/local.mk'.
(CLEANFILES): New, will be updated later in included files.
($(srcdir)/lib/local.mk): Include it.
($(srcdir)/lib/freeze.mk): Likewise.
* lib/Makefile.am: Rename ...
* lib/local.mk: .. like this, with several adjustments.  In
particular ...
(edit): Drop this definition, subsumed by the one in the
top-level Makefile.am.
* bin/local.mk (edit): Drop definition, that is already present
in the top-level Makefile.am now.
($(srcdir)/lib/freeze.mk): Drop inclusion; that is already done
in the top-level Makefile.am now.
* doc/local.mk (CLEANFILES): Adjust: append to it, do not define
it.
* lib/freeze.mk ($(AUTOM4TE_CFG)): Adjust recipe.
* configure.ac (AC_CONFIG_FILES): Drop 'lib/Makefile'.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>