Re: Autotools integration / How to determine .so filename extension

Matti Picus <[email protected]> Sat, 10 Jul 2021 20:51:09 +0300
Newsgroups gmane.comp.python.pypy
Message-ID <[email protected]>
On 10/7/21 4:44 pm, Roland Lutz wrote:
> How do I determine the correct filename extension for PyPy extension 
> modules?
>

The canonical way is to use sysconfig


pypy -c "import sysconfig;print(sysconfig.get_config_var('EXT_SUFFIX'))"

.pypy37-pp73-x86_64-linux-gnu.so


On python2.7 use 'SO'

~/oss/pypy2.7-HEAD/bin/pypy -c "import 
sysconfig;print(sysconfig.get_config_var('SO'))"

.pypy-73.so


If you wish to cross-compile or do not want to run python to find the 
values, pypy7.3.5+ on linux now ship a CPython compatible file with all 
the values pre-computed. The file is

<pypy-directory>/lib_pypy/_sysconfigdata__linux*.py

Matti