Issue 1016224: configure.in change to allow compilation on AIX 5 (original) (raw)
A build of the current Python-CVS will fail on the _bsddb module build (well, the _bsddb module build will fail and the setup.py will ignore it and continue) on AIX 5 with the following error:
building '_bsddb' extension
cc_r -DNDEBUG -O -I.../libprefix/include -I.
-I./Include -I.../python/Include -I.../python -c .../python/Modules/_bsddb.c -o build/temp.aix-5.1-2.4/_bsddb.o "./pyconfig.h", line 832.9: 1506-236 (W) Macro name _XOPEN_SOURCE has been redefined. "./pyconfig.h", line 832.9: 1506-358 (I) "_XOPEN_SOURCE" is defined on line 89 of /usr/include/standards.h. "/usr/include/wchar.h", line 290.68: 1506-046 (S) Syntax error. (wcsnrtombs) "/usr/include/wchar.h", line 293.68: 1506-046 (S) Syntax error. (mbsnrtowcs)
error lines in /usr/include/wchar.h are the following:
extern size_t wcsnrtombs(char *, const wchar_t **,
size_t, size_t, mbstate_t *); extern size_t mbsnrtowcs(wchar_t *, const char **, size_t, size_t, mbstate_t *);
The problem is that mbstate_t is only defined if _XOPEN_SOURCE is 500. Without the follow configure[.in] change Python will define it to be 600.
This Python patch did the same thing for AIX 4:
http://sourceforge.net/tracker/index.php?func=detail&aid=836434&group_id=5470&atid=305470
I will upload a patch to configure.in.
Logged In: YES user_id=21627
It is (my) policy that work-arounds for bugs are only made for systems that actually have the bugs. If you agree that this entire thing is a bug in AIX (not being able to compile its own headers if the user gives a #define that is meant to be supported), then I'd like to encourage you to constrain the work-around on those AIX5 releases where it shows up. If it shows up on all AIX5 releases so far (which, AFAICT, is 5.1 .. 5.3), I'd still like to write 5.[123] rather than presuming that the bug stays until AIX6.
The rationale for that procedure is that I want to take out the work-arounds one day; for that to happen, we must need to reevaluate the work-around for each OS release. Then, we can unsupport older releases at some point, and eventually remove work-arounds.