B 6k× þë¸òã @s‚ddlZddlZddlmZmZmZmZmZddlm Z m Z m Z ddl m Z dZy,ddlZdZeZejZejZejZejZWnhek räy4ddlZddlZdZeZejZejZejZejZWnek rÞe  d¡YnXYnXerþejejejej fZ!dd „Z"d d „Z#d d „Z$Gdd„dƒZ%dd„Z&dd„Z'dd„Z(Gdd„de ƒZ)e&ƒdkr~e  *d¡e)Z+ddl,m)Z)ddl,m%Z%dS)éN)ÚDistutilsExecErrorÚDistutilsPlatformErrorÚ CompileErrorÚLibErrorÚ LinkError)Ú CCompilerÚgen_preprocess_optionsÚgen_lib_options)ÚlogFTzWarning: Can't read registry to find the necessary compiler setting Make sure that Python modules winreg, win32api or win32con are installed.cCsnyt||ƒ}Wntk r"dSXg}d}x||j kr>|}d|}y"| |jg| |g|g¡Wqhtk r8}z t|ƒ‚Wdd}~XYqhXqhnÒ||jkrtj  |¡}tj  |¡}yl| |jgd|d|g|g¡tj  tj  |¡¡\}}tj  ||d¡}| |jgd|g|g¡Wqhtk rú}z t|ƒ‚Wdd}~XYqhXqhntd||fƒ‚d |}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)rXrkZ_setup_compilerÚextendrhrgr/rMr-ÚabspathÚ _c_extensionsÚ_cpp_extensionsrrÚspawnrbrrrtÚdirnamercrmrqrfr`)r)Zsourcesrvr'Z include_dirsÚdebugÚ extra_preargsÚextra_postargsZdependsZ compile_infoÚobjectsZpp_optsZbuildZ compile_optsÚobjÚsrcrwZ input_optZ output_optÚmsgZh_dirZrc_dirrÚ_Zrc_filerrrÚcompileWsj              zMSVCCompiler.compilec Csž|js| ¡| ||¡\}}|j||d}| ||¡rŽ|d|g}|rJy| |jg|¡Wqštk rŠ}z t|ƒ‚Wdd}~XYqšXn t   d|¡dS)N)rvz/OUT:zskipping %s (up-to-date)) rXrkÚ_fix_object_argsÚlibrary_filenameÚ _need_linkr}r[rrr r) r)r‚Zoutput_libnamervrÚ target_langÚoutput_filenameZlib_argsr…rrrÚcreate_static_lib¬s zMSVCCompiler.create_static_libc CsÖ|js| ¡| ||¡\}}| |||¡}|\}}}|rL| dt|ƒ¡t||||ƒ}|dk rptj  ||¡}|  ||¡rÆ|t j kr¬| rœ|j dd…}q¾|jdd…}n| r¸|j }n|j}g}x|pÊgD]}| d|¡qÌW||||d|g}|dk rLtj tj |¡¡\}}tj  tj |d¡| |¡¡}| d|¡| r^| |dd…<| rn| | ¡| tj |¡¡y| |jg|¡Wn,tk rÂ}z t|ƒ‚Wdd}~XYnXn t d|¡dS)Nz5I don't know what to do with 'runtime_library_dirs': r z/EXPORT:z/OUT:rz/IMPLIB:zskipping %s (up-to-date))rXrkrˆZ _fix_lib_argsÚwarnÚstrr rMr-rfrŠrZ EXECUTABLErjrirrmrqr~r‰ryZmkpathr}rarrr r)r)Z target_descr‚rŒrvZ librariesZ library_dirsZruntime_library_dirsZexport_symbolsrr€rZ build_tempr‹Z fixed_argsZlib_optsZldflagsZ export_optsZsymZld_argsZdll_nameZdll_extZ implib_filer…rrrÚlinkÅsV       zMSVCCompiler.linkcCsd|S)Nz /LIBPATH:r)r)ÚdirrrrÚlibrary_dir_optionszMSVCCompiler.library_dir_optioncCs tdƒ‚dS)Nztjd d¡D]*}tj tj |¡|¡}tj |¡rH|SqHW|S)NZPathr\)r]rMr-rfrzÚisfiler^rD)r)Zexer1Úfnrrrr_5s   zMSVCCompiler.find_exeÚx86cCsÀtsgS|d}|jdkr,d|j|jf}nd|j|f}xHtD]@}t||ƒ}|r@|jdkrr|j ||¡ d¡S|| d¡Sq@W|jdkr¼x,tD]$}t|d|jƒdk r”| d¡Pq”WgS) Nz dirsrRz6%s\%0.1f\VC\VC_OBJECTS_PLATFORM_INFO\Win32\Directoriesz?%s\6.0\Build System\Components\Platforms\Win32 (%s)\Directoriesr\r;z%s\6.0z´It seems you have Visual Studio 6 installed, but the expected registry settings are not present. You must at least run the Visual Studio GUI once so that these entries are created.) Ú _can_read_regrSrUr,r rVr6rDrŽ)r)r-ÚplatformrrrrrrrdKs(        zMSVCCompiler.get_msvc_pathscCs6|dkr| d¡}n | |¡}|r2d |¡tj|<dS)Nr[Zlibraryr\)rdrfrMr^)r)rr1rrrreos   zMSVCCompiler.set_path_env_var)rrr)rrl)NNNrNNN)NrN) NNNNNrNNNN)r)rš)r7r8r9Z compiler_typeZ executablesr{r|rrrtrprsruZstatic_lib_extensionZshared_lib_extensionZstatic_lib_formatZshared_lib_formatZ exe_extensionr+rkrxr‡rrr’r“r”r—r_rdrerrrrrQÈsN  B  V  F  $rQg @z3Importing new compiler from distutils.msvc9compiler)rQ)r&)-rArMZdistutils.errorsrrrrrZdistutils.ccompilerrrr Z distutilsr r›ÚwinregZhkey_modZ OpenKeyExr ZEnumKeyrZ EnumValuerÚerrorr Ú ImportErrorZwin32apiZwin32conÚinfoZ HKEY_USERSÚHKEY_CURRENT_USERÚHKEY_LOCAL_MACHINEZHKEY_CLASSES_ROOTr,rr rr&rHrLrPrQrZOldMSVCCompilerZdistutils.msvc9compilerrrrrÚ s\      - 9