Current File : //lib/python3.9/site-packages/setuptools/_distutils/__pycache__/sysconfig.cpython-39.pyc
a

��kheS�@s�dZddlZddlZddlZddlZddlmZdejvZej	�
ej�Zej	�
ej
�Zej	�
ej�Zej	�
ej�Zdejvr�ej	�ejd�Zn&ejr�ej	�ej	�ej��Zne��Zdd�Zeed	d�Zejd
kr�dd�Zee�Zee�Zd
d�Ze�ZdZ ze�sej!Z Wne"�y"Yn0dd�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)1a�Provide 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:        <fdrake@acm.org>
�N�)�DistutilsPlatformErrorZ__pypy__Z_PYTHON_PROJECT_BASEcCs,dD]"}tj�tj�|d|��rdSqdS)N)ZSetupzSetup.localZModulesTF)�os�path�isfile�join)�d�fn�r
�C/usr/lib/python3.9/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)rr
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�|dur|rtpt}tr&tj�|d�Stjdkr|tr^|r@tp>t	Stj�t
d�d�}tj�|�Sdt�t
}tj�|d|�Stjdkr�tr�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'.
    NZinclude�posix�srcdirZInclude�pythonr�PCzFI don't know where Python installs its C header files on platform '%s')�BASE_EXEC_PREFIX�BASE_PREFIX�IS_PYPYrrr�name�python_buildrr�get_config_var�normpathr�build_flags�pathsepr)�
plat_specific�prefixZincdirZ
python_dirr
r
r�get_python_incYs.

���r*cCs�tr8|durt}|r*tj�|dtjd�Stj�|d�S|dur^|rR|rLtpNt}n|rZt	p\t}tj
dkr�|sp|r~ttdd�}nd}tj�||dt��}|r�|Stj�|d�Sn<tj
d	kr�|r�tj�|d
�Stj�|d
d�Snt
dtj
��dS)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'.
    Nz
lib-pythonrz
site-packagesr�
platlibdir�librrZLibz?I don't know where Python installs its library on platform '%s')r!rrrrr�versionrr �EXEC_PREFIXr"�getattrrr)r(�standard_libr)�libdirZ	libpythonr
r
r�get_python_lib�s:

�
��r2c	Cs�|jdk�r�tjdkr8td�s8ddl}|�t�dtd<tddd	d
ddd
d�\}}}}}}}}	dtj	vr�tj	d}
tjdkr�dtj	vr�|�
|�r�|
|t|�d�}|
}dtj	vr�tj	d}dtj	vr�tj	d}dtj	vr�tj	d}n|d}dtj	v�r|dtj	d}d	tj	v�r<|dtj	d	}|dtj	d	}dtj	v�r~|dtj	d}|dtj	d}|dtj	d}d
tj	v�r�tj	d
}dtj	v�r�|dtj	d}n|d|	}|d|}
|j||
|
d|||||d�||_
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.
    Zunix�darwinZCUSTOMIZED_OSX_COMPILERrN�TrueZCCZCXX�CFLAGSZCCSHAREDZLDSHAREDZSHLIB_SUFFIXZARZARFLAGSZCPPz -E�LDFLAGS� �CPPFLAGS)Zpreprocessor�compilerZcompiler_soZcompiler_cxxZ	linker_soZ
linker_exe�archiver)Z
compiler_typer�platformr$�_osx_support�customize_compiler�_config_vars�get_config_varsr�environr�lenZset_executablesZshared_lib_extension)r9r<ZccZcxxZcflagsZccsharedZldsharedZshlib_suffix�arZar_flagsZnewccZcppr:Zcc_cmdr
r
rr=�sf


��


��






�	r=cCsDtr,tjdkr"tj�tptd�}q6tp(t}n
tdd�}tj�|d�S)z2Return full pathname of installed pyconfig.h file.rrr�r(z
pyconfig.h)r#rr"rrrrr*)Zinc_dirr
r
r�get_config_h_filenames


rDcCs\trtj�tptd�Stddd�}d�t�t	�}t
tjd�rL|dtjj
7}tj�||d�S)zAReturn full pathname of installed Makefile from the Python build.ZMakefilerr�r(r0zconfig-{}{}�
_multiarchz-%s)r#rrrrrr2�formatrr&�hasattrr�implementationrF)Zlib_dirZconfig_filer
r
r�get_makefile_filenamesrJcCs�|duri}t�d�}t�d�}|��}|s.q�|�|�}|rv|�dd�\}}zt|�}WntyjYn0|||<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�gZ	define_rxZundef_rx�line�m�n�vr
r
r�parse_config_hs"




rXz"([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�}|dur*i}i}i}|��}|durDq�t�|�}|r2|�dd�\}}	|	��}	|	�dd	�}
d
|
vr�|	||<q2zt|	�}	Wn"t	y�|	�dd
�||<Yq20|	||<q2d}|�rpt
|�D�]�}||}
t�|
�p�t
�|
�}|�rf|�d�}d}||v�r"t||�}n�||v�r2d
}nx|tjv�rJtj|}n`||v�r�|�d��rx|dd�|v�rxd	}n$d||v�r�d
}nt|d|�}nd	||<}|�rl|
|��d�}|
d|���||}
d
|v�r�|
||<nxzt|
�}
Wn t	�y|
��||<Yn
0|
||<||=|�d��rl|dd�|v�rl|dd�}||v�rl|
||<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)Zstrip_commentsZskip_blanksZ
join_lines�errorsNrz$$r�$)r5r6r8TFZPY_�)Zdistutils.text_filerYrM�_variable_rxrNrO�strip�replacerPrQ�list�_findvar1_rx�search�_findvar2_rx�strrr@r�end�start�close�items�
isinstance�update)r	rSrYrRZdoneZnotdonerTrUrVrWZtmpvZrenamed_variablesr"�value�found�itemZafter�kr
r
r�parse_makefile=s�








�



rpcCsVt�|�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)rbrcrd�span�getrO)�s�varsrUZbegrfr
r
r�expand_makefile_vars�s*ruc
Cs�tj�ddjtjtjttjdd�d��}zt	|t
�t�dgd�}Wn(tyjt	dt
�t�dgd�}Yn0|j
}iat�|�d	S)
z7Initialize the module as appropriate for POSIX systems.Z_PYTHON_SYSCONFIGDATA_NAMEz+_sysconfigdata_{abi}_{platform}_{multiarch}rFr)Zabir;Z	multiarch�build_time_varsrZ_sysconfigdataN)rr@rrrGr�abiflagsr;r/rI�
__import__�globals�locals�ImportErrorrvr>rk)r"Z_temprvr
r
r�_init_posix�s ���
r|cCs~i}tddd�|d<tddd�|d<tdd�|d<t��d|d<d	|d
<t��dd�|d
<tj�tj�	t
j��|d<|adS)z+Initialize the module as appropriate for NTrrrEZLIBDESTZ
BINLIBDESTrCZ	INCLUDEPY�
EXT_SUFFIXz.exeZEXE�.rZVERSIONZBINDIRN)
r2r*�_imp�extension_suffixesrr`rr�dirname�abspathr�
executabler>)rSr
r
r�_init_nt�sr�cGsbtdu�r0t��dtj�}|r(|�niattd<ttd<t�st�d�}|dur\|td<t�dt�}tjdkr�t	r�tj
�t��}tj
�
||�}ntj
�t��}tj
�tj
�|��td<t	�rtjdk�rt}tj
�td��s|t��k�rtj
�
|td�}tj
�|�td<tjd	k�r0d
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.
    NZ_init_r)�exec_prefixr}�SOrrr3r)r>ryrrrr"rr.r!rr#rr�rJrr�r%�isabs�getcwdrr;r<Zcustomize_config_vars�append)�args�funcr�r�baser<Zvalsr"r
r
rr?�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?rr)r"r�r
r
rr$5sr$)rN)rrN)N)N)5�__doc__rrrKrr[r�builtin_module_namesr!rr%r)rr�r.�base_prefixr �base_exec_prefixrr@r�rr�r�r�rr/rr"rrr#r&rw�AttributeErrorrr*r2r=rDrJrXrLr^rbrdrprur>r|r�r?r$r
r
r
r�<module>s\




*
6I





jK