Source

importpy,osfrompypy.translator.platformimport_run_subprocessfrompypy.translator.platform.posiximportBasePosixclassBaseLinux(BasePosix):name="linux"link_flags=('-pthread','-lrt')cflags=('-O3','-pthread','-fomit-frame-pointer','-Wall','-Wno-unused')standalone_only=()shared_only=('-fPIC',)so_ext='so'so_prefixes=('lib','')def_args_for_shared(self,args):return['-shared']+argsdefinclude_dirs_for_libffi(self):returnself._pkg_config("libffi","--cflags-only-I",['/usr/include/libffi'])deflibrary_dirs_for_libffi(self):returnself._pkg_config("libffi","--libs-only-L",['/usr/lib/libffi'])classLinux(BaseLinux):shared_only=()# it seems that on 32-bit linux, compiling with -fPIC# gives assembler that asmgcc is not happy about.deflibrary_dirs_for_libffi_a(self):# places where we need to look for libffi.areturnself.library_dirs_for_libffi()+['/usr/lib']classLinux64(BaseLinux):pass