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>
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>
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>
admin: mention recent copyright assignments

* AUTHORS: Update list.

Signed-off-by: Eric Blake <eblake@redhat.com>
* tests/local.at (AT_CHECK_M4): Support 'stderr' as fourth argument.
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.
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.
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.
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.
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.