JFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3RbrJFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3RbrB  f/w@sRdZddlZddlZddlZddlZddlmZmZmZm Z m Z ddl m Z m Z mZddlmZddlmZddlZejZejZejZejZejejejejfZ ej!dkoej"dkZ#e#rd Z$d Z%d Z&n d Z$d Z%dZ&dddZ'GdddZ(GdddZ)ddZ*ddZ+ddZ,ddZ-d$ddZ.e*Z/e/d kr>ed!e/Gd"d#d#e Z0dS)%a distutils.msvc9compiler Contains MSVCCompiler, an implementation of the abstract CCompiler class for the Microsoft Visual Studio 2008. The module is compatible with VS 2005 and VS 2008. You can find legacy support for older versions of VS in distutils.msvccompiler. N)DistutilsExecErrorDistutilsPlatformError CompileErrorLibError LinkError) CCompilergen_preprocess_optionsgen_lib_options)log) get_platformwin32lz1Software\Wow6432Node\Microsoft\VisualStudio\%0.1fz5Software\Wow6432Node\Microsoft\Microsoft SDKs\Windowsz,Software\Wow6432Node\Microsoft\.NETFrameworkz%Software\Microsoft\VisualStudio\%0.1fz)Software\Microsoft\Microsoft SDKs\Windowsz Software\Microsoft\.NETFrameworkx86Zamd64)r z win-amd64c@sPeZdZdZddZeeZddZeeZddZeeZdd Ze eZd S) Regz2Helper class to read values from the registry cCs:x,tD]$}|||}|r||kr||SqWt|dS)N)HKEYS read_valuesKeyError)clspathkeybasedrtdd}YnX|rPtj|sd|}tj |d}|rtj|rtj |tj tj d}tj |}tj|std|dSntd||std dStj |d }tj|r|Std dS) zFind the vcvarsall.bat file At first it tries to find the productdir of VS 2008 in the registry. If that fails it falls back to the VS90COMNTOOLS env var. z %s\Setup\VCr>z%Unable to find productdir in registryNzVS%0.f0COMNTOOLSZVCz%s is not a valid directoryz Env var %s is not set or invalidzNo productdir foundz vcvarsall.batzUnable to find vcvarsall.bat)r7rrrr debugrVrisdirenvirongetr[pardirabspathisfile)r;r8r>ZtoolskeyZtoolsdir vcvarsallrrrfind_vcvarsalls2         rec Cs<t|}ddddh}i}|dkr(tdtd||tjd||ftjtjd }z|\}}|d krzt| d | d }xr| d D]d}t |}d |krq| }| d d\} } | } | |kr| tjr| dd} t| || <qWWd|j|jXt|t|kr8ttt||S)zDLaunch vcvarsall.bat and read the settings from its environment includelibZlibpathrNzUnable to find vcvarsall.batz'Calling 'vcvarsall.bat %s' (version=%s)z "%s" %s & set)stdoutstderrrr+ =rrG)rerr r] subprocessPopenPIPEZ communicatewaitr*rQrr&stripr%endswithrVrZr\rhcloserirP ValueErrorstrlistkeys) r;ZarchrdZ interestingresultpopenrhrilinerr(rrrquery_vcvarsalls<          rzg @z(VC %0.1f is not supported by this modulec @seZdZdZdZiZdgZdddgZdgZdgZ eeee Z d Z d Z d Z d Zd ZZdZd.ddZd/ddZd0ddZd1ddZd2ddZd3ddZddZd d!Zd"d#Zd$d%Zd&d'Zd(d)Zd4d*d+Zd,d-ZdS)5 MSVCCompilerzwConcrete class that implements an interface to Microsoft Visual C++, as defined by the CCompiler abstract class.Zmsvcz.cz.ccz.cppz.cxxz.rcz.mcz.resz.objz.libz.dllz%s%sz.exercCs8t||||t|_d|_g|_d|_d|_d|_dS)NzSoftware\Microsoft\VisualStudioF) rr<VERSION_MSVCCompiler__versionZ_MSVCCompiler__root_MSVCCompiler__paths plat_name_MSVCCompiler__arch initialized)r:verboseZdry_runZforcerrrr<IszMSVCCompiler.__init__NcCs,|jrtd|dkrt}d}||kr6td|fdtjkrtdtjkrt|drtd|_d|_d|_ d |_ d |_ n|tks|d krt |}nt td t |}t t|}|d tj|_|dtjd<|dtjd<t|jdkrtd|j|d|_|d|_|d|_ |d |_ |d |_ y,x&tjd dD]}|j|qJWWntk rxYnXt|j|_d|jtjd <d|_|jdkrdddddg|_ddddddg|_n&ddddddg|_dddddddg|_dddg|_|jd krddd!d"g|_dg|_d#|_dS)$Nzdon't init multiple times)r z win-amd64z--plat-name must be one of %sZDISTUTILS_USE_SDKZMSSdkzcl.exezlink.exezlib.exezrc.exezmc.exer _rrgrfrzxPython was built with %s, and extensions need to be built with the same version of the compiler, but it isn't installed.;r z/nologoz/Oxz/MDz/W3z/DNDEBUGz/Odz/MDdz/Z7z/D_DEBUGz/GS-z/DLLz/INCREMENTAL:NOz/INCREMENTAL:noz/DEBUGT) rAssertionErrorr rrVr_find_execclinkerrgrcmcPLAT_TO_VCVARSrzr|rQrZr~rPZ_MSVCCompiler__productrrrYr[Zpreprocess_optionsrcompile_optionscompile_options_debugldflags_sharedr}ldflags_shared_debugZldflags_static)r:rZok_platsZ plat_specZvc_envrArrr initializeTsf                   zMSVCCompiler.initializecCs|dkr d}g}x|D]}tj|\}}tj|d}|tj|d}||jkrdtd||rttj|}||jkr| tj |||j q||j kr| tj |||j q| tj |||j qW|S)NrrzDon't know how to compile %s)rVrsplitext splitdriveisabssrc_extensionsrbasename_rc_extensionsrr[ res_extension_mc_extensions obj_extension)r:Zsource_filenamesZ strip_dir output_dirZ obj_namesZsrc_namerextrrrobject_filenamess(         zMSVCCompiler.object_filenamesc  Cst|js||||||||} | \}} }} } |p6g} | d|rT| |jn | |jx | D]}y| |\}}Wntk rwhYnX|rtj |}||j krd|}nT||j krd|}n>||j kr>|}d|}y"||jg| |g|gWqhtk r8}z t|Wdd}~XYqhXqhn||jkrtj |}tj |}yl||jgd|d|g|gtj tj |\}}tj ||d}||jgd|g|gWqhtk r}z t|Wdd}~XYqhXqhntd||fd |}y&||jg| | ||g|Wqhtk rj}z t|Wdd}~XYqhXqhW| S) Nz/cz/Tcz/Tpz/foz-hz-rz.rcz"Don't know how to compile %s to %sz/Fo)rrZ_setup_compilerextendrrrrVrrb _c_extensions_cpp_extensionsrspawnrrrrdirnamerrrr[r)r:Zsourcesrr6Z include_dirsr] extra_preargsextra_postargsZdependsZ compile_infoobjectsZpp_optsZbuildZ compile_optsobjsrcrZ input_optZ output_optmsgZh_dirZrc_dirrrZrc_filerrrcompilesj              zMSVCCompiler.compilec Cs|js||||\}}|j||d}|||r|d|g}|rJy||jg|Wqtk r}z t|Wdd}~XYqXn t d|dS)N)rz/OUT:zskipping %s (up-to-date)) rr_fix_object_argslibrary_filename _need_linkrrgrrr r]) r:rZoutput_libnamerr] target_langoutput_filenameZlib_argsrrrrcreate_static_libs zMSVCCompiler.create_static_libc CsX|js||||\}}||||}|\}}}|rL|dt|t||||}|dk rptj ||}| ||rH|t j kr| r|j dd}q|jdd}n| r|j }n|j}g}x|pgD]}|d|qW||||d|g}tj|d} |dk rPtjtj|\}}tj | ||}|d|||| || rp| |dd<| r|| |tj|y||jg|Wn,tk r}z t|Wdd}~XYnX|||}|dk rT|\}}d||f}y|dd d ||gWn,tk rD}z t|Wdd}~XYnXn td |dS) Nz5I don't know what to do with 'runtime_library_dirs': rz/EXPORT:z/OUT:rz/IMPLIB:z-outputresource:%s;%szmt.exez-nologoz -manifestzskipping %s (up-to-date))rrrZ _fix_lib_argswarnrtr rVrr[rr EXECUTABLErrrrrrrmanifest_setup_ldargsrZmkpathrrrrmanifest_get_embed_infor r])r: target_descrrrZ librariesZ library_dirsZruntime_library_dirsZexport_symbolsr]rr build_temprZ fixed_argsZlib_optsZldflagsZ export_optsZsymld_argsZdll_nameZdll_extZ implib_filerZmfinfoZ mffilenamemfidZout_argrrrlink6sl           zMSVCCompiler.linkcCs,tj|tj|d}|d|dS)Nz .manifestz/MANIFESTFILE:)rVrr[rr)r:rrr temp_manifestrrrrsz"MSVCCompiler.manifest_setup_ldargscCs`x,|D] }|dr|ddd}PqWdS|tjkr>d}nd}||}|dkrXdS||fS)Nz/MANIFESTFILE::rrL) startswithrQrr_remove_visual_c_ref)r:rrargrrrrrrs    z$MSVCCompiler.manifest_get_embed_infocCsyt|}z |}Wd|Xtdtj}t|d|}d}t|d|}tdtj}t||dkrrdSt|d}z|||S|XWnt k rYnXdS)NzU|)rz*\s*zI|)w) openreadrrrerDOTALLrFsearchwriteOSError)r:Z manifest_fileZ manifest_fZ manifest_bufpatternrrrrs.     z!MSVCCompiler._remove_visual_c_refcCsd|S)Nz /LIBPATH:r)r:dirrrrlibrary_dir_optionszMSVCCompiler.library_dir_optioncCs tddS)NztjddD]*}tjtj||}tj|rH|SqHW|S)aReturn path to an MSVC executable program. Tries to find the program in several places: first, one of the MSVC program search paths from the registry; next, the directories in the PATH environment variable. If any of those work, return an absolute path that is known to exist. If none of them work, just return the original program name, 'exe'. ZPathr)r~rVrr[rbrcr_rQ)r:ZexerAfnrrrrs   zMSVCCompiler.find_exe)rrr)N)rr)NNNrNNN)NrN) NNNNNrNNNN)r) r/r0r1r2Z compiler_typeZ executablesrrrrrrrZstatic_lib_extensionZshared_lib_extensionZstatic_lib_formatZshared_lib_formatZ exe_extensionr<rrrrrrrrrrrrrrrrrr{+sR  W  V  R + r{)r )1r2rVrlrNrZdistutils.errorsrrrrrZdistutils.ccompilerrrr Z distutilsr Zdistutils.utilr winregZ OpenKeyExrZEnumKeyrZ EnumValuer$errorrZ HKEY_USERSHKEY_CURRENT_USERHKEY_LOCAL_MACHINEZHKEY_CLASSES_ROOTrplatformmaxsizeZ NATIVE_WIN64r7r@r?rrr5rUrYr\rerzr|r{rrrrsL  >. # )