Ë
    nûàgM<  ã                  óÌ   — d Z ddlm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 ddlmZ ddlmZ dd	lmZmZmZ dd
lmZ ddlmZmZmZmZ d„ Zd„ Zd„ Z G d„ de«      Zy)a9  distutils.unixccompiler

Contains the UnixCCompiler class, a subclass of CCompiler that handles
the "typical" Unix-style command-line C compiler:
  * macros defined with -Dname[=value]
  * macros undefined with -Uname
  * include search directories specified with -Idir
  * libraries specified with -lllib
  * library search directories specified with -Ldir
  * compile handled by 'cc' (or similar) executable with -c option:
    compiles .c to .o
  * link static library handled by 'ar' command (possibly with 'ranlib')
  * link shared library handled by 'cc -shared'
é    )ÚannotationsNé   )Ú	sysconfig)Úlog)Úcompiler_fixup)Únewer)Ú	CCompilerÚgen_lib_optionsÚgen_preprocess_options)Úconsolidate_linker_args)ÚCompileErrorÚDistutilsExecErrorÚLibErrorÚ	LinkErrorc                ó�   — d}t         j                  j                  | d   «      dk(  rd}d| |   v r|dz  }d| |   v rŒ| d| | |d fS )zÿ
    For macOS, split command into 'env' portion (if any)
    and the rest of the linker command.

    >>> _split_env(['a', 'b', 'c'])
    ([], ['a', 'b', 'c'])
    >>> _split_env(['/usr/bin/env', 'A=3', 'gcc'])
    (['/usr/bin/env', 'A=3'], ['gcc'])
    r   Úenvr   ú=N©ÚosÚpathÚbasename©ÚcmdÚpivots     úa/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/setuptools/_distutils/unixccompiler.pyÚ
_split_envr   0   sc   € ð €EÜ	‡w�w×Ñ˜˜A™Ó 5Ò(ØˆØ�S˜‘ZÑØ�Q‰JˆEð �S˜‘ZÒàˆv�ˆ;˜˜E˜F˜Ð#Ð#ó    c                ó`   — t         j                  j                  | d   «      dk(  }| d| | |d fS )a  
    AIX platforms prefix the compiler with the ld_so_aix
    script, so split that from the linker command.

    >>> _split_aix(['a', 'b', 'c'])
    ([], ['a', 'b', 'c'])
    >>> _split_aix(['/bin/foo/ld_so_aix', 'gcc'])
    (['/bin/foo/ld_so_aix'], ['gcc'])
    r   Ú	ld_so_aixNr   r   s     r   Ú
_split_aixr    B   s8   € ô �G‰G×Ñ˜S ™VÓ$¨Ñ3€EØˆv�ˆ;˜˜E˜F˜Ð#Ð#r   c                ó:   — t        |«      }| d| |k(  r|nd}| |d S )a  
    The linker command usually begins with the compiler
    command (possibly multiple elements), followed by zero or more
    params for shared library building.

    If the LDSHARED env variable overrides the linker command,
    however, the commands may not match.

    Return the best guess of the linker parameters by stripping
    the linker command. If the compiler command does not
    match the linker command, assume the linker command is
    just the first element.

    >>> _linker_params('gcc foo bar'.split(), ['gcc'])
    ['foo', 'bar']
    >>> _linker_params('gcc foo bar'.split(), ['other'])
    ['foo', 'bar']
    >>> _linker_params('ccache gcc foo bar'.split(), 'ccache gcc'.split())
    ['foo', 'bar']
    >>> _linker_params(['gcc'], ['gcc'])
    []
    Nr   )Úlen)Ú
linker_cmdÚcompiler_cmdÚc_lenr   s       r   Ú_linker_paramsr&   P   s0   € ô. �Ó€EØ  Ð'¨<Ò7‰E¸Q€EØ�e�fÐÐr   c                  ó@  — e Zd ZdZddgdgdgdgddgddgdgddgddgddœZej                  dd	 d
k(  rdged<   g d¢ZdZdZ	dZ
dZdZdxZxZZeZej                  dk(  rdZdZ
dZdZ	 	 	 	 	 d"d„Zd„ Z	 d#d„Z	 	 	 	 	 	 	 	 	 	 d$d„Zd„ Zd„ Zd%d„Zd„ Zed „ «       Zd&d!„Zy)'ÚUnixCCompilerÚunixNÚccúc++z-sharedÚarz-cr)ÚpreprocessorÚcompilerÚcompiler_soÚcompiler_cxxÚcompiler_so_cxxÚ	linker_soÚlinker_so_cxxÚ
linker_exeÚlinker_exe_cxxÚarchiverÚranlibé   Údarwinr7   )z.cz.Cz.ccz.cxxz.cppz.mz.oz.az.soz.dylibz.tbdzlib%s%sÚcygwinz.exez.dll.az.dllzcyg%s%sc                óî  — | j                  d ||«      }|\  }}}t        ||«      }	| j                  |	z   }
|r|
j                  d|g«       |r||
d d |r|
j                  |«       |
j	                  |«       | j
                  xs |d u xs t        ||«      }|sy |r.| j                  t        j                  j                  |«      «       	 | j                  |
«       y # t        $ r}t        |«      ‚d }~ww xY w)Nú-or   )Ú_fix_compile_argsr   r-   ÚextendÚappendÚforcer   Úmkpathr   r   ÚdirnameÚspawnr   r   )ÚselfÚsourceÚoutput_fileÚmacrosÚinclude_dirsÚextra_preargsÚextra_postargsÚ
fixed_argsÚignoreÚpp_optsÚpp_argsÚ
preprocessÚmsgs                r   rO   zUnixCCompiler.preprocessš   sì   € ð ×+Ñ+¨D°&¸,ÓGˆ
Ø'1Ñ$ˆ�˜Ü(¨°Ó>ˆØ×#Ñ# gÑ-ˆÙØ�N‰N˜D +Ð.Ô/ÙØ'ˆG�B�QˆKÙØ�N‰N˜>Ô*Ø�‰�vÔð —Z‘ZÒT ;°$Ð#6ÒT¼%ÀÈÓ:Tˆ
ÙØáØ�K‰KœŸ™Ÿ™¨Ó4Ô5ð	$Ø�J‰J�wÕøÜ!ò 	$Ü˜sÓ#Ð#ûð	$ús   Ã	C Ã	C4Ã$C/Ã/C4c                ó@  — t        | j                  ||z   «      }t        | j                  ||z   «      }	 | j                  |«      dk(  r| j	                  ||z   |d|gz   |z   «       y | j	                  ||z   |d|gz   |z   «       y # t
        $ r}	t        |	«      ‚d }	~	ww xY w)Nr+   r<   )r   r/   r1   Údetect_languagerC   r   r   )
rD   ÚobjÚsrcÚextÚcc_argsrJ   rM   r/   r1   rP   s
             r   Ú_compilezUnixCCompiler._compile¿   s¬   € Ü$ T×%5Ñ%5°wÀÑ7OÓPˆÜ(¨×)=Ñ)=¸wÈÑ?WÓXˆð	$Ø×#Ñ# CÓ(¨EÒ1Ø—
‘
Ø# gÑ-°°d¸CÐ0@Ñ@À>ÑQõð —
‘
˜;¨Ñ0°C¸¸sÐ3CÑCÀnÑTÕUøÜ!ò 	$Ü˜sÓ#Ð#ûð	$ús   ´1B Á&B Â	BÂBÂBc                óò  — | j                  ||«      \  }}| j                  ||¬«      }| j                  ||«      r‹| j                  t        j
                  j                  |«      «       | j                  | j                  |gz   |z   | j                  z   «       | j                  r!	 | j                  | j                  |gz   «       y y t        j                  d|«       y # t        $ r}t        |«      ‚d }~ww xY w)N)Ú
output_dirúskipping %s (up-to-date))Ú_fix_object_argsÚlibrary_filenameÚ
_need_linkrA   r   r   rB   rC   r6   Úobjectsr7   r   r   r   Údebug)rD   r^   Úoutput_libnamerY   r_   Útarget_langÚoutput_filenamerP   s           r   Úcreate_static_libzUnixCCompiler.create_static_libÌ   sÕ   € ð #×3Ñ3°G¸ZÓHÑˆ�à×/Ñ/°È:Ð/ÓVˆà�?‰?˜7 OÔ4Ø�K‰KœŸ™Ÿ™¨Ó8Ô9Ø�J‰J�t—}‘}¨Ð'8Ñ8¸7ÑBÀTÇ\Á\ÑQÔRð �{Š{ð(Ø—J‘J˜tŸ{™{¨oÐ->Ñ>Õ?ð ô �I‰IÐ0°/ÕBøô *ò (Ü" 3›-Ð'ûð(ús   Â%C Ã	C6Ã&C1Ã1C6c                ó  — | j                  ||«      \  }}| j                  |||«      }|\  }}}t        | |||«      }t        |t        t        d «      f«      st        d«      ‚|� t        j                  j                  ||«      }| j                  ||«      �r>|| j                  z   |z   d|gz   }|	rdg|d d |
r|
|d d |r|j                  |«       | j                  t        j                  j                  |«      «       	 |t        j                   k(  }|r| j"                  n|dk(  r| j$                  n| j&                  d d  }|dk(  ro| j(                  rct+        |«      \  }}t-        |«      \  }}t+        | j(                  «      \  }}t+        | j"                  «      \  }}t/        ||«      }||z   |z   |z   }t1        ||«      }| j3                  ||z   «       y t9        j:                  d|«       y # t4        $ r}t7        |«      ‚d }~ww xY w)Nz%'output_dir' must be a string or Noner<   z-gr   r+   rZ   )r[   Ú_fix_lib_argsr
   Ú
isinstanceÚstrÚtypeÚ	TypeErrorr   r   Újoinr]   r^   r>   rA   rB   r	   Ú
EXECUTABLEr4   r3   r2   r0   r   r    r&   r   rC   r   r   r   r_   )rD   Útarget_descr^   rb   rY   Ú	librariesÚlibrary_dirsÚruntime_library_dirsÚexport_symbolsr_   rI   rJ   Ú
build_tempra   rK   Úlib_optsÚld_argsÚbuilding_exeÚlinkerr   Ú	linker_neÚaixÚ	linker_naÚ_Úcompiler_cxx_neÚlinker_exe_neÚparamsrP   s                               r   ÚlinkzUnixCCompiler.linkä   sþ  € ð  #×3Ñ3°G¸ZÓHÑˆ�Ø×'Ñ'¨	°<ÐAUÓVˆ
Ø8BÑ5ˆ	�<Ð!5ä" 4¨Ð7KÈYÓWˆÜ˜*¤s¬D°«JÐ&7Ô8ÜÐCÓDÐDØÐ!Ü Ÿg™gŸl™l¨:°ÓGˆOà�?‰?˜7 OÕ4Ø §¡Ñ,¨xÑ7¸4ÀÐ:QÑQˆGÙØ#˜f�˜˜�ÙØ+�˜˜�ÙØ—‘˜~Ô.Ø�K‰KœŸ™Ÿ™¨Ó8Ô9ð%ð  +¬i×.BÑ.BÑB�ñ $ð —O’Oð /:¸UÒ.B˜×*Ò*ÈÏÉáð�ð  %Ò'¨D×,=Ò,=Ü%/°Ó%7‘N�C˜Ü%/°	Ó%:‘N�C˜Ü)3°D×4EÑ4EÓ)FÑ&�A�Ü'1°$·/±/Ó'BÑ$�A�}ä+¨I°}ÓE�FØ  3™Y¨Ñ8¸6ÑA�Fä'¨°Ó8�à—
‘
˜6 GÑ+Õ,ô �I‰IÐ0°/ÕBøô &ò %Ü “nÐ$ûð%ús   Ä CG- Ç-	HÇ6HÈHc                ó   — d|z   S )Nú-L© )rD   Údirs     r   Úlibrary_dir_optionz UnixCCompiler.library_dir_option)  ó   € Ø�c‰zÐr   c                óª   — t        j                  d«      }t        j                  j	                  t        j                  |«      d   «      }d|v xs d|v S )NÚCCr   Úgcczg++)r   Úget_config_varr   r   r   ÚshlexÚsplit)rD   Úcc_varr.   s      r   Ú_is_gcczUnixCCompiler._is_gcc,  sI   € Ü×)Ñ)¨$Ó/ˆÜ—7‘7×#Ñ#¤E§K¡K°Ó$7¸Ñ$:Ó;ˆØ˜Ð Ò5 E¨XÐ$5Ð5r   c                ól  — t         j                  d d dk(  r(ddlm}m}  |«       }|r ||«      ddgk\  rd|z   S d|z   S t         j                  d d	 d
k(  rd|z   S t         j                  d d dk(  r| j                  «       rdndd|z   gS t        j                  d«      dk(  rt        dd|z   g«      S d|z   S )Nr8   r9   r   )Úget_macosx_target_verÚsplit_versioné
   é   z-Wl,-rpath,r   é   Úfreebsdz-Wl,-rpath=zhp-uxz-Wl,+sz+sÚGNULDÚyesz-Wl,--enable-new-dtagsz-Wl,-R)	ÚsysÚplatformÚdistutils.utilr�   rŽ   r‹   r   r‡   r   )rD   r�   r�   rŽ   Úmacosx_target_vers        r   Úruntime_library_dir_optionz(UnixCCompiler.runtime_library_dir_option1  sÙ   € ô �<‰<˜˜Ð˜xÒ'ßKá 5Ó 7ÐÙ ¡]Ð3DÓ%EÈ"ÈaÈÒ%PØ$ sÑ*Ð*à˜c‘zÐ!Ü�\‰\˜"˜1Ð Ò*Ø  3Ñ&Ð&Ü�\‰\˜"˜1Ð Ò(à ŸL™LœN‘°Ø�s‘
ðð ô ×#Ñ# GÓ,°Ò5Ü*à(Ø Ñ#ð,ó ð ð ˜c‘>Ð!r   c                ó   — d|z   S )Nz-lr€   )rD   Úlibs     r   Úlibrary_optionzUnixCCompiler.library_optionY  rƒ   r   c                óf  — t        j                  d«      }t        j                  d|«      }t        j
                  dk(  xr< |xr8 | j                  d«      xs% | j                  d«      xr | j                  d«       }|r2t        j                  j                  |j                  d«      | dd «      S | S )	a°  
        macOS users can specify an alternate SDK using'-isysroot'.
        Calculate the SDK root if it is specified.

        Note that, as of Xcode 7, Apple SDKs may contain textual stub
        libraries with .tbd extensions rather than the normal .dylib
        shared libraries installed in /.  The Apple compiler tool
        chain handles this transparently but it can cause problems
        for programs that are being built with an SDK and searching
        for specific libraries.  Callers of find_library_file need to
        keep in mind that the base filename of the returned SDK library
        file might have a different extension from that of the library
        file installed on the running system, for example:
          /Applications/Xcode.app/Contents/Developer/Platforms/
              MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/
              usr/lib/libedit.tbd
        vs
          /usr/lib/libedit.dylib
        ÚCFLAGSz-isysroot\s*(\S+)r9   z/System/z/usr/z/usr/local/r   N)r   r‡   ÚreÚsearchr•   r–   Ú
startswithr   r   rj   Úgroup)r�   ÚcflagsÚmatchÚ
apply_roots       r   Ú_library_rootzUnixCCompiler._library_root\  s£   € ô* ×)Ñ)¨(Ó3ˆÜ—	‘	Ð.°Ó7ˆô �L‰L˜HÑ$ò Øòð —‘˜zÓ*ò SØ—N‘N 7Ó+ÒQ°C·N±NÀ=Ó4QÐ0Qð 	ñ 9CŒr�w‰w�|‰|˜EŸK™K¨›N¨C°°¨GÓ4ÐKÈÐKr   c                óJ  ‡ ‡— ˆˆ fd„dj                  «       D «       }t        ‰ j                  |«      }t        j                  t
        j                  j                  t        j                  ||«      «      }t        t
        j                  j                  |«      }t        |d«      S )zÛ
        Second-guess the linker with not much hard
        data to go on: GCC seems to prefer the shared library, so
        assume that *all* Unix C compilers do,
        ignoring even GCC's "-static" option.
        c              3  óD   •K  — | ]  }‰j                  ‰|¬ «      –— Œ y­w))Úlib_typeN)r\   )Ú.0rh   r›   rD   s     €€r   ú	<genexpr>z2UnixCCompiler.find_library_file.<locals>.<genexpr>†  s)   øè ø€ ò 
àð ×!Ñ! #°Ð!×5ñ
ùs   ƒ zdylib xcode_stub shared staticN)r‰   Úmapr¦   Ú	itertoolsÚstarmapr   r   rj   ÚproductÚfilterÚexistsÚnext)rD   Údirsr›   r_   Ú	lib_namesÚrootsÚsearchedÚfounds   ` `     r   Úfind_library_filezUnixCCompiler.find_library_file  sy   ù€ ô
à8×>Ñ>Ó@ô
ˆ	ô
 �D×&Ñ&¨Ó-ˆä×$Ñ$¤R§W¡W§\¡\´9×3DÑ3DÀUÈIÓ3VÓWˆä”r—w‘w—~‘~ xÓ0ˆô �E˜4Ó Ð r   )NNNNN)NFN)
NNNNNFNNNN)r�   rg   Úreturnzstr | list[str])F)Ú__name__Ú
__module__Ú__qualname__Úcompiler_typeÚexecutablesr•   r–   Úsrc_extensionsÚobj_extensionÚstatic_lib_extensionÚshared_lib_extensionÚdylib_lib_extensionÚxcode_stub_lib_extensionÚstatic_lib_formatÚshared_lib_formatÚdylib_lib_formatÚxcode_stub_lib_formatÚexe_extensionrO   rW   rc   r}   r‚   r‹   r™   rœ   Ústaticmethodr¦   r¸   r€   r   r   r(   r(   l   sO  „ Ø€Mð Ø�FØ�vØ˜Ø!˜7Ø˜IÐ&Ø Ð+Ø�fØ  )Ð,Ø˜5�MØñ€Kð ‡|�|�B�QÐ˜8Ò#Ø!) 
ˆ�HÑò ?€NØ€MØÐØ ÐØ"ÐØ%ÐØ?HÐHÐÐHÐ)Ð,<Ø,ÐØ
‡|�|�xÒØˆØ'ÐØ$ÐØ$Ðð
 ØØØØó#$òJ$ð RVóCð: ØØØ!ØØØØØØó?CòJò6ó
&"òPð ñ Ló ð LôD!r   r(   )Ú__doc__Ú
__future__r   r­   r   rŸ   rˆ   r•   Ú r   Ú_logr   Ú_macos_compatr   Ú	_modifiedr   Ú	ccompilerr	   r
   r   Úcompatr   Úerrorsr   r   r   r   r   r    r&   r(   r€   r   r   ú<module>rÔ      sV   ðñõ #ã Û 	Û 	Û Û 
å Ý Ý )Ý ß IÑ IÝ +ß IÓ Iò$$ò$$òô8f!�Iõ f!r   