
    n&phD.                         S r SSKrSSKrSSKrSSKrSSKrSSKrSSKJr  SSK	J
r
Jr  SSKJr  SSKJr  SSKJrJr  S	S
KJr  S	SK	JrJr  S rSr " S S\R2                  5      r " S S\5      rSrSrSrS rS rSr g)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   )DistutilsExecErrorDistutilsPlatformError)
write_file)get_config_vars)LooseVersionsuppress_known_deprecation   )unix)CompileErrorErrorc                      / $ )z6No longer needed, but kept for backward compatibility. r       [/var/www/html/venv/lib/python3.13/site-packages/setuptools/_distutils/compilers/C/cygwin.py	get_msvcrr      s    Ir   zxUnable to set runtime library search path on Windows, usually indicated by `runtime_library_dirs` parameter to Extensionc                      ^  \ rS rSrSrSrSrSrSrSr	Sr
SrS	rS
rSU 4S jjr\S 5       rS r          SU 4S jjrS rU 4S jr\U 4S j5       rSrU =r$ )Compiler*   z9Handles the Cygwin port of the GNU C compiler to Windows.cygwinz.oz.az.dll.az.dllzlib%s%szcyg%s%sz.exec                 &  > [         TU ]  XU5        [        5       u  pEU R                  SU SU S35        U[        La  U R                  SU S35        [        SS5      u  U l        U l        [        R                  R                  SU R                  =(       d    S5      U l        [        R                  R                  SU R                  =(       d    S	5      U l        U R                  U l        U R                  U l        S
nU R                  U R                   S3U R                   S3U R                   S3U R                   S3U R                   S3U R                   SU 3U R                   S3U R                   SU 3S9  [        5       U l        g )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'   Compiler.__init__7   sv   51(*0G9ANO$II") $OO ,D%8 **..tww'7%8::>>%):U;''"hh!y 2377)#;< HH:%78#xxj(@A''),)M?C"hhZy1!001M?K 	 		
 '[r   c                     [         R                  " S[        SS9  [        5          [	        S5      sS S S 5        $ ! , (       d  f       g = f)Nzgcc_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	   )r5   s    r   gcc_versionCompiler.gcc_version[   s8     	X		
 ()) *))s	   :
Ac                 ~   US;   a   U R                  SSUSU/5        g U R                  U5      S:X  a(  U R                  U R                  U-   USU/-   U-   5        gU R                  U R
                  U-   USU/-   U-   5        g! [         a  n[        U5      eSnAff = f! [         a  n[        U5      eSnAff = f)z:Compiles the source by spawning GCC and windres if needed.).rc.reswindresz-iz-oNzc++)spawnr   r   detect_languager!   r   )r5   objsrcextcc_argsextra_postargspp_optsmsgs           r   _compileCompiler._compilej   s    /!(

ItS$<=('',5JJ,,!"c*+ )) JJ((72c45EEV & ("3''( & ("3''(s4   B <B" 'B" 
BBB"
B<,B77B<c                   > [         R                   " U
=(       d    / 5      n
[         R                   " U=(       d    / 5      n[         R                   " U=(       d    / 5      nU(       a  U R                  [        5        UR                  U R                  5        UGb  XR
                  :w  d  U R                  S:X  a  [        R                  R                  US   5      n[        R                  R                  [        R                  R                  U5      5      u  nn[        R                  R                  XS-   5      nS[        R                  R                  U5       3S/nUR                  U5        U R                  [        UU4SU 35        UR                  U5        U	(       d  U
R                  S5        [         TU ]E  UUUUUUUSU	U
UUU5        g)	zLink the objects.Nr   r   z.defzLIBRARY EXPORTSzwriting z-s)copyr+   _runtime_library_dirs_msgextendr4   
EXECUTABLEr1   r.   pathdirnamesplitextbasenamejoinexecuter   appendr&   link)r5   target_descobjectsoutput_filename
output_dir	librarieslibrary_dirsruntime_library_dirsexport_symbolsdebugextra_preargsrO   
build_temptarget_langtemp_dirdll_namedll_extensiondef_filecontentsr<   s                      r   ra   Compiler.link   sz   $ 		-"526IIio2.	))GMr*II/0 	++, &??*doo.F wwwqz2H(*(8(8  1)%X}
 ww||H.?@H #277#3#3O#D"EF	RHOON+LLh%9XhZ;PQ
 NN8$   & 	
r   c                 0    U R                  [        5        / $ N)r+   rW   r5   dirs     r   runtime_library_dir_option#Compiler.runtime_library_dir_option   s     			+,	r   c                 b   > [         R                  R                  U5      n[        TU ]  XU5      $ ru   )r.   rZ   normcaser&   _make_out_path)r5   re   	strip_dirsrc_namenorm_src_namer<   s        r   r|   Compiler._make_out_path   s)    ((2w%j]KKr   c                 d   > 0 [         TU ]  ES Vs0 s H  oXR                  -   _M     snE$ s  snf )z#
Add support for rc and res files.
)rG   rF   )r&   out_extensionsobj_extension)r5   rM   r<   s     r   r   Compiler.out_extensions   s@    

g$
8GHC,,,,H
 	
Hs   -)r,   r-   r4   r1   r2   FFF)
NNNNNFNNNN)__name__
__module____qualname____firstlineno____doc__compiler_typer   static_lib_extensionshared_lib_extensiondylib_lib_extensionstatic_lib_formatshared_lib_formatdylib_lib_formatexe_extensionr'   propertyrC   rR   ra   rx   r|   r   __static_attributes____classcell__r<   s   @r   r   r   *   s    CMM# !! M")H * *(: !V
pL
 
 
r   r   c                   :   ^  \ rS rSrSrSrSU 4S jjrS rSrU =r	$ )MinGW32Compiler   z:Handles the Mingw32 port of the GNU C compiler to Windows.mingw32c                 p  > [         TU ]  XU5        Sn[        U R                  5      (       a  [	        S5      eU R                  U R                   S3U R                   S3U R                   S3U R                   S3U R                   U R                   SU 3U R                   U R                   SU 3S9  g )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   r3   r-   r1   r2   )r5   r6   r7   r8   r;   r<   s        r   r'   MinGW32Compiler.__init__   s    51!twwKLLy	*77)#45#xxj(9: HH:Y/'')=/:"hhZ!001=/B 	 		
r   c                      [        [        5      eru   )r   rW   rv   s     r   rx   *MinGW32Compiler.runtime_library_dir_option  s    $%>??r   r   r   )
r   r   r   r   r   r   r'   rx   r   r   r   s   @r   r   r      s    DM
&@ @r   r   okznot ok	uncertainc                     SSK Jn   S[        R                  ;   a  [        S4$ S[        R                  ;   a  [        S4$ U R                  5       n [        R                  " U5      R                  SS9nS	nX2;   a	  [        nS
nO[        nSnXA< SU SU< 34$ ! [         a"  n[        SU SUR                   34s SnA$ SnAff = f)aK  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vQ019-@@@  M"obTS\\N$KLLMs   #B 
C"B?9C?Cc                     [        [        R                  " U 5      S/-   5      nUR                  5       R	                  S5      $ )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   J  s6    ekk"o0@@AJ&&y11r   )!r   rV   r.   r   r   r   rA   
subprocessr   errorsr   r   	file_utilr   r   r   r   r	   r
    r   r   r   r   rW   r   r   r*   r   r   r(   r   get_versionsr   r   r   <module>r      s     	   
  # $ ( ? I F
t}} F
T@h @@   .Ab2 r   