Lc@s"dZdZddkZddkZddkZddklZlZlZl Z l Z ddk l Z l Z lZddklZdZy@ddkZdZeZeiZeiZeiZeiZWnej ovyLddkZddkZdZeZeiZeiZeiZeiZWn ej oeid nXnXeo"ei ei!ei"ei#fZ$nd Z%d Z&d Z'd fdYZ(dZ)dZ*dZ+de fdYZ,e)djo7ei-de,Z.ddk/l,Z,ddk/l(Z(ndS(sdistutils.msvccompiler Contains MSVCCompiler, an implementation of the abstract CCompiler class for the Microsoft Visual Studio. s>$Id: msvccompiler.py 62197 2008-04-07 01:53:39Z mark.hammond $iN(tDistutilsExecErrortDistutilsPlatformErrort CompileErrortLibErrort LinkError(t CCompilertgen_preprocess_optionstgen_lib_options(tlogiisWarning: Can't read registry to find the necessary compiler setting Make sure that Python modules _winreg, win32api or win32con are installed.c Csyt||}Wntj odSXg}d}xDyt||}Wntj oPnX|i||d}q9|S(sReturn list of registry keys.iiN(t RegOpenKeyExtRegErrortNonet RegEnumKeytappend(tbasetkeythandletLtitk((s./usr/lib64/python2.6/distutils/msvccompiler.pyt read_keys<s  c Csyt||}Wntj odSXh}d}xbyt||\}}}Wntj oPnX|i}t||t|<|d}q9|S(sXReturn dict of registry keys and values. All names are converted to lowercase. iiN(R R R t RegEnumValuetlowert convert_mbcs(RRRtdRtnametvaluettype((s./usr/lib64/python2.6/distutils/msvccompiler.pyt read_valuesNs  cCsMt|dd}|dj o*y|d}WqItj oqIXn|S(Ntencodetmbcs(tgetattrR t UnicodeError(tstenc((s./usr/lib64/python2.6/distutils/msvccompiler.pyRcs  t MacroExpandercBs,eZdZdZdZdZRS(cCsh|_|i|dS(N(tmacrost load_macros(tselftversion((s./usr/lib64/python2.6/distutils/msvccompiler.pyt__init__ns cCsEx>tD]6}t||}|o|||id|(((s./usr/lib64/python2.6/distutils/msvccompiler.pyR#ls   cCsd}titi|}|djodS|t|}ti|idd\}}t|d d}t|dd!d }|djo d }n|djo ||Sd S( sReturn the version of MSVC that was used to build Python. For Python 2.3 and up, the version number is included in sys.version. For earlier versions, assume the compiler is MSVC 6. sMSC v.iit iiiig$@iN(R;tfindtsysR'tlentsplittintR (tprefixRR!trestt majorVersiont minorVersion((s./usr/lib64/python2.6/distutils/msvccompiler.pytget_build_versions     cCs]d}titi|}|djodStitid|}ti|t||!S(saReturn the processor architecture. Possible results are "Intel", "Itanium", or "AMD64". s bit (itIntelt)(R;RBRCR'RD(RGRtj((s./usr/lib64/python2.6/distutils/msvccompiler.pytget_build_architectures  cCsKg}x>|D]6}tii|}||jo|i|q q W|S(snReturn a list of normalized paths with duplicates removed. The current order of paths is maintained. (tosR+tnormpathR (tpathst reduced_pathsR8tnp((s./usr/lib64/python2.6/distutils/msvccompiler.pytnormalize_and_reduce_pathss t MSVCCompilerc BsDeZdZdZhZdgZdddgZdgZdgZeeeeZ dZ d Z d Z d Z d ZZd ZddddZdZdddZddddddddZddddZddddddddddd ZdZdZdZddZdZddZdZRS(swConcrete class that implements an interface to Microsoft Visual C++, as defined by the CCompiler abstract class.tmsvcs.cs.ccs.cpps.cxxs.rcs.mcs.ress.objs.libs.dlls%s%ss.exeicCsti||||t|_t|_|idjoL|idjod|_t|i|_n d|_d|i|_ nd|id|_ t |_ dS(NRLisSoftware\Microsoft\VisualStudiosSoftware\Microsoft\DevstudiosVisual Studio version %ssMicrosoft SDK compiler %si( RR(RKt_MSVCCompiler__versionROt_MSVCCompiler__archt_MSVCCompiler__rootR#t_MSVCCompiler__macrost_MSVCCompiler__producttFalset initialized(R&tverbosetdry_runtforce((s./usr/lib64/python2.6/distutils/msvccompiler.pyR(s    c Csg|_dtijoQdtijoA|ido1d|_d|_d|_d|_d|_n|i d|_t |id jot d |i n|id|_|id|_|id|_|id|_|id|_|i d |i d y8x1titidd D]}|ii|q7WWntj onXt|i|_ti|id tidR R(R&R+tplatformRRR((s./usr/lib64/python2.6/distutils/msvccompiler.pyRn[s, !  cCsW|djo|id}n|i|}|oti|dti|s\$(                .