HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.104.1.lve.el8.x86_64 #1 SMP Tue Feb 10 20:07:30 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.29
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/saltstack/salt/lib/python3.10/distutils/__pycache__/unixccompiler.cpython-310.pyc
o

�N�g�9�@s�dZddlZddlZddlZddlmZddlmZddlm	Z	m
Z
mZddlm
Z
mZmZmZddlmZejdkr?ddlZGd	d
�d
e	�ZdS)a9distutils.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�eZdZdZddgdgdgddgdgddgdd�Zejdd�d	kr'd
ged
<gd�ZdZd
Z	dZ
dZdZdZ
ZZeZejdkrDdZ		d'dd�Zdd�Z	d(dd�Z				d)dd�Zdd�Zdd �Zd!d"�Zd#d$�Zd*d%d&�ZdS)+�
UnixCCompilerZunixNZccz-shared�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.tbdzlib%s%s�cygwinz.exec
Cs�|�d||�}|\}}}t||�}	|j|	}
|r|
�d|g�|r'||
dd�<|r.|
�|�|
�|�|js?|dus?t||�rc|rJ|�tj	�
|��z|�|
�WdStyb}zt
|��d}~wwdS)N�-or)Z_fix_compile_argsrr�extend�append�forcer�mkpath�os�path�dirname�spawnrr)�self�sourceZoutput_fileZmacros�include_dirs�
extra_preargs�extra_postargs�
fixed_args�ignore�pp_optsZpp_args�msg�r+�=/opt/saltstack/salt/lib/python3.10/distutils/unixccompiler.py�
preprocessUs*




���zUnixCCompiler.preprocessc	
Csd|j}tjdkrt�|||�}z|�|||d|g|�WdSty1}zt|��d}~ww)Nrr)r�sys�platform�_osx_support�compiler_fixupr!rr)	r"�obj�src�extZcc_argsr&r)rr*r+r+r,�_compileos
����zUnixCCompiler._compilerc
Cs�|�||�\}}|j||d�}|�||�rN|�tj�|��|�|j|g||j	�|j
rLz|�|j
|g�WdStyK}zt|��d}~wwdSt
�d|�dS)N)�
output_dir�skipping %s (up-to-date))�_fix_object_args�library_filename�
_need_linkrrrr r!r�objectsrrr	r�debug)r"r;Zoutput_libnamer6r<�target_lang�output_filenamer*r+r+r,�create_static_libzs*����	���zUnixCCompiler.create_static_libc
Cs�|�||�\}}|�|||�}|\}}}t||||�}t|ttd�f�s(td��|dur3tj�	||�}|�
||�r�||j|d|g}|	rMdg|dd�<|
rU|
|dd�<|r\|�|�|�
tj�|��zf|tjkrs|jdd�}n|jdd�}|
dkr�|jr�d}tj�|d�dkr�d}d||vr�|d7}d||vs�tj�||�d	kr�d}nd}|j||||<tjd
kr�t�||�}|�||�WdSty�}zt|��d}~wwt�d|�dS)Nz%'output_dir' must be a string or Nonerz-grzc++�env��=Z	ld_so_aixrr7)r8Z
_fix_lib_argsr�
isinstance�str�type�	TypeErrorrr�joinr:r;rrr rZ
EXECUTABLErrr�basenamer.r/r0r1r!rr
rr<)r"Ztarget_descr;r>r6Z	librariesZlibrary_dirsZruntime_library_dirsZexport_symbolsr<r%r&Z
build_tempr=r'Zlib_optsZld_argsZlinker�i�offsetr*r+r+r,�link�s`�
���

�
��zUnixCCompiler.linkcC�d|S)N�-Lr+)r"�dirr+r+r,�library_dir_option��z UnixCCompiler.library_dir_optioncst�fdd�dD��S)Nc3s�|]}|�vVqdS)Nr+)�.0�name��
compiler_namer+r,�	<genexpr>�s�z(UnixCCompiler._is_gcc.<locals>.<genexpr>)�gcczg++Zclang)�any)r"rTr+rSr,�_is_gcc�szUnixCCompiler._is_gcccCs�tj�t�d��}tjdd�dkrd|Stjdd�dkr#d|Stjdd�d	kr=|�|�r7d
d|gSdd|gS|�|�rQt�d�d
krMd|Sd|Sd|S)N�CCrrrM�Zfreebsdz-Wl,-rpath=�zhp-uxz-Wl,+sz+sZGNULDZyesz-Wl,--enable-new-dtags,-Rz-Wl,-Rz-R)rrrHr�get_config_varr.r/rX)r"rNrr+r+r,�runtime_library_dir_option�s

z(UnixCCompiler.runtime_library_dir_optioncCrL)Nz-lr+)r"�libr+r+r,�library_optionrPzUnixCCompiler.library_optioncCs�|j|dd�}|j|dd�}|j|dd�}|j|dd�}tjdkr>t�d�}t�d|�}	|	dur9t�t�d	��}
n|	�	d
�}
|D]�}t
j�||�}t
j�||�}
t
j�||�}t
j�||�}tjdkr�|�
d�sr|�
d�r�|�
d
�s�t
j�|
|d
d�|�}t
j�|
|d
d�|�}
t
j�|
|d
d�|�}t
j�|
|d
d�|�}t
j�|
�r�|
St
j�|�r�|St
j�|�r�|St
j�|�r�|Sq@dS)N�shared)Zlib_type�dylib�
xcode_stub�staticr�CFLAGSz-isysroot\s*(\S+)rYrAz/System/z/usr/z/usr/local/)r9r.r/rr\�re�searchr0Z_default_sysroot�grouprrrG�
startswith�exists)r"�dirsr^r<Zshared_fZdylib_fZxcode_stub_fZstatic_fZcflags�mZsysrootrNr`rarcrbr+r+r,�find_library_file
sH



����zUnixCCompiler.find_library_file)NNNNN)NrN)
NNNNNrNNNN)r)�__name__�
__module__�__qualname__Z
compiler_typeZexecutablesr.r/Zsrc_extensionsZ
obj_extensionZstatic_lib_extensionZshared_lib_extensionZdylib_lib_extensionZxcode_stub_lib_extensionZstatic_lib_formatZshared_lib_formatZdylib_lib_formatZxcode_stub_lib_formatZ
exe_extensionr-r5r?rKrOrXr]r_rlr+r+r+r,r
-sN�



�
�
�B*r
)�__doc__rr.re�	distutilsrZdistutils.dep_utilrZdistutils.ccompilerrrrZdistutils.errorsrrr	r
rr/r0r
r+r+r+r,�<module>s