JFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3RbrJFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbro h{@s ddlZddlZddlZddlZddlmZddlTddlmZm Z ddlm Z ddl m Z ddl mZddlmZdd lmZdd lmZed Zd d ZGdddeZdS)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)Nrshow_compilers)distutils.ccompilerr r rB/opt/alt/python310/lib64/python3.10/distutils/command/build_ext.pyr s  r c@seZdZdZdejZdddddefdd d d efd d ddddefddddddddddgZgdZ ddde fgZ d d!Z d"d#Z d$d%Zd&d'Zd(d)Zd*d+Zd,d-Zd.d/Zd0d1Zejd2d3Zd4d5Zd6d7Zd8d9Zd:d;Zdd?Zd@dAZdBdCZdS)D build_extz8build C/C++ extensions (compile/link to build directory)z (separated by '%s'))z build-lib=bz(directory for compiled extension modules)z build-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)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 rpath)rrr r$r%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_objectsrr compilerswigswig_cpp swig_optsr%parallelselfrrrinitialize_optionsjs* zbuild_ext.initialize_optionsc Csddlm}|ddddddd d |jdur|jj|_|jj|_|}|jd d }|j dur7|jj p5g|_ t |j t rE|j t j|_ tjtjkrW|j t jtjd |j | t jj||krq|j | t jj|d|d|jdurg|_|jdurg|_nt |jt r|j t j|_|jdurg|_nt |jt r|j t j|_t jdkr-|jt jtjdtjtjkr|jt jtjd|jrt j|jd|_n t j|jd|_|j t jtt tdd}|r|j||j!dkrd}n|j!dd}t jtjd}|r't j||}|j|tj"dddkr\tj#$t jtjdrV|jt jtjddt%dn|jd|&drv|j'sp|j|&d n|jd|j(r|j( d!}d"d#|D|_(|j)r|j) d!|_)|j*durg|_*n|j* d$|_*|j+rt jt,d }t jt,d} t j-|r|j |t j-| r|j| |j| t |j.t rz t/|j.|_.WdSt0yt1d%wdS)&Nr) sysconfigZbuild)r'r')r)r))r2r2)rr)r r )r6r6)r(r()Z plat_specificZincluder.r1ntZlibsZDebugZRelease_homewin32ZPCbuildcygwinbinlibpythonZconfig.Py_ENABLE_SHAREDZLIBDIR,cSsg|]}|dfqS)1r).0Zsymbolrrr sz.build_ext.finalize_options.. zparallel should be an integer)2 distutilsr:Zset_undefined_optionsr* distributionZ ext_packageZ ext_modulesr&Zget_python_incr+ isinstancestrsplitospathsepsys exec_prefixbase_exec_prefixappendpathjoinextendZensure_string_listr.r/r0nameprefixrr)dirnamergetattrr(platform executable startswithrget_config_varZ python_buildr,r-r5r%r isdirr6int ValueErrorZDistutilsOptionError) r8r:Z py_includeZplat_py_includeZ _sys_homesuffixZnew_libZdefinesZ user_includeZuser_librrrfinalize_optionss                             zbuild_ext.finalize_optionscCsbddlm}|js dS|jr&|d}|j|pg|j |j ||j |j |j|jd|_ t|j tjdkrJ|jtkrJ|j |j|jdurV|j |j|jdurj|jD] \}}|j ||q^|jdur{|jD]}|j |qr|jdur|j |j|j dur|j |j |jdur|j |j|j dur|j !|j |"dS)Nr) new_compiler build_clib)r2verbosedry_runr r<)#rrgr&rMZhas_c_librariesget_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_objectsbuild_extensions)r8rgrhrZvaluemacrorrrruns@             z build_ext.runc Csj t|ts tdt|D]\}}t|trqt|tr#t|dkr'td|\}}td|t|t r;t |s?tdt|t sHtdt||d}dD]}| |}|durbt|||qQ| d |_d |vrrtd | d }|rg|_g|_|D],} t| trt| d vstdt| dkr|j| dqt| dkr|j| q|||<qdS)Nz:'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_argsr0Zdef_filez9'def_file' element of build info dict no longer supportedmacros)r;rpz9'macros' element of build info dict must be 1- or 2-tupler;r)rNlistDistutilsSetupError enumeratertuplelenr warnrOextension_name_rematchdictgetsetattrruntime_library_dirs define_macros undef_macrosrV) r8r&rextext_nameZ build_infokeyvalrurnrrrcheck_extensions_listVsf             zbuild_ext.check_extensions_listcCs,||jg}|jD]}||jq |SN)rr&rYrq)r8 filenamesrrrrget_source_filess  zbuild_ext.get_source_filescCs2||jg}|jD] }|||jq |Sr)rr&rVget_ext_fullpathrZ)r8Zoutputsrrrr get_outputss  zbuild_ext.get_outputscCs*||j|jr|dS|dSr)rr&r6_build_extensions_parallel_build_extensions_serialr7rrrrls   zbuild_ext.build_extensionsc sj}jdur t}zddlm}Wn tyd}Ynw|dur*dS||d8fddjD}tj|D]\}} | | Wdn1sYwYqAWddS1sjwYdS)NTr)ThreadPoolExecutor)Z max_workerscsg|] }j|qSr)Zsubmitbuild_extension)rIrZexecutorr8rrrJsz8build_ext._build_extensions_parallel..) r6rQ cpu_countZconcurrent.futuresr ImportErrorrr&zip_filter_build_errorsresult)r8ZworkersrZfuturesrZfutrrrrs,      "z$build_ext._build_extensions_parallelc CsD|jD]}|| ||Wdn1swYqdSr)r&rr)r8rrrrrs   z"build_ext._build_extensions_serialc csXzdVWdStttfy+}z|js|d|j|fWYd}~dSd}~ww)Nz"building extension "%s" failed: %s)ZCCompilerErrorZDistutilsErrorZ CompileErrorZoptionalr{rZ)r8rerrrrs zbuild_ext._filter_build_errorsc CsL|j}|dust|ttfstd|jt|}||j}||j}|j s6t ||ds6t d|jdSt d|j|||}|jpGg}|jdd}|jD]}||fqR|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+rextra_postargsdepends)r.r/rrexport_symbolsrr)Z target_lang)"rqrNrvryrwrZsortedrrr rr rinfo swig_sourcesrsrrrVr2compiler)r+Z_built_objectsrrrYrtlanguageZdetect_languageZlink_shared_object get_librariesr/rget_export_symbols) r8rrqext_pathrZ extra_argsrur-ZobjectsrrrrrsV         zbuild_ext.build_extensioncCs& g}g}i}|jrtd|jsd|jvsd|jvrd}nd}|D](}tj|\}} | dkrF||d||||d||<q#||q#|sP|S|jpV| } | dg} | |j|jri| d|jsw|jD]} | | qo|D]}||} t d || | | d | |gqy|S) Nz/--swig-cpp is deprecated - use --swig-opts=-c++z-c++z.cppz.cz.i_wrapz-pythonzswigging %s to %sz-o) r4r r{r5rQrWsplitextrVr3 find_swigrYrZspawn)r8rq extensionZ new_sourcesrZ swig_targetsZ target_extsourcebaserr3Zswig_cmdotargetrrrr2s@        zbuild_ext.swig_sourcescCs\ tjdkrdStjdkr'dD]}tjd|d}tj|r$|SqdStdtj)Nposixr3r<)z1.3z1.2z1.1z c:\swig%szswig.exez>I don't know how to find (much less run) SWIG on platform '%s')rQrZrWrXisfileZDistutilsPlatformError)r8Zversfnrrrrhs   zbuild_ext.find_swigcCs ||}|d}||d}|js*tjj|dd|g}tj|j|Sd|dd}|d}tj | |}tj||S)NrErrbuild_py) get_ext_fullnamerPget_ext_filenamerrQrWrXr'rkabspathZget_package_dir)r8rfullnamemodpathfilenamer*rZ package_dirrrrrs   zbuild_ext.get_ext_fullpathcCs |jdur|S|jd|S)NrE)r*)r8rrrrrs zbuild_ext.get_ext_fullnamecCs0 ddlm}|d}|d}tjj||S)NrrarEZ EXT_SUFFIX)distutils.sysconfigrarPrQrWrX)r8rrarZ ext_suffixrrrrs   zbuild_ext.get_ext_filenamecCsx d|jdd}z|dWnty)d|dddd}Ynwd |}||jvr9|j||jS) N_rErasciirZpunycode-_ZPyInit)rZrPencodeUnicodeEncodeErrorreplacedecoderrV)r8rreZ initfunc_namerrrrs    zbuild_ext.get_export_symbolscCs tjdkr2ddlm}t|j|s/d}|jr|d}|tjd?tjd?d@f}|j|gS|jSdd l m }d }|d rdt td rFd }ntjdkrNd }ndt j vrd|ddkr\d }n|ddkrdd }|rr|d}|jd|gS|jS)Nr>r) MSVCCompilerz python%d%dZ_drFrFZgetandroidapilevelTrAZ_PYTHON_HOST_PLATFORMZANDROID_API_LEVELZMACHDEPZ LDVERSIONrD)rSr^Zdistutils._msvccompilerrrNr2r hexversionr.rrahasattrrQenviron)r8rrtemplateZ pythonlibraZlink_libpythonZ ldversionrrrrs8         zbuild_ext.get_libraries) __name__ __module__ __qualname__ descriptionrQrRZsep_byr Z user_optionsZboolean_optionsr Z help_optionsr9rfrorrrrlrr contextlibcontextmanagerrrrrrrrrrrrrrr!sp +@N   L6  r)rrQrerSZdistutils.corerZdistutils.errorsrrrrZdistutils.dep_utilrZdistutils.extensionrZdistutils.utilr rLr Zsiter rr|r rrrrrs&