[Pythonmac-SIG] wxPython 2.6.2.1 source build a final summary
Bill Northcott
w.northcott at unsw.edu.au
Thu Feb 9 03:13:46 CET 2006
This is a final summary of my experiences building wxPython 2.6.2.1
sources on MacOS X 10.4.4 with ActivePython 2.4.2.10 and Xcode 2.2.1
with gcc-3.3 and g77.
To avoid the problems with _POSIX_C_SOURCE and friends, I
conditionalized the defines for _POSIX_C_SOURCE _XOPEN_SOURCE and
_XOPEN_SOURCE_EXTENDED with #if !defined(__cplusplus). This has
enabled me to build a number of modules including wxPython without
problem. The C sources are quite happy with the POSIX defines and
the C++ sources don't get them. It seems to me that these changes
should be made in Python.
The configure test for strcasecmp seems wrong to me. As I see it,
most modern operating environments are standards compliant. So they
will have strings.h and it will contain strcasecmp. The use of
string.h should be just a fall back. All that is necessary to fix
this is to swap the tests around to check for strings.h first
followed by string.h and the hack as a final default. I still feel
much happier using the _POSIX_C_SOURCE define to always get
strcasecmp from strings.h. That will always work in a C program by
definition. The problem is C++. Really you should not use
strcasecmp in a C++ program. The 'right' answer is to have a C
source file defining a small utility function wxstrcasecmp() and link
this with the C++ object files. That way you can be sure that POSIX
compliance will do it for you.
With those changes, wxPython now builds for me from source and it
runs Bob's demo programs. without recompiling them.
Cheers
Bill Northcott
More information about the Pythonmac-SIG
mailing list