[pypy-dev] Windows Testing

Amaury Forgeot d'Arc amauryfa at gmail.com
Wed May 14 19:34:11 CEST 2008


Maciej Fijalkowski wrote:
>>  > Hi Amaury!
>>  >
>>  > Thanks for doing good job bringing more support for pypy on windows. I
>>  > think next direction would be to bring more modules to windows, from
>>  > which I guess _rawffi is the most important (this will bring ctypes to
>>  > windows platform). I can help you bits with that if you would like to
>>  > go in that direction.
>>
>>  Well, I am not a ffi expert, but at least I know how to run the unit tests.
>>  The first step I see is to get the equivalent of libffi for win32 and
>>  microsoft compilers.
>>  My first thought was to steal it from the
>>  cpython/Modules/_ctypes/libffi_msvc directory,
>>  do you have other ideas?
>>
>
> Honestly, no :) You don't need to be an ffi expert, all logic is
> there, it's just missing few places where windows support is needed.
> We tried including libffi into pypy, but failed for some obscure build
> process reasons.
>
> Thanks for tackling this!

OK, It seems that I have a working version of rlib\libffi for win32,
enough for test_libffi to pass.

The problem I have now is that I used the files from
cpython/Modules/_ctypes/libffi_msvc verbatim.
The ExternalCompilationInfo looks like this:

    c_source = py.code.Source("""
        /* 40 lines of external definitions, needed to compile the library */
        """)
    eci = ExternalCompilationInfo(
        includes = ['ffi.h', 'windows.h'],
        libraries = ['kernel32'],
        include_dirs = ['c:/afa/python/trunk/Modules/_ctypes/libffi_msvc'],
        separate_module_files =
['c:/afa/python/trunk/Modules/_ctypes/libffi_msvc/ffi.c',

'c:/afa/python/trunk/Modules/_ctypes/libffi_msvc/prep_cif.c',

'c:/afa/python/trunk/Modules/_ctypes/libffi_msvc/win32.c',
                                 ],
        separate_module_sources = [c_source],
        export_symbols = ['ffi_call', 'ffi_prep_cif', 'ffi_prep_closure'],
        )

What shall I do with these external files? Copy them into a
subdirectory of translator/c/src?

-- 
Amaury Forgeot d'Arc



More information about the Pypy-dev mailing list