
    vKgs.                         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JrJr  SSKJr  SSKJr  SSKJr  SS	KJrJr  S
 rSr " S S\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   )CCompilerErrorCompileErrorDistutilsExecErrorDistutilsPlatformError)
write_file)get_config_vars)UnixCCompiler)LooseVersionsuppress_known_deprecationc                      / $ )z6No longer needed, but kept for backward compatibility. r       e/var/www/highfloat_scraper/venv/lib/python3.13/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                      ^  \ 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S jrS rU 4S jr\U 4S j5       rSrU =r$ )CygwinCCompiler(   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&   CygwinCCompiler.__init__5   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   )r4   s    r   gcc_versionCygwinCCompiler.gcc_versionY   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   )r4   objsrcextcc_argsextra_postargspp_optsmsgs           r   _compileCygwinCCompiler._compileh   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        [         R"                  " U 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extendr3   
EXECUTABLEr0   r-   pathdirnamesplitextbasenamejoinexecuter	   appendr   link)r4   target_descobjectsoutput_filename
output_dir	librarieslibrary_dirsruntime_library_dirsexport_symbolsdebugextra_preargsrN   
build_temptarget_langtemp_dirdll_namedll_extensiondef_filecontentss                      r   r`   CygwinCCompiler.link   s~   $ 		-"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*   rV   r4   dirs     r   runtime_library_dir_option*CygwinCCompiler.runtime_library_dir_option   s     			+,	r   c                 b   > [         R                  R                  U5      n[        TU ]  XU5      $ rt   )r-   rY   normcaser%   _make_out_path)r4   rd   	strip_dirsrc_namenorm_src_namer;   s        r   r{   CygwinCCompiler._make_out_path   s)    ((2w%j]KKr   c                 b   > 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.
)rF   rE   )r%   out_extensionsobj_extension)r4   rL   r;   s     r   r   CygwinCCompiler.out_extensions   s@    

g$
8GHC,,,,H
 	
Hs   ,)r+   r,   r3   r0   r1   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&   propertyrB   rQ   r`   rw   r{   r   __static_attributes____classcell__r;   s   @r   r   r   (   s    CMM# !! M")H * *(: !W
r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	$ )Mingw32CCompiler   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   r2   r,   r0   r1   )r4   r5   r6   r7   r:   r;   s        r   r&   Mingw32CCompiler.__init__   s    51!tww !TUUy	*77)#45#xxj(9: HH:Y/'')=/:"hhZ!001=/B 	 		
r   c                      [        [        5      ert   )r   rV   ru   s     r   rw   +Mingw32CCompiler.runtime_library_dir_option  s    $%>??r   r   r   )
r   r   r   r   r   r   r&   rw   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   I  s6    ekk"o0@@AJ&&y11r   )!r   rU   r-   r   r   r   r@   
subprocessr   errorsr   r   r   r   	file_utilr	   r   r
   unixccompilerr   r   r   r   r   rV   r   r   r)   r   r   r'   r   get_versionsr   r   r   <module>r      s     	   
  #  " & ( =I G
m G
V@ @@   .Ab2 r   