what is _XOPEN_SOURCE=500 needed for?

Martin Waitz tali at admingilde.org
Wed May 25 00:05:56 PDT 2005


hoi :)

On Mon, May 23, 2005 at 11:21:25PM -0600, Matthieu Herrb wrote:
> I'm trying to build the modular tree on OpenBSD. One problem I noticed 
> is that -D_XOPEN_SOURCE=500 is now added unconditionnaly to all CFLAGS.
> This breaks things on OpenBSD, so It should probably be defined only on 
> systems that needs it.

I had a similar problem with another project.
It needed pread/pwrite which are only defined with _XOPEN_SOURCE on
glibc systems. And it broke on OpenBSD, too.

We fixed it with the following code in configure.ac:
# _GNU_SOURCE is needed for glibcs pread/pwrite
AH_VERBATIM([_GNU_SOURCE],
¯˙˙˙˙˙˙˙    [/* Enable GNU extensions on systems that have them.  */
#ifndef _GNU_SOURCE
# define _GNU_SOURCE
#endif])


glibc will automatically define _XOPEN_SOURCE=600 when _GNU_SOURCE
is set. OpenBSD ignores _GNU_SOURCE and all is well.

-- 
Martin Waitz
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.x.org/archives/xorg/attachments/20050525/3377800b/attachment.pgp>


More information about the xorg mailing list