�
��c@s�dZdZddkZddkZddklZlZddklZddkl Z ddk
lZddkl
Z
lZlZdd klZlZlZlZdd
klZd�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'
sB$Id: unixccompiler.py 52237 2006-10-08 17:52:37Z ronald.oussoren $i�N(t
StringTypetNoneType(tcopy(t sysconfig(tnewer(t CCompilertgen_preprocess_optionstgen_lib_options(tDistutilsExecErrortCompileErrortLibErrort LinkError(tlogc Cs�d}}t|�}ti�d}t|id�d�}|djot}}nd|j}d|j}|oBx?y!|id�}|||d5Wq|tj
oPq|Xq|n|o;y!|id�}|||d5Wq�j
oq�nd
}d|jo!|id�}||d}n/d|jo!|id�}||d}n|o5ti i
|�o!tid|�tid �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 -isysrootis4Compiling with an SDK that doesn't seem to exist: %ss$Please check your Xcode installationN(
tlisttostunametinttsplittTruetindext
ValueErrortNonetpathtisdirRtwarn( tcompiler_sotcc_argst stripArchtstripSysroottkernel_versiont
major_versionRtsysroottidx((s*/sys/lib/python/distutils/unixccompiler.pyt_darwin_compiler_fixup-sB
t
UnixCCompilercBsreZdZhd%d<dgd<dgd<dgd<ddgd<dgd<d d
gd<d%d<Zeid
djodged<nddddddgZdZdZ dZ
dZdZZ
Zeidjo
dZnd%d%d%d%d%d�Zd�Zd%dd%d�Zd%d%d%d%d%dd%d%d%d%d �Zd!�Zd"�Zd#�Zdd$�ZRS(&tunixtpreprocessortcctcompilerRtcompiler_cxxs-sharedt linker_sot
linker_exetars-crtarchivertranlibitdarwins.cs.Cs.ccs.cxxs.cpps.ms.os.as.sos.dylibslib%s%stcygwins.execCs|id||�\}}}t||�}|i|} |o| id|g�n|o|| d*n|o| i|�n| i|�|ip|djpt||�oZ|o|it i
i|��ny|i| �Wqt
j
o}
t|
�qXndS(Ns-oi(t_fix_compile_argsRRR%textendtappendtforceRtmkpathRRtdirnametspawnRR (tselftsourcetoutput_filetmacrostinclude_dirst
extra_preargstextra_postargstignoretpp_optstpp_argstmsg((s*/sys/lib/python/distutils/unixccompiler.pyt
preprocess�s"
'c Cs{|i}tidjot|||�}ny&|i|||d|g|�Wntj
o}t|�nXdS(NR.s-o(RtsystplatformR"R6RR ( R7tobjtsrctextRR=R?RRA((s*/sys/lib/python/distutils/unixccompiler.pyt_compile�s icCs�|i||�\}}|i|d|�}|i||�o�|itii|��|i|i|g||i �|i
o@y|i|i
|g�Wq�tj
o}t|�q�Xq�nt
id|�dS(Nt
output_dirsskipping %s (up-to-date)(t_fix_object_argstlibrary_filenamet
_need_linkR4RRR5R6R,tobjectsR-RR
Rtdebug(R7RMtoutput_libnameRIRNttarget_langtoutput_filenameRA((s*/sys/lib/python/distutils/unixccompiler.pytcreate_static_lib�s
cCs8|i||�\}}|i|||�\}}}t||||�}t|�ttfjo
td�n|dj oti i
||�}n|i||�oz||i|d|g}| odg|d*n|
o|
|d*n|o|i
|�n|iti i|��y�|tijo|i}n|i}|
djoo|ioed}ti i|d�djo-d}x$d||jo|d}q�Wn|i|||<ntid jot||�}n|i||�Wq4tj
o}t|�q4Xntid
|�dS(Ns%'output_dir' must be a string or Nones-os-gisc++tenvit=R.sskipping %s (up-to-date)(RJt
_fix_lib_argsRttypeRRt TypeErrorRRRtjoinRLRMR1R4R5Rt
EXECUTABLER*R)R(tbasenameRCRDR"R6RRRRN(R7ttarget_descRMRQRIt librariestlibrary_dirstruntime_library_dirstexport_symbolsRNR<R=t
build_tempRPtlib_optstld_argstlinkertiRA((s*/sys/lib/python/distutils/unixccompiler.pytlink�sD
cCsd|S(Ns-L((R7tdir((s*/sys/lib/python/distutils/unixccompiler.pytlibrary_dir_optionscCs�tiitid��}tid djod|Sn�tid djod|Snmtid d jptid d
jod|gSn7|d d
jp|d djod|Sn d|SdS(NtCCiR.s-Lishp-uxs+s -Litirix646tosf1V5s-rpathitgccsg++s-Wl,-Rs-R(RRRZRtget_config_varRCRD(R7RfR'((s*/sys/lib/python/distutils/unixccompiler.pytruntime_library_dir_option s
("cCsd|S(Ns-l((R7tlib((s*/sys/lib/python/distutils/unixccompiler.pytlibrary_option#scCs�|i|dd�}|i|dd�}|i|dd�}x�|D]�}tii||�}tii||�} tii||�}
tii| �o| SqFtii|�o|SqFtii|
�o|
SqFqFWdS(Ntlib_typetsharedtdylibtstatic(RKRRRXtexistsR(R7tdirsRnRNtshared_ftdylib_ftstatic_fRfRqRrRs((s*/sys/lib/python/distutils/unixccompiler.pytfind_library_file&sN(t__name__t
__module__t
compiler_typeRtexecutablesRCRDtsrc_extensionst
obj_extensiontstatic_lib_extensiontshared_lib_extensiontdylib_lib_extensiontstatic_lib_formattshared_lib_formattdylib_lib_formatt
exe_extensionRBRHRRReRgRmRoRy(((s*/sys/lib/python/distutils/unixccompiler.pyR#gs>
6 (t__doc__t__revision__RRCttypesRRRt distutilsRtdistutils.dep_utilRtdistutils.ccompilerRRRtdistutils.errorsRR R
RRR"R#(((s*/sys/lib/python/distutils/unixccompiler.pys<module>s" :
|