
    nj/                       S r SSKJ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	r	SSK
Jr  SSKrSSKJrJr  SSKJr  SSKJr  S	S
KJr  S	SKJr  \" \5      rS rSr " S S\R8                  5      r " S S\5      rSrSrSr S r!SS j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).
    )annotationsN)get_config_vars   )ErrorPlatformError)
get_logger)is_mingw   )unix)CompileErrorc                     / $ )z6No longer needed, but kept for backward compatibility. r       d/var/www/html/pdf-tiff/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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'Cygwin port of GNU C Compiler for Win32z.oz.az.dll.az.dllzlib%s%szcyg%s%sz.exec                   > [         TU ]  XS9  [        5       u  p4U 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 )N)forcez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 -O1 -Wallz -mcygwin -mdll -O1 -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verboser   statusdetailsshared_option	__class__s         r   r&   Compiler.__init__8   sw   .(*0G9ANO$II") $OO ,D%8 **..tww'7%8::>>%):U;''"hh!y 3477)#<= HH:%89#xxj(AB''),)M?C"hhZy1!001M?K 	 		
 '[r   c                t    [         R                  " S[        SS9  [        R                  R                  S5      $ )Nzgcc_version attribute of CygwinCCompiler is deprecated. Instead of returning actual gcc version a fixed value 11.2.0 is returned.r   )
stacklevelz11.2.0)warningsr*   DeprecationWarning	packagingversionVersion)r4   s    r   gcc_versionCompiler.gcc_version\   s5     	X		
   ((22r   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! [        R                  [        4 a  n[	        U5      eSnAff = f! [        R                  [        4 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++)call
subprocessCalledProcessErrorOSErrorr   detect_languager    r   )r4   objsrcextcc_argsextra_postargspp_optsmsgs           r   _compileCompiler._compilej   s    /!(		9dCs;<('',5II,,!"c*+ )) II((72c45EEV 117; ("3''( 117; ("3''(s4   B <B2 'B2 B/B**B/2CCC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b6  XR
                  :w  d  U R                  S:X  G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        [        R                  SU5        [        R                   " U5      R#                  SR                  U5      S-   5        UR%                  U5        U	(       d  U
R%                  S	5        [&        TU ]Q  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 %s
z-s)copyr*   _runtime_library_dirs_msgextendr3   
EXECUTABLEr0   r-   pathdirnamesplitextbasenamejoinloginfopathlibPath
write_textappendr%   link)r4   target_descobjectsoutput_filename
output_dir	librarieslibrary_dirsruntime_library_dirsexport_symbolsdebugextra_preargsrQ   
build_temptarget_langtemp_dirdll_name_dll_extensiondef_filecontentsr9   s                      r   rh   Compiler.link   s   $ 		-"526IIio2.	))GMr*II/0 	++, &??*doo.F wwwqz2H)+)9)9  1*&X~
 ww||H.?@H #277#3#3O#D"EF	RHOON+HH\8,LL"--dii.AD.HI
 NN8$   & 	
r   c                0    U R                  [        5        / $ N)r*   rZ   r4   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      $ r|   )r-   r]   normcaser%   _make_out_path)r4   rl   	strip_dirsrc_namenorm_src_namer9   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.
)rF   rE   )r%   out_extensionsobj_extension)r4   rO   r9   s     r   r   Compiler.out_extensions   s@    

g$
8GHC,,,,H
 	
Hs   -)r+   r,   r3   r0   r1   FF)
NNNNNFNNNN)__name__
__module____qualname____firstlineno____doc__compiler_typedescriptionr   static_lib_extensionshared_lib_extensiondylib_lib_extensionstatic_lib_formatshared_lib_formatdylib_lib_formatexe_extensionr&   propertyrB   rT   rh   r   r   r   __static_attributes____classcell__r9   s   @r   r   r   *   s    CM;KM# !! M")H 3 3(: !W
rL
 
 
r   r   c                  N   ^  \ rS rSrSrSrSrS	U 4S jj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.mingw32z(Mingw32 port of GNU C Compiler for Win32c                n  > [         TU ]  X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
 -O1 -Wallz -shared -O1 -Wall )r   r   r    r   r!   r"   r#   r$   )	r%   r&   is_cygwinccr+   r   r2   r,   r0   r1   )r4   r5   r   r8   r9   s       r   r&   MinGW32Compiler.__init__   s    (!twwKLLy
+77)#56#xxj(:; HH:Z0'')=/:"hhZ!001=/B 	 		
r   c                B   > [        5       (       a  [        TU ]	  5         g g r|   )r	   r%   configure_system)r4   r9   s    r   r    MinGW32Compiler.configure_system  s     ::G$& r   c                     [        [        5      er|   )r   rZ   r}   s     r   r   *MinGW32Compiler.runtime_library_dir_option  s    566r   r   r   )returnNone)r   r   r   r   r   r   r   r&   r   r   r   r   r   s   @r   r   r      s$    DM<K
&'7 7r   r   okznot ok	uncertainc                    SSK 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   NGCCzsys.version mentions 'GCC'Clangzsys.version mentions 'Clang'zutf-8)encoding__GNUC__mentionszdoes not mentionr   zcouldn't read 'z': )	sysconfigsysr@   r)   get_config_h_filenamerd   re   	read_textCONFIG_H_NOTOKrK   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=7C=Cc                    [         R                  " [        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)rI   check_outputshlexsplitstripendswith)r+   
out_strings     r   r   r   S  s<    ((RN;K)KLJ&&y11r   )r+   zstr | shlex._ShlexInstreamr   bool)$r   
__future__r   rY   r-   rd   r   rI   r   r=   r   r   packaging.versionr?   errorsr   r   loggingr   platform.detectr	    r   r   r   rb   r   rZ   r   r   r)   r   r   r'   r   get_versionsr   r   r   <module>r      s    #  	    
  %  )   &   I G
t}} G
V!7h !7P   .Ab2 r   