£Á°èZ¨Ä…–K§‚«“ô4“ÒÙ´dîfUÙÃÅ WKbyÊ¦•êŽ…È®FÒ¿ÊÎóCozá¬S@6{Í:›œêZÌ:Š•_%:¢¾¾~;‘Ã~èŠ©ÊÇí`ÔÑ©úë™µ'5I¿fš×WO%ø9¾«¾DK|€ùÍD”Ýs]nHÕ¶ê×Ó¼ãžªéUWŸÈË%DÒÕ¬ï‘]/Åcx  ‰ï2ß]ä6G[]S£ÔÏ¯rs{úëóµmÒï#UQxo·õÞCe]"±/aÙ&Eã4ú9Jé_ÞåëdãöKë)AÞ                  ¯¹ægƒÛowÐø^d™ý½ßB7áyMä9ÜÖUã
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
<html>
a
    Sh;                     @   s   d 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	m
Z
mZ ddlmZmZmZmZ ddlmZ ejdkr~ddlZG d	d
 d
e	ZdS )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'
    N)	sysconfig)newer)	CCompilergen_preprocess_optionsgen_lib_options)DistutilsExecErrorCompileErrorLibError	LinkError)logdarwinc                
       s   e Zd ZdZddgdgdgddgdgddgddZejdd d	krNd
ged
< g dZdZdZ	dZ
dZdZd Z ZZeZejdkrdZ fddZd)ddZdd Zd*ddZd+ddZdd  Zd!d" Zd#d$ Zd%d& Zd,d'd(Z  ZS )-UnixCCompilerZunixNZccz-sharedZarz-cr)preprocessorcompilercompiler_socompiler_cxx	linker_so
linker_exearchiverranlib   r   r   )z.cz.Cz.ccz.cxxz.cppz.mz.oz.az.soz.dylibz.tbdzlib%s%scygwinz.exec                    s@   t  |||\}}}td}|r6||v r6|| |||fS )z'Remove standard library path from rpathZLIBDIR)super_fix_lib_argsr   get_config_varremove)self	librarieslibrary_dirsruntime_library_dirslibdir	__class__ </opt/alt/python39/lib64/python3.9/distutils/unixccompiler.pyr   U   s    


zUnixCCompiler._fix_lib_argsc              
   C   s   |  d ||}|\}}}t||}	| j|	 }
|r>|
d|g |rN||
d d< |r\|
| |
| | js~|d u s~t||r|r| tj	
| z| |
 W n, ty } zt|W Y d }~n
d }~0 0 d S )N-or   )Z_fix_compile_argsr   r   extendappendZforcer   mkpathospathdirnamespawnr   r   )r   sourceZoutput_fileZmacrosZinclude_dirsextra_preargsextra_postargs
fixed_argsignorepp_optsZpp_argsmsgr#   r#   r$   
preprocess^   s$    




zUnixCCompiler.preprocessc           	   
   C   sr   | j }tjdkr t||| }z | || |d|g |  W n, tyl } zt|W Y d }~n
d }~0 0 d S )Nr   r%   )r   sysplatform_osx_supportcompiler_fixupr,   r   r   )	r   objsrcZextZcc_argsr/   r2   r   r3   r#   r#   r$   _compilex   s    

zUnixCCompiler._compiler   c              
   C   s   |  ||\}}| j||d}| ||r| tj| | | j|g | | j	  | j
rz| | j
|g  W q ty } zt|W Y d }~qd }~0 0 ntd| d S )N)
output_dirskipping %s (up-to-date))_fix_object_argslibrary_filename
_need_linkr(   r)   r*   r+   r,   r   objectsr   r   r	   r   debug)r   rA   Zoutput_libnamer<   rB   target_langoutput_filenamer3   r#   r#   r$   create_static_lib   s$    	 zUnixCCompiler.create_static_libc              
   C   s  |  ||\}}| |||}|\}}}t| |||}t|ttd fsPtd|d urftj	||}| 
||r|| j | d|g }|	rdg|d d< |
r|
|d d< |r|| | tj| z|tjkr| jd d  }n| jd d  }|dkrr| jrrd}tj|d dkr@d}d|| v r@|d7 }q&tj|| d	kr\d}nd}| j| ||| < tjd
krt||}| ||  W n. ty } zt|W Y d }~n
d }~0 0 ntd| d S )Nz%'output_dir' must be a string or Noner%   z-gr   zc++env   =Z	ld_so_aixr   r=   )r>   r   r   
isinstancestrtype	TypeErrorr)   r*   joinr@   rA   r&   r(   r+   r   Z
EXECUTABLEr   r   r   basenamer5   r6   r7   r8   r,   r   r
   r   rB   )r   Ztarget_descrA   rD   r<   r   r   r   Zexport_symbolsrB   r.   r/   Z
build_temprC   r0   Zlib_optsZld_argsZlinkerioffsetr3   r#   r#   r$   link   sZ    


 zUnixCCompiler.linkc                 C   s   d| S )N-Lr#   )r   dirr#   r#   r$   library_dir_option   s    z UnixCCompiler.library_dir_optionc                    s   t  fdddD S )Nc                 3   s   | ]}| v V  qd S )Nr#   ).0namecompiler_namer#   r$   	<genexpr>       z(UnixCCompiler._is_gcc.<locals>.<genexpr>)Zgcczg++Zclang)any)r   rX   r#   rW   r$   _is_gcc   s    zUnixCCompiler._is_gccc                 C   s   t jtd}tjd d dkr,d| S tjd d dkrFd| S tjd d d	krz| |rnd
d| gS dd| gS | |rtddkrd| S d| S nd| S d S )NCCr   r   rR      Zfreebsdz-Wl,-rpath=   zhp-uxz-Wl,+sz+sZGNULDZyesz-Wl,--enable-new-dtags,-Rz-Wl,-Rz-R)r)   r*   rN   r   r   r5   r6   r\   )r   rS   r   r#   r#   r$   runtime_library_dir_option   s    


z(UnixCCompiler.runtime_library_dir_optionc                 C   s   d| S )Nz-lr#   )r   libr#   r#   r$   library_option  s    zUnixCCompiler.library_optionc                 C   s  | j |dd}| j |dd}| j |dd}| j |dd}tjdkr|td}td|}	|	d u rrttd	}
n
|		d
}
|D ] }t
j||}t
j||}t
j||}t
j||}tjdkrL|ds|drL|dsLt
j|
|d
d  |}t
j|
|d
d  |}t
j|
|d
d  |}t
j|
|d
d  |}t
j|rb|  S t
j|rx|  S t
j|r|  S t
j|r|  S qd S )Nshared)Zlib_typedylib
xcode_stubstaticr   ZCFLAGSz-isysroot\s*(\S+)r]   rG   z/System/z/usr/z/usr/local/)r?   r5   r6   r   r   researchr7   Z_default_sysrootgroupr)   r*   rM   
startswithexists)r   dirsra   rB   Zshared_fZdylib_fZxcode_stub_fZstatic_fZcflagsmZsysrootrS   rc   rd   rf   re   r#   r#   r$   find_library_file  sF    




zUnixCCompiler.find_library_file)NNNNN)Nr   N)
NNNNNr   NNNN)r   )__name__
__module____qualname__Zcompiler_typeZexecutablesr5   r6   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   r4   r;   rE   rQ   rT   r\   r`   rb   rn   __classcell__r#   r#   r!   r$   r   -   sN   


	  
 
    
B*r   )__doc__r)   r5   rg   Z	distutilsr   Zdistutils.dep_utilr   Zdistutils.ccompilerr   r   r   Zdistutils.errorsr   r   r	   r
   r   r6   r7   r   r#   r#   r#   r$   <module>   s   
