More on Building Python for Solaris 10 on SPARC
Continuing the building Python saga.
Surprisingly, Python and g++ don't play well together on Solaris 10. For example, this simple file:
#include "Python.h"Will not compile with g++, spewing out errors like:
#include
$ g++ -m64 -I/usr/local/64/include/python2.4 -c test.cc
In file included from /usr/local/64/include/python2.4/Python.h:8,
from test.cc:1:
/usr/local/64/include/python2.4/pyconfig.h:844:1: warning: "_XOPEN_SOURCE" redefined:84:1: warning: this is the location of the previous definition
In file included from test.cc:2:
[...]../include/c++/3.4.4/cwchar:145: error: `::btowc' has not been declared
[...]../include/c++/3.4.4/cwchar:150: error: `::fwide' has not been declared
...
This is a result of g++ requiring _XOPEN_SOURCE to be 500 (bugzilla; it looks like this won't be fixed), whereas Python defines it to be 600. This is corrected in Python's configure script on Solaris 8 and 9, but not 10.
Unfortunately, Python's configure also defines _XOPEN_SOURCE_EXTENDED which Solaris 10's feature tests header (/usr/include/sys/feature_tests.h) uses to force the ABI version backwards. Anyway, apply the patches listed here (which should be in the next versions of Python) and re-configure, re-build and re-install Python and everything is happy again!
