o ƒ_¶a‡Vã@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#d1dd„Z$dd„Z%d2dd„Z&dd„Z'dd„Z(dZ)dd„Z*d3dd „Z+e ,d!¡Z-e ,d"¡Z.e ,d#¡Z/d3d$d%„Z0d&d'„Z1da2d(Z3d)d*„Z4d+d,„Z5d-d.„Z6d/d0„Z7dS)4aProvide 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é)ÚDistutilsPlatformErrorÚ__pypy__Ú_PYTHON_PROJECT_BASEcCs,dD]}tj tj |d|¡¡rdSqdS)N)ÚSetupz Setup.localÚModulesTF)ÚosÚpathÚisfileÚjoin)ÚdÚfn©rúA/usr/lib/python3/dist-packages/setuptools/_distutils/sysconfig.pyÚ_is_python_source_dir,s ÿrÚ_homeÚntcCs0|rtj |¡ tj tj td¡¡¡rtS|S)NÚPCbuild)rr ÚnormcaseÚ startswithr ÚPREFIX)r rrrÚ _fix_pcbuild5s ÿrcCstrttƒSttƒS©N)Ú _sys_homerÚ project_baserrrrÚ _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_inforrrrÚget_python_versionQsr cCsà|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©ééÚ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_PYPYrrr r Ú python_buildrrÚget_config_varÚnormpathr Ú build_flagsÚpathsepr)Ú plat_specificÚprefixÚincdirÚimplementationÚ python_dirrrrÚget_python_incYs0      ÿÿÿr9cCs|r|Stj |d¡S)Nú site-packages)rr r )Ú standard_libÚ libpythonÚ early_prefixr5rrrÚ _posix_lib…sr>cCsútr!tjdkr!|dur t}|rtj |dtjd¡Stj |d¡S|}|dur6|r0|r-tp.t }n|r4t p5t}tj dkr`|s?|rFt tddƒ}nd}trLd nd }tj |||t ƒ¡}t||||ƒStj d krv|rntj |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'. r"Nz lib-pythonrr:r!Ú platlibdirÚlibr(r)rÚLibz?I don't know where Python installs its library on platform '%s')r.rrrrr r Úversionr+r,Ú EXEC_PREFIXr-Úgetattrr r>r)r4r;r5r=Úlibdirr7r<rrrÚget_python_libŒs:    ÿ ÿÿrFc 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. Ú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ÚarchiverÚRANLIBÚranlib)r_)Ú compiler_typerÚplatformr0Ú _osx_supportÚcustomize_compilerÚ _config_varsÚget_config_varsrÚenvironrÚlenÚset_executablesÚ executablesÚgetÚshared_lib_extension)rXrbÚccÚcxxÚcflagsÚccsharedÚldsharedÚ shlib_suffixÚarÚar_flagsÚnewccÚcppr]Úcc_cmdrrrrcÃsh     ÿÿ   ÿ               ù  ¾rccCsDtrtjdkrtj tp td¡}n tpt}ntdd}tj |d¡S)z2Return full pathname of installed pyconfig.h file.rr*r©r4z pyconfig.h)r/rr-r r rrr9)Úinc_dirrrrÚget_config_h_filenames    ryz+config-{python_ver}{build_flags}{multiarch}cCs`tr tj tptd¡Stddd}ttj dƒrdtj j nd}t j t ƒt|d}tj ||d¡S) zAReturn full pathname of installed Makefile from the Python build.ÚMakefilerr©r4r;Ú _multiarchz-%sr)Ú python_verr2Ú multiarch)r/rr r rrrFÚhasattrrr7r|Ú_makefile_tmplÚformatr r2)Úlib_dirr~Ú config_filerrrÚget_makefile_filenames  ÿþýr„cCsš|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ÚgÚ define_rxÚundef_rxÚlineÚmÚnÚvrrrÚparse_config_h0s&   ö  ó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#n?t |¡}|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 }nd||vr¿d }nt|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)Ústrip_commentsÚ skip_blanksÚ join_linesÚerrorsNTrz$$rú$)rMrTrVFÚPY_r#)Údistutils.text_filer•r‡Ú _variable_rxrˆr‰ÚstripÚreplacerŠr‹ÚlistÚ _findvar1_rxÚsearchÚ _findvar2_rxÚstrrrfrÚendÚstartÚcloseÚitemsÚ isinstanceÚupdate)r rr•rŒÚdoneÚnotdonerr‘r’r“ÚtmpvÚrenamed_variablesr-ÚvalueÚfoundÚitemÚafterÚkrrrÚparse_makefileSsŽ      þì       ÿ   €Ð2  € rµcCsX 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)r¢r£r¤Úspanrjr‰)ÚsÚvarsr‘Úbegr¦rrrÚexpand_makefile_vars½s *ùrºz+_sysconfigdata_{abi}_{platform}_{multiarch}c Cs„tj dtjtjtjttj ddƒd¡}z t |t ƒt ƒdgdƒ}Wnt y5t dt ƒt ƒdgdƒ}Ynw|j}iat |¡dS) z7Initialize the module as appropriate for POSIX systems.Ú_PYTHON_SYSCONFIGDATA_NAMEr|r)Úabirar~Úbuild_time_varsrÚ_sysconfigdataN)rrfrjÚ_sysconfig_name_tmplrrÚabiflagsrarDr7Ú __import__ÚglobalsÚlocalsÚ ImportErrorr½rdr«)r-Ú_tempr½rrrÚ _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 NTrrr{ÚLIBDESTÚ BINLIBDESTrwÚ INCLUDEPYÚ EXT_SUFFIXz.exeÚEXEÚ.rÚVERSIONÚBINDIRN) rFr9Ú_impÚextension_suffixesr r rr ÚdirnameÚabspathrÚ executablerd)rrrrÚ_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. NÚ_init_r5Ú exec_prefixrÊÚSOr&r!rHr)rdrÂrjrr-rrCr.rr/r rÑr„r rÒr1ÚisabsÚgetcwdrrarbÚcustomize_config_varsÚappend)ÚargsÚfuncr×r&ÚbaserbÚvalsr-rrrresB       recCs*|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ÚDeprecationWarningrerj)r-ràrrrr0Qs r0)rN)rrNr)8Ú__doc__rÏrr…rršrÚbuiltin_module_namesr.r r1r5rrÖrCÚ base_prefixr,Úbase_exec_prefixr+rfrÒrrÓrÑrÙrrDrr-rrr/r2rÀÚAttributeErrorr r9r>rFrcryr€r„r”r†ržr¢r¤rµrºrdr¿rÆrÔrer0rrrrÚsh      € ý , 7K     j K