Your IP : 172.28.240.42


Current Path : /usr/lib/python2.7/distutils/
Upload File :
Current File : //usr/lib/python2.7/distutils/unixccompiler.pyc


|_c@sdZdZddlZddlZddlZddlmZmZddlm	Z	ddl
mZddlm
Z
mZmZddlmZmZmZmZdd	lmZd
Zde
fdYZdS(
s9distutils.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'
s$Id$iN(t
StringTypetNoneType(t	sysconfig(tnewer(t	CCompilertgen_preprocess_optionstgen_lib_options(tDistutilsExecErrortCompileErrortLibErrort	LinkError(tlogc	Csd}}t|}tjd}t|jdd}|dkrXt}}nd|k}d|k}|sdtjkrx<y!|jd}|||d5Wqtk
rPqXqndtjkr|r|tjdj}n|r2y!|jd}|||d5Wq2tk
r.q2Xnd}d|krd|jd}||d}n,d|kr|jd}||d}n|rtj
j|rtj
d	|tj
d
n|S(se
    This function will strip '-isysroot PATH' and '-arch ARCH' from the
    compile flags if the user has specified one them in extra_compile_flags.

    This is needed because '-arch ARCH' adds another architecture to the
    build, without a way to remove an architecture. Furthermore GCC will
    barf if multiple '-isysroot' arguments are present.
    iit.is-archs	-isysroott	ARCHFLAGSis4Compiling with an SDK that doesn't seem to exist: %ss$Please check your Xcode installationN(tlisttostunametinttsplittTruetenvirontindext
ValueErrortNonetpathtisdirRtwarn(	tcompiler_sotcc_argst	stripArchtstripSysroottkernel_versiont
major_versionRtsysroottidx((s-/usr/lib/python2.7/distutils/unixccompiler.pyt_darwin_compiler_fixup,sF	



	t
UnixCCompilercBsgeZdZid&d6dgd6dgd6dgd6ddgd6dgd6d	d
gd6d&d6Zejd
 dkrdged<nddddddgZdZdZ	dZ
dZdZZ
ZejdkrdZnd&d&d&d&d&dZdZd&dd&dZd&d&d&d&d&dd&d&d&d&d 
Zd!Zd"Zd#Zd$Zdd%ZRS('tunixtpreprocessortcctcompilerRtcompiler_cxxs-sharedt	linker_sot
linker_exetars-crtarchivertranlibitdarwins.cs.Cs.ccs.cxxs.cpps.ms.os.as.sos.dylibslib%s%stcygwins.execCs	|jd||\}}}t||}|j|}	|rV|	jd|gn|ri||	d*n|r|	j|n|	j||js|dkst||r|r|jt	j
j|ny|j|	Wqt
k
r}
t|
qXndS(Ns-oi(t_fix_compile_argsRRR&textendtappendtforceRtmkpathRRtdirnametspawnRR(tselftsourcetoutput_filetmacrostinclude_dirst
extra_preargstextra_postargstignoretpp_optstpp_argstmsg((s-/usr/lib/python2.7/distutils/unixccompiler.pyt
preprocesss"


$c	Csw|j}tjdkr.t|||}ny&|j|||d|g|Wntk
rr}t|nXdS(NR/s-o(RtsystplatformR#R7RR(	R8tobjtsrctextRR>R@RRB((s-/usr/lib/python2.7/distutils/unixccompiler.pyt_compiles	icCs|j||\}}|j|d|}|j||r|jtjj||j|j|g||j	|j
ry|j|j
|gWqtk
r}t|qXqnt
jd|dS(Nt
output_dirsskipping %s (up-to-date)(t_fix_object_argstlibrary_filenamet
_need_linkR5RRR6R7R-tobjectsR.RR	Rtdebug(R8RNtoutput_libnameRJROttarget_langtoutput_filenameRB((s-/usr/lib/python2.7/distutils/unixccompiler.pytcreate_static_libs	cCsi|j||\}}|j|||\}}}g|D]}|dkr=|^q=}g|D]}|dkrb|^qb}t||||}t|ttfkrtdn|dk	rtj	j
||}n|j||rU||j|d|g}|	r dg|d*n|
r3|
|d*n|rI|j
|n|jtj	j|y|tjkr|j}n
|j}|
d	kr|jrd}tj	j|dd
krd}x!d||kr|d}qWn|j|||<ntjd
kr!t||}n|j||Wqetk
rQ}t|qeXntjd|dS(Ns/libs/lib64s/usr/libs
/usr/lib64s%'output_dir' must be a string or Nones-os-gisc++tenvit=R/sskipping %s (up-to-date)(s/libs/lib64s/usr/libs
/usr/lib64(s/libs/lib64s/usr/libs
/usr/lib64(RKt
_fix_lib_argsRttypeRRt	TypeErrorRRRtjoinRMRNR2R5R6Rt
EXECUTABLER+R*R)tbasenameRDRER#R7RR
RRO(R8ttarget_descRNRRRJt	librariestlibrary_dirstruntime_library_dirstexport_symbolsROR=R>t
build_tempRQtdirtlib_optstld_argstlinkertiRB((s-/usr/lib/python2.7/distutils/unixccompiler.pytlinksL

	


cCsd|S(Ns-L((R8Rb((s-/usr/lib/python2.7/distutils/unixccompiler.pytlibrary_dir_optionscCsd|kpd|kS(Ntgccsg++((R8t
compiler_name((s-/usr/lib/python2.7/distutils/unixccompiler.pyt_is_gccscCstjjtjd}tjd dkr6d|Stjd dkrt|j|rfdd|gSdd|gStjd	 d
kstjd dkrd|gS|j|rd
|Sd|SdS(NtCCiR/s-Lishp-uxs-Wl,+ss+sitirix646tosf1V5s-rpaths-Wl,-Rs-R(RRR[Rtget_config_varRDRERk(R8RbR(((s-/usr/lib/python2.7/distutils/unixccompiler.pytruntime_library_dir_options
&
cCsd|S(Ns-l((R8tlib((s-/usr/lib/python2.7/distutils/unixccompiler.pytlibrary_option1scCs|j|dd}|j|dd}|j|dd}tjdkrtjd}tjd|}|dkrd}	q|jd	}	nx#|D]}
t	j
j|
|}t	j
j|
|}t	j
j|
|}
tjdkrv|
jd
s|
jdrv|
jdrvt	j
j|	|
d	|}t	j
j|	|
d	|}t	j
j|	|
d	|}
nt	j
j
|r|St	j
j
|r|St	j
j
|
r|
SqWdS(
Ntlib_typetsharedtdylibtstaticR/tCFLAGSs-isysroot\s+(\S+)t/is/System/s/usr/s/usr/local/(RLRDRERRotretsearchRtgroupRRRYt
startswithtexists(R8tdirsRqROtshared_ftdylib_ftstatic_ftcflagstmR!RbRtRuRv((s-/usr/lib/python2.7/distutils/unixccompiler.pytfind_library_file4s4	
N(t__name__t
__module__t
compiler_typeRtexecutablesRDREtsrc_extensionst
obj_extensiontstatic_lib_extensiontshared_lib_extensiontdylib_lib_extensiontstatic_lib_formattshared_lib_formattdylib_lib_formatt
exe_extensionRCRIRSRgRhRkRpRrR(((s-/usr/lib/python2.7/distutils/unixccompiler.pyR$ks@







				;				(t__doc__t__revision__RRDRyttypesRRt	distutilsRtdistutils.dep_utilRtdistutils.ccompilerRRRtdistutils.errorsRRR	R
RR#R$(((s-/usr/lib/python2.7/distutils/unixccompiler.pyt<module>s$"	?