File "build_ext.cpython-37.pyc"

Full Path: /home/attunedd/public_html/byp/izo/con7ext_sym404/rintoar.txt/opt/alt/python37/lib64/python3.7/distutils/command/__pycache__/build_ext.cpython-37.pyc
File size: 15.42 KB
MIME-type: text/x-bytecode.python
Charset: 8 bit

B

 fv@sdZddlZddlZddlZddlZddlmZddlTddlm	Z	m
Z
ddlmZddlm
Z
ddlmZdd	lmZdd
lmZddlmZedZd
dZGdddeZdS)zdistutils.command.build_ext

Implements the Distutils 'build_ext' command, for building extension
modules (currently limited to C extensions, should accommodate C++
extensions ASAP).N)Command)*)customize_compilerget_python_version)get_config_h_filename)newer_group)	Extension)get_platform)log)	USER_BASEz3^[a-zA-Z_][a-zA-Z_0-9]*(\.[a-zA-Z_][a-zA-Z_0-9]*)*$cCsddlm}|dS)Nr)show_compilers)distutils.ccompilerr)rr@/opt/alt/python37/lib64/python3.7/distutils/command/build_ext.pyrsrc@seZdZdZdejZdddddefdd	d
defdd
ddddefddddddddddgZddddd gZ	d!d"d#e
fgZd$d%Zd&d'Z
d(d)Zd*d+Zd,d-Zd.d/Zd0d1Zd2d3Zd4d5Zejd6d7Zd8d9Zd:d;Zd<d=Zd>d?Zd@dAZdBdCZdDdEZdFdGZd"S)H	build_extz8build C/C++ extensions (compile/link to build directory)z (separated by '%s'))z
build-lib=bz(directory for compiled extension modules)zbuild-temp=tz1directory for temporary files (build by-products)z
plat-name=pz>platform name to cross-compile for, if supported (default: %s))inplaceiziignore build-lib and put compiled extensions into the source directory alongside your pure Python modulesz
include-dirs=Iz.list of directories to search for header files)zdefine=DzC preprocessor macros to define)zundef=Uz!C preprocessor macros to undefine)z
libraries=lz!external C libraries to link withz
library-dirs=Lz.directories to search for external C libraries)zrpath=Rz7directories to search for shared C libraries at runtime)z
link-objects=Oz2extra explicit link objects to include in the link)debuggz'compile/link with debugging information)forcefz2forcibly build everything (ignore file timestamps))z	compiler=czspecify the compiler type)z	parallel=jznumber of parallel build jobs)zswig-cppNz)make SWIG create C++ files (default is C))z
swig-opts=Nz!list of SWIG command line options)zswig=Nzpath to the SWIG executable)userNz#add user include, library and rpathrrrzswig-cppr#z
help-compilerNzlist available compilerscCsd|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_d|_d|_
d|_d|_d|_d|_d|_d|_d|_dS)Nr)
extensions	build_lib	plat_name
build_temprpackageinclude_dirsdefineundef	librarieslibrary_dirsrpathlink_objectsrrcompilerswigswig_cpp	swig_optsr#parallel)selfrrrinitialize_optionsjs*zbuild_ext.initialize_optionsc

Csddlm}|ddddddd	d
|jdkr8|jj|_|jj|_|}|jdd}|j	dkrn|jj	pjg|_	t
|j	tr|j	t
j|_	tjtjkr|j	t
jtjd
|j	|t
jj||kr|j	|t
jj|d|d|jdkrg|_|jdkrg|_nt
|jtr:|jt
j|_|jdkrNg|_nt
|jtrl|jt
j|_t
jdkrh|jt
jtjdtjtjkr|jt
jtjd|jrt
j|jd|_nt
j|jd|_|j	t
jtt tdd}|r|j||j!dkr*d}n|j!dd}t
jtjd}|r\t
j||}|j|tj"dddkrtj#$t
jtjdr|jt
jtjddt%dn|jd|&dr|j's|j|&d n|jd|j(r|j(d!}d"d#|D|_(|j)r4|j)d!|_)|j*dkrHg|_*n|j*d$|_*|j+rt
jt,d
}t
jt,d}	t
j-|r|j	|t
j-|	r|j|	|j|	t
|j.tryt/|j.|_.Wnt0k
rt1d%YnXdS)&Nr)	sysconfigZbuild)r%r%)r'r')r0r0)rr)rr)r4r4)r&r&)Z
plat_specificZincluder,r/ntZlibsZDebugZRelease_homewin32ZPCbuildcygwinbinlibpythonZconfig.Py_ENABLE_SHAREDZLIBDIR,cSsg|]}|dfqS)1r).0Zsymbolrrr
<listcomp>sz.build_ext.finalize_options.<locals>.<listcomp> zparallel should be an integer)2	distutilsr7Zset_undefined_optionsr(distributionZext_packageZext_modulesr$Zget_python_incr)
isinstancestrsplitospathsepsysexec_prefixbase_exec_prefixappendpathjoinextendZensure_string_listr,r-r.nameprefixrr'dirnamergetattrr&platform
executable
startswithrget_config_varZpython_buildr*r+r3r#risdirr4int
ValueErrorZDistutilsOptionError)
r5r7Z
py_includeZplat_py_includeZ	_sys_homesuffixZnew_libZdefinesZuser_includeZuser_librrrfinalize_optionss






zbuild_ext.finalize_optionscCsrddlm}|jsdS|jrL|d}|j|p:g|j	
|j||j|j
|j|jd|_t|jtjdkr|jtkr|j|j|jdk	r|j|j|jdk	rx |jD]\}}|j||qW|jdk	rx|jD]}|j|qW|jdk	r|j|j|j	dk	r2|j|j	|jdk	rL|j|j|j dk	rf|j!|j |"dS)Nr)new_compiler
build_clib)r0verbosedry_runrr9)#r
rdr$rJZhas_c_librariesget_finalized_commandr,rVZget_library_namesr-rSrer0rfrgrrrNrWr&r	Z
initializer)Zset_include_dirsr*Zdefine_macror+Zundefine_macroZ
set_librariesZset_library_dirsr.Zset_runtime_library_dirsr/Zset_link_objectsbuild_extensions)r5rdrerWvaluemacrorrrruns>





z
build_ext.runc
Cst|tstdxjt|D]\\}}t|tr4qt|trJt|dkrRtd|\}}td|t|t	rzt
|stdt|tstdt||d}x*dD]"}|
|}|d	k	rt|||qW|
d
|_d|krtd|
d
}|rtg|_g|_xj|D]b}	t|	tr,t|	dks4tdt|	dkrT|j|	dnt|	dkr|j|	qW|||<qWd	S)aEnsure that the list of extensions (presumably provided as a
        command option 'extensions') is valid, i.e. it is a list of
        Extension objects.  We also support the old-style list of 2-tuples,
        where the tuples are (ext_name, build_info), which are converted to
        Extension instances here.

        Raise DistutilsSetupError if the structure is invalid anywhere;
        just returns otherwise.
        z:'ext_modules' option must be a list of Extension instanceszMeach element of 'ext_modules' option must be an Extension instance or 2-tuplezvold-style (ext_name, build_info) tuple found in ext_modules for extension '%s' -- please convert to Extension instancezRfirst element of each tuple in 'ext_modules' must be the extension name (a string)zOsecond element of each tuple in 'ext_modules' must be a dictionary (build info)sources)r)r-r,
extra_objectsextra_compile_argsextra_link_argsNr.Zdef_filez9'def_file' element of build info dict no longer supportedmacros)r8rmz9'macros' element of build info dict must be 1- or 2-tupler8r)rKlistDistutilsSetupError	enumeratertuplelenr
warnrLextension_name_rematchdictgetsetattrruntime_library_dirs
define_macrosundef_macrosrS)
r5r$rextext_nameZ
build_infokeyvalrrrkrrrcheck_extensions_listVsP










zbuild_ext.check_extensions_listcCs0||jg}x|jD]}||jqW|S)N)rr$rVrn)r5	filenamesrrrrget_source_filess
zbuild_ext.get_source_filescCs6||jg}x |jD]}|||jqW|S)N)rr$rSget_ext_fullpathrW)r5Zoutputsrrrrget_outputss
zbuild_ext.get_outputscCs(||j|jr|n|dS)N)rr$r4_build_extensions_parallel_build_extensions_serial)r5rrrris
zbuild_ext.build_extensionscsj}jdkrt}yddlm}Wntk
r@d}YnX|dkrVdS||dTfddjD}x6tj|D]&\}}	||
WdQRXqWWdQRXdS)NTr)ThreadPoolExecutor)Zmax_workerscsg|]}j|qSr)Zsubmitbuild_extension)rFr)executorr5rrrGsz8build_ext._build_extensions_parallel.<locals>.<listcomp>)r4rN	cpu_countZconcurrent.futuresrImportErrorrr$zip_filter_build_errorsresult)r5ZworkersrZfuturesrZfutr)rr5rrs 


z$build_ext._build_extensions_parallelc
Cs4x.|jD]$}||||WdQRXqWdS)N)r$rr)r5rrrrrsz"build_ext._build_extensions_serialc
csTy
dVWnDtttfk
rN}z |js*|d|j|fWdd}~XYnXdS)Nz"building extension "%s" failed: %s)ZCCompilerErrorZDistutilsErrorZCompileErrorZoptionalrxrW)r5rerrrrs
zbuild_ext._filter_build_errorsc
CsT|j}|dkst|ttfs*td|jt|}||j}||j}|jslt	||dslt
d|jdSt
d|j|
||}|jpg}|jdd}x|jD]}||fqW|jj||j||j|j||jd}|dd|_|jr||j|jpg}|jp|j|}	|jj|||||j|j|| ||j|j|	d
dS)Nzjin 'ext_modules' option (extension '%s'), 'sources' must be present and must be a list of source filenamesZnewerz$skipping '%s' extension (up-to-date)zbuilding '%s' extension)Z
output_dirrrr)rextra_postargsdepends)r,r-r~rexport_symbolsrr'Ztarget_lang)!rnrKrsrvrtrWrrrrr
rinfoswig_sourcesrprrrSr0compiler'r)Z_built_objectsrorVrqlanguageZdetect_languageZlink_shared_object
get_librariesr-r~get_export_symbols)
r5rrnext_pathrZ
extra_argsrrr+ZobjectsrrrrrsN



zbuild_ext.build_extensioncCs0g}g}i}|jrtd|js6d|jks6d|jkr<d}nd}xX|D]P}tj|\}}	|	dkr||d||||d||<qF||qFW|s|S|jp|	}
|
dg}|
|j|jr|d|jsx|jD]}||qWx6|D].}||}
td	||
||d
|
|gqW|S)zWalk the list of source files in 'sources', looking for SWIG
        interface (.i) files.  Run SWIG on all that are found, and
        return a modified 'sources' list with SWIG source files replaced
        by the generated C (or C++) files.
        z/--swig-cpp is deprecated - use --swig-opts=-c++z-c++z.cppz.cz.i_wrapz-pythonzswigging %s to %sz-o)
r2r
rxr3rNrTsplitextrSr1	find_swigrVrZspawn)r5rn	extensionZnew_sourcesrZswig_targetsZ
target_extsourcebaserr1Zswig_cmdotargetrrrr1s>





zbuild_ext.swig_sourcescCs`tjdkrdStjdkrNxBdD]&}tjd|d}tj|r|SqWdSntdtjdS)	zReturn the name of the SWIG executable.  On Unix, this is
        just "swig" -- it should be in the PATH.  Tries a bit harder on
        Windows.
        posixr1r9)z1.3z1.2z1.1z	c:\swig%szswig.exez>I don't know how to find (much less run) SWIG on platform '%s'N)rNrWrTrUisfileZDistutilsPlatformError)r5Zversfnrrrrgs


zbuild_ext.find_swigcCs||}|d}||d}|jsRtjj|dd|g}tj|j|Sd|dd}|d}tj	|
|}tj||S)zReturns the path of the filename for a given extension.

        The file is located in `build_lib` or directly in the package
        (inplace option).
        rBrNrbuild_py)get_ext_fullnamerMget_ext_filenamerrNrTrUr%rhabspathZget_package_dir)r5rfullnameZmodpathfilenamer(rZpackage_dirrrrrs


zbuild_ext.get_ext_fullpathcCs |jdkr|S|jd|SdS)zSReturns the fullname of a given extension name.

        Adds the `package.` prefixNrB)r()r5rrrrrs
zbuild_ext.get_ext_fullnamecCs.ddlm}|d}|d}tjj||S)zConvert the name of an extension (eg. "foo.bar") into the name
        of the file from which it will be loaded (eg. "foo/bar.so", or
        "foo\bar.pyd").
        r)r^rBZ
EXT_SUFFIX)distutils.sysconfigr^rMrNrTrU)r5rr^rZ
ext_suffixrrrrs
zbuild_ext.get_ext_filenamecCs0d|jdd}||jkr*|j||jS)aReturn the list of symbols that a shared extension has to
        export.  This either uses 'ext.export_symbols' or, if it's not
        provided, "PyInit_" + module_name.  Only relevant on Windows, where
        the .pyd file (DLL) must export the module "PyInit_" function.
        ZPyInit_rBr)rWrMrrS)r5rZ
initfunc_namerrrrs
zbuild_ext.get_export_symbolscCstjdkrdddlm}t|j|s\d}|jr4|d}|tjd?tjd?d@f}|j|gS|jSnttjd	krt|jStjd
ddkr|jSdd
l	m
}|drdtjd?tjd?d@|d}|j|gS|jSd
S)zReturn the list of libraries to link against when building a
        shared extension.  On most platforms, this is just 'ext.libraries';
        on Windows, we add the Python library (eg. python20.dll).
        r;r)MSVCCompilerz
python%d%dZ_ddarwinNZaix)r7rCz
python{}.{}{}ZABIFLAGS)
rPr[Zdistutils._msvccompilerrrKr0r
hexversionr,rIr7r^format)r5rrtemplateZ	pythonlibr7rrrrs*



zbuild_ext.get_libraries) __name__
__module____qualname__ZdescriptionrNrOZsep_byr	Zuser_optionsZboolean_optionsrZhelp_optionsr6rcrlrrrrirr
contextlibcontextmanagerrrrrrrrrrrrrrr!s^

@N	
K6	
r)__doc__rrNrerPZdistutils.corerZdistutils.errorsrrrrZdistutils.dep_utilrZdistutils.extensionrZdistutils.utilr	rIr
Zsiterrryrrrrrr<module>s"