Commit Graph

2009 Commits

Author SHA1 Message Date
Paul Eggert
f6156ba050 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.
2014-08-07 17:17:25 -07:00
Paul Eggert
8a8e075675 doc: Solaris 11 supports $(...)
* doc/autoconf.texi (Shell Substitutions): Say that $(...) isn't
working in Solaris 10 and earlier, not in "recent releases".
2014-08-07 17:17:25 -07:00
Paul Eggert
c1fa7dc412 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.
2014-08-07 17:17:25 -07:00
Vincent Lefevre
1717921aa6 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
2014-02-13 11:38:12 -07:00
Eric Blake
e5d3c9621f 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>
2014-02-05 14:20:44 -07:00
Eric Blake
a610501ded 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.
2014-01-01 16:27:53 -07:00
Zack Weinberg
f181785d0e 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.
2013-09-21 20:02:47 -04:00
Zack Weinberg
86c213d0e3 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.
2013-09-21 19:38:09 -04:00
Zack Weinberg
11f520c61d 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.
2013-09-21 19:01:40 -04:00
Eric Blake
a197431414 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>
2013-09-14 06:28:34 -06:00
Eric Blake
befa52738c 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>
2013-09-05 14:56:45 -06:00
Paul Eggert
63f3c78cdb doc: 'configure && make', not 'configure; make' (Bug#15066)
* doc/install.texi (Basic Installation): Say '&&', not ';'.
2013-08-10 08:12:30 -07:00
Paul Eggert
79c4c50fc7 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.
2013-06-29 17:49:44 -07:00
Stefano Lattarini
a2af455752 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>
2013-05-06 12:26:37 +02:00
Stefano Lattarini
ac62b53ff7 build: no more make recursion for 'doc' subdir
* .gitignore: Adjust.
* Makefile.am ($(srcdir)/doc/local.mk): New include.
(SUBDIRS): Drop 'doc'.
(AM_MAKEINFOFLAGS): Rename ...
(custom_MAKEINFOFLAGS): ... like this, to avoid conflicting with
the AM_MAKEINFOFLAGS defined in the included 'doc/local.mk'
($(srcdir)/INSTALL): Adjust recipe.
* doc/Makefile.am: Rename ...
* doc/local.mk: ... like this, and adjust.
* configure.ac (AC_CONFIG_FILES): Drop 'doc/Makefile'.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
2013-05-06 12:22:00 +02:00
Stefano Lattarini
b2356bded8 sync: some files from upstream
* build-aux/config.guess: This.
* build-aux/config.sub: And this.
* build-aux/gendocs.sh: And this.
* build-aux/gnupload: And this.
* build-aux/texinfo.tex: And this.
* doc/standards.texi: And this.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
2013-05-05 17:25:05 +02:00
Paul Eggert
6b42b38f9b doc: add missing semicolons to make rules
Problem reported by Peter Eisentraut in
<http://lists.gnu.org/archive/html/bug-autoconf/2013-04/msg00007.html>.
* doc/autoconf.texi (Automatic Remaking): Append semicolons
to rules that need empty commands.
2013-04-23 21:43:03 -07:00
Akim Demaille
42761668c0 AC_PROG_YACC: don't force Bison to warn against its own features
When invoked with -y/--yacc, Bison warns when its extensions over
POSIX Yacc are used.  Yet many packages requiring GNU Bison use
Autoconf/Automake's Yacc support, which passes -y to Bison.  It
turns out that passing '-o y.tab.c' has exactly the desired
effect: generating not only y.tab.c but also y.tab.h with -d and
y.output with -v.  See:
http://lists.gnu.org/archive/html/bison-patches/2013-02/msg00100.html
* lib/autoconf/programs.m4 (AC_PROG_YACC): Use bison -o y.tab.c.
* NEWS, doc/autoconf.texi: Document this change.
2013-03-19 11:19:40 -07:00
Paul Eggert
845e703afd doc: explain why single-quoting is better
* doc/autoconf.texi (Build Directories): Explain single-quoting.
Reported by Markus Elfring in
<http://savannah.gnu.org/support/?108262>.
2013-03-08 09:23:07 -08:00
Paul Eggert
9e087dd343 AC_FUNC_GETLOADAVG: doc fix
* doc/autoconf.texi (Particular Functions):
Omit incorrect mention of @var{dir} before getloadavg.c.
Problem reported by Patricke Welche in:
http://lists.gnu.org/archive/html/autoconf-patches/2013-02/msg00006.html
2013-02-23 11:15:04 -08:00
Gary V. Vaughan
c3d301efd6 m4sugar: fix AS_VAR_GET regression.
AS_VAR_GET expands AS_ECHO inside en evaled single quoted string,
which causes the single quotes in "printf '%s\n'" to expose the
%s\n to the shell which expands "\n" to simply "n" before passing
it to printf.
* lib/m4sugar/m4sh.m4 (AS_ECHO): Use double quotes around the
format string.
* doc/autoconf.texi (Limitations of Shell Builtins): Show double
quotes to match AS_ECHO expansion.
* NEWS: Likewise.
2013-01-29 19:25:14 +07:00
Gary V. Vaughan
2b59b6f8a7 m4sugar: factor away _AS_ECHO_PREPARE.
"printf '%s\n' ..." has been a fine replacement for plain "echo"
for at least 5 years (probably more like 10), even with most
museum-piece shells.
* lib/m4sugar/m4sh.m4 (_AS_ECHO_PREPARE): Remove.
(_AS_SHELL_SANITIZE): Keep as_nl setting originally from
_AS_ECHO_PREPARE here where it more properly belongs.
(AS_ECHO, AS_ECHO_N): Use printf unconditionally.
* doc/autoconf.texi (Limitations of Shell Builtins): Document
preference for 'printf' over working around 'echo' bugs.
* NEWS: Updated.
Reported by Jim Meyering.
2013-01-29 16:47:48 +07:00
Roger Leigh
bd79b51000 AC_PROG_CXX: Add checks for C++11, C++98TR1 and C++98
These checks are the C++ equivalent of the existing C
standards checks.
* doc/autoconf.texi (C++ Compiler): Document new behavior.
* lib/autoconf/c.m4 (AC_PROG_CXX): Try for C++11,
falling back to C++98.
(_AC_CXX_STD_TRY, _AC_CXX_CXX98_TEST_HEADER, _AC_CXX_CXX98_TEST_BODY)
(_AC_CXX_CXX11_TEST_HEADER, _AC_CXX_CXX11_TEST_BODY)
(_AC_PROG_CXX_CXX98, _AC_PROG_CXX_CXX11):
New macros.
2013-01-28 23:32:05 -08:00
Eric Blake
ddd0bfbb06 maint: resync files from upstream
'make syntax-check' complained about something that was already
fixed upstream in doc/standards.texi, so I ran 'make update', and
omitted lib/Autom4te as that still has some issues to be sorted out.

* GNUmakefile: Resync from upstream.
* build-aux/announce-gen: Likewise.
* build-aux/config.guess: Likewise.
* build-aux/config.sub: Likewise.
* build-aux/git-version-gen: Likewise.
* build-aux/gitlog-to-changelog: Likewise.
* build-aux/gnupload: Likewise.
* build-aux/move-if-change: Likewise.
* build-aux/texinfo.tex: Likewise.
* build-aux/update-copyright: Likewise.
* build-aux/useless-if-before-free: Likewise.
* build-aux/vc-list-files: Likewise.
* doc/gendocs_template: Likewise.
* doc/standards.texi: Likewise.
* m4/autobuild.m4: Likewise.
* maint.mk: Likewise.
2013-01-03 15:19:05 -07:00
Eric Blake
fbaee459bf maint: bump copyright to 2013
Done via 'make update-copyright', since all files are effectively
modified and distributed this year via public version control.

* all files: Update copyright year.
2013-01-03 14:58:52 -07:00
Stefano Lattarini
685f4bd8b9 maint: sync some files from gnulib
* build-aux/config.guess: Synced by "make gnulib-update".
* build-aux/config.sub: Likewise.
* build-aux/gendocs.sh: Likewise.
* build-aux/gnupload: Likewise.
* build-aux/texinfo.tex: Likewise.
* doc/gendocs_template: Likewise.
* doc/standards.texi: Likewise.
* maint.mk: Likewise.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
2012-12-29 10:32:24 +01:00
Paul Eggert
ca8b864f43 AC_C__GENERIC: New macro.
* NEWS, doc/autoconf.texi (C Compiler): Document it.
* lib/autoconf/c.m4 (AC_C__GENERIC): Implement it.
2012-12-27 14:35:16 -08:00
Paolo Bonzini
851ef51796 autotest: enable usage of EXEEXT in AT_TESTED
Together with Linux's binfmt-misc feature, Wine can be used to test
cross-compiled programs as if they were native.  However, the shell
will not perform the "magic" addition of the .exe extension after a
program name when searching for an executable.  These simple patches
let the user work around this by specifying $EXEEXT in the AT_CHECK
and AT_TESTED argument.  (More care is needed because of carriage
returns, but this is beyond the scope of this series).

* tests/autotest.at (AT_INIT): Expand contents of $at_tested.
(AT_TESTED): Quote each program that is passed to the function.
* lib/autotest/general.m4 (C unit tests): Add AT_TESTED invocation
and keyword.
* doc/autoconf.texi (Writing testsuites): Document usage of variables
in AT_TESTED.
* NEWS: Document change.

Signed-off-by: Paolo Bonzini <bonzini@gnu.org>
2012-12-22 15:34:50 +01:00
Paul Eggert
fd29dbd7d9 AC_FUNC_ALLOCA: port to recent BSDs and remove obsolete AIX
* doc/autoconf.texi (Particular Functions): Remove the AIX case
from the recommended code, as the most recent version of the AIX
compiler that IBM still supports (V10.1 as of this writing) has
<alloca.h> and thus longer needs this, and the old suggestion
wasn't completely working anyway.  Remove obsolete discussion of
SVR3 libPW alloca and of SVR4 libucb alloca.
* lib/autoconf/functions.m4 (AC_FUNC_ALLOCA):
Rework to match documentation, including abovementioned AIX change.
Inconsistency with documentation reported by Steven G. Johnson in
<http://lists.gnu.org/archive/html/autoconf/2003-03/msg00179.html>.
As this adds stdlib.h, it should also fix the problems on recent
BSD platforms noted by Patrick Welche in
http://lists.gnu.org/archive/html/autoconf-patches/2012-12/msg00009.html
though the fix differs from NetBSD's current workaround.
Also, don't bother checking for alloca if <alloca.h> works,
as the latter implies the former.
2012-12-20 21:22:34 -08:00
Paolo Bonzini
42b4918d16 autotest: define AT_DATA_UNQUOTED
* lib/autotest/general.m4 (AT_DATA_UNQUOTED): New macro, paralleling
AT_DATA but not quoting the contents.
* doc/autoconf.texi (Writing Testsuites): Document it.
* tests/autotest.at (AT_DATA_UNQUOTED): Test it.

Signed-off-by: Paolo Bonzini <bonzini@gnu.org>
2012-12-07 14:25:08 +01:00
Paul Eggert
64ad4deb51 AC_CHECK_FILES: improve documentation
* doc/autoconf.texi (Files): Document AC_CHECK_FILES better.
Reported by Christophe Curis in
<http://savannah.gnu.org/support/?108182>.
2012-11-17 11:06:23 -08:00
Eric Blake
5269030d19 AC_CONFIG_MACRO_DIRS: improve tracing and add sanity checks
Too many legacy tools exist for us to unilaterally quit supporting
AC_CONFIG_MACRO_DIR - it is feasible for someone to want their
package to bootstrap with both automake 1.13 and libtool 2.4.2,
where the newer automake will only trace the new style of multiple
directory listings, but the older libtool does a sed and settles
on the one use of the old name.  So, we let both macros forward
to a new tracing macro, which also has the benefit of sanitizing
calls into one directory per trace; we also ensure that the old
macro is always traced, and appears at most once and before any
use of the new macro.

* doc/autoconf.texi (Input) <AC_CONFIG_MACRO_DIRS>: Document how
to trace this macro.
* lib/autom4te.in (Autoreconf-preselections)
(Automake-preselections): Preselect this trace.
* lib/autoconf/general.m4 (AC_CONFIG_MACRO_DIR_TRACE): New trace.
(_AC_CONFIG_MACRO_DIRS_USED, _AC_CONFIG_MACRO_DIRS): New internal
macros.
(AC_CONFIG_MACRO_DIRS, AC_CONFIG_MACRO_DIR): Use them.
* tests/tools.at (autoconf --trace: AC_CONFIG_MACRO_DIRS): New
test.
2012-11-09 16:16:22 -07:00
Stefano Lattarini
1ed0548896 warn: allow aclocal to silence m4_require warnings
We introduce a new witness macro, m4_require_silent_probe, for use by
aclocal during the Autoconf-without-aclocal-m4 language.  This will let
aclocal process AC_CONFIG_MACRO_DIRS without emitting spurious warnings.
In fact, if aclocal doesn't suppress require warnings, then, when some macro
expanded in configure.ac calls AC_REQUIRE on another macro that is defined
in one of the local m4 macro dirs specified with AC_CONFIG_MACRO_DIRS, the
*first* autom4te invocation issued by aclocal, not yet being able to "see"
the m4 macro definitions in the local m4 dirs, will print spurious
warnings like:

    configure.ac:4: warning: MY_BAR is m4_require'd but not m4_defun'd
    configure.ac:3: MY_FOO is expanded from...

Expose the use of this macro in our testsuite.

Originally reported by Nick Bowler; see point (4) of:
<http://lists.gnu.org/archive/html/autoconf-patches/2012-11/msg00000.html>

* lib/m4sugar/m4sugar.m4 (_m4_require_call): Make warnings in the
-Wsyntax category depend on the witness macro.
* tests/m4sugar.at (m4@&t@_require: warning message): New test.
* doc/autoconf.texi (Prerequisite Macros): Document how aclocal
can silence AC_REQUIRE (m4_require) warnings.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
2012-11-09 16:16:22 -07:00
Stefano Lattarini
4f6345bda7 docs: ACLOCAL_AMFLAGS will become obsolescent in Automake 1.13
See commit 'v1.12.1-165-gcd1a9cc' "aclocal: deprecate ACLOCAL_AMFLAGS,
trace AC_CONFIG_MACRO_DIR instead" in the Automake git repository.

See also follow-up discussion at:
<http://lists.gnu.org/archive/html/automake-patches/2012-07/msg00010.html>

* doc/autoconf.texi (@node Input @defmac AC_CONFIG_MACRO_DIRS): Adjust.
(autoreconf Invocation): Warn about the possible future removal of
ACLOCAL_AMFLAGS support from Automake.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
2012-11-09 15:45:45 -07:00
Stefano Lattarini
d73770f879 AC_CONFIG_MACRO_DIRS: new macro, mostly for aclocal
Similar to AC_CONFIG_MACRO_DIR, but accepts more than one argument.
This will allow projects to use several m4 macro local dirs.  This is
especially important for projects that are used as nested subpackages
of larger projects.

See also:
<http://lists.gnu.org/archive/html/autoconf/2011-12/msg00037.html>
<http://lists.gnu.org/archive/html/automake-patches/2012-07/msg00010.html>

* lib/autoconf/general.m4 (AC_CONFIG_MACRO_DIRS): New.  Expands to the
empty anyway, since it is only meant to be traced by tools like aclocal
and autoreconf.
(AC_CONFIG_MACRO_DIR): Updated comments.
* doc/autoconf.texi (@node "Input"): Document AC_CONFIG_MACRO_DIRS as
preferred over AC_CONFIG_MACRO_DIR.
* NEWS: Update.

Suggested-by: Eric Blake <eblake@redhat.com>
Helped-by: Nick Bowler <nbowler@elliptictech.com>
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
2012-11-09 15:45:44 -07:00
Paul Eggert
18c140b50b AC_PROG_CC: define via AC_DEFUN_ONCE
Suggested by Adrian Bunk in
http://lists.gnu.org/archive/html/autoconf-patches/2012-09/msg00034.html
* NEWS:
* doc/autoconf.texi (C Compiler): Document it
* lib/autoconf/c.m4 (AC_PROG_CC): Implement it.
2012-10-16 13:41:34 -07:00
Paul Eggert
c8d2326a71 AC_PROG_CC: clarify documentation, encourage -qlanglvl=extc1x
* doc/autoconf.texi (C Compiler): Document the intent of AC_PROG_CC
better.  It's not meant to check for strict conformance, only to
get the latest version with extensions.
(Running the Preprocessor, Present But Cannot Be Compiled):
Document new diagnostic wording.
* lib/autoconf/c.m4 (_AC_C_STD_TRY): Change diagnostic wording from
"checking for gcc option to accept ISO C11" to
"checkint for gcc option to enable C11 features", as this better
reflects what is actually happening.
(_AC_PROG_CC_C99): Put -qlanglvl=extc1x here ...
(_AC_PROG_CC_C11): ... rather than here, as it doesn't pass the C11
test with IBM XL C V12.1, and the point is to enable features not to
test for strict conformance.
2012-09-28 10:45:02 -07:00
Paul Eggert
27eb3aef3e AC_PROG_CC_C89, AC_PROG_CC_C99: now obsolete; defer to AC_PROG_CC
* NEWS:
* doc/autoconf.texi (C Compiler, Running the Preprocessor)
(Limitations of Usual Tools, Present But Cannot Be Compiled)
(Obsolete Macros):
Document the changes described below.
* lib/autoconf/c.m4 (_AC_PROG_CC_FORCE_VERSION): Remove.
(AC_PROG_CC_C89, AC_PROG_CC_C99, AC_PROG_CC_STDC):
Just do AC_PROG_CC, but mark as obsolete.  This replaces my recent
ill-advised attempt to let AC_PROG_CC_C89 and AC_PROG_CC_C99 downgrade
the version of C supported.
* doc/autoconf.texi (Limitations of Usual Tools, Volatile Objects):
Document C11 more accurately.  In some cases this involves removing
some details about 'volatile', alas, since C11 changed this stuff.
Again.
2012-09-21 19:28:20 -07:00
Stefano Lattarini
eb75296d01 maint: resync most files from upstream
The files in lib/Autom4te/ are intentionally not synced at this point,
since automake commit v1.11-2114-g2d671e1 "perl refactor: use modern
semantics of 'open'":
<http://lists.gnu.org/archive/html/automake-patches/2012-03/msg00111.html>
would require wider adaptation of our scripts to the new XFile API, and
also exposes some latent bugs in autoconf where we use raw 'open' instead
of XFile::open.  We'll take care of that in a later patches (maybe).

* build-aux/announce-gen: Resync via 'make fetch'.
* build-aux/config.guess: Likewise.
* build-aux/config.sub: Likewise.
* build-aux/gendocs.sh: Likewise.
* build-aux/gitlog-to-changelog: Likewise.
* build-aux/gnupload: Likewise.
* build-aux/texinfo.tex: Likewise.
* doc/make-stds.texi: Likewise.
* doc/standards.texi: Likewise.
* maint.mk: Likewise.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
2012-09-21 21:52:09 +02:00
Paul Eggert
8e796471bf AC_PROG_CC_STDC: fold into AC_PROG_CC, removing C11 macro
* NEWS:
* doc/autoconf.texi (C Compiler): Document the following.
* lib/autoconf/c.m4 (AC_PROG_CC): Check for the latest C version
supported, not just C89.
(_AC_C_STD_TRY): Keep track of the options we add to bring
the C compiler up to standard, so that we can undo it if the
user later requests some other C standard.
(_AC_PROG_CC_FORCE_VERSION): New macro.
(AC_PROG_CC_C89, AC_PROG_CC_C99): Use it.  These macros now
have a documented side effect of changing the C version requested.
(AC_PROG_CC_C11): Remove.  It wasn't useful.
(AC_PROG_CC_STDC): Now an obsolescent alias for AC_PROG_CC.
(AC_C_PROTOTYPES): Allow any standard C version, not just c89.
Don't chatter, since we don't actually run any checking code.
* lib/autoconf/types.m4 (AC_TYPE_LONG_LONG_INT)
(AC_TYPE_UNSIGNED_LONG_LONG_INT): Treat C11 like C99.
* TODO: Remove the TODO item corresponding to the above.
2012-09-20 14:33:32 -07:00
Paul Eggert
787acdfaa7 AC_FUNC_VFORK: check for Solaris 2.4 signal-handling bug
* NEWS:
* doc/autoconf.texi (Particular Functions): Document this.
* lib/autoconf/functions.m4 (_AC_FUNC_VFORK): Check for the bug.
2012-09-16 16:42:20 -07:00
Paul Eggert
f52459d158 AC_CHECK_ALIGNOF: fix cross-compilation bug with newer gcc
* doc/autoconf.texi (Default Includes, Particular Functions)
(Header Portability):
* lib/autoconf/c.m4 (AC_LANG_FUNC_LINK_TRY(C)):
* lib/autoconf/headers.m4 (AC_HEADER_STDC):
* lib/autoconf/types.m4 (_AC_CHECK_ALIGNOF):
* lib/m4sugar/m4sugar.m4 (m4_require) [comment only]:
Assume the existence of the C89 freestanding headers <float.h>,
<limits.h>, <stdarg.h>, <stddef.h>, as that's safe nowadays.
This is less likely to run into gotchas, and should fix a
cross-compilation bug with newer GCC reported by Myke Frysinger in
<http://lists.gnu.org/archive/html/bug-autoconf/2012-09/msg00001.html>.
2012-09-06 14:55:09 -07:00
Paul Eggert
db36f6df60 AC_PROG_CC_C11: new macro, which AC_PROG_CC_STDC now defaults to
* NEWS:
* doc/autoconf.texi (C Compiler): Document this.
(Gnulib, Function Portability, Particular Functions)
(Header Portability, Particular Headers, Defining Symbols)
(Printing Messages, Limitations of Usual Tools)
(Preprocessor Arithmetic, Volatile Objects, Exiting Portably):
Modernize wording for C11.
* lib/autoconf/c.m4 (_AC_C_C99_TEST_HEADER, _AC_C_C99_TEST_BODY):
New macros, taken from _AC_PROG_CC_C99.  These are so that we can
also include the C99 tests in the C11 test program.
(_AC_PROG_CC_C99): Use them.
(_AC_PROG_CC_C11, AC_PROG_CC_C11): New macros.
(AC_PROG_CC_STDC): Prefer C11 to C99 or C89.
2012-08-23 12:46:20 -07:00
Eric Blake
1bb104167e AC_SUBST: document and test previous patch
Test that: invalid variable names are detected, that the variable
name does not get macro expanded, that assignment to the variable
works whether as part of AC_SUBST or independently, that the last
assignment wins.

* doc/autoconf.texi (Setting Output Variables) <AC_SUBST>: Mention
that variable does not overlap with macros.
* tests/base.at (AC_SUBST): New test.

Signed-off-by: Eric Blake <eblake@redhat.com>
2012-08-15 22:23:04 -06:00
Akim Demaille
b406df6adc doc: fix style issues in the display of macro optional arguments
* doc/autoconf.texi (@dvarv): New.
Use it where optional macro arguments default to other arguments.
2012-07-26 08:13:53 +02:00
Eric Blake
45737f00b0 doc: mention trap pitfalls
Document why the previous patch was useful.

* doc/autoconf.texi (Limitations of Builtins) <trap>: Mention the
need to be defensive in trap handlers.
2012-07-18 14:58:16 -06:00
Patrice Dumas
a357718b08 doc: fix texinfo macro usage
The texinfo manual recommends avoiding the use of a trailing @c in
any macro designed to be used inline (as is the case with our ovar
and dvar macros).  Furthermore, passing '@\n' in the middle of a
macro call is much different than passing '@\n' between arguments
of a @defmac for line continuation.

* doc/autoconf.texi (ovar, dvar): Don't end macro with @c, since
these macros are designed to be embedded in one-line usage.
(Fortran Compiler): Don't split @dvar.
* THANKS: Update.
Reported by Stefano Lattarini.

Signed-off-by: Eric Blake <eblake@redhat.com>
Copyright-paperwork-exempt: Yes
2012-07-18 13:51:17 -06:00
Eric Blake
8c8522f1c5 doc: fix texinfo location reports
Otherwise, newer texinfo parses this line as a line directive, and
any error later in the file will claim to be from "conftest.c" instead
of "autoconf.texi".

* doc/autoconf.texi (Generating Sources): Avoid confusing newer
texinfo into thinking we had a line directive.
Reported by Stefano Lattarini, fix suggested by Patrice Dumas.
2012-07-17 12:02:12 -06:00
Eric Blake
7f1e05a5fc doc: avoid hard-coding usage of automake's missing
Now that automake documents AM_MISSING_PROG, and given that automake
has reserved the right to change the calling conventions of 'missing',
we should not recommend a hard-coded use of 'missing --run'.

* doc/autoconf.texi (Making testsuite Scripts): Recommend
AM_MISSING_PROG when using automake, and avoid hard-coding use of
'missing' otherwise.
2012-06-29 08:54:43 -06:00
Stefano Lattarini
560f16b52d general: deprecate 'configure.in' as autoconf input
It has been years since that has been deprecated in the documentation,
in favour of 'configure.ac':

  Previous versions of Autoconf promoted the name configure.in, which
  is somewhat ambiguous (the tool needed to process this file is not
  described by its extension), and introduces a slight confusion with
  config.h.in and so on (for which '.in' means "to be processed by
  configure"). Using configure.ac is now preferred.

It's now time to start giving runtime warning about the use of
'configure.in', so that support for it can be removed in future
versions of autoconf/automake.

* lib/Autom4te/Configure_ac.pm: Issue a warning in the 'obsolete'
category if 'configure.in' is detected.  Since this module is synced
from Automake, this change is to be backported there (and will be
soon).
* doc/autoconf.texi: Update.
* tests/tools.at: Adjust to avoid spurious failures.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
2012-05-23 00:13:01 +02:00