<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
        integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
</html>
a
    Reh                     @   s  d Z ddlZddlZddlZddlZddlmZmZ zddlZW n e	yZ   ddl
ZY n0 g dZdd ZejrejeejZnee Zejdkrded	d  v reejeeZejdkrd
edd  v reejeeeZejdkr*dedd  v r*eejeeeZdd Ze Zdadd Ze ZedZdd Zdejdd  Zdejdd  Z dejdd  Z!ej"ej#Z$ej"ej%Z&da'dZ(dd Z)dd Z*dd  Z+d!d" Z,d#d$ Z-d%d& Z.dId'd(Z/d)d* Z0d+d, Z1d-d. Z2dJd/d0Z3d1d2 Z4d3d4 Z5d5d6 Z6e- dd7fd8d9Z7e- dd7fd:d;Z8d<d= Z9d>d? Z:d@dA Z;dBdC Z<dDdE Z=dFdG Z>e?dHkre>  dS )Kz-Access to Python's configuration information.    N)pardirrealpath)get_config_h_filenameget_config_varget_config_varsget_makefile_filenameget_pathget_path_names	get_pathsget_platformget_python_versionget_scheme_namesparse_config_hc                 C   s&   z
t | W S  ty    |  Y S 0 d S N)r   OSError)path r   /builddir/build/BUILDROOT/alt-python39-pip-21.3.1-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/pip/_vendor/distlib/_backport/sysconfig.py_safe_realpath"   s    
r   ntZpcbuildiz\pc\viz\pcbuild\amd64ic                  C   s,   dD ]"} t jt jtd| r dS qdS )N)z
Setup.distzSetup.localModulesTF)osr   isfilejoin_PROJECT_BASE)fnr   r   r   is_python_build:   s    r   Fc                  C   s   t sddlm}  tddd }| |}|d}|s>J d| }t| W d    n1 sf0    Y  t	rdD ] }t
|d	d
 t
|dd qxda d S )N   )finder.   r   zsysconfig.cfgzsysconfig.cfg exists)posix_prefix
posix_homeincludez{srcdir}/Includeplatincludez{projectbase}/.T)	_cfg_read	resourcesr   __name__rsplitfind	as_stream_SCHEMESreadfp_PYTHON_BUILDset)r   Zbackport_package_finderZ_cfgfilesschemer   r   r   _ensure_cfg_readD   s    

(r2   z\{([^{]*?)\}c              
      s   t   | dr| d}nt }|  }|D ]8}|dkr<q.|D ]$\}}| ||rVq@| ||| q@q.| d |  D ]H}t| |  fdd}| |D ]\}}| ||t	
|| qqzd S )Nglobalsc                    s$   |  d}| v r | S |  dS Nr    r   groupZmatchobjname	variablesr   r   	_replacero   s    
z"_expand_globals.<locals>._replacer)r2   has_sectionitemstuplesections
has_optionr.   remove_sectiondict	_VAR_REPLsub)configr3   r?   sectionoptionvaluer;   r   r9   r   _expand_globalsY   s$    

rI   z%s.%s.%s   z%s.%sr   z%s%sc                    s    fdd}t || S )zIn the string `path`, replace tokens like {some.thing} with the
    corresponding value from the map `local_vars`.

    If there is no corresponding value, leave the token unchanged.
    c                    s8   |  d}| v r | S |tjv r.tj| S |  dS r4   )r6   r   environr7   
local_varsr   r   r;      s    


z_subst_vars.<locals>._replacerrC   rD   )r   rM   r;   r   rL   r   _subst_vars   s    rO   c                 C   s0   |   }| D ]\}}||v r"q|| |< qd S r   )keysr=   )target_dict
other_dicttarget_keyskeyrH   r   r   r   _extend_dict   s
    rU   c                 C   s`   i }|d u ri }t |t  t| D ]4\}}tjdv rDtj|}tjt	||||< q&|S )N)posixr   )
rU   r   r+   r=   r   r8   r   
expandusernormpathrO   )r1   varsresrT   rH   r   r   r   _expand_vars   s    
r[   c                    s    fdd}t || S )Nc                    s$   |  d}| v r | S |  dS r4   r5   r7   rY   r   r   r;      s    
zformat_value.<locals>._replacerrN   )rH   rY   r;   r   r\   r   format_value   s    r]   c                   C   s   t jdkrdS t jS )NrV   r!   )r   r8   r   r   r   r   _get_default_scheme   s    
r^   c                  C   s   t jdd } dd }t jdkrBt jdp.d}| r8| S ||dS tjdkr|td	}|r|| r`| S |dd
|dtjd d  S | r| S |ddS d S )NPYTHONUSERBASEc                  W   s   t jt jj|  S r   )r   r   rW   r   )argsr   r   r   joinuser   s    z_getuserbase.<locals>.joinuserr   APPDATA~PythondarwinPYTHONFRAMEWORKLibraryz%d.%dr   z.local)r   rK   getr8   sysplatformr   version_info)env_basera   baseZ	frameworkr   r   r   _getuserbase   s$    



rn   c              	   C   s  t d}t d}t d}|du r*i }i }i }tj| ddd}| }W d   n1 s`0    Y  |D ]}	|	dsn|	 d	krqn||	}
|
rn|
d
d\}}| }|	dd	}d|v r|||< qnzt
|}W n" ty   |	dd||< Y qn0 |||< qnt| }d}t|dkrt|D ]}|| }||pP||}
|
dur|
d
}d}||v rt|| }n||v rd}nx|tjv rtj| }n`||v r|dr|dd |v rd	}n$d| |v rd}nt|d|  }nd	 ||< }|r||
 d }|d|
  | | }d|v rL|||< n|zt
|}W n  tyx   | ||< Y n
0 |||< || |dr|dd |v r|dd }||vr|||< n|||< || q.q| D ]"\}}t|tr| ||< q|| |S )zParse 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.
    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_]*)}Nzutf-8surrogateescape)encodingerrors# r    r   z$$$)CFLAGSLDFLAGSCPPFLAGSr   TFPY_rJ   )recompilecodecsopen	readlines
startswithstripmatchr6   replaceint
ValueErrorlistrP   lenr>   searchstrr   rK   endstartremover=   
isinstanceupdate)filenamerY   _variable_rx_findvar1_rx_findvar2_rxdonenotdoneflineslinemnvtmpvr:   renamed_variablesr8   rH   founditemafterkr   r   r   _parse_makefile   s    	


&













r   c                  C   sD   t rtjtdS ttdr,dttjf } nd} tjt	d| dS )z Return the path of the Makefile.Makefileabiflagszconfig-%s%srE   stdlib)
r-   r   r   r   r   hasattrri   _PY_VERSION_SHORTr   r   )config_dir_namer   r   r   r   K  s    
r   c              
   C   s   t  }zt||  W nL ty` } z4d| }t|drD|d|j  }t|W Y d}~n
d}~0 0 t }z6t|}t||  W d   n1 s0    Y  W nL ty } z4d| }t|dr|d|j  }t|W Y d}~n
d}~0 0 tr| d | d< dS )z7Initialize the module as appropriate for POSIX systems.z.invalid Python installation: unable to open %sstrerrorz (%s)N	BLDSHAREDLDSHARED)	r   r   IOErrorr   r   r   r|   r   r-   )rY   makefileemsgconfig_hr   r   r   r   _init_posixV  s&    

,
r   c                 C   sV   t d| d< t d| d< t d| d< d| d< d	| d
< t| d< tjttj| d< dS )z+Initialize the module as appropriate for NTr   LIBDEST
platstdlib
BINLIBDESTr#   	INCLUDEPYz.pydSOz.exeEXEVERSIONBINDIRN)r   _PY_VERSION_SHORT_NO_DOTr   r   dirnamer   ri   
executabler\   r   r   r   _init_non_posixr  s    r   c                 C   s   |du ri }t d}t d}|  }|s.q||}|rv|dd\}}zt|}W n tyj   Y n0 |||< q ||}|r d||d< q |S )zParse 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_]+) [*]/
r    r   r   )ry   rz   readliner   r6   r   r   )fprY   	define_rxundef_rxr   r   r   r   r   r   r   r     s&    




r   c                  C   s:   t r$tjdkrtjtd} q,t} ntd} tj| dS )zReturn the path of pyconfig.h.r   PCr$   z
pyconfig.h)r-   r   r8   r   r   r   r   )inc_dirr   r   r   r     s    
r   c                   C   s   t tt S )z,Return a tuple containing the schemes names.)r>   sortedr+   r?   r   r   r   r   r     s    r   c                   C   s
   t dS )z*Return a tuple containing the paths names.r!   )r+   optionsr   r   r   r   r	     s    r	   Tc                 C   s&   t   |rt| |S tt| S dS )zReturn a mapping containing an install scheme.

    ``scheme`` is the install scheme name. If not provided, it will
    return the default scheme for the current platform.
    N)r2   r[   rB   r+   r=   )r1   rY   expandr   r   r   r
     s    
r
   c                 C   s   t ||||  S )z[Return a path corresponding to the scheme.

    ``scheme`` is the install scheme name.
    )r
   )r8   r1   rY   r   r   r   r   r     s    r   c                  G   s  t du rvi a tt d< tt d< tt d< tt d< td td  t d< tt d	< tt d
< tt d< ztjt d< W n ty   dt d< Y n0 t	j
dv rtt  t	j
dkrtt  tjdkrt t d< dt vrtt d< ntt d t d< trXt	j
dkrXt}zt	 }W n ty   d}Y n0 t	jt d sX||krXt	j|t d }t	j|t d< tjdkrvt	 d }t|dd }|dk rdD ]2}t | }tdd|}tdd|}|t |< qndt	jv rt	jd }dD ]0}t | }tdd|}|d | }|t |< qt dd}	td|	}
|
durv|
 d}t	j!|svdD ]$}t | }tdd|}|t |< qP| rg }| D ]}|"t | q|S t S dS )ay  With no arguments, return a dictionary of all configuration
    variables relevant for the current platform.

    On Unix, this means every variable defined in Python's installed Makefile;
    On Windows and Mac OS 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prefixexec_prefix
py_versionpy_version_shortr   r   py_version_nodotrm   platbaseprojectbaser   rs   )r   Zos2rV   z2.6userbasesrcdirre   r      )rv   
BASECFLAGSru   	PY_CFLAGSr   z-arch\s+\w+\s z-isysroot [^ 	]*Z	ARCHFLAGSru   z-isysroot\s+(\S+)r    z-isysroot\s+\S+(\s|$))#_CONFIG_VARS_PREFIX_EXEC_PREFIX_PY_VERSIONr   r   ri   r   AttributeErrorr   r8   r   r   versionrn   r   r-   getcwdr   r   isabsr   rX   rj   unamer   splitry   rD   rK   rh   r   r6   existsappend)r`   rm   cwdr   Zkernel_versionmajor_versionrT   flagsarchru   r   Zsdkvalsr8   r   r   r   r     s    










r   c                 C   s   t  | S )zReturn the value of a single variable using the dictionary returned by
    'get_config_vars()'.

    Equivalent to get_config_vars().get(name)
    )r   rh   )r8   r   r   r   r   P  s    r   c                  C   sd  t jdkrnd} tj| }|dkr(tjS tjd|}tj|t|  |  }|dkr\dS |dkrhdS tjS t jd	kstt d
stjS t 	 \}}}}}| 
dd}|
dd}|
dd}|dd dkrd||f S |dd dkr&|d dkrVd}dt|d d |dd f }n0|dd dkrDd||f S |dd dkrdd|||f S |dd d krd }td!}	|	|}
|
rV|
 }n|dd d"krVt }|d#}|}ztd$}W n ty   Y nR0 ztd%| }
W |  n
|  0 |
dur8d&|
d'd&dd }|sB|}|rV|}d(}|d& d)krd*t d+d v rd,}t d+}td-|}ttt|}t|d'kr|d }n^|d.krd,}nN|d/krd0}n>|d1krd2}n.|d3krd4}n|d5kr
d6}ntd7|f n<|d8kr6tjd9krVd:}n |d;v rVtjd9krRd<}nd=}d>|||f S )?a  Return a string that identifies the current platform.

    This is used mainly to distinguish platform-specific build directories and
    platform-specific built distributions.  Typically includes the OS name
    and version and the architecture (as supplied by 'os.uname()'),
    although the exact information included depends on the OS; eg. for IRIX
    the architecture isn't particularly important (IRIX only runs on SGI
    hardware), but for Linux the kernel version isn't particularly
    important.

    Examples of returned values:
       linux-i586
       linux-alpha (?)
       solaris-2.6-sun4u
       irix-5.3
       irix64-6.2

    Windows will return one of:
       win-amd64 (64bit Windows on AMD64 (aka x86_64, Intel64, EM64T, etc)
       win-ia64 (64bit Windows on Itanium)
       win32 (all others - specifically, sys.platform is returned)

    For other non-POSIX platforms, currently just returns 'sys.platform'.
    r   z bit ()amd64z	win-amd64Zitaniumzwin-ia64rV   r   /rs   r   _-N   linuxz%s-%ssunosr   5solarisz%d.%srJ   r      Zirixaixz%s-%s.%s   cygwinz[\d.]+re   MACOSX_DEPLOYMENT_TARGETz0/System/Library/CoreServices/SystemVersion.plistz=<key>ProductUserVisibleVersion</key>\s*<string>(.*?)</string>r   r    macosxz10.4.z-archru   fatz-arch\s+(\S+))i386ppc)r   x86_64intel)r   r   r   Zfat3)ppc64r   fat64)r   r   r   r   	universalz%Don't know machine value for archs=%rr   l        r   )PowerPCPower_Macintoshr   r   z%s-%s-%s) r   r8   ri   r   r)   rj   r   lowerr   r   r   r   ry   rz   r   r6   r   rh   r|   r   r   readcloser   r   r   findallr>   r   r.   r   maxsize)r   ijZlookosnamehostreleaser   machinerel_rer   ZcfgvarsZmacverZ
macreleaser   cflagsZarchsr   r   r   r   Y  s    
$











r   c                   C   s   t S r   )r   r   r   r   r   r     s    r   c                 C   sF   t t| D ]0\}\}}|dkr0td|   td||f  qd S )Nr   z%s: z
	%s = "%s")	enumerater   r=   print)titledataindexrT   rH   r   r   r   _print_dict  s    r  c                   C   sR   t dt   t dt   t dt   t   tdt  t   tdt  dS )z*Display all information sysconfig detains.zPlatform: "%s"zPython version: "%s"z!Current installation scheme: "%s"Paths	VariablesN)r  r   r   r^   r  r
   r   r   r   r   r   _main  s    r  __main__)N)N)@__doc__r{   r   ry   ri   os.pathr   r   configparserImportErrorConfigParser__all__r   r   r   r   r   r   r8   r   r   r   r-   r%   r2   RawConfigParserr+   rz   rC   rI   rk   r   r   r   rX   r   r   r   r   r   
_USER_BASErO   rU   r[   r]   r^   rn   r   r   r   r   r   r   r   r	   r
   r   r   r   r   r   r  r  r'   r   r   r   r   <module>   sx   "
!	
v
 	 #
