Viewing File: /opt/alt/python35/lib64/python3.5/distutils/__pycache__/unixccompiler.cpython-35.opt-1.pyc



®ÕYf¨:ã@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Údarwincs eZdZdZddddgddgddgddd	gd
dgddd
gddiZejdd…dkr†dged<ddddddgZdZdZ	dZ
dZdZdZ
ZZeZejdkrådZ‡fdd †Zdddddd!d"„Zd#d$„Zdd%dd&d'„Zdddddd%ddddd(d)„
Zd*d+„Zd,d-„Zd.d/„Zd0d1„Zd%d2d3„Z‡S)4Ú
UnixCCompilerZunixÚpreprocessorNÚcompilerZccÚcompiler_soÚcompiler_cxxÚ	linker_soz-sharedÚ
linker_exeÚarchiverÚarz-crÚranlibérz.cz.Cz.ccz.cxxz.cppz.mz.oz.az.soz.dylibz.tbdzlib%s%sÚcygwinz.execset|j|ƒj|||ƒ\}}}tjdƒ}|rX||krX|j|ƒ|||fS)z'Remove standard library path from rpathÚLIBDIR)ÚsuperÚ	__class__Ú
_fix_lib_argsrÚget_config_varÚremove)ÚselfÚ	librariesÚlibrary_dirsÚruntime_library_dirsZlibdir)r©ú</opt/alt/python35/lib64/python3.5/distutils/unixccompiler.pyrUs
zUnixCCompiler._fix_lib_argscCs|jd||ƒ}|\}}}t||ƒ}	|j|	}
|rY|
jd|gƒ|ro||
dd…<|r‚|
j|ƒ|
j|ƒ|js³|dks³t||ƒr|rÒ|jtj	j
|ƒƒy|j|
ƒWn1tk
r}zt
|ƒ‚WYdd}~XnXdS)Nz-or)Z_fix_compile_argsrrÚextendÚappendZforcerÚmkpathÚosÚpathÚdirnameÚspawnrr)rÚsourceZoutput_fileZmacrosZinclude_dirsÚ
extra_preargsÚextra_postargsÚ
fixed_argsÚignoreÚpp_optsZpp_argsÚmsgr#r#r$Ú
preprocess_s$


$zUnixCCompiler.preprocessc	CsŒ|j}tjdkr.tj|||ƒ}y&|j|||d|g|ƒWn1tk
r‡}zt|ƒ‚WYdd}~XnXdS)Nrz-o)rÚsysÚplatformÚ_osx_supportÚcompiler_fixupr+rr)	rÚobjÚsrcZextZcc_argsr.r1rr2r#r#r$Ú_compileys		
zUnixCCompiler._compilercCsé|j||ƒ\}}|j|d|ƒ}|j||ƒrÕ|jtjj|ƒƒ|j|j|g||j	ƒ|j
råy|j|j
|gƒWqåtk
rÑ}zt|ƒ‚WYdd}~XqåXnt
jd|ƒdS)NÚ
output_dirzskipping %s (up-to-date))Ú_fix_object_argsÚlibrary_filenameÚ
_need_linkr'r(r)r*r+rÚobjectsrrr	rÚdebug)rr?Zoutput_libnamer;r@Útarget_langÚoutput_filenamer2r#r#r$Úcreate_static_lib„s	"zUnixCCompiler.create_static_libcCsI|j||ƒ\}}|j|||ƒ}|\}}}t||||ƒ}t|ttdƒfƒsxtdƒ‚|dk	r™tjj	||ƒ}|j
||ƒr5||j|d|g}|	rßdg|dd…<|
rõ|
|dd…<|r|j|ƒ|j
tjj|ƒƒyÝ|tjkrI|jdd…}n|jdd…}|
dkrË|jrËd}tjj|dƒdkrºd}xd||kr¹|d7}qœW|j|||<tjd	krìtj||ƒ}|j||ƒWqEtk
r1}zt|ƒ‚WYdd}~XqEXntjd
|ƒdS)Nz%'output_dir' must be a string or Nonez-oz-grzc++Úenvéú=rzskipping %s (up-to-date))r<rrÚ
isinstanceÚstrÚtypeÚ	TypeErrorr(r)Újoinr>r?r%r'r*rZ
EXECUTABLErrrÚbasenamer4r5r6r7r+rr
rr@)rZtarget_descr?rBr;r r!r"Zexport_symbolsr@r-r.Z
build_temprAr/Zlib_optsZld_argsZlinkerÚir2r#r#r$ÚlinkžsH		
"zUnixCCompiler.linkcCsd|S)Nz-Lr#)rÚdirr#r#r$Úlibrary_dir_optionØsz UnixCCompiler.library_dir_optioncCsd|kpd|kS)NÚgcczg++r#)rZ
compiler_namer#r#r$Ú_is_gccÛszUnixCCompiler._is_gcccCs tjjtjdƒƒ}tjdd…dkr<d|Stjdd…dkr]d|Stjdd…d	kr¡|j|ƒr“d
d|gSdd|gStjdd…dksÓtjdd…d
krÝd|gS|j|ƒrtjdƒdkr	d|Sd|Snd|SdS)NÚCCrrz-LéZfreebsdz-Wl,-rpath=ézhp-uxz-Wl,+sz+sZirix646Zosf1V5z-rpathÚGNULDÚyesz-Wl,--enable-new-dtags,-Rz-Wl,-Rz-R)r(r)rLrrr4r5rR)rrOrr#r#r$Úruntime_library_dir_optionÞs 2
z(UnixCCompiler.runtime_library_dir_optioncCsd|S)Nz-lr#)rÚlibr#r#r$Úlibrary_option
szUnixCCompiler.library_optioncCs.|j|ddƒ}|j|ddƒ}|j|ddƒ}|j|ddƒ}tjdkr¨tjdƒ}tjd|ƒ}	|	dkr™d	}
n|	jd
ƒ}
x|D]w}tj	j
||ƒ}tj	j
||ƒ}
tj	j
||ƒ}tj	j
||ƒ}tjdkrÎ|jdƒsF|jdƒrÎ|jd
ƒrÎtj	j
|
|d
d…|ƒ}tj	j
|
|d
d…|ƒ}
tj	j
|
|d
d…|ƒ}tj	j
|
|d
d…|ƒ}tj	j|
ƒrä|
Stj	j|ƒrú|Stj	j|ƒr|Stj	j|ƒr¯|Sq¯WdS)NZlib_typeÚsharedÚdylibÚ
xcode_stubÚstaticrÚCFLAGSz-isysroot\s+(\S+)ú/rEz/System/z/usr/z/usr/local/)
r=r4r5rrÚreÚsearchÚgroupr(r)rKÚ
startswithÚexists)rÚdirsrYr@Zshared_fZdylib_fZxcode_stub_fZstatic_fZcflagsÚmZsysrootrOr[r\r^r]r#r#r$Úfind_library_file
s>	
""""zUnixCCompiler.find_library_file)Ú__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:rCrNrPrRrXrZrhr#r#)rr$r
-sF				

	6,r
)Ú__doc__r(r4raZ	distutilsrZdistutils.dep_utilrZdistutils.ccompilerrrrZdistutils.errorsrrr	r
rr5r6r
r#r#r#r$Ú<module>s$"
Back to Directory File Manager