tzh
2024-08-22 c7d0944258c7d0943aa7b2211498fd612971ce27
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
[\¬Qc@sòdZdZddlZddlZddlZddlZddlmZmZm    Z    m
Z
m Z ddl m Z mZddlmZddlmZddlZejZejZejZejZejejejejfZ ej!dkoej"d%kZ#e#r'd Z$d Z%d Z&dZ'ndZ$dZ%dZ&dZ'idd6dd6dd6Z(dd&d„ƒYZ)dd'd„ƒYZ*d„Z+d„Z,d„Z-d„Z.dd „Z/e+ƒZ0e0d!krØed"e0ƒ‚nd#e fd$„ƒYZ1dS((s 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.
s$Id$iÿÿÿÿN(tDistutilsExecErrortDistutilsPlatformErrort CompileErrortLibErrort    LinkError(t    CCompilertgen_lib_options(tlog(t get_platformtwin32ii s1Software\Wow6432Node\Microsoft\VisualStudio\%0.1fs.Software\Wow6432Node\Microsoft\VCExpress\%0.1fs5Software\Wow6432Node\Microsoft\Microsoft SDKs\Windowss,Software\Wow6432Node\Microsoft\.NETFrameworks%Software\Microsoft\VisualStudio\%0.1fs"Software\Microsoft\VCExpress\%0.1fs)Software\Microsoft\Microsoft SDKs\Windowss Software\Microsoft\.NETFrameworktx86tamd64s    win-amd64tia64swin-ia64tRegcBsbeZdZd„ZeeƒZd„ZeeƒZd„ZeeƒZd„ZeeƒZRS(s2Helper class to read values from the registry
    cCsMx:tD]2}|j||ƒ}|r||kr||SqWt|ƒ‚dS(N(tHKEYSt read_valuestKeyError(tclstpathtkeytbasetd((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/msvc9compiler.pyt    get_valueDs
  cCs„yt||ƒ}Wntk
r'dSXg}d}xItryt||ƒ}Wntk
rdPnX|j|ƒ|d7}q7W|S(sReturn list of registry keys.iiN(t RegOpenKeyExtRegErrortNonetTruet
RegEnumKeytappend(RRRthandletLtitk((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/msvc9compiler.pyt    read_keysLs       c    Cs¨yt||ƒ}Wntk
r'dSXi}d}xmtr£yt||ƒ\}}}Wntk
rmPnX|jƒ}|j|ƒ||j|ƒ<|d7}q7W|S(s`Return dict of registry keys and values.
 
        All names are converted to lowercase.
        iiN(RRRRt RegEnumValuetlowert convert_mbcs(    RRRRRRtnametvaluettype((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/msvc9compiler.pyR^s       cCsIt|ddƒ}|dk    rEy|dƒ}WqEtk
rAqEXn|S(Ntdecodetmbcs(tgetattrRt UnicodeError(tstdec((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/msvc9compiler.pyR$ts  (    t__name__t
__module__t__doc__Rt classmethodR!RR$t staticmethod(((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/msvc9compiler.pyR @s                   t MacroExpandercBs,eZd„Zd„Zd„Zd„ZRS(cCs'i|_t||_|j|ƒdS(N(tmacrostVS_BASEtvsbaset load_macros(tselftversion((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/msvc9compiler.pyt__init__€s     cCs!tj||ƒ|jd|<dS(Ns$(%s)(R RR4(R8tmacroRR((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/msvc9compiler.pyt    set_macro…scCsR|jd|jddƒ|jd|jddƒ|jdtdƒy2|dkrl|jd    td
ƒn td
ƒ‚Wntk
r˜td ƒ‚nX|d krÑ|jd |jdƒ|jdtdƒn}d}xttD]l}yt||ƒ}Wntk
r qÞnXt    |dƒ}t
j |d||fƒ}|d|j d<qÞWdS(Nt VCInstallDirs    \Setup\VCt
productdirt VSInstallDirs    \Setup\VSt FrameworkDirt installrootg @tFrameworkSDKDirssdkinstallrootv2.0sPython was built with Visual Studio 2008;
extensions must be built with a compiler than can generate compatible binaries.
Visual Studio 2008 was not found on this system. If you have Cygwin installed,
you can try compiling with MingW32, by passing "-c mingw32" to setup.py.g"@tFrameworkVersions clr versiont WindowsSdkDirtcurrentinstallfolders.Software\Microsoft\NET Framework Setup\Productis%s\%sR9s$(FrameworkVersion)( R<R6tNET_BASERRt WINSDK_BASERRRRR RR4(R8R9tpRthRR((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/msvc9compiler.pyR7ˆs.  
     cCs6x/|jjƒD]\}}|j||ƒ}qW|S(N(R4titemstreplace(R8R,R tv((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/msvc9compiler.pytsub§s(R.R/R:R<R7RM(((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/msvc9compiler.pyR3~s            cCs¯d}tjj|ƒ}|dkr(dS|t|ƒ}tj|jddƒ\}}t|d ƒd}t|dd!ƒd    }|dkr—d
}n|dkr«||Sd S( sÃReturn 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.iÿÿÿÿit iiþÿÿÿiig$@iN(tsysR9tfindtlentsplittintR(tprefixRR,trestt majorVersiont minorVersion((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/msvc9compiler.pytget_build_version¬s       cCsIg}x<|D]4}tjj|ƒ}||kr |j|ƒq q W|S(snReturn a list of normalized paths with duplicates removed.
 
    The current order of paths is maintained.
    (tosRtnormpathR(tpathst reduced_pathsRHtnp((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/msvc9compiler.pytnormalize_and_reduce_pathsÂs   cCs[|jtjƒ}g}x*|D]"}||kr|j|ƒqqWtjj|ƒ}|S(s8Remove duplicate values of an environment variable.
    (RRRYtpathsepRtjoin(tvariabletoldListtnewListRt newVariable((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/msvc9compiler.pytremoveDuplicatesÐs  cCs­t|}ytjd|dƒ}Wntk
r=d }nX|d kr˜t|}ytjd|dƒ}Wq˜tk
r”d }tjdƒq˜Xn| s²tj    j
|ƒ rZd|}tj j |d ƒ}|rFtj    j
|ƒrFtj    j |tjtjdƒ}tj    j|ƒ}tj    j
|ƒsWtjd|ƒd SqZtjd|ƒn|sqtjdƒd Stj    j |d    ƒ}tj    j|ƒrœ|Stjd
ƒd S( s¨Find 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.
    s %s\Setup\VCR>s%Unable to find productdir in registrysVS%0.f0COMNTOOLStVCs%s is not a valid directorys Env var %s is not set or invalidsNo productdir founds vcvarsall.batsUnable to find vcvarsall.batN(R5R RRRtVSEXPRESS_BASERtdebugRYRtisdirtenvirontgetR`tpardirtabspathtisfile(R9R6R>ttoolskeyttoolsdirt    vcvarsall((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/msvc9compiler.pytfind_vcvarsallÛs@
 
 
 
!  c CsÊt|ƒ}tdƒ}i}|dkr9tdƒ‚ntjd||ƒtjd||fdtjd    tjƒ}zø|j    ƒ\}}|j
ƒd
kr¶t|j d ƒƒ‚n|j d ƒ}x¦|j d ƒD]•}t j|ƒ}d |krüqÕn|jƒ}|j d dƒ\}    }
|    jƒ}    |    |krÕ|
jtjƒrW|
d }
nt|
ƒ||    <qÕqÕWWd|jjƒ|jjƒXt|ƒt|ƒkrÆttt|jƒƒƒƒ‚n|S(sDLaunch vcvarsall.bat and read the settings from its environment
    tincludetlibtlibpathRsUnable to find vcvarsall.bats'Calling 'vcvarsall.bat %s' (version=%s)s "%s" %s & settstdouttstderriR)s
t=iiÿÿÿÿN(sincludeslibslibpathspath(RrtsetRRRRht
subprocesstPopentPIPEt communicatetwaitR(RRR R$tstripR#tendswithRYR_ReRvtcloseRwRQt
ValueErrortstrtlisttkeys( R9tarchRqt interestingtresulttpopenRvRwtlineRR&((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/msvc9compiler.pytquery_vcvarsalls<              !g @s(VC %0.1f is not supported by this modulet MSVCCompilerc BsMeZdZdZiZdgZdddgZdgZdgZeeeeZ    dZ
d    Z d
Z d Z d ZZd Zdddd„Zdd„Zddd„Zdddddddd„Zdddd„Zddddddddddd„
Zd„Zd„Zd„Zd„Zd„Zd„Zdd„Zd„ZRS(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.exeicCsPtj||||ƒt|_d|_g|_d|_d|_t    |_
dS(NsSoftware\Microsoft\VisualStudio( RR:tVERSIONt_MSVCCompiler__versiont_MSVCCompiler__roott_MSVCCompiler__pathsRt    plat_namet_MSVCCompiler__archtFalset initialized(R8tverbosetdry_runtforce((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/msvc9compiler.pyR:Ss                    c
Cs.|j stdƒ‚|dkr.tƒ}nd&}||krVtd|fƒ‚ndtjkr³dtjkr³|jdƒr³d|_d    |_    d
|_
d |_ d |_ n+|tƒksÎ|dkrÛt |}nt tƒd t |}tt|ƒ}|djdƒjtjƒ|_|djdƒtjd<|djdƒtjd<t|jƒdkr„td|jƒ‚n|jdƒ|_|jd    ƒ|_    |jd
ƒ|_
|jd ƒ|_ |jd ƒ|_ y5x.tjdjdƒD]}|jj|ƒqøWWntk
r&nXt|jƒ|_dj|jƒtjd<d|_|jdkr dddddg|_ddddddg|_n9ddddddg|_dddddddg|_d dd!g|_|jd"krd dd#d$d%g|_ ndg|_!t"|_dS('Nsdon't init multiple timesR    s    win-amd64swin-ia64s--plat-name must be one of %stDISTUTILS_USE_SDKtMSSdkscl.exeslink.exeslib.exesrc.exesmc.exet_RR)RtRsisxPython was built with %s, and extensions need to be built with the same version of the compiler, but it isn't installed.t;R
s/nologos/Oxs/MDs/W3s/DNDEBUGs/Ods/MDds/Z7s/D_DEBUGs/GS-s/DLLs/INCREMENTAL:NOis/INCREMENTAL:nos/DEBUGs    /pdb:None(swin32s    win-amd64swin-ia64(#R•tAssertionErrorRRRRYRjtfind_exetcctlinkerRttrctmctPLAT_TO_VCVARSR‹RŽtencodeRRR_R‘RQt_MSVCCompiler__productRRR^R`tpreprocess_optionsR“tcompile_optionstcompile_options_debugtldflags_sharedRtldflags_shared_debugtldflags_staticR(R8R’tok_platst    plat_spectvc_envRH((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/msvc9compiler.pyt
initialize^sf   -                   "          tcCs>|dkrd}ng}x|D]}tjj|ƒ\}}tjj|ƒd}|tjj|ƒ}||jkrŽtd|ƒ‚n|r©tjj|ƒ}n||j    krÞ|j
tjj |||j ƒƒq"||j kr|j
tjj |||j ƒƒq"|j
tjj |||jƒƒq"W|S(NR°isDon't know how to compile %s(RRYRtsplitextt
splitdrivetisabstsrc_extensionsRtbasenamet_rc_extensionsRR`t res_extensiont_mc_extensionst obj_extension(R8tsource_filenamest    strip_dirt
output_dirt    obj_namestsrc_nameRtext((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/msvc9compiler.pytobject_filenamesµs(     c    Csè|js|jƒn|j||||||ƒ}    |    \}}
}} } |pRg} | jdƒ|r{| j|jƒn| j|jƒxV|
D]N}y| |\}}Wntk
rÂq’nX|rÞtj    j
|ƒ}n||j krúd|}n||j krd|}nq||j kr†|}d|}y)|j|jg| |g|gƒWq’tk
r}t|ƒ‚q’Xq’n||jkrqtj    j|ƒ}tj    j|ƒ}y|j|jgd|d|g|gƒtj    jtj    j|ƒƒ\}}tj    j||dƒ}|j|jgd|g|gƒWq’tk
rj}t|ƒ‚q’Xq’ntd||fƒ‚d    |}y-|j|jg| | ||g|ƒWq’tk
rß}t|ƒ‚q’Xq’W|
S(
Ns/cs/Tcs/Tps/fos-hs-rs.rcs"Don't know how to compile %s to %ss/Fo(R•R¯t_setup_compileRtextendR¨R§RRYRRmt _c_extensionst_cpp_extensionsR¶tspawnR¡RRR¸tdirnameR¢R±RµR`RŸ(R8tsourcesR¼R4t include_dirsRht extra_preargstextra_postargstdependst compile_infotobjectstpp_optstbuildt compile_optstobjtsrcR¿t    input_optt
output_opttmsgth_dirtrc_dirRR›trc_file((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/msvc9compiler.pytcompileÔsj           
# $$#
 c    CsÃ|js|jƒn|j||ƒ\}}|j|d|ƒ}|j||ƒr¯|d|g}|rony|j|jg|ƒWq¿tk
r«}t|ƒ‚q¿Xnt    j
d|ƒdS(NR¼s/OUT:sskipping %s (up-to-date)( R•R¯t_fix_object_argstlibrary_filenamet
_need_linkRÅRtRRRRh(    R8RÍtoutput_libnameR¼Rht target_langtoutput_filenametlib_argsRÕ((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/msvc9compiler.pytcreate_static_lib)s          cCsø|js|jƒn|j||ƒ\}}|j|||ƒ}|\}}}|rr|jdt|ƒƒnt||||ƒ}|dk    r«tj    j
||ƒ}n|j ||ƒrä|t j krò|    râ|jd}q |jd}n|    r|j}n    |j}g}x%|pgD]}|jd|ƒq W||||d|g}tj    j|dƒ} |dk    rÐtj    jtj    j|ƒƒ\}}tj    j
| |j|ƒƒ}|jd|ƒn|j|| |ƒ|
rö|
|d*n| r |j| ƒn|jtj    j|ƒƒy|j|jg|ƒWntk
ra}t|ƒ‚nX|j||ƒ}|dk    rô|\}}d||f}y |jdd    d
||gƒWqátk
rÝ}t|ƒ‚qáXqôntjd |ƒdS( Ns5I don't know what to do with 'runtime_library_dirs': is/EXPORT:s/OUT:is/IMPLIB:s-outputresource:%s;%ssmt.exes-nologos    -manifestsskipping %s (up-to-date)(R•R¯RÚt _fix_lib_argstwarnRƒRRRYRR`RÜRt
EXECUTABLERªR©RRÆR±RµRÛtmanifest_setup_ldargsRÂtmkpathRÅR RRtmanifest_get_embed_infoRRh(R8t target_descRÍRßR¼t    librariest library_dirstruntime_library_dirstexport_symbolsRhRÉRÊt
build_tempRÞt
fixed_argstlib_optstldflagst export_optstsymtld_argstdll_nametdll_extt implib_fileRÕtmfinfot
mffilenametmfidtout_arg((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/msvc9compiler.pytlinkBsl                                    cCs:tjj|tjj|ƒdƒ}|jd|ƒdS(Ns    .manifests/MANIFESTFILE:(RYRR`RµR(R8RßRíRót temp_manifest((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/msvc9compiler.pyRå¡s    cCs…x;|D]/}|jdƒr|jddƒd}PqqWdS|tjkrVd}nd}|j|ƒ}|dkr{dS||fS(Ns/MANIFESTFILE:t:ii(t
startswithRRRRRät_remove_visual_c_ref(R8RèRótargRüRù((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/msvc9compiler.pyRç­s      cCsîyÖt|ƒ}z|jƒ}Wd|jƒXtjdtjƒ}tj|d|ƒ}d}tj|d|ƒ}tjdtjƒ}tj||ƒdkr£dSt|dƒ}z|j    |ƒ|SWd|jƒXWnt
k
rénXdS(NsU<assemblyIdentity.*?name=("|')Microsoft\.VC\d{2}\.CRT("|').*?(/>|</assemblyIdentity>)R°s*<dependentAssembly>\s*</dependentAssembly>sI<assemblyIdentity.*?name=(?:"|')(.+?)(?:"|').*?(?:/>|</assemblyIdentity>)tw( topentreadRtreRÙtDOTALLRMtsearchRtwritetIOError(R8t manifest_filet
manifest_ft manifest_buftpattern((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/msvc9compiler.pyRÿÅs.          cCsd|S(Ns    /LIBPATH:((R8tdir((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/msvc9compiler.pytlibrary_dir_optionðscCstdƒ‚dS(Ns<don't know how to set runtime library search path for MSVC++(R(R8R ((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/msvc9compiler.pytruntime_library_dir_optionóscCs |j|ƒS(N(RÛ(R8Rt((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/msvc9compiler.pytlibrary_option÷scCs€|r|d|g}n    |g}xW|D]K}xB|D]:}tjj||j|ƒƒ}tjj|ƒr6|Sq6Wq)WdSdS(Nt_d(RYRR`RÛtexistsR(R8tdirsRtRht    try_namesR R%tlibfile((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/msvc9compiler.pytfind_library_fileûs       cCs§xH|jD]=}tjjtjj|ƒ|ƒ}tjj|ƒr
|Sq
WxUtjdjdƒD]=}tjjtjj|ƒ|ƒ}tjj|ƒrb|SqbW|S(sŒReturn 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'.
        tPathRœ(R‘RYRR`RmRnRjRR(R8texeRHtfn((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/msvc9compiler.pyRž s    !!N( R.R/R0t compiler_typet executablesRÃRÄR¶R¸R´R·R¹tstatic_lib_extensiontshared_lib_extensiontstatic_lib_formattshared_lib_formatt exe_extensionR:RR¯RÀRÙRáRûRåRçRÿRRRRRž(((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/msvc9compiler.pyRŒ5sR            
 Y  V  R            +             I(((2R0t __revision__RYRzRORtdistutils.errorsRRRRRtdistutils.ccompilerRRt    distutilsRtdistutils.utilRt_winregt    OpenKeyExRtEnumKeyRt    EnumValueR"terrorRt
HKEY_USERStHKEY_CURRENT_USERtHKEY_LOCAL_MACHINEtHKEY_CLASSES_ROOTRtplatformtmaxsizet NATIVE_WIN64R5RgRGRFR£R R3RXR^ReRrR‹RŽRŒ(((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/msvc9compiler.pyt<module>sV    (                      
>.                , )