Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 21 Jan 2012 14:07:17 +0200
From:      Andriy Gapon <avg@FreeBSD.org>
To:        python@FreeBSD.org
Cc:        freebsd-standards@FreeBSD.org, gogo@cs.uni-sb.de
Subject:   pyconfig.h and freebsd10: _POSIX_C_SOURCE and _XOPEN_SOURCE
Message-ID:  <4F1AAA75.5050500@FreeBSD.org>

next in thread | raw e-mail | index | archive | help

It seems that python27's pyconfig.h (artificially?) limits visibility of system
APIs by setting _POSIX_C_SOURCE to 200112L and _XOPEN_SOURCE to 600.
This might not actually change much for earlier FreeBSD versions.

But in FreeBSD 10 we now have interfaces from POSIX 200809, specifically some
things that are then used by xlocale.h.

Now take an example of py-lxml port.  It depends on both libxslt and python
(obviously).  libxslt doesn't have any limitations in POSIX interfaces that it
uses, so it detects xlocale.h and uses it.  xlocale.h depends on definition of
locale_t in locale.h.  But since locale_t has been introduced in POSIX 2008 its
declaration is under __POSIX_VISIBLE >= 200809.  And because of pyconfig.h,
py-lxml build doesn't see locale_t and so the build fails.

This is probably an issue that the upstream should also consider.

Having briefly looked at python27's configure script I wonder if we should set
define_xopen_source=no for FreeBSD 10 (like it has been done for FreeBSD/4.*).

But in general I am not sure why python has to limit itself to those levels of
interfaces (_POSIX_C_SOURCE 200112L and _XOPEN_SOURCE 600).

Thoughts, ideas, suggestions?
Thank you!
-- 
Andriy Gapon



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4F1AAA75.5050500>