[issue2552] test_ctypes failed Python 2.6a2 Solaris 10 SUN C

Martin v. Löwis report at bugs.python.org
Sat Apr 5 19:35:59 CEST 2008


Martin v. Löwis <martin at v.loewis.de> added the comment:

> Yes, but the _ctypes module requires gcc, as Thomas Heller mentioned.

So the proper fix for that would be to port it to SunPro, of course.

> The 
> only thing which can be done is avoid building the _ctypes module if the 
> compiler is not gcc.

I'm not sure whether that would be much better than the status quo,
though. People would continue to complain that the ctypes module is not
built.

Why do you consider the current behaviour incorrect?

> I did look at fixing that but have not found the 
> proper way to do that.

There are several ways. One is to skip compilation in setup.py, for
which you should then determine whether the compiler is gcc. For
that, you could look at ac_compiler_gnu in configure.in, and
set a variable in Makefile.pre.in if the compiler is GCC. Then,
in setup.py, you could look for that variable as parsed from
the Makefile, and skip _ctypes accordingly.

Alternatively, you could check for __GNUC__ when compiling
ctypes, and make the compiler produce a better-understandable
#error.

Regards,
Martin

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2552>
__________________________________


More information about the Python-bugs-list mailing list