+
     hv@  c                  s   R t ^ RIHt ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIH	t	 ^RI
Ht ^RIHt ^RIHt ^RIHt ^RIHt ^R	IHt ^R
I
Ht ^RIHtHtHt ^RIHtHtHt R tR tR t ! R R]P@                  4      t R# )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)Iterable)	sysconfig)log)compiler_fixup)newer)consolidate_linker_args)DistutilsExecError)base)_Macrogen_lib_optionsgen_preprocess_options)CompileErrorLibError	LinkErrorc                s    ^ p\         P                  P                  V ^ ,          4      R8X  d   ^pRW,          9   d   V^,          pK  V RV WR 3# )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'])
envZ=NospathbasenameZcmdpivot   & K/usr/lib/python3.14/site-packages/setuptools/_distutils/compilers/C/unix.py
_split_envr   7   sQ     E	wwA5(SZQJEv;F##    c                sf    \         P                  P                  V ^ ,          4      R8H  pV RV WR 3# )z
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'])
Z	ld_so_aixNr   r   r   r   
_split_aixr   I   s6     GGSV$3Ev;F##r   c                s<    \        V4      pV RV V8X  d   TM^pWR # )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'])
[]
N)Zlen)Z
linker_cmdZcompiler_cmdZc_lenr   s   &&  r   _linker_paramsr   W   s.    . E'<7EQEfr   c                  sx  a  ] tR t^stRtRRRR.RR.RR.R	R.R
RR.RRR.RR.RRR.RRR.RR/t]P                  R,          R8X  d   R.]R&   . R/OtRt	Rt
RtRtRtR;t;tt]t]P                  R8X  d	   RtRtRtRtV 3R  ltR0R! R" lltR# tR1R$ ltR2R% R& lltR' tR( tR) R* ltR+ t]R, 4       tR3R- ltR.tV ;t # )4CompilerZunixpreprocessorNcompilerZcccompiler_socompiler_cxxc++compiler_so_cxx	linker_soz-sharedlinker_so_cxx
linker_exeZlinker_exe_cxxarchiverZarz-crranlibNi   Ndarwinz.oz.az.soz.dylibz.tbdzlib%s%sZcygwinz.exez.dll.az.dllzcyg%s%sc                s   < \         SV `  WV4      w  rp\        P                  ! R4      pV'       d/   VP	                  R4      '       d   WC9   d   VP                  V4       WV3# )z'Remove standard library path from rpathZLIBDIRz/usr/lib)Zsuper_fix_lib_argsr   get_config_var
startswithZremove)self	librarieslibrary_dirsruntime_library_dirsZlibdir	__class__s   &&&& r   r*   ZCompiler._fix_lib_args   sd    8=8M%99
5	!5 ))(3 !!*--/ ''/(<<<r   c               s0    V ^8  d   QhRRRRRRRRR	R
RR/# )   sourcezstr | os.PathLike[str]output_filezstr | os.PathLike[str] | Nonemacroszlist[_Macro] | Noneinclude_dirs"list[str] | tuple[str, ...] | Noneextra_preargszlist[str] | Noneextra_postargszIterable[str] | None Zformat   "r   __annotate__Compiler.__annotate__   sF     #$ #$&#$ 3#$ $	#$
 9#$ (#$ -#$r   c                	sH   V P                  R W44      pVw  rp\        W44      p	V P                  V	,           p
V'       d   V
P                  RV.4       V'       d   WZR&   V'       d   V
P                  V4       V
P	                  V4       V P
                  ;'       g    VR J ;'       g    \        W4      pV'       g   R # V'       d/   V P                  \        P                  P                  V4      4        V P                  V
4       R #   \         d   p\        T4      hR p?ii ; i)N-oNi    N)Z_fix_compile_argsr   r   extendZappendZforcer   mkpathr   r   dirnamespawnr   r   )r-   r3   r4   r5   r6   r8   r9   
fixed_argsZignorepp_optsZpp_args
preprocessmsgs   &&&&&&&      r   rG   ZCompiler.preprocess   s     ++D&G
'1$(>##g-NND+./'BKNN>*v ZZTT;$#6TT%:T
KK45	$JJw! 	$s##	$s   3D D!DD!c                	s   \        V P                  WE,           4      p\        V P                  WE,           4      p V P                  V4      R 8X  d+   V P	                  W,           VRV.,           V,           4       R# V P	                  Wt,           VRV.,           V,           4       R#   \
         d   p	\        T	4      hRp	?	ii ; i)r!   r?   N)r   r   r"   Zdetect_languagerD   r   r   )
r-   ZobjZsrcZextZcc_argsr9   rF   r   r"   rH   s
   &&&&&&&   r   _compileZCompiler._compile   s    $T%5%5w7OP()=)=w?WX	$##C(E1

#-dC0@@>Q 

;0Cs3CCnTU! 	$s##	$s   >B$ :(B$ $B?/B::B?c                	s.   V P                  W4      w  rV P                  W#R 7      pV P                  W4      '       d   V P                  \        P
                  P                  V4      4       V P                  V P                  V.,           V,           V P                  ,           4       V P                  '       d'    V P                  V P                  V.,           4       R# R# \        P                  ! RV4       R#   \         d   p\        T4      hRp?ii ; i))
output_dirNskipping %s (up-to-date))_fix_object_argslibrary_filename
_need_linkrB   r   r   rC   rD   r&   objectsr'   r   r   r   debug)r-   rO   Zoutput_libnamerJ   rP   target_langoutput_filenamerH   s   &&&&&&  r   create_static_libZCompiler.create_static_lib   s     #33GH///V??744KK89JJt}}'887BT\\QR {{{(JJt{{o->>?  II0/B * ("3-'(s   9#C9 9DDDc          
     s,    V ^8  d   QhRRRRRRRRRR/# )	r2   rO   zlist[str] | tuple[str, ...]rJ   z
str | Noner.   r7   r/   r0   r:   r;   r<   r   r=   r>      sF     ?C ?C -?C
 ?C 6?C 9?C A?Cr   c                	s   V P                  W$4      w  r$V P                  WVV4      pVw  rVp\        WWu4      p\        V\        \        R 4      34      '       g   \        R4      hVe    \        P                  P                  WC4      pV P                  W#4      '       Ed   W P                  ,           V,           RV.,           pV	'       d   R.VR&   V
'       d   V
VR&   V'       d   VP                  V4       V P                  \        P                  P                  V4      4        V\        P                   P"                  8H  pV'       d   V P$                  MVR8X  d   V P&                  MV P(                  R,          pVR8X  d   V P*                  '       dp   \-        V4      w  pp\/        V4      w  pp\-        V P*                  4      w  pp\-        V P$                  4      w  pp\1        VV4      pVV,           V,           V,           p\3        VV4      pV P5                  VV,           4       R # \:        P<                  ! RV4       R #   \6         d   p\9        T4      hR p?ii ; i)Nz%'output_dir' must be a string or Noner?   z-gr@   r!   :NNNrK   )rL   r*   r
   Z
isinstancestrtypeZ	TypeErrorr   r   joinrN   rO   rA   rB   rC   r   r   Z
EXECUTABLEr%   r$   r#   r    r   r   r   r   rD   r   r   r   rP   )r-   Ztarget_descrO   rR   rJ   r.   r/   r0   Zexport_symbolsrP   r8   r9   Z
build_temprQ   rE   Zlib_optsZld_argsZbuilding_exeZlinkerr   Z	linker_neZaixZ	linker_naZ_Zcompiler_cxx_neZlinker_exe_neZparamsrH   s   &&&&&&&&&&&&&&              r   linkZCompiler.link   s     #33GH''	AUV
8B5	!5"47KW*sDJ&788CDD! ggll:GO??744,x74:QQG#f+~.KK89%  +dmm.F.FF $ OO /:U.B** %'D,=,=,=%/%7NC%/	%:NC)3D4E4E)F&A'1$//'B$A}+I}EF 3Y86AF'8

6G+, II0/B & %n$%s&   #$I A
I BI IIIc                	    R V,           # )-Lr:   )r-   dir   &&r   library_dir_optionZCompiler.library_dir_option>      czr   c                	s    \         P                  ! R 4      p\        P                  P	                  \
        P                  ! V4      ^ ,          4      pRV9   ;'       g    RV9   # )ZCCZgcczg++)r   r+   r   r   r   shlexsplit)r-   Zcc_varr   s   &  r   _is_gccZCompiler._is_gccA  sL    ))$/77##EKK$7$:; 55EX$55r   c               s     V ^8  d   QhRRRR/# )r2   rZ   rT   Zreturnzstr | list[str]r:   r;   r<   r   r=   r>   F  s     &" &"c &"o &"r   c                	s   \         P                  R ,          R8X  d9   ^ RIHpHp V! 4       pV'       d   V! V4      ^
^.8  d
   RV,           # RV,           # \         P                  R,          R8X  d
   RV,           # \         P                  R,          R	8X  d$   V P                  4       '       d   R
MRRV,           .# \        P                  ! R4      R8X  d   \        RRV,           .4      # RV,           # )r(   r)   )get_macosx_target_versplit_versionz-Wl,-rpath,rY   :Ni   NZfreebsdz-Wl,-rpath=:Ni   Nzhp-uxz-Wl,+sz+sZGNULDZyesz-Wl,--enable-new-dtagsz-Wl,-R)	sysplatformZdistutils.utilra   rb   r`   r   r+   r   )r-   rZ   ra   rb   Zmacosx_target_vers   &&   r   runtime_library_dir_optionZ#Compiler.runtime_library_dir_optionF  s     <<x'K 5 7 ]3D%E"a%P$s**cz!\\"* 3&&\\"( LLNNs
  ##G,5*(#,   c>!r   c                	rX   )z-lr:   )r-   libr[   r   library_optionZCompiler.library_optionn  r]   r   c                s   \         P                  ! R4      p\        P                  ! RV4      p\        P
                  R8H  ;'       dS    T;'       dI    V P                  R4      ;'       g0    V P                  R4      ;'       d    V P                  R4      '       * pV'       d7   \        P                  P                  VP                  ^4      V R,          4      # T # )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
ZCFLAGSz-isysroot\s*(\S+)r)   z/System/z/usr/z/usr/local/:i   NN)r   r+   reZsearchrc   rd   r,   r   r   rV   Zgroup)rZ   ZcflagsZmatchZ
apply_roots   &   r   _library_rootZCompiler._library_rootq  s    * ))(3		.7 LLH$    z* S SNN7+QQCNN=4Q0Q 	 9Crww||EKKNCG4KKr   c                sN  a a VV 3R lRP                  4        4       p\        S P                  V4      p\        P                  ! \
        P                  P                  \        P                  ! WT4      4      p\        \
        P                  P                  V4      p\        VR4      # )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  sJ   <"   T F  pSP                  SVR 7      x  K  	  R# 5i))Zlib_typeN)rM   )Z.0rU   rf   r-   s   & r   Z	<genexpr>Z-Compiler.find_library_file.<locals>.<genexpr>  s+      
@ !!#!55@s    #zdylib xcode_stub shared staticN)r_   Zmapri   	itertoolsZstarmapr   r   rV   ZproductZfilterZexistsZnext)r-   Zdirsrf   rP   Z	lib_namesZrootsZsearchedZfounds   f&f&    r   find_library_fileZCompiler.find_library_file  sw    
8>>@
	
 D&&-$$RWW\\93D3DU3VWrww~~x0 E4  r   r:   )z.cz.Cz.ccz.cxxz.cppz.m)NNNNN)NFN)
NNNNNFNNNN)F)!Z__name__Z
__module__Z__qualname__Z__firstlineno__Zcompiler_typeZexecutablesrc   rd   Zsrc_extensionsZobj_extensionZstatic_lib_extensionZshared_lib_extensionZdylib_lib_extensionZxcode_stub_lib_extensionZstatic_lib_formatZshared_lib_formatZdylib_lib_formatZxcode_stub_lib_formatZexe_extensionr*   rG   rI   rS   rW   r\   r`   re   rg   Zstaticmethodri   rk   Z__static_attributes__Z__classcell__)r1   s   @r   r   r   s   s6   M 	TFvE7dI&%+tf5),T5M$K ||B8#!)
H ?NM "%?HHH),<,
||x'$$=#$J$C0?CJ6
&"P  L  LD! !r   r   )!Z__doc__Z
__future__r    rj   r   rh   r^   rc   Zcollections.abcr   Z r   Z_logr   Z_macos_compatr   Z	_modifiedr   Zcompatr   Zerrorsr   r   r	   r
   r   r   r   r   r   r   r   r   r:   r   r   <module>rl      sg    #  	 	  
 $   +  - (  A A ,$$$8t!t}} t!r   