Ë
    nûàgs.  ã                   óâ   — d Z ddlZddlZddlZddlZddlZddl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lmZ dd	lmZmZ d
„ ZdZ G d„ de«      Z G d„ de«      ZdZdZdZd„ Zd„ ZdZ y)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)Úcheck_outputé   )ÚCCompilerErrorÚCompileErrorÚDistutilsExecErrorÚDistutilsPlatformError)Ú
write_file)Úget_config_vars)ÚUnixCCompiler)ÚLooseVersionÚsuppress_known_deprecationc                  ó   — g S )z6No longer needed, but kept for backward compatibility.© r   ó    úc/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/setuptools/_distutils/cygwinccompiler.pyÚ	get_msvcrr      s   € à€Ir   zxUnable to set runtime library search path on Windows, usually indicated by `runtime_library_dirs` parameter to Extensionc                   óž   ‡ — e Zd ZdZdZdZdZdZdZdZ	dZ
dZd	Zdˆ fd
„	Zed„ «       Zd„ Z	 	 	 	 	 	 	 	 	 	 dd„Zd„ Zˆ fd„Zeˆ fd„«       Zˆ xZS )ÚCygwinCCompilerz9Handles the Cygwin port of the GNU C compiler to Windows.Úcygwinz.oz.az.dll.az.dllzlib%s%szcyg%s%sz.exec                 ó  •— t         ‰| �  |||«       t        «       \  }}| j                  d|› d|› d�«       |t        ur| j                  d|› d�«       t        dd«      \  | _        | _        t        j                  j                  d| j                  xs d«      | _        t        j                  j                  d| j                  xs d	«      | _        | j                  | _        | j                  | _        d
}| j                  | j                  › d�| j                  › d�| j                  › d�| j                  › d�| j                  › d�| j                  › d|› �| j                  › d�| j                  › d|› �¬«       t        «       | _        y )NzPython's GCC status: z (details: ú)zCPython's pyconfig.h doesn't seem to support your compiler. Reason: z>. Compiling may fail because of undefined preprocessor macros.ÚCCÚCXXÚgcczg++ú-sharedz -mcygwin -O -Wallz -mcygwin -mdll -O -Wallz	 -mcygwinz
 -mcygwin )ÚcompilerÚcompiler_soÚcompiler_cxxÚcompiler_so_cxxÚ
linker_exeÚ	linker_soÚlinker_exe_cxxÚlinker_so_cxx)ÚsuperÚ__init__Úcheck_config_hÚdebug_printÚCONFIG_H_OKÚwarnr
   ÚccÚcxxÚosÚenvironÚgetÚ
linker_dllÚlinker_dll_cxxÚset_executablesr   Údll_libraries)ÚselfÚverboseÚdry_runÚforceÚstatusÚdetailsÚshared_optionÚ	__class__s          €r   r%   zCygwinCCompiler.__init__5   sz  ø€ Ü‰Ñ˜ '¨5Ô1ä(Ó*‰ˆ�Ø×ÑÐ0°°¸ÀGÀ9ÈAÐNÔOØœÑ$Ø�I‰IðØ"˜)ð $OðOôô ,¨D°%Ó8ÑˆŒ�”ô —*‘*—.‘.  t§w¡wÒ'7°%Ó8ˆŒÜ—:‘:—>‘> %¨¯©Ò):°UÓ;ˆŒàŸ'™'ˆŒØ"Ÿh™hˆÔØ!ˆà×ÑØŸ™�yÐ 2Ð3ØŸ7™7˜)Ð#;Ð<Ø ŸH™H˜:Ð%7Ð8Ø#Ÿx™x˜jÐ(@ÐAØŸ'™'˜ )Ð,ØŸ™Ð)¨°M°?ÐCØ"Ÿh™h˜Z yÐ1Ø!×0Ñ0Ð1°¸M¸?ÐKð 	ô 		
ô '›[ˆÕr   c                 ó�   — t        j                  dt        d¬«       t        «       5  t	        d«      cd d d «       S # 1 sw Y   y xY w)Nz�gcc_version attribute of CygwinCCompiler is deprecated. Instead of returning actual gcc version a fixed value 11.2.0 is returned.é   )Ú
stacklevelz11.2.0)Úwarningsr)   ÚDeprecationWarningr   r   )r3   s    r   Úgcc_versionzCygwinCCompiler.gcc_versionY   sA   € ô 	�‰ðXäØõ		
ô (Ó)ñ 	*Ü Ó)÷	*÷ 	*ò 	*ús	   §<¼Ac                 ót  — |dv r	 | j                  dd|d|g«       y	 | j                  |«      dk(  r(| j                  | j                  |z   |d|gz   |z   «       y| j                  | j
                  |z   |d|gz   |z   «       y# t        $ r}t        |«      ‚d}~ww xY w# t        $ r}t        |«      ‚d}~ww xY w)z:Compiles the source by spawning GCC and windres if needed.)ú.rcú.resÚwindresz-iz-oNzc++)Úspawnr   r   Údetect_languager   r   )r3   ÚobjÚsrcÚextÚcc_argsÚextra_postargsÚpp_optsÚmsgs           r   Ú_compilezCygwinCCompiler._compileh   sÚ   € à�/Ñ!ð(Ø—
‘
˜I t¨S°$¸Ð<Õ=ð(Ø×'Ñ'¨Ó,°Ò5Ø—J‘JØ×,Ñ,Ø!ñ"à  cÐ*ñ+ð )ñ)õð —J‘JØ×(Ñ(¨7Ñ2°c¸4ÀÐ5EÑEÈÑVõøô &ò (Ü" 3Ó'Ð'ûð(ûô &ò (Ü" 3Ó'Ð'ûð(ús4   †B ž;B Á'B Â	BÂBÂBÂ	B7Â'B2Â2B7c                 óv  — t        j                   |
xs g «      }
t        j                   |xs g «      }t        j                   |xs g «      }|r| j                  t        «       |j                  | j                  «       |��|| j
                  k7  s| j                  dk(  ræt        j                  j                  |d   «      }t        j                  j                  t        j                  j                  |«      «      \  }}t        j                  j                  ||dz   «      }dt        j                  j                  |«      › �dg}|j                  |«       | j                  t        ||fd|› �«       |j                  |«       |	s|
j                  d«       t!        j"                  | |||||||d|	|
|||«       y)	zLink the objects.Nr   r   z.defzLIBRARY ÚEXPORTSzwriting z-s)Úcopyr)   Ú_runtime_library_dirs_msgÚextendr2   Ú
EXECUTABLEr/   r,   ÚpathÚdirnameÚsplitextÚbasenameÚjoinÚexecuter	   Úappendr   Úlink)r3   Útarget_descÚobjectsÚoutput_filenameÚ
output_dirÚ	librariesÚlibrary_dirsÚruntime_library_dirsÚexport_symbolsÚdebugÚextra_preargsrK   Ú
build_tempÚtarget_langÚtemp_dirÚdll_nameÚdll_extensionÚdef_fileÚcontentss                      r   r\   zCygwinCCompiler.link€   s‚  € ô$ Ÿ	™	 -Ò"5°2Ó6ˆÜ—I‘I˜išo¨2Ó.ˆ	Ü—)‘)˜GšM rÓ*ˆáØ�I‰IÔ/Ô0ð 	×Ñ˜×+Ñ+Ô,ð Ñ&Ø˜4Ÿ?™?Ò*¨d¯o©oÀÒ.Fô —w‘w—‘ w¨q¡zÓ2ˆHä(*¯©×(8Ñ(8Ü—‘× Ñ  Ó1ó)Ñ%ˆX�}ô
 —w‘w—|‘| H¨h¸Ñ.?Ó@ˆHð #¤2§7¡7×#3Ñ#3°OÓ#DÐ"EÐFÈ	ÐRˆHØ�O‰O˜NÔ+Ø�L‰Lœ h°Ð%9¸XÀhÀZÐ;PÔQð
 �N‰N˜8Ô$ñ Ø× Ñ  Ô&ä×ÑØØØØØØØØ ØØØØØØõ	
r   c                 ó0   — | j                  t        «       g S ©N)r)   rR   ©r3   Údirs     r   Úruntime_library_dir_optionz*CygwinCCompiler.runtime_library_dir_optionÙ   s   € ð 	�	‰	Ô+Ô,Øˆ	r   c                 ód   •— t         j                  j                  |«      }t        ‰| �  |||«      S ro   )r,   rU   Únormcaser$   Ú_make_out_path)r3   r`   Ú	strip_dirÚsrc_nameÚnorm_src_namer:   s        €r   ru   zCygwinCCompiler._make_out_pathâ   s+   ø€ äŸ™×(Ñ(¨Ó2ˆÜ‰wÑ% j°)¸]ÓKÐKr   c                 ób   •— i t         ‰| �  ¥dD �ci c]  }||| j                  z   “Œ c}¥S c c}w )z3
        Add support for rc and res files.
        )rC   rB   )r$   Úout_extensionsÚobj_extension)r3   rI   r:   s     €r   rz   zCygwinCCompiler.out_extensionsç   s@   ø€ ð

Ü‰gÑ$ð
à8GÖH°ˆs�C˜$×,Ñ,Ñ,Ñ,ÒHð
ð 	
ùâHs   ‘,©FFF)
NNNNNFNNNN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Úcompiler_typer{   Ústatic_lib_extensionÚshared_lib_extensionÚdylib_lib_extensionÚstatic_lib_formatÚshared_lib_formatÚdylib_lib_formatÚexe_extensionr%   Úpropertyr@   rN   r\   rr   ru   rz   Ú__classcell__©r:   s   @r   r   r   (   sž   ø„ ÙCà€MØ€MØÐØ#ÐØ ÐØ!ÐØ!ÐØ ÐØ€Mõ")ðH ñ*ó ð*ò(ð: ØØØ!ØØØØØØóW
òrôLð
 ó
ó ô
r   r   c                   ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )ÚMingw32CCompilerz:Handles the Mingw32 port of the GNU C compiler to Windows.Úmingw32c                 ón  •— t         ‰| �  |||«       d}t        | j                  «      rt	        d«      ‚| j                  | j                  › d�| j                  › d�| j                  › d�| j                  › d�| j                  › | j                  › d|› �| j                  › | j                  › d|› �¬«       y )Nr   z1Cygwin gcc cannot be used with --compiler=mingw32z	 -O -Wallz -shared -O -Wallú )r   r   r   r   r    r!   r"   r#   )	r$   r%   Úis_cygwinccr*   r   r1   r+   r/   r0   )r3   r4   r5   r6   r9   r:   s        €r   r%   zMingw32CCompiler.__init__ø   s¸   ø€ Ü‰Ñ˜ '¨5Ô1à!ˆä�t—w‘wÔÜ Ð!TÓUÐUà×ÑØŸ™�y 	Ð*ØŸ7™7˜)Ð#4Ð5Ø#Ÿx™x˜jÐ(9Ð:Ø ŸH™H˜: YÐ/ØŸ'™'˜ØŸ™Ð)¨¨=¨/Ð:Ø"Ÿh™h˜ZØ!×0Ñ0Ð1°°=°/ÐBð 	õ 		
r   c                 ó    — t        t        «      ‚ro   )r   rR   rp   s     r   rr   z+Mingw32CCompiler.runtime_library_dir_option  s   € Ü$Ô%>Ó?Ð?r   r|   )r}   r~   r   r€   r�   r%   rr   rŠ   r‹   s   @r   r�   r�   ó   s   ø„ ÙDà€Mõ
ö&@r   r�   Úokznot okÚ	uncertainc                  ó„  — ddl m}  dt        j                  v rt        dfS dt        j                  v rt        dfS | j                  «       }	 t        j                  |«      j                  d¬«      }d	}||v r	t        }d
}nt        }d}||›d|› d|›�fS # t        $ r"}t        d|› d|j                  › �fcY d}~S d}~ww xY w)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   )Ú	sysconfigÚGCCzsys.version mentions 'GCC'ÚClangzsys.version mentions 'Clang'zutf-8)ÚencodingÚ__GNUC__Úmentionszdoes not mentionr�   zcouldn't read 'z': N)Ú	distutilsr–   ÚsysÚversionr(   Úget_config_h_filenameÚpathlibÚPathÚ	read_textÚCONFIG_H_NOTOKÚOSErrorÚCONFIG_H_UNCERTAINÚstrerror)r–   ÚfnÚconfig_hÚ	substringÚcodeÚmention_inflectedÚexcs          r   r&   r&     sà   € õ* $ð ”—‘ÑÜÐ8Ð8Ð8ð ”#—+‘+ÑÜÐ:Ð:Ð:ð 
×	(Ñ	(Ó	*€BðAÜ—<‘< Ó#×-Ñ-°wÐ-Ó?ˆð ˆ	Ø˜Ñ ÜˆDØ *Ñä!ˆDØ 2ÐØ˜�v˜QÐ0Ð1°°9°-Ð@Ð@Ð@øô ò MÜ" o°b°T¸¸S¿\¹\¸NÐ$KÐLÕLûðMús   Á%B Â	B?ÂB:Â4B?Â:B?c                 ó„   — t        t        j                  | «      dgz   «      }|j                  «       j	                  d«      S )zCTry to determine if the compiler that would be used is from cygwin.z-dumpmachines   cygwin)r   ÚshlexÚsplitÚstripÚendswith)r*   Ú
out_strings     r   r‘   r‘   I  s6   € äœeŸk™k¨"›o°Ð0@Ñ@ÓA€JØ×ÑÓ×&Ñ& yÓ1Ð1r   )!r€   rQ   r,   r    r®   r�   r>   Ú
subprocessr   Úerrorsr   r   r   r   Ú	file_utilr	   r–   r
   Úunixccompilerr   rž   r   r   r   rR   r   r�   r(   r£   r¥   r&   r‘   Úget_versionsr   r   r   ú<module>r¸      s‘   ðñó Û 	Û Û Û 
Û Ý #÷ó õ "Ý &Ý (ß =òðIð ôG
�mô G
ôV@�ô @ð@ €Ø€Ø Ð ò.Aòb2ð €ðr   