• File: unixccompiler.cpython-38.pyc
  • Full Path: /home3/farmfre2/public_html/ALFA_DATA/alfasymlink/root/opt/alt/python38/lib64/python3.8/distutils/__pycache__/unixccompiler.cpython-38.pyc
  • Date Modified: 10/26/2026 8:15 PM
  • File size: 6.83 KB
  • MIME-type: text/x-bytecode.python
  • Charset: 8 bit
U

j;@sdZddlZddlZddlZddlmZddlmZddlm	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)	CCompilergen_preprocess_optionsgen_lib_options)DistutilsExecErrorCompileErrorLibError	LinkError)logdarwinc
seZdZdZddgdgdgddgdgddgddZejddd	krNd
ged
<ddd
dddgZdZdZ	dZ
dZdZdZ
ZZeZejdkrdZfddZd.ddZddZd/d d!Zd0d"d#Zd$d%Zd&d'Zd(d)Zd*d+Zd1d,d-ZZS)2
UnixCCompilerZunixNZccz-sharedZarz-cr)preprocessorcompilercompiler_socompiler_cxx	linker_so
linker_exearchiverranlibrrz.cz.Cz.ccz.cxxz.cppz.mz.oz.az.soz.dylibz.tbdzlib%s%scygwinz.execs@t|||\}}}td}|r6||kr6|||||fS)z'Remove standard library path from rpathZLIBDIR)super
_fix_lib_argsrget_config_varremove)self	librarieslibrary_dirsruntime_library_dirsZlibdir	__class__</opt/alt/python38/lib64/python3.8/distutils/unixccompiler.pyrUs


zUnixCCompiler._fix_lib_argsc
Cs|d||}|\}}}t||}	|j|	}
|r>|
d|g|rN||
dd<|r\|
||
||js~|dks~t||r|r|tj	
|z||
Wn*tk
r}zt
|W5d}~XYnXdS)N-or)Z_fix_compile_argsrrextendappendZforcermkpathospathdirnamespawnrr)rsourceZoutput_fileZmacrosZinclude_dirs
extra_preargsextra_postargs
fixed_argsignorepp_optsZpp_argsmsgr"r"r#
preprocess^s$




zUnixCCompiler.preprocessc	
Csp|j}tjdkr t|||}z ||||d|g|Wn*tk
rj}zt|W5d}~XYnXdS)Nrr$)rsysplatform_osx_supportcompiler_fixupr+rr)	robjsrcZextZcc_argsr.r1rr2r"r"r#_compilexs

zUnixCCompiler._compilerc
Cs|||\}}|j||d}|||r|tj|||j|g||j	|j
rz||j
|gWqtk
r}zt|W5d}~XYqXnt
d|dS)N)
output_dirskipping %s (up-to-date))_fix_object_argslibrary_filename
_need_linkr'r(r)r*r+robjectsrrr	rdebug)rr@Zoutput_libnamer;rAtarget_langoutput_filenamer2r"r"r#create_static_libs$	zUnixCCompiler.create_static_libc
Cs|||\}}||||}|\}}}t||||}t|ttdfsPtd|dk	rftj	||}|
||r||j|d|g}|	rdg|dd<|
r|
|dd<|r|||
tj|z|tjkr|jdd}n|jdd}|
dkrr|jrrd}tj|ddkr@d}d||kr@|d7}q&tj||d	kr\d}nd}|j||||<tjd
krt||}|||Wn,tk
r}zt|W5d}~XYnXntd|dS)Nz%'output_dir' must be a string or Noner$z-grzc++env=Z	ld_so_aixrr<)r=rr
isinstancestrtype	TypeErrorr(r)joinr?r@r%r'r*rZ
EXECUTABLErrrbasenamer4r5r6r7r+rr
rrA)rZtarget_descr@rCr;rrrZexport_symbolsrAr-r.Z
build_temprBr/Zlib_optsZld_argsZlinkerioffsetr2r"r"r#linksZ


zUnixCCompiler.linkcCsd|S)N-Lr")rdirr"r"r#library_dir_optionsz UnixCCompiler.library_dir_optioncCsd|kpd|kS)NZgcczg++r")rZ
compiler_namer"r"r#_is_gccszUnixCCompiler._is_gcccCstjtd}tjdddkr,d|StjdddkrFd|Stjddd	krz||rnd
d|gSdd|gS||rtdd
krd|Sd|Snd|SdS)NCCrrrQZfreebsdz-Wl,-rpath=zhp-uxz-Wl,+sz+sZGNULDZyesz-Wl,--enable-new-dtags,-Rz-Wl,-Rz-R)r(r)rMrrr4r5rT)rrRrr"r"r#runtime_library_dir_options


z(UnixCCompiler.runtime_library_dir_optioncCsd|S)Nz-lr")rlibr"r"r#library_optionszUnixCCompiler.library_optioncCs|j|dd}|j|dd}|j|dd}|j|dd}tjdkr|td}td|}	|	dkrrttd	}
n
|		d
}
|D] }t
j||}t
j||}
t
j||}t
j||}tjdkrL|
ds|
drL|
d
sLt
j|
|d
d|}t
j|
|d
d|}
t
j|
|d
d|}t
j|
|d
d|}t
j|
rb|
St
j|rx|St
j|r|St
j|r|SqdS)Nshared)Zlib_typedylib
xcode_stubstaticrZCFLAGSz-isysroot\s*(\S+)rUrFz/System/z/usr/z/usr/local/)r>r4r5rrresearchr6Z_default_sysrootgroupr(r)rL
startswithexists)rdirsrYrAZshared_fZdylib_fZxcode_stub_fZstatic_fZcflagsmZsysrootrRr[r\r^r]r"r"r#find_library_filesF




zUnixCCompiler.find_library_file)NNNNN)NrN)
NNNNNrNNNN)r)__name__
__module____qualname__Z
compiler_typeZexecutablesr4r5Zsrc_extensionsZ
obj_extensionZstatic_lib_extensionZshared_lib_extensionZdylib_lib_extensionZxcode_stub_lib_extensionZstatic_lib_formatZshared_lib_formatZdylib_lib_formatZxcode_stub_lib_formatZ
exe_extensionrr3r:rDrPrSrTrXrZrf
__classcell__r"r"r r#r
-sb


	


B*r
)__doc__r(r4r_Z	distutilsrZdistutils.dep_utilrZdistutils.ccompilerrrrZdistutils.errorsrrr	r
rr5r6r
r"r"r"r#<module>s