added changes allows compilation of C extensions into shared libraries to be used with ctypes (not all C extensions have been ported yet).