ROOTPLOIT
Server: LiteSpeed
System: Linux server71.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64
User: niphet (1079)
PHP: 5.3.29
Disabled: NONE
Upload Files
File: //lib64/python3.8/distutils/command/__pycache__/build_ext.cpython-38.pyc
U

e5dP{ã@s¶dZddlZddlZddlZddlZddlmZddlTddlm	Z	m
Z
ddlmZddlm
Z
ddlmZdd	lmZdd
lmZddlmZe d¡Zd
d„ZGdd„deƒZdS)z¶distutils.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_compilerÚget_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ú3/usr/lib64/python3.8/distutils/command/build_ext.pyr
sr
c@seZdZdZdejZdddddeƒfdd	d
defdd
ddddefddddddddddgZddddd gZ	d!d"d#e
fgZd$d%„Zd&d'„Z
d(d)„Zd*d+„Zd,d-„Zd.d/„Zd0d1„Zd2d3„Zd4d5„Zejd6d7„ƒZd8d9„Zd:d;„Zd<d=„Zd>d?„Zd@dA„ZdBdC„ZdDdE„ZdFdG„Zd"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))ÚinplaceÚiziignore 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)ÚdebugÚgz'compile/link with debugging information)ÚforceÚfz2forcibly build everything (ignore file timestamps))z	compiler=Úczspecify the compiler type)z	parallel=Újznumber of parallel build jobs)úswig-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 rpathrrr r$r%z
help-compilerNzlist available compilerscCs‚d|_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_temprÚpackageÚinclude_dirsÚdefineÚundefÚ	librariesÚlibrary_dirsÚrpathÚlink_objectsrr ÚcompilerÚswigÚswig_cppÚ	swig_optsr%Úparallel©ÚselfrrrÚinitialize_optionsjs*zbuild_ext.initialize_optionsc

Csüddlm}| ddddddd	d
¡|jdkr8|jj|_|jj|_| ¡}|jdd}|j	dkrn|jj	pjg|_	t
|j	tƒrŠ|j	 t
j¡|_	tjtjkr®|j	 t
j tjd
¡¡|j	 | t
jj¡¡||krâ|j	 | t
jj¡¡| d¡| d¡|jdkrg|_|jdkrg|_nt
|jtƒr:|j t
j¡|_|jdkrNg|_nt
|jtƒrl|j t
j¡|_t
jdkrh|j t
j tjd¡¡tjtjkr¶|j t
j tjd¡¡|jrÒt
j |jd¡|_nt
j |jd¡|_|j	 t
j tƒ¡¡t tddƒ}|r|j |¡|j!dkr*d}n|j!dd…}t
j tjd¡}|r\t
j ||¡}|j |¡tj"dd…dkrÆtj# $t
j tjd¡¡rº|j t
j tjddt%ƒd¡¡n|j d¡| &d¡rú|j'sî|j | &d ¡¡n|j d¡|j(r|j( d!¡}d"d#„|Dƒ|_(|j)r4|j) d!¡|_)|j*dkrHg|_*n|j* d$¡|_*|j+rºt
j t,d
¡}t
j t,d¡}	t
j -|¡r”|j	 |¡t
j -|	¡rº|j |	¡|j |	¡t
|j.tƒrøzt/|j.ƒ|_.Wnt0k
röt1d%ƒ‚YnXdS)&Nr)Ú	sysconfigZbuild)r'r')r)r))r2r2)rr)r r )r6r6)r(r(é)Z
plat_specificZincluder.r1ÚntZlibsZDebugZReleaseÚ_homeÚwin32éZPCbuildéÚcygwinÚbinÚlibÚpythonZconfigÚ.ÚPy_ENABLE_SHAREDZLIBDIRú,cSsg|]}|df‘qS)Ú1r)Ú.0ZsymbolrrrÚ
<listcomp>ùsz.build_ext.finalize_options.<locals>.<listcomp>ú zparallel should be an integer)2Ú	distutilsr:Zset_undefined_optionsr*ÚdistributionZext_packageZext_modulesr&Zget_python_incr+Ú
isinstanceÚstrÚsplitÚosÚpathsepÚsysÚexec_prefixÚbase_exec_prefixÚappendÚpathÚjoinÚextendZensure_string_listr.r/r0ÚnameÚprefixrr)ÚdirnamerÚgetattrr(ÚplatformÚ
executableÚ
startswithrÚget_config_varZpython_buildr,r-r5r%rÚisdirr6ÚintÚ
ValueErrorZDistutilsOptionError)
r8r:Z
py_includeZplat_py_includeZ	_sys_homeÚsuffixZnew_libZdefinesZuser_includeZuser_librrrÚfinalize_options‚s°ù




ÿ

þzbuild_ext.finalize_optionscCsjddlm}|jsdS|j ¡rL| d¡}|j | ¡p:g¡|j	 
|j¡||j|j
|j|jd|_t|jƒtjdkr”|jtƒkr”|j |j¡|jdk	r¬|j |j¡|jdk	rÔ|jD]\}}|j ||¡q¼|jdk	rö|jD]}|j |¡qä|jdk	r|j |j¡|j	dk	r*|j |j	¡|jdk	rD|j |j¡|j dk	r^|j !|j ¡| "¡dS)Nr)Únew_compilerÚ
build_clib)r2ÚverboseÚdry_runr r<)#rrgr&rMZhas_c_librariesÚget_finalized_commandr.rYZget_library_namesr/rVrhr2rirjr rrQrZr(r	Z
initializer+Zset_include_dirsr,Zdefine_macror-Zundefine_macroZ
set_librariesZset_library_dirsr0Zset_runtime_library_dirsr1Zset_link_objectsÚbuild_extensions)r8rgrhrZÚvalueÚmacrorrrÚruns@

ý




z
build_ext.runc
Csvt|tƒstdƒ‚t|ƒD]T\}}t|tƒr0qt|tƒrFt|ƒdkrNtdƒ‚|\}}t d|¡t|t	ƒrvt
 |¡s~tdƒ‚t|tƒstdƒ‚t||dƒ}dD]"}| 
|¡}|d	k	r¢t|||ƒq¢| 
d
¡|_d|krät d¡| 
d
¡}|rhg|_g|_|D]b}	t|	tƒr"t|	ƒdks*tdƒ‚t|	ƒdkrJ|j |	d¡nt|	ƒdkr|j |	¡q|||<qd	S)a¬Ensure 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 instancesézMeach 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_objectsÚextra_compile_argsÚextra_link_argsNr0Zdef_filez9'def_file' element of build info dict no longer supportedÚmacros)r;rpz9'macros' element of build info dict must be 1- or 2-tupler;r)rNÚlistÚDistutilsSetupErrorÚ	enumeraterÚtupleÚlenr
ÚwarnrOÚextension_name_reÚmatchÚdictÚgetÚsetattrÚruntime_library_dirsÚ
define_macrosÚundef_macrosrV)
r8r&rÚextÚext_nameZ
build_infoÚkeyÚvalrurnrrrÚcheck_extensions_listVs^

ÿ
ÿþ
ÿÿ
ÿ


ÿzbuild_ext.check_extensions_listcCs,| |j¡g}|jD]}| |j¡q|S©N)rˆr&rYrq)r8Ú	filenamesr„rrrÚget_source_files¤s

zbuild_ext.get_source_filescCs2| |j¡g}|jD]}| | |j¡¡q|Sr‰)rˆr&rVÚget_ext_fullpathrZ)r8Zoutputsr„rrrÚget_outputs­s

zbuild_ext.get_outputscCs(| |j¡|jr| ¡n| ¡dSr‰)rˆr&r6Ú_build_extensions_parallelÚ_build_extensions_serialr7rrrrl»s
zbuild_ext.build_extensionscsºˆj}ˆjdkrt ¡}zddlm}Wntk
r@d}YnX|dkrVˆ ¡dS||dP‰‡‡fdd„ˆjDƒ}tˆj|ƒD]&\}}ˆ 	|¡| 
¡W5QRXq„W5QRXdS)NTr)ÚThreadPoolExecutor)Zmax_workerscsg|]}ˆ ˆj|¡‘qSr)ZsubmitÚbuild_extension)rIr„©Zexecutorr8rrrJÑsÿz8build_ext._build_extensions_parallel.<locals>.<listcomp>)r6rQÚ	cpu_countZconcurrent.futuresrÚImportErrorrr&ÚzipÚ_filter_build_errorsÚresult)r8ZworkersrZfuturesr„Zfutrr’rrŽÃs"

ÿz$build_ext._build_extensions_parallelc
Cs0|jD]$}| |¡| |¡W5QRXqdSr‰)r&r–r‘)r8r„rrrr×s
z"build_ext._build_extensions_serialc
csTz
dVWnDtttfk
rN}z |js*‚| d|j|f¡W5d}~XYnXdS)Nz"building extension "%s" failed: %s)ZCCompilerErrorZDistutilsErrorZCompileErrorZoptionalr{rZ)r8r„Úerrrr–Üs
ÿzbuild_ext._filter_build_errorsc
CsP|j}|dkst|ttfƒs*td|jƒ‚t|ƒ}| |j¡}||j}|jslt	||dƒslt
 d|j¡dSt
 d|j¡| 
||¡}|jpŽg}|jdd…}|jD]}| |f¡q¤|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_dirrur+rÚextra_postargsÚdepends)r.r/rr™Úexport_symbolsrr)Ztarget_lang)!rqrNrvryrwrZrŒršr rr
rÚinfoÚswig_sourcesrsr‚rƒrVr2Úcompiler)r+Z_built_objectsrrrYrtÚlanguageZdetect_languageZlink_shared_objectÚ
get_librariesr/rÚget_export_symbols)
r8r„rqÚext_pathršZ
extra_argsrur-ZobjectsrŸrrrr‘æsXþÿ


ú
÷zbuild_ext.build_extensioncCs$g}g}i}|jrt d¡|js6d|jks6d|jkr<d}nd}|D]P}tj |¡\}}	|	dkrŠ| |d|¡| |¡|d||<qD| |¡qD|sž|S|jpª| 	¡}
|
dg}| 
|j¡|jrÐ| d¡|jsì|jD]}| |¡qÜ|D].}||}
t d	||
¡| |d
|
|g¡qð|S)züWalk 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Ú_wrapéÿÿÿÿz-pythonzswigging %s to %sz-o)
r4r
r{r5rQrWÚsplitextrVr3Ú	find_swigrYrœZspawn)r8rqÚ	extensionZnew_sourcesrZswig_targetsZ
target_extÚsourceÚbaser„r3Zswig_cmdÚoÚtargetrrrr1s@
ÿ


zbuild_ext.swig_sourcescCs^tjdkrdStjdkrLdD]*}tj d|d¡}tj |¡r|SqdStdtjƒ‚dS)	z›Return the name of the SWIG executable.  On Unix, this is
        just "swig" -- it should be in the PATH.  Tries a bit harder on
        Windows.
        Úposixr3r<)z1.3z1.2z1.1z	c:\swig%szswig.exez>I don't know how to find (much less run) SWIG on platform '%s'N)rQrZrWrXÚisfileZDistutilsPlatformError)r8ZversÚfnrrrr¦gs


ÿÿzbuild_ext.find_swigcCsŽ| |¡}| d¡}| |d¡}|jsRtjj|dd…|gŽ}tj |j|¡Sd |dd…¡}| d¡}tj 	| 
|¡¡}tj ||¡S)z¡Returns the path of the filename for a given extension.

        The file is located in `build_lib` or directly in the package
        (inplace option).
        rEr¤NrÚbuild_py)Úget_ext_fullnamerPÚget_ext_filenamerrQrWrXr'rkÚabspathZget_package_dir)r8r…ÚfullnameÚmodpathÚfilenamer*r¯Zpackage_dirrrrrŒs


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

        Adds the `package.` prefixNrE)r*)r8r…rrrr°šs
zbuild_ext.get_ext_fullnamecCs.ddlm}| d¡}|dƒ}tjj|Ž|S)z¦Convert 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©rarEZ
EXT_SUFFIX)Údistutils.sysconfigrarPrQrWrX)r8r…rar¢Z
ext_suffixrrrr±£s
zbuild_ext.get_ext_filenamecCsxd|j d¡d}z| d¡Wn0tk
rRd| d¡ dd¡ d¡}YnXd	|}||jkrr|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.
        Ú_rEr¤ÚasciirZpunycodeó-ó_ZPyInit)rZrPÚencodeÚUnicodeEncodeErrorÚreplaceÚdecoder›rV)r8r„reZ
initfunc_namerrrr¡­s"
zbuild_ext.get_export_symbolscCsätjdkr^ddlm}t|j|ƒsÞd}|jr4|d}|tjd?tjd?d@f}|j|gSn€dd	l	m
}d
}|dƒrÂttdƒr†d
}n<tjdkr–d
}n,dtj
krÂ|dƒdkr²d
}n|dƒdkrÂd
}|rÞ|dƒ}|jd|gS|jS)zÓReturn 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_déééÿr¶FrFZgetandroidapilevelTrAZ_PYTHON_HOST_PLATFORMZANDROID_API_LEVELZMACHDEPZ	LDVERSIONrD)rSr^Zdistutils._msvccompilerrÀrNr2rÚ
hexversionr.r·raÚhasattrrQÚenviron)r8r„rÀÚtemplateZ	pythonlibraZlink_libpythonZ	ldversionrrrr Às4

ÿ



zbuild_ext.get_libraries) Ú__name__Ú
__module__Ú__qualname__ZdescriptionrQrRZsep_byr	Zuser_optionsZboolean_optionsr
Zhelp_optionsr9rfrorˆr‹rrlrŽrÚ
contextlibÚcontextmanagerr–r‘rr¦rŒr°r±r¡r rrrrr!sp
ÿÿÿÿÙ+ÿÿ@N	
	K6	
r)Ú__doc__rËrQÚrerSZdistutils.corerZdistutils.errorsr·rrrZdistutils.dep_utilrZdistutils.extensionrZdistutils.utilr	rLr
Zsiterržr|r
rrrrrÚ<module>s$ÿ