<!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>
B
    ‘–Re*B  ã               @   sâ   d Z ddlZddlZddlZddlmZmZmZ ddlZddl	m
Z
 ddlmZ ddlmZmZmZmZ ddlmZ ddlmZ d	d
„ ZG dd„ de
ƒZG dd„ deƒZdZdZdZdd„ Ze d¡Zdd„ Zdd„ Z dd„ Z!dS )a  distutils.cygwinccompiler

Provides the CygwinCCompiler class, a subclass of UnixCCompiler that
handles the Cygwin port of the GNU C compiler to Windows.  It also contains
the Mingw32CCompiler class which handles the mingw32 port of GCC (same as
cygwin in no-cygwin mode).
é    N)ÚPopenÚPIPEÚcheck_output)ÚUnixCCompiler)Ú
write_file)ÚDistutilsExecErrorÚCCompilerErrorÚCompileErrorÚUnknownFileError)ÚLooseVersion)Úfind_executablec              C   s€   t j d¡} | dkr|t j| d | d … }|dkr8dgS |dkrFdgS |d	krTd
gS |dkrbdgS |dkrpdgS td| ƒ‚dS )zaInclude the appropriate MSVC runtime library if Python was built
    with MSVC 7.0 or later.
    zMSC v.éÿÿÿÿé   é
   Z1300Zmsvcr70Z1310Zmsvcr71Z1400Zmsvcr80Z1500Zmsvcr90Z1600Zmsvcr100zUnknown MS Compiler version %s N)ÚsysÚversionÚfindÚ
ValueError)Zmsc_posZmsc_ver© r   ú›/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_distutils/cygwinccompiler.pyÚ	get_msvcr?   s    r   c            
   @   sR   e Zd ZdZdZdZdZdZdZdZ	dZ
dd
d„Zdd„ Zddd„Zddd„ZdS )ÚCygwinCCompilerz? Handles the Cygwin port of the GNU C compiler to Windows.
    Úcygwinz.oz.az.dllzlib%s%sz%s%sz.exer   c             C   sH  t  | |||¡ tƒ \}}|  d||f ¡ |tk	rB|  d| ¡ tj dd¡| _	tj dd¡| _
d| j	krÎtƒ \| _| _| _|  | jd| j| j| jf  ¡ | jdkr²| j	| _nd	| _| jd
krÈd}qÚd}n| j	| _d}| jd| j	 d| j	 d| j
 d| j	 d| j|f d d| j	kr<| jdkr<dg| _|  d¡ ntƒ | _d S )Nz%Python's GCC status: %s (details: %s)zƒPython's pyconfig.h doesn't seem to support your compiler. Reason: %s. Compiling may fail because of undefined preprocessor macros.ÚCCÚgccÚCXXzg++z: gcc %s, ld %s, dllwrap %s
z2.10.90Údllwrapz2.13z-sharedz-mdll -staticz%s -mcygwin -O -Wallz%s -mcygwin -mdll -O -Wallz%s -mcygwinz%s -mcygwin %s)ÚcompilerÚcompiler_soÚcompiler_cxxÚ
linker_exeÚ	linker_soz2.91.57Úmsvcrtz,Consider upgrading to a newer version of gcc)r   Ú__init__Úcheck_config_hÚdebug_printÚCONFIG_H_OKÚwarnÚosÚenvironÚgetÚccÚcxxÚget_versionsÚgcc_versionÚ
ld_versionZdllwrap_versionÚcompiler_typeÚ
linker_dllÚset_executablesÚdll_librariesr   )ÚselfÚverboseÚdry_runÚforceÚstatusÚdetailsÚshared_optionr   r   r   r#   d   sF    





zCygwinCCompiler.__init__c          
   C   s¨   |dks|dkrVy|   dd|d|g¡ W q¤ tk
rR } zt|ƒ‚W dd}~X Y q¤X nNy"|   | j| |d|g | ¡ W n* tk
r¢ } zt|ƒ‚W dd}~X Y nX dS )z:Compiles the source by spawning GCC and windres if needed.z.rcz.resZwindresz-iz-oN)Úspawnr   r	   r   )r4   ÚobjÚsrcÚextZcc_argsÚextra_postargsZpp_optsÚmsgr   r   r   Ú_compile¤   s    zCygwinCCompiler._compileNc             C   sT  t   |
p
g ¡}
t   |pg ¡}t   |p&g ¡}| | j¡ |dk	r|| jksV| jdkrtj |d ¡}tj tj 	|¡¡\}}tj 
||d ¡}tj 
|d| d ¡}dtj 	|¡ dg}x|D ]}| |¡ qÀW |  t||fd	| ¡ | jd
kr|
 d|g¡ |
 d|g¡ n
| |¡ |	s,|
 d¡ t | |||||||d|	|
|||¡ dS )zLink the objects.Nr   r   z.defÚlibz.az
LIBRARY %sZEXPORTSz
writing %sr   z--output-libz--defz-s)ÚcopyÚextendr3   Z
EXECUTABLEr1   r(   ÚpathÚdirnameÚsplitextÚbasenameÚjoinÚappendÚexecuter   r   Úlink)r4   Ztarget_descZobjectsZoutput_filenameÚ
output_dirÚ	librariesÚlibrary_dirsÚruntime_library_dirsÚexport_symbolsÚdebugZextra_preargsr?   Ú
build_tempZtarget_langÚtemp_dirZdll_nameZdll_extensionZdef_fileZlib_fileÚcontentsÚsymr   r   r   rL   ³   s:    
	



zCygwinCCompiler.linkÚ c             C   s®   |dkrd}g }x˜|D ]}t j t j |¡¡\}}|| jddg krTtd||f ƒ‚|rdt j |¡}|dkrŒ| t j ||| | j	 ¡¡ q| t j ||| j	 ¡¡ qW |S )z#Adds supports for rc and res files.NrW   z.rcz.resz"unknown file type '%s' (from '%s'))z.resz.rc)
r(   rE   rG   ÚnormcaseZsrc_extensionsr
   rH   rJ   rI   Úobj_extension)r4   Zsource_filenamesZ	strip_dirrM   Z	obj_namesÚsrc_nameÚbaser>   r   r   r   Úobject_filenames  s     
z CygwinCCompiler.object_filenames)r   r   r   )
NNNNNr   NNNN)r   rW   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r0   rY   Zstatic_lib_extensionÚshared_lib_extensionZstatic_lib_formatZshared_lib_formatZexe_extensionr#   rA   rL   r\   r   r   r   r   r   Y   s   
@   
Kr   c               @   s   e Zd ZdZdZddd„ZdS )ÚMingw32CCompilerz@ Handles the Mingw32 port of the GNU C compiler to Windows.
    Zmingw32r   c          	   C   s¨   t  | |||¡ d| jkr*| jdk r*d}nd}d| jkrH| jdkrHd}nd}t| jƒr^tdƒ‚| jd	| j d
| j d	| j d| j d| j	||f d g | _
tƒ | _
d S )Nr   z2.13z-mdll -staticz-sharedz2.91.57z--entry _DllMain@12rW   z1Cygwin gcc cannot be used with --compiler=mingw32z%s -O -Wallz%s -mdll -O -Wallz%sz%s %s %s)r   r   r   r    r!   )r   r#   r+   r/   r.   Úis_cygwinccr   r2   r,   r1   r3   r   )r4   r5   r6   r7   r:   Úentry_pointr   r   r   r#     s&    
zMingw32CCompiler.__init__N)r   r   r   )r]   r^   r_   r`   r0   r#   r   r   r   r   rb     s   rb   Úokznot okZ	uncertainc           
   C   s®   ddl m}  dtjkrtdfS dtjkr0tdfS |  ¡ }y@t|ƒ}z(d| ¡ kr\td| fS td	| fS W d
| 	¡  X W n0 t
k
r¨ } ztd||jf fS d
}~X Y nX d
S )aw  Check if the current Python installation appears amenable to building
    extensions with GCC.

    Returns a tuple (status, details), where 'status' is one of the following
    constants:

    - CONFIG_H_OK: all is well, go ahead and compile
    - CONFIG_H_NOTOK: doesn't look good
    - CONFIG_H_UNCERTAIN: not sure -- unable to read pyconfig.h

    'details' is a human-readable string explaining the situation.

    Note there are two ways to conclude "OK": either 'sys.version' contains
    the string "GCC" (implying that this Python was built with GCC), or the
    installed "pyconfig.h" contains the string "__GNUC__".
    r   )Ú	sysconfigZGCCzsys.version mentions 'GCC'ZClangzsys.version mentions 'Clang'Z__GNUC__z'%s' mentions '__GNUC__'z '%s' does not mention '__GNUC__'Nzcouldn't read '%s': %s)Ú	distutilsrf   r   r   r&   Úget_config_h_filenameÚopenÚreadÚCONFIG_H_NOTOKÚcloseÚOSErrorÚCONFIG_H_UNCERTAINÚstrerror)rf   ÚfnÚconfig_hÚexcr   r   r   r$   M  s     

r$   s   (\d+\.\d+(\.\d+)*)c             C   sl   |   ¡ d }t|ƒdkrdS t| dtdj}z| ¡ }W d| ¡  X t |¡}|dkrZdS t	| 
d¡ ¡ ƒS )z¤Find the version of an executable by running `cmd` in the shell.

    If the command is not found, or the output does not match
    `RE_VERSION`, returns None.
    r   NT)ÚshellÚstdouté   )Úsplitr   r   r   rt   rj   rl   Ú
RE_VERSIONÚsearchr   ÚgroupÚdecode)ÚcmdÚ
executableÚoutÚ
out_stringÚresultr   r   r   Ú_find_exe_version~  s    

r€   c              C   s   dddg} t dd„ | D ƒƒS )zg Try to find out the versions of gcc, ld and dllwrap.

    If not possible it returns None for it.
    zgcc -dumpversionzld -vzdllwrap --versionc             S   s   g | ]}t |ƒ‘qS r   )r€   )Ú.0r{   r   r   r   ú
<listcomp>™  s    z get_versions.<locals>.<listcomp>)Útuple)Úcommandsr   r   r   r-   “  s    
r-   c             C   s   t | dgƒ}| ¡  d¡S )zCTry to determine if the compiler that would be used is from cygwin.z-dumpmachines   cygwin)r   ÚstripÚendswith)r+   r~   r   r   r   rc   ›  s    rc   )"r`   r(   r   rC   Ú
subprocessr   r   r   ÚreZdistutils.unixccompilerr   Údistutils.file_utilr   Údistutils.errorsr   r   r	   r
   Zdistutils.versionr   Údistutils.spawnr   r   r   rb   r&   rk   rn   r$   Úcompilerw   r€   r-   rc   r   r   r   r   Ú<module>   s,   + @1/
