o ¯)»a~Tã@s¶dZddlZddlZddlZddlZddlmZdejvZej   ej ¡Z ej   ej ¡Zej   ej¡Zej   ej¡ZdejvrHej  ejd¡ZnejrWej  ej  ej¡¡Zne ¡Zdd„Zeed dƒZejd krvd d „ZeeƒZeeƒZd d„ZeƒZdZ zes…ej!Z Wn e"yYnwdd„Z#d-dd„Z$d.dd„Z%dd„Z&dd„Z'dd„Z(d/dd„Z)e *d¡Z+e *d¡Z,e *d ¡Z-d/d!d"„Z.d#d$„Z/da0d%d&„Z1d'd(„Z2d)d*„Z3d+d,„Z4dS)0aProvide access to Python's configuration information. The specific configuration variables available depend heavily on the platform and configuration. The values may be retrieved using get_config_var(name), and the list of variables is available via get_config_vars().keys(). Additional convenience functions are also available. Written by: Fred L. Drake, Jr. Email: éNé)ÚDistutilsPlatformErrorZ__pypy__Z_PYTHON_PROJECT_BASEcCs,dD]}tj tj |d|¡¡rdSqdS)N)ZSetupz Setup.localZModulesTF)ÚosÚpathÚisfileÚjoin)ÚdÚfn©r úR/opt/alt/python310/lib/python3.10/site-packages/setuptools/_distutils/sysconfig.pyÚ_is_python_source_dir,s ÿr Ú_homeÚntcCs0|rtj |¡ tj tj td¡¡¡rtS|S)NZPCbuild)rrÚnormcaseÚ startswithrÚPREFIX)rr r r Ú _fix_pcbuild5s ÿrcCstrttƒSttƒS©N)Ú _sys_homer Ú project_baser r r r Ú _python_build=srÚcCsdtjdd…S)z–Return a string containing the major and minor Python version, leaving off the patchlevel. Sample return values could be '1.5' or '2.2'. z%d.%dNé)ÚsysÚ version_infor r r r Úget_python_versionQsrcCsà|dur |rtp t}tjdkrItrtjdkrtj |d¡St r4|r%t p$t Stj t dƒd¡}tj  |¡Str8dnd}|tƒt}tj |d|¡Stjd krit rbtj |d¡tjjtj |d ¡Stj |d¡Std tjƒ‚) a¤Return the directory containing installed Python header files. If 'plat_specific' is false (the default), this is the path to the non-platform-specific header files, i.e. Python.h and so on; otherwise, this is the path to platform-specific header files (namely pyconfig.h). If 'prefix' is supplied, use it instead of sys.base_prefix or sys.base_exec_prefix -- i.e., ignore 'plat_specific'. NÚposix©ééZincludeÚsrcdirZIncludeÚpypyÚpythonrÚPCzFI don't know where Python installs its C header files on platform '%s')ÚBASE_EXEC_PREFIXÚ BASE_PREFIXrÚnameÚIS_PYPYrrrrÚ python_buildrrÚget_config_varÚnormpathrÚ build_flagsÚpathsepr)Ú plat_specificÚprefixZincdirÚimplementationZ python_dirr r r Úget_python_incYs0      ÿÿÿr0cCsþtr!tjdkr!|dur t}|rtj |dtjd¡Stj |d¡S|dur4|r.|r+tp,t }n|r2t p3t}tj dkrb|s=|rDt tddƒ}nd}trJd nd }tj |||t ƒ¡}|r[|Stj |d¡Stj d krx|rptj |d ¡Stj |d d¡Std tj ƒ‚)aSReturn the directory containing the Python library (standard or site additions). If 'plat_specific' is true, return the directory containing platform-specific modules, i.e. any module from a non-pure-Python module distribution; otherwise, return the platform-shared library directory. If 'standard_lib' is true, return the directory containing standard Python library modules; otherwise, return the directory for site-specific modules. If 'prefix' is supplied, use it instead of sys.base_prefix or sys.base_exec_prefix -- i.e., ignore 'plat_specific'. rNz lib-pythonrz site-packagesrÚ platlibdirÚlibr!r"rZLibz?I don't know where Python installs its library on platform '%s')r'rrrrrrÚversionr$r%Ú EXEC_PREFIXr&Úgetattrrr)r-Ú standard_libr.Úlibdirr/Z libpythonr r r Úget_python_lib„s<    ÿ ÿÿr8c Cs|jdkrtjdkrtdƒsddl}| t¡dtd<tddd d d d d dƒ\}}}}}}}} dtj vrOtj d} d tj vrM|  |¡rM| |t |ƒd…}| }dtj vrYtj d}d tj vrctj d }dtj vrntj d} n|d} dtj vr€|dtj d}d tj vr—|dtj d }|dtj d }dtj vr·| dtj d} |dtj d}|dtj d}d tj vrÁtj d }dtj vrÐ|dtj d} n|d| } |d|} |j | | | d||||| ddtj vr|j  dd¡r|j tj dd||_dSdS)zÄDo any platform-specific customization of a CCompiler instance. Mainly needed on Unix, so we can plug in the information that varies across Unices and is stored in Python's Makefile. ZunixÚdarwinZCUSTOMIZED_OSX_COMPILERrNÚTrueZCCZCXXÚCFLAGSZCCSHAREDZLDSHAREDZ SHLIB_SUFFIXZARZARFLAGSZCPPz -EÚLDFLAGSú ÚCPPFLAGS)Z preprocessorÚcompilerZ compiler_soZ compiler_cxxZ linker_soZ linker_exeÚarchiverZRANLIBÚranlib)rA)Z compiler_typerÚplatformr)Ú _osx_supportÚcustomize_compilerÚ _config_varsÚget_config_varsrÚenvironrÚlenZset_executablesZ executablesÚgetZshared_lib_extension)r?rCZccZcxxZcflagsZccsharedZldsharedZ shlib_suffixZarZar_flagsZnewccZcppr@Zcc_cmdr r r rD¼sh     ÿÿ   ÿ               ù  ¾rDcCsDtrtjdkrtj tp td¡}qtpt}ntdd}tj |d¡S)z2Return full pathname of installed pyconfig.h file.rr#r©r-z pyconfig.h)r(rr&rrrrr0)Zinc_dirr r r Úget_config_h_filenames    rKcCs\tr tj tptd¡Stddd}d tƒt ¡}t t j dƒr&|dt j j 7}tj ||d¡S)zAReturn full pathname of installed Makefile from the Python build.ZMakefilerr©r-r6z config-{}{}Ú _multiarchz-%s)r(rrrrrr8Úformatrr+Úhasattrrr/rM)Zlib_dirZ config_filer r r Úget_makefile_filenames  rPcCsš|duri}t d¡}t d¡} | ¡}|s |S| |¡}|r>| dd¡\}}zt|ƒ}Wn ty8Ynw|||<n| |¡}|rLd|| d¡<q)zÌParse a config.h-style file. A dictionary containing name/value pairs is returned. If an optional dictionary is passed in as the second argument, it is used instead of a new dictionary. Nz"#define ([A-Z][A-Za-z0-9_]+) (.*) z&/[*] #undef ([A-Z][A-Za-z0-9_]+) [*]/ Trrr)ÚreÚcompileÚreadlineÚmatchÚgroupÚintÚ ValueError)ÚfpÚgZ define_rxZundef_rxÚlineÚmÚnÚvr r r Úparse_config_hs&   ö  ór^z"([a-zA-Z][a-zA-Z0-9_]+)\s*=\s*(.*)z\$\(([A-Za-z][A-Za-z0-9_]*)\)z\${([A-Za-z][A-Za-z0-9_]*)}c Cs¤ddlm}||ddddd}|duri}i}i} | ¡}|dur#qbt |¡}|ra| dd¡\}} |  ¡} |  d d ¡} d | vrE| ||<nzt| ƒ} Wnt y\|  d d ¡||<Ynw| ||<qd } |r1t |ƒD]Ã} || } t   | ¡pzt   | ¡}|r+| d¡}d}||vrt||ƒ}n>||vr—d }n7|tjvr¢tj|}n,|| vrÈ|  d¡r¶| dd…| vr¶d }qÎd||vr¿d }qÎt|d|ƒ}nd ||<}|r*| | ¡d…}| d| ¡…||} d |vrî| || <qkzt| ƒ} Wnt y|  ¡|| <Ynw| || <|| =|  d¡r*| dd…| vr*| dd…} | |vr*| || <qk|| =qk|sg| ¡| ¡D]\}} t| tƒrI|  ¡||<q9| |¡|S)zÌParse a Makefile-style file. A dictionary containing name/value pairs is returned. If an optional dictionary is passed in as the second argument, it is used instead of a new dictionary. r)ÚTextFilerÚsurrogateescape)Zstrip_commentsZ skip_blanksZ join_linesÚerrorsNTrz$$rú$)r;r<r>FZPY_r)Zdistutils.text_filer_rSÚ _variable_rxrTrUÚstripÚreplacerVrWÚlistÚ _findvar1_rxÚsearchÚ _findvar2_rxÚstrrrGrÚendÚstartÚcloseÚitemsÚ isinstanceÚupdate)r rYr_rXZdoneZnotdonerZr[r\r]ZtmpvZrenamed_variablesr&ÚvalueÚfoundÚitemZafterÚkr r r Úparse_makefileBs      þì       ÿ ÿ  €Ð2  € rucCsX t |¡p t |¡}|r(| ¡\}}|d|…| | d¡¡||d…}n |Sq)a¨Expand Makefile-style variables -- "${foo}" or "$(foo)" -- in 'string' according to 'vars' (a dictionary mapping variable names to values). Variables not present in 'vars' are silently expanded to the empty string. The variable values in 'vars' should not contain further variable expansions; if 'vars' is the output of 'parse_makefile()', you're fine. Returns a variable-expanded version of 's'. TrrN)rgrhriÚspanrIrU)ÚsÚvarsr[Zbegrkr r r Úexpand_makefile_vars¬s *ùryc Cs„tj ddjtjtjttjddƒd¡}z t |t ƒt ƒdgdƒ}Wnt y5t dt ƒt ƒdgdƒ}Ynw|j }iat |¡d S) z7Initialize the module as appropriate for POSIX systems.Z_PYTHON_SYSCONFIGDATA_NAMEz+_sysconfigdata_{abi}_{platform}_{multiarch}rMr)ZabirBZ multiarchÚbuild_time_varsrZ_sysconfigdataN)rrGrIrNrÚabiflagsrBr5r/Ú __import__ÚglobalsÚlocalsÚ ImportErrorrzrErp)r&Z_temprzr r r Ú _init_posixÇs" ýÿ ÿþr€cCs~i}tddd|d<tddd|d<tdd|d<t ¡d|d<d |d <tƒ d d ¡|d <tj tj  t j ¡¡|d<|a dS)z+Initialize the module as appropriate for NTrrrLZLIBDESTZ BINLIBDESTrJZ INCLUDEPYÚ EXT_SUFFIXz.exeZEXEÚ.rZVERSIONZBINDIRN) r8r0Ú_impÚextension_suffixesrrerrÚdirnameÚabspathrÚ executablerE)rYr r r Ú_init_ntÜsrˆcGsLtdur‘tƒ dtj¡}|r|ƒniattd<ttd<tsƒt d¡}|dur,|td<t dt¡}tjdkrOt rHtj   t ƒ¡}tj   ||¡}ntj   t ƒ¡}tj  tj  |¡¡td<t rƒtjdkrƒt}tj  td¡sƒ|t ¡krƒtj   |td¡}tj  |¡td<tjd kr‘d dl}| t¡|r¤g}|D] }| t |¡¡q—|StS) aßWith no arguments, return a dictionary of all configuration variables relevant for the current platform. Generally this includes everything needed to build extensions and install both pure modules and extensions. On Unix, this means every variable defined in Python's installed Makefile; on Windows it's a much smaller set. With arguments, return a list of values that result from looking up each argument in the configuration variable dictionary. NZ_init_r.Ú exec_prefixrÚSOr rr9r)rEr}rIrr&rr4r'rr(rr…rPrr†r*ÚisabsÚgetcwdrrBrCZcustomize_config_varsÚappend)ÚargsÚfuncrŠr ÚbaserCZvalsr&r r r rFïsD     ÿ  rFcCs*|dkrddl}| dtd¡tƒ |¡S)z“Return the value of a single variable using the dictionary returned by 'get_config_vars()'. Equivalent to get_config_vars().get(name) rŠrNz SO is deprecated, use EXT_SUFFIXr)ÚwarningsÚwarnÚDeprecationWarningrFrI)r&r‘r r r r):s r))rN)rrNr)5Ú__doc__rƒrrQrrarÚbuiltin_module_namesr'rr*r.rr‰r4Ú base_prefixr%Úbase_exec_prefixr$rGr†rr‡r…rŒr r5rr&rrr(r+r{ÚAttributeErrorrr0r8rDrKrPr^rRrcrgriruryrEr€rˆrFr)r r r r Úsb      € ý  +8K    j K