[PATCH:libICE] Add AC_USE_SYSTEM_EXTENSIONS to make asprintf() visible in GNU libc

Gaetan Nadon memsize at videotron.ca
Wed Dec 22 06:06:52 PST 2010


On Tue, 2010-12-21 at 18:30 -0800, Alan Coopersmith wrote:

> asprintf is considered a GNU extension and thus one needs to define
> _GNU_SOURCE before including stdio.h.
> 
> Reported-by: Cyril Brulebois <kibi at debian.org>
> Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
> ---
>  configure.ac |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index 03432f5..88fbcd7 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -12,6 +12,11 @@ AC_CONFIG_HEADERS([config.h])
>  AM_INIT_AUTOMAKE([foreign dist-bzip2])
>  AM_MAINTAINER_MODE
>  
> +# Set common system defines for POSIX extensions, such as _GNU_SOURCE
> +# Must be called before any macros that run the compiler (like
> +# AC_PROG_LIBTOOL or XORG_DEFAULT_OPTIONS) to avoid autoconf errors.
> +AC_USE_SYSTEM_EXTENSIONS
> +
>  # Require xorg-macros minimum of 1.10 for DocBook XML documentation
>  m4_ifndef([XORG_MACROS_VERSION],
>            [m4_fatal([must install xorg-macros 1.10 or later before running autoconf/autogen])])


Reviewed-by: Signed-off-by: Gaetan Nadon <memsize at videotron.ca>

I typically put it in the "Initialize Autoconf" section, the higher the
bettter. It's an Autoconf macro and does not require automake to be
initialized. But it's perfectly ok where it is now. You would get a
warning anyway if it were placed too late in the file.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.x.org/archives/xorg-devel/attachments/20101222/3060371d/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: <http://lists.x.org/archives/xorg-devel/attachments/20101222/3060371d/attachment.pgp>


More information about the xorg-devel mailing list