U Ù üe~Tã@s¼dZddlZddlZddlZddlZddlmZdejkZej   ej ¡Z ej   ej ¡Zej   ej¡Zej   ej¡Zdejkrej  ejd¡Zn&ejr®ej  ej  ej¡¡Zne ¡Zdd„Zeed dƒZejd krìd d „ZeeƒZeeƒZd d„ZeƒZdZ zes ej!Z Wne"k r$YnXdd„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-d0d!d"„Z.d#d$„Z/da0d%d&„Z1d'd(„Z2d)d*„Z3d+d,„Z4dS)1aProvide 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)ÚSetupz Setup.localÚModulesTF)ÚosÚpathÚisfileÚjoin)ÚdÚfn©r úM/opt/hc_python/lib/python3.8/site-packages/setuptools/_distutils/sysconfig.pyÚ_is_python_source_dir,srÚ_homeÚntcCs0|r,tj |¡ tj tj td¡¡¡r,tS|S)NZPCbuild)rrÚnormcaseÚ startswithr ÚPREFIX)r r r r Ú _fix_pcbuild5s ÿrcCstr ttƒ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ä|dkr|rtpt}tjdkr’tr:tjdkr:tj |d¡St rh|rJt pHt Stj t dƒd¡}tj  |¡Strpdnd}|tƒt}tj |d|¡Stjd krÒt rÄtj |d¡tjjtj |d ¡Stj |d¡Std tjƒ‚dS) 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©ééÚincludeÚsrcdirÚIncludeÚ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ÚprefixÚincdirÚimplementationÚ python_dirr r r Úget_python_incYs0       ÿÿÿr5cCstrBtjdkrB|dkrt}|r4tj |dtjd¡Stj |d¡S|dkrh|r\|rVtpXt }n |rdt pft}tj dkrÆ|sz|rˆt tddƒ}nd}tr”d nd }tj |||t ƒ¡}|r¶|Stj |d¡Snc Cs|jdkrtjdkr8tdƒs8ddl}| t¡dtd<tddd d d d d dƒ\}}}}}}}} dtj kržtj d} d tj krš|  |¡rš| |t |ƒd…}| }dtj kr²tj d}d tj krÆtj d }dtj krÜtj d} n|d} dtj kr|dtj d}d tj kr2|dtj d }|dtj d }dtj krt| dtj d} |dtj d}|dtj d}d tj krŠtj d }dtj krª|dtj d} n |d| } |d|} |j | | | d||||| ddtj kr|j  dd¡r|j tj dd||_dS)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. ÚunixÚdarwinÚCUSTOMIZED_OSX_COMPILERrNÚTrueÚCCÚCXXÚCFLAGSÚCCSHAREDÚLDSHAREDÚ SHLIB_SUFFIXÚARÚARFLAGSÚCPPz -EÚLDFLAGSú ÚCPPFLAGS)Ú preprocessorÚcompilerÚ compiler_soÚ compiler_cxxÚ linker_soÚ linker_exeÚarchiverZRANLIBÚranlib)rV)Ú compiler_typerÚplatformr,Ú _osx_supportÚcustomize_compilerÚ _config_varsÚget_config_varsrÚenvironrÚlenÚset_executablesZ executablesÚgetÚshared_lib_extension)rPrYÚccÚcxxÚcflagsÚccsharedÚldsharedÚ shlib_suffixÚarÚar_flagsÚnewccÚcpprUÚcc_cmdr r r rZ¼sn   ÿÿ   ÿ               ù rZcCsDtr,tjdkr"tj tptd¡}q6tp(t}n tdd}tj |d¡S)z2Return full pathname of installed pyconfig.h file.rr&r©r0z pyconfig.h)r+rr)rr rrr5)Úinc_dirr r r Úget_config_h_filenames    rocCs\trtj tptd¡Stddd}d tƒt ¡}t t j dƒrL|dt j j 7}tj ||d¡S)zAReturn full pathname of installed Makefile from the Python build.ÚMakefilerr©r0r<z config-{}{}Ú _multiarchz-%s)r+rrr rrr>Úformatrr.Úhasattrrr3rr)Úlib_dirÚ config_filer r r Úget_makefile_filenames  rwcCsš|dkr i}t d¡}t d¡}| ¡}|s.q–| |¡}|rx| dd¡\}}z t|ƒ}Wntk rlYnX|||<q | |¡}|r d|| d¡<q |S)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_]+) [*]/ rrr)ÚreÚcompileÚreadlineÚmatchÚgroupÚintÚ ValueError)ÚfpÚgÚ define_rxÚundef_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}|dkr*i}i}i}| ¡}|dkrDqÄt |¡}|r2| dd¡\}} |  ¡} |  dd ¡} d | krˆ| ||<q2z t| ƒ} Wn$t k r¸|  dd ¡||<Yq2X| ||<q2d } |rtt |ƒD]˜} || } t   | ¡pöt   | ¡}|rj| d¡}d }||kr$t||ƒ}nˆ||kr4d }nx|tjkrLtj|}n`|| kr |  d¡rz| dd…| krzd }n$d||krŽd }nt|d|ƒ}n d ||<}|rp| | ¡d…}| d| ¡…||} d |krî| || <nzz t| ƒ} Wn"t k r|  ¡|| <Yn X| || <|| =|  d¡rp| dd…| krp| dd…} | |krp| || <qÖ|| =qÖqÈ| ¡| ¡D]"\}} t| tƒr„|  ¡||<q„| |¡|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)Ústrip_commentsÚ skip_blanksÚ join_linesÚerrorsNrz$$rú$)rErLrNTFÚPY_r)Údistutils.text_filerˆrzÚ _variable_rxr{r|ÚstripÚreplacer}r~ÚlistÚ _findvar1_rxÚsearchÚ _findvar2_rxÚstrrr]rÚendÚstartÚcloseÚitemsÚ isinstanceÚupdate)r r€rˆrÚdoneÚnotdonerƒr„r…r†ÚtmpvÚrenamed_variablesr)ÚvalueÚfoundÚitemÚafterÚkr r r Úparse_makefileBs„                 ÿ      r¨cCsVt |¡pt |¡}|rR| ¡\}}|d|…| | d¡¡||d…}qqRq|S)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'. rrN)r•r–r—Úspanr`r|)ÚsÚvarsr„Úbegr™r r r Úexpand_makefile_vars¬s  *r­c Cs†tj ddjtjtjttjddƒd¡}zt |t ƒt ƒdgdƒ}Wn*t k rlt dt ƒt ƒdgdƒ}YnX|j }iat |¡d S) z7Initialize the module as appropriate for POSIX systems.Ú_PYTHON_SYSCONFIGDATA_NAMEz+_sysconfigdata_{abi}_{platform}_{multiarch}rrr)ÚabirXÚ multiarchÚbuild_time_varsrZ_sysconfigdataN)rr]r`rsrÚabiflagsrXr;r3Ú __import__ÚglobalsÚlocalsÚ ImportErrorr±r[rž)r)Ú_tempr±r 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 NTrrrqÚLIBDESTÚ BINLIBDESTrmÚ INCLUDEPYÚ EXT_SUFFIXz.exeÚEXEÚ.rÚVERSIONÚBINDIRN) r>r5Ú_impÚextension_suffixesrr“rrÚdirnameÚabspathrÚ executabler[)r€r r r Ú_init_ntÜsrÆcGsbtdkr0tƒ dtj¡}|r(|ƒniattd<ttd<tst d¡}|dk r\|td<t dt¡}tjdkr¢t r”tj   t ƒ¡}tj   ||¡}ntj   t ƒ¡}tj  tj  |¡¡td<t rtjdkrt}tj  td¡s|t ¡krtj   |td¡}tj  |¡td<tjd kr0d dl}| t¡|rZg}|D]}| t |¡¡q>|StSdS) 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. NÚ_init_r1Ú exec_prefixr¼ÚSOr"rr@r)r[r´r`rr)rr:r*rr+rrÃrwr rÄr-ÚisabsÚgetcwdrrXrYÚcustomize_config_varsÚappend)ÚargsÚfuncrÉr"ÚbaserYÚvalsr)r r r r\ïsD     ÿ  r\cCs*|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ÚDeprecationWarningr\r`)r)rÒr r r r,:sr,)rN)rrN)N)N)5Ú__doc__rÁrrxrrrÚbuiltin_module_namesr*rr-r1rrÈr:Ú base_prefixr(Úbase_exec_prefixr'r]rÄrrÅrÃrËrr;rr)rrr+r.r²ÚAttributeErrorrr5r>rZrorwr‡ryr‘r•r—r¨r­r[r¸rÆr\r,r r r r Ús\        + 8K      jK