Re: [PATCH 5/6] Use AC_CHECK_{DECLS, FUNCS, HEADERS}_ONCE more in specific-check macros.

Eric Blake <[email protected]>
Newsgroups gmane.comp.sysutils.autoconf.patches
Organization Red Hat, Inc.
Message-ID <[email protected]>
On 09/15/2013 10:24 AM, Zack Weinberg wrote:
>  * 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.
> 

> +AC_CHECK_FUNCS_ONCE([fork vfork])
>  if test "x$ac_cv_func_fork" = xyes; then
>    _AC_FUNC_FORK
>  else
> @@ -1988,12 +1986,12 @@ AU_ALIAS([AC_VFORK], [AC_FUNC_FORK])
>  # Why the heck is that _doprnt does not define HAVE__DOPRNT???
>  # That the logical name!
>  AC_DEFUN([AC_FUNC_VPRINTF],
> -[AC_CHECK_FUNCS(vprintf, [],
> -[AC_CHECK_FUNC(_doprnt,
> -	       [AC_DEFINE(HAVE_DOPRNT, 1,
> +[AC_CHECK_FUNCS_ONCE([vprintf])
> +AS_IF([test $ac_cv_func_vprintf = no],

Unsafe - the user can pre-populate the cache with something that would
break 'test'.  Use what we do elsewhere:

AS_IF([test "x$ac_cv_func_vprintf" = xno],

ACK with that fix.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc (application/pgp-signature, 621 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.14 (GNU/Linux)
Comment: Public key at http://people.redhat.com/eblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBCAAGBQJSPaLnAAoJEKeha0olJ0NqMWUH/Rd8Lt4ZK45vqQZsCPKQbJ9N
C6wphEBE8aP+ZznkKsbaofpGv6S1nxWM33KfWb2I5arai8my4DS87nlOWhk13Sd/
lZ35sA/nq8z87HMT43WKkVObWjtZr5LIeYFf0WMn33ZZtP4ILaR86gv6J2xJMduF
4MUzsKn7FmZPZAfQTZgliXljpJc1O57ptyTm5Qrg3sJk71NXhstiqKMuL/+lxX13
UDbYMA9MZR6FwCz5y64Gc+ljqkz7PIKELzMVVS2JM/DI5LWMVXKlb92g4Is7LK9y
v8qaEQAdwf++BSpDQ0RBGbJIknMVkcrCl/jF2lh55FAUpIqZFumJOJfnU6cIj8o=
=JOVS
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.